Dialogue practice method and device, storage medium and equipment
By constructing dialogue scenario information for specific industries and combining them with large language models (LLM), targeted dialogue exercises are implemented, which solves the problem of lack of objective dialogue exercises in the existing technology, and improves users' dialogue communication skills and practice effects in specific fields.
Patent Information
- Application Number
- CN202510225365.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-06-13
AI Technical Summary
The existing dialogue practice methods using the Large Language Model (LLM) lack objectiveness and cannot achieve targeted practice, resulting in insufficient improvement of users' dialogue and communication skills in specific fields and poor practice results.
By obtaining user dialogue practice instructions, construct industry-specific dialogue scenario information, including dialogue background, goals and example dialogue, and implement targeted dialogue exercises in combination with LLM until the user's dialogue goals are completed.
It improves users' dialogue and communication skills in specific fields, improves the pertinence and effectiveness of dialogue exercises, and improves users' dialogue exercise experience.
Smart Images

Figure CN120144711A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of natural language processing, and in particular, to a dialogue practice method, device, storage medium, and equipment. Background Art
[0002] With the rapid development of information technologies such as artificial intelligence and the Internet of Things, the application scenarios of human-computer interaction are becoming more and more extensive. Various large language models (LLMs) appear in people's lives and work. They provide intelligent interaction functions such as dialogue practice for people to assist people in completing various behavioral intentions such as personalized learning and improving dialogue ability.
[0003] At present, although it is already possible to use LLMs combined with functions such as speech synthesis and speech recognition to provide users with a scenario simulation dialogue practice from pronunciation to feedback pronunciation, achieving a natural dialogue effect. However, in the process of simulated dialogue practice, there is often a lack of purpose, and only random and unstructured dialogue communication can be completed with users, and more efficient targeted practice cannot be achieved. For example, in the field of vocational English learning, users usually have strong purposes in learning vocational English, and they often do not care about the proficiency in the use of specific grammar and sentence patterns, but are more concerned about how to accurately and efficiently convey semantics, which cannot be achieved by using LLMs to conduct dialogue practice with users at present. It can be seen that the existing method of using LLMs to conduct dialogue practice with users cannot improve the dialogue communication ability of users in specific fields, the practice effect is poor, and thus the dialogue practice experience of users will be reduced. Summary of the Invention
[0004] The main purpose of the embodiments of this application is to provide a dialogue practice method, device, storage medium, and equipment, which can realize targeted dialogue practice of the target type with users based on LLMs, thereby not only improving the practice effect, but also improving the dialogue communication ability of users in specific fields, and further improving the dialogue practice experience of users.
[0005] The embodiments of this application provide a dialogue practice method, including:
[0006] Obtain a dialogue practice instruction proposed by a user, and select dialogue background information, dialogue target information, and exemplary dialogue information from dialogue scenario information according to the dialogue practice instruction;
[0007] Input the dialogue background information, dialogue target information, the dialogue content that has been carried out between the user and the large language model, and combine with the first prompt instruction prompt into the large language model to obtain the reply content output by the large language model for the user's latest dialogue;
[0008] Based on the dialogue target information, the conversation content already carried out between the user and the large language model, and the exemplary dialogue information, determine whether the dialogue target between the user and the large language model is completed; if so, end this dialogue practice; if not, continue with the next round of dialogue practice until the dialogue target between the user and the large language model is completed.
[0009] In a possible implementation manner, the construction method of the dialogue scenario information is as follows:
[0010] Determine the preset industry and the dialogue role information involved in the preset industry;
[0011] Use the large language model to construct the dialogue scenario information corresponding to the preset industry according to the name information of the preset industry and the dialogue role information involved in the preset industry.
[0012] In a possible implementation manner, the use of the large language model to construct the dialogue scenario information corresponding to the preset industry according to the name information of the preset industry and the dialogue role information involved in the preset industry includes:
[0013] Combine the name information of the preset industry and the dialogue role information involved in the preset industry with the second prompt instruction prompt, and input them into the large language model to obtain the dialogue background information, dialogue target information, and exemplary dialogue information output by the large language model related to the preset industry, so as to constitute the dialogue scenario information corresponding to the preset industry.
[0014] In a possible implementation manner, the determination of whether the dialogue target between the user and the large language model is completed according to the dialogue target information, the conversation content already carried out between the user and the large language model, and the exemplary dialogue information includes:
[0015] Use the large language model to determine whether the dialogue target between the user and the large language model is completed according to the dialogue target information, the conversation content already carried out between the user and the large language model, and the exemplary dialogue information.
[0016] In a possible implementation manner, the use of the large language model to determine whether the dialogue target between the user and the large language model is completed according to the dialogue target information, the conversation content already carried out between the user and the large language model, and the exemplary dialogue information includes:
[0017] Combine the dialogue background information, dialogue target information, the conversation content already carried out between the user and the large language model, and the exemplary dialogue information with the third prompt instruction prompt, and input them into the large language model to obtain the determination result output by the large language model on whether the dialogue target between the user and the large language model is completed.
[0018] In a possible implementation, determining whether the conversation goal between the user and the large language model is completed based on the conversation goal information, the conversation content that has occurred between the user and the large language model, and the exemplary conversation information includes:
[0019] Concatenate the conversation goal information, the conversation content that has occurred between the user and the large language model, and the exemplary conversation information, and perform text tokenization on the concatenated text to obtain processed text data;
[0020] Perform conversion processing on the processed text data to obtain processed feature vectors;
[0021] Establish the association between the feature vectors and whether the conversation goal is achieved, and determine whether the conversation goal between the user and the large language model is completed according to the association result.
[0022] In a possible implementation, establishing the association between the feature vectors and whether the conversation goal is achieved, and determining whether the conversation goal between the user and the large language model is completed includes:
[0023] Input the feature vectors into a fully connected layer for information integration to obtain integrated feature vectors;
[0024] Perform Dropout regularization processing on the integrated feature vectors to obtain processed feature vectors;
[0025] After non-linearly processing the processed feature vectors through an activation function, input them into a fully connected layer for output, and perform binary classification on the output result to determine whether the conversation goal between the user and the large language model is completed according to the processing result.
[0026] In a possible implementation, the method further includes:
[0027] Obtain a conversation practice instruction for role reversal proposed by the user, and in response to the conversation practice instruction for role reversal, input the conversation background information, conversation goal information, and the conversation content that has occurred between the user and the large language model, combined with the fourth prompt instruction prompt, into the large language model to obtain the reply content for the user's latest conversation after role reversal output by the large language model.
[0028] An embodiment of the present application also provides a conversation practice device, including:
[0029] A first acquisition unit, configured to acquire a conversation practice instruction proposed by a user, and select conversation background information, conversation goal information, and exemplary conversation information from the conversation scenario information according to the conversation practice instruction;
[0030] An input unit for inputting the conversation background information, the conversation target information, the conversation content already carried out between the user and the large language model, combined with a first prompt, into the large language model to obtain a reply content for the user's latest conversation output by the large language model;
[0031] A judgment unit for judging whether the conversation target between the user and the large language model is completed according to the conversation target information, the conversation content already carried out between the user and the large language model, and the exemplary conversation information; if so, end this conversation practice; if not, continue the next round of conversation practice until the conversation target between the user and the large language model is completed.
[0032] In a possible implementation manner, the device further includes:
[0033] A determination unit for determining a preset industry and the conversation role information involved in the preset industry;
[0034] A construction unit for using the large language model to construct the conversation scenario information corresponding to the preset industry according to the name information of the preset industry and the conversation role information involved in the preset industry.
[0035] In a possible implementation manner, the construction unit is specifically used for:
[0036] Inputting the name information of the preset industry and the conversation role information involved in the preset industry, combined with a second prompt, into the large language model to obtain the conversation background information, the conversation target information, and the exemplary conversation information related to the preset industry output by the large language model, so as to constitute the conversation scenario information corresponding to the preset industry.
[0037] In a possible implementation manner, the judgment unit is specifically used for:
[0038] Using the large language model to judge whether the conversation target between the user and the large language model is completed according to the conversation target information, the conversation content already carried out between the user and the large language model, and the exemplary conversation information.
[0039] In a possible implementation manner, the judgment unit is specifically used for:
[0040] Inputting the conversation background information, the conversation target information, the conversation content already carried out between the user and the large language model, and the exemplary conversation information, combined with a third prompt, into the large language model to obtain a determination result output by the large language model on whether the conversation target between the user and the large language model is completed.
[0041] In one possible implementation, the determination unit includes:
[0042] A splicing subunit, configured to splice the dialogue target information, the dialogue content already carried out between the user and the large language model, and the exemplary dialogue information, and perform text tokenization processing on the spliced text to obtain processed text data;
[0043] A conversion subunit, configured to perform conversion processing on the processed text data to obtain processed feature vectors;
[0044] A judgment subunit, configured to establish an association between the feature vectors and whether the dialogue target is achieved, and judge whether the dialogue target between the user and the large language model is completed according to the association result.
[0045] In one possible implementation, the judgment subunit includes:
[0046] An integration subunit, configured to input the feature vectors into a fully connected layer for information integration to obtain integrated feature vectors;
[0047] A regularization subunit, configured to perform Dropout regularization processing on the integrated feature vectors to obtain processed feature vectors;
[0048] An input subunit, configured to input the processed feature vectors through non-linear processing of an activation function into a fully connected layer for output, and perform binary classification processing on the output result to judge whether the dialogue target between the user and the large language model is completed according to the processing result.
[0049] In one possible implementation, the device further includes:
[0050] A second acquisition unit, configured to acquire a dialogue practice instruction for role reversal proposed by the user, and in response to the dialogue practice instruction for role reversal, input the dialogue background information, the dialogue target information, the dialogue content already carried out between the user and the large language model, combined with the fourth prompt instruction prompt, into the large language model to obtain the reply content of the large language model for the user's latest dialogue after role reversal.
[0051] The embodiments of the present application further provide a dialogue practice device, including: a processor, a memory, and a system bus;
[0052] The processor and the memory are connected through the system bus;
[0053] The memory is used to store one or more programs, and the one or more programs include instructions, and when the instructions are executed by the processor, the processor executes any one of the implementation manners of the above dialogue practice method.
[0054] The embodiments of the present application further provide a computer-readable storage medium, in which instructions are stored. When the instructions run on a terminal device, the terminal device is enabled to execute any one of the implementation manners of the above-mentioned dialogue practice method.
[0055] The embodiments of the present application further provide a computer program product. When the computer program product runs on a terminal device, the terminal device is enabled to execute any one of the implementation manners of the above-mentioned dialogue practice method.
[0056] A dialogue practice method, device, storage medium and device provided by the embodiments of the present application first obtain a dialogue practice instruction proposed by a user, and select dialogue background information, dialogue target information and exemplary dialogue information from the dialogue scenario information according to the dialogue practice instruction; then input the dialogue background information, dialogue target information, and the dialogue content that the user and the large language model have already had, combined with the first prompt instruction prompt, into the large language model to obtain the reply content output by the large language model for the user's latest dialogue; then, according to the dialogue target information, the dialogue content that the user and the large language model have already had (including the reply content output by the large language model for the user's latest dialogue), and the exemplary dialogue information, determine whether the dialogue target between the user and the large language model is completed; if so, end this dialogue practice; if not, continue the next round of dialogue practice until the dialogue target between the user and the large language model is completed.
[0057] It can be seen that since the present application first constructs the corresponding dialogue scenario information for each industry, and then selects dialogue background, dialogue target, exemplary dialogue and other information that better meet the user's needs for personalized dialogue practice from it, so as to combine with the LLM to achieve targeted dialogue practice for the user in a specific industry field target class, thereby effectively improving the user's dialogue communication ability in this specific industry field, and further enhancing the user's dialogue practice experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0059] Figure 1 It is a schematic diagram of providing a scenario simulation dialogue practice from pronunciation to feedback pronunciation for the user by using a large language model combined with functions such as speech synthesis and speech recognition provided by the embodiments of the present application;
[0060] Figure 2A flowchart of a dialogue practice method provided by an embodiment of the present application;
[0061] Figure 3 An interaction diagram of a user having a dialogue practice with a large language model provided by an embodiment of the present application;
[0062] Figure 4 A process example diagram for determining whether the dialogue goal between a user and a large language model is completed based on a pre-trained language representation model in the field of natural language processing provided by an embodiment of the present application;
[0063] Figure 5 A composition diagram of a dialogue practice device provided by an embodiment of the present application. Detailed implementation manners
[0064] With the rapid development of Internet and artificial intelligence technologies, the application scenarios of human-computer interaction are becoming more and more extensive. Taking English oral role-playing as an example, it refers to a turn-based English dialogue between a human and a machine under a given topic, usually in the form of one question and one answer. The machine starts a dialogue with the user based on its understanding of the topic; after receiving the user's voice response content, it transcribes it, and then based on semantic understanding, the machine continues the dialogue.
[0065] Such as Figure 1 As shown, it is currently possible to use a large language model (LLM) as an auxiliary language learning tool, combined with functions such as speech synthesis and speech recognition, to provide users with a scenario simulation dialogue practice from pronunciation to feedback pronunciation, achieving anthropomorphic responses and achieving a relatively natural dialogue effect. However, the existing dialogue practice using an LLM with users often lacks goals, the dialogue is relatively random, unstructured, and does not distinguish specific categories, etc., and cannot achieve more efficient targeted practice, thus resulting in the inability to meet the needs of users for personalized learning and improving dialogue capabilities.
[0066] For example, when a user wants to improve their learning effect of professional English by having a dialogue practice with an LLM, they have a clear purpose, such as wanting to deeply understand industry-specific terms, acquire negotiation and presentation skills, or improve the ability to communicate cross-culturally through professional English, etc. Therefore, in the process of dialogue practice, whether these dialogue goals of the user can be achieved is very important. The user may not care about the proficiency in the use of specific grammar and sentence patterns, but rather care more about how to accurately and efficiently convey semantics. For example, when the user is a restaurant service staff, how to have a dialogue practice with an LLM to achieve friendly communication with diners through simple and effective vocabulary (without requiring proficiency in specific grammar or sentence patterns) to improve their service level is the purpose of their dialogue practice, which is currently impossible to achieve when using an LLM to have a dialogue practice with users.
[0067] It can be seen that the existing methods of using LLM to practice conversations with users cannot improve the user's conversation and communication skills in specific fields (such as vocational oral English learning, dining, ticketing, etc.), and the practice effect is poor, thus reducing the user's conversation practice experience.
[0068] To address the above deficiencies, the present application provides a conversation practice method. First, obtain the conversation practice instruction proposed by the user, and based on the conversation practice instruction, select conversation background information, conversation target information, and exemplary conversation information from the conversation scenario information. Then, input the conversation background information, conversation target information, the conversation content that the user and the large language model have already had, combined with the first prompt instruction, into the large language model to obtain the reply content output by the large language model for the user's latest conversation. Next, based on the conversation target information, the conversation content that the user and the large language model have already had (including the reply content output by the large language model for the user's latest conversation), and the exemplary conversation information, determine whether the conversation target between the user and the large language model is completed. If so, end this conversation practice; if not, continue the next round of conversation practice until the conversation target between the user and the large language model is completed.
[0069] It can be seen that since the present application first constructs the corresponding conversation scenario information for each industry, and then selects information such as conversation background, conversation target, and exemplary conversation that better meet the user's personalized conversation practice needs from it, to combine with the LLM to achieve targeted conversation practice for the user in the target category of a specific industry field, it can effectively improve the user's conversation and communication skills in this specific industry field, and thus enhance the user's conversation practice experience.
[0070] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the scope of protection of the present application.
[0071] First Embodiment
[0072] See Figure 2 , which is a schematic flowchart of a conversation practice method provided in this embodiment. The method includes the following steps:
[0073] S201: Obtain the conversation practice instruction proposed by the user, and based on the conversation practice instruction, select conversation background information, conversation target information, and exemplary conversation information from the conversation scenario information.
[0074] In this embodiment, in order to meet the needs of users' personalized learning and improve their conversation ability in specific industry fields, the present application first constructs corresponding conversation scenario information for different industry fields (such as English oral learning, catering, transportation, ticketing, etc.) based on a large language model (LLM), including but not limited to conversation background (such as the location, time, environment, etc. of the conversation scenario), conversation goals (referring to the goals that users can achieve through conversations), and exemplary conversations, etc. And use existing or future storage devices to store the constructed conversation scenario information corresponding to each industry field. For the specific construction method, please refer to the detailed introduction in the second embodiment below.
[0075] On this basis, when a conversation practice instruction is obtained from the user through means such as voice or input text, further according to this conversation practice instruction, from the pre-constructed and stored conversation scenario information corresponding to each industry field, select the conversation background information (such as the location, time, environment, etc. of the conversation scenario), conversation goal information (that is, the goal content that the user can achieve through the conversation), and exemplary conversation information, etc. related to the industry field indicated by the conversation practice instruction for the conversation practice. Use the conversation background information (such as the location, time, environment, etc. of the conversation scenario) and conversation goal information (that is, the goal content that the user can achieve through the conversation) as the basic basis, and through the execution of the subsequent step S202, with the help of the natural language understanding ability and thinking logic reasoning ability of the large language model LLM, construct the targeted and efficient conversation practice content of the target class between the user and the large language model LLM. And use the exemplary conversation information as an auxiliary judgment basis, and through the execution of the subsequent step S203, judge whether the conversation practice that the user and the large language model LLM have carried out can achieve the same effect as the "exemplary conversation", that is, complete the goal that the user wants to achieve (that is, the content shown in the conversation goal information). Thus, it can not only improve the conversation practice effect, but also improve the user's conversation communication ability in a specific field, and further improve the user's conversation practice experience.
[0076] For example: Take the user as a service staff in a restaurant. Suppose the conversation practice instruction he puts forward is "I am a service staff in XX Restaurant. Please improve my service level through conversation practice". Thus, according to this conversation practice instruction, it can be determined that the industry field indicated for the conversation practice is the catering service industry, and then relevant conversation background information, conversation goal information, and exemplary conversation information can be selected from the conversation scenario information corresponding to the catering service industry.
[0077] Among them, the conversation background information may include but is not limited to the following content:
[0078] "Location: A high-end Chinese restaurant;
[0079] Time: 7 pm on Friday, during the peak dining period;
[0080] Environment: The restaurant is exquisitely decorated, with soft lighting and melodious background music.
[0081] The roles involved include: Service staff member Li, 25 years old, with 3 years of work experience; Customer Mr. Wang, a businessperson in his 40s.
[0082] And the customer's needs or problems are: Mr. Wang is visiting this restaurant for the first time and is not familiar with the menu. He wants to order some special dishes of the restaurant. At the same time, he has a mild peanut allergy.
[0083] The dialogue target information can include but is not limited to the following:
[0084] "The specific goals that the service staff needs to achieve: 1. Warmly welcome the customer and create a good first impression; 2. Understand the customer's dietary preferences and needs; 3. Recommend special dishes suitable for the customer; 4. Pay attention to the customer's allergy situation and ensure food safety; 5. Provide professional and considerate service to satisfy the customer."
[0085] Exemplary dialogue information can be but is not limited to the following:
[0086] "[Exemplary dialogue]:
[0087] Li: Welcome, Mr. Wang. Are you dining at our restaurant for the first time?
[0088] Mr. Wang: Yes, a friend recommended it to me. I heard that your dishes are very special.
[0089] Li: Thank you very much for coming. We do have many popular special dishes. Do you have any particular taste preferences?
[0090] Mr. Wang: I like dishes with a spicier taste, but I have a mild peanut allergy.
[0091] Li: I see. I'll pay special attention. Considering your preference, I recommend our signature dishes "Spicy Hot Pot" and "Boiled Fish". Both of these dishes are spicier and do not contain peanuts. Also, our "Kung Pao Chicken" is very popular, but it usually contains peanuts. If you're interested, I can ask the kitchen to prepare a special version without peanuts for you.
[0092] Mr. Wang: That sounds good. Then I'll have the Spicy Hot Pot and the Boiled Fish. And also a seasonal vegetable.
[0093] Li: Okay, great choice. We currently have fresh Qinglong vegetables, and they are very crispy and tender when stir-fried. What do you think?
[0094] Mr. Wang: Okay, that's all.
[0095] Xiao Li: Alright, I've noted down your order: Spicy Cabbage with Spices, Boiled Fish, and Stir-Fried Qinglong Vegetables. I will emphasize your peanut allergy again to ensure food safety. Would you like something to drink?
[0096] Mr. Wang: Just a pot of jasmine tea.
[0097] Xiao Li: Understood. Your tea will be served soon, and the dishes will take about 20 minutes. If you have any other needs, feel free to let me know. Enjoy your meal!
[0098] Among them, it should be noted that the large language model (LLM) can be a language model based on deep learning, which can generate new language expressions according to the input text content, such as text, sentences, paragraphs, or even articles, etc. The large language model (LLM) uses a large-scale language dataset and is trained through autoregressive generation to obtain language rules and patterns, and can simulate human instructions to generate language expressions (such as text data). Specifically, when the large language model (LLM) generates new text data, it predicts the possibility of the next language unit based on the previously generated content until the complete text data is generated.
[0099] It should also be noted that the present application does not limit the selection method for selecting the dialogue background information, dialogue target information, and exemplary dialogue information from the dialogue scenario information, and can be set according to the actual situation and empirical values. For example, if the pre-constructed dialogue scenario information is stored in the large language model LLM, the model can directly call the stored dialogue scenario information for selection when needed. Or, if the pre-constructed dialogue scenario information is stored in a third-party storage device, the large language model LLM can, when needed, use a search instruction to temporarily search for the dialogue background information from the third-party storage device for selection.
[0100] S202: Input the dialogue background information, dialogue target information, and the dialogue content that the user and the large language model have already had, combined with the first prompt instruction prompt, into the large language model to obtain the reply content output by the large language model for the user's latest dialogue.
[0101] In this embodiment, after selecting, through step S201, information such as the conversation background (such as the location, time, environment, etc. of the conversation scene), conversation goal (i.e., the target content that the user can achieve through the conversation practice), and exemplary conversations related to the industry field for conversation practice indicated by the conversation practice instruction proposed by the user from the pre-constructed and stored conversation scene information corresponding to each industry field, in order to improve the conversation practice effect between the user and the large language model (LLM), these information (such as conversation narration, opening greetings, conversation goals, etc.) can be further fed back to the user, as Figure 3 shown, so that the user can answer or ask questions to the large language model (LLM) according to information such as the scene and conversation goal. Furthermore, the large language model (LLM) can utilize its own natural language understanding ability and thinking logic reasoning ability to advance the conversation according to information such as the scene and conversation goal, that is, to give a conversation feedback to the user. Specifically, the conversation background information, conversation goal information, and the conversation content that has occurred between the user and the large language model can be incorporated into the prompt instruction (herein defined as the first prompt instruction) and input into the large language model (LLM) to obtain the reply content of the large language model for the user's latest conversation, that is, to achieve anthropomorphic answers and the advancement of the conversation goal. After updating the conversation content that has occurred between the user and the large language model, it can be used to execute the subsequent step S203.
[0102] Illustrative example: Based on the above example, still assuming that the user who uses the LLM for conversation practice is a service staff in a restaurant, an example of the first prompt instruction prompt input to the large language model (LLM) can be as follows:
[0103] "You are an experienced Chinese teacher. You are here to help the service staff improve his service level in practice by role-playing as a customer.
[0104]
Background
[0105] Location: A high-end Chinese restaurant;
[0106] Time: 7 pm on Friday, during the dinner rush hour;
[0107] Environment: The restaurant is exquisitely decorated, with soft lighting and melodious background music.
[0108] Involved characters:
[0109] - Service staff Li: 25 years old, with 3 years of work experience;
[0110] - Customer Mr. Wang: A business person in his forties.
[0111] Customer's needs or questions:
[0112] Mr. Wang is visiting this restaurant for the first time and is not familiar with the menu. He wants to order some special dishes of the restaurant. At the same time, he has a mild peanut allergy.
[0113] Specific goals that the service staff needs to achieve:
[0114] 1. Greet customers warmly and create a good first impression;
[0115] 2. Understand customers' dietary preferences and needs;
[0116] 3. Recommend special dishes suitable for customers;
[0117] 4. Pay attention to customers' allergies and ensure food safety;
[0118] 5. Provide professional and considerate service to satisfy customers.
[0119] Note:
[0120] 1. All outputs must be within 30 characters. If it exceeds, it needs to be simplified.
[0121] 2. The reply should be clear and relevant to the goal.
[0122] 3. In this role-play, you must always act like a customer.
[0123]
Current conversation content
[0124] Li: Welcome, Mr. Wang. Is this your first time dining at our restaurant?
[0125] Mr. Wang: Yes, a friend recommended it to me. I heard your dishes are very special.
[0126] Li: Thank you very much for coming. We do have many popular special dishes. Do you have any particular taste preferences?
[0127]
Output content
[0128] Please give the next line of the role-play according to the conversation goal and
Current conversation content
[0129] After inputting the above example of the first prompt instruction into the large language model LLM, the example of the reply content for the user's latest conversation output by the large language model can be as follows:
[0130] “I like spicy dishes, but I have a mild peanut allergy.”
[0131] S203: Determine whether the conversation goal between the user and the large language model is completed based on the conversation goal information, the conversation content that has taken place between the user and the large language model, and the exemplary conversation information; if so, end this conversation practice; if not, continue with the next round of conversation practice until the conversation goal between the user and the large language model is completed.
[0132] In this embodiment, after obtaining the reply content of the large language model for the user's latest conversation through step S202, the updated conversation content between the user and the large language model (i.e., it includes the reply content of the large language model for the user's latest conversation) can be obtained. Then, further, based on the updated conversation content between the user and the large language model, the conversation goal information, and the exemplary conversation information, it can be determined whether the conversation goal of this conversation practice between the user and the large language model is completed. If so, it means that through this conversation practice, the needs of the user's personalized learning and improving the conversation ability in a specific industry field can be met, and this conversation practice can be ended; conversely, if not, the above steps S202 - S203 need to be executed again to continue the next round of conversation practice, and so on, until the conversation goal between the user and the large language model is achieved, thereby improving the user's conversation communication ability in a specific industry field and further enhancing the user's conversation practice experience.
[0133] It should be noted that the method for determining whether the conversation goal between the user and the large language model in this application is not limited and can be selected according to the actual situation and experience. For example, the large language model LLM can be used to determine whether the conversation goal between the user and the large language model is completed based on the conversation goal information, the conversation content that has taken place between the user and the large language model, and the exemplary conversation information; or, based on other pre-trained language representation models in the field of natural language processing, it can be determined whether the conversation goal between the user and the large language model is completed according to the conversation goal information, the conversation content that has taken place between the user and the large language model, and the exemplary conversation information. In this way, when one of the judgment results indicates that the conversation goal between the user and the large language model is completed, it can be determined that the conversation goal between the user and the large language model has been achieved; or, when one of the judgment results indicates that the conversation goal between the user and the large language model is not completed, it can be determined that the conversation goal between the user and the large language model has not been achieved.
[0134] Specifically, an optional implementation method is as follows. By using a large language model (LLM), based on the dialogue target information, the dialogue content that has occurred between the user and the large language model, and the exemplary dialogue information, the method for determining whether the dialogue target between the user and the large language model has been completed can be: incorporating the dialogue background information, dialogue target information, the dialogue content that has occurred between the user and the large language model, and the exemplary dialogue information into a prompt (herein defined as the third prompt), and inputting it into the large language model (LLM), so as to obtain the determination result output by the large language model regarding whether the dialogue target between the user and the large language model has been completed.
[0135] In this implementation method, in order to improve the judgment accuracy of the large language model (LLM), the present application introduces the "exemplary dialogue information" obtained through step S201 as an auxiliary judgment basis, and adopts the method of "few-shot learning" or "in-context learning", using the "exemplary dialogue information" to provide specific context and reference for the large language model (LLM), enabling it to better understand the structure, process, and criteria for achieving the goal of the dialogue, etc., so that it can learn more details and patterns from the example dialogues. In this way, by providing a small number of high-quality examples, the few-shot learning ability of the model can be activated, enabling it to quickly adapt to specific tasks. This method can improve the model performance without a large amount of training data. At the same time, by concretizing the abstract target judgment task through the "exemplary dialogue information", the model can also more clearly understand which dialogues can be regarded as achieving the goal, thereby reducing the uncertainty of the model.
[0136] For example: Still based on the above example, still assuming that the catering service industry is the preset industry, and the user who uses the LLM for dialogue practice is a service staff in a restaurant, then an example of the third prompt input to the large language model (LLM) can be as follows:
[0137] "You are an experienced Chinese teacher. Your role is to read and semantically analyze the text input of the waiter according to the specific tasks or questions assigned to the waiter. After reviewing each input, determine whether the content accurately and effectively addresses any of the topics outlined in the
Dialogue Target
[0138]
Background
[0139] Location: A high-end Chinese restaurant;
[0140] Time: 7 pm on Friday, during the peak dining period;
[0141] Environment: The restaurant is exquisitely decorated, with soft lighting and melodious background music.
[0142] Involved roles:
[0143] - Staff member Li: 25 years old, with 3 years of work experience;
[0144] - Customer Mr. Wang: A businessperson in his forties.
[0145] Customer's needs or problems:
[0146] Mr. Wang is visiting this restaurant for the first time and is not very familiar with the menu. He wants to order some special dishes of the restaurant. At the same time, he has a mild peanut allergy.
[0147]
Dialogue goals
[0148] 1. Warmly greet the customer and create a good first impression;
[0149] 2. Understand the customer's dietary preferences and needs;
[0150] 3. Recommend special dishes suitable for the customer;
[0151] 4. Pay attention to the customer's allergy situation and ensure food safety;
[0152] 5. Provide professional and considerate service to satisfy the customer.
[0153]
Current dialogue content
[0154] Li: Welcome, Mr. Wang. I'm Li, your waiter for tonight. Nice to serve you. Is this your first time dining at our restaurant?
[0155] Mr. Wang: Yes. I heard from a friend that this place is very good, so I came here especially to give it a try.
[0156] Li: Thank you very much for your trust. We will strive to bring you a pleasant dining experience. Do you have any special taste preferences?
[0157] Mr. Wang: I prefer dishes with a lighter taste. Also, I have a mild peanut allergy and hope to avoid it.
[0158] Li: I see, Mr. Wang. Thank you for informing us of your allergy. We will pay special attention. Considering your preference, I recommend several of our special dishes to you: First is the steamed spotted maigre. The fish is tender and the taste is refreshing. There is also a dish of sautéed asparagus with truffles and wild mushrooms, which is light, delicious and nutritious. Finally, our signature dish, Dongpo Pork, is fatty but not greasy and melts in the mouth. None of these dishes contain peanuts. What do you think?
[0159] Mr. Wang: They all sound good. Just order according to what you said.
[0160] Li: Okay, Mr. Wang. Please wait a moment. I'll place the order for you right away.
[0161] Mr. Wang: Sure, this will do.
[0162] Xiao Li: Okay, I've noted it down. Your dishes will be served shortly. If you need anything else, feel free to call me. Enjoy your meal!
[0163]
Exemplary Dialogue
[0164] Xiao Li: Welcome, Mr. Wang. Is this your first time dining at our restaurant?
[0165] Mr. Wang: Yes, a friend recommended it to me. I heard your dishes are very special.
[0166] Xiao Li: Thank you very much for coming. We do have many popular special dishes. Do you have any particular taste preferences?
[0167] Mr. Wang: I like dishes with a spicier taste, but I'm slightly allergic to peanuts.
[0168] Xiao Li: I see. I'll pay special attention. Considering your preference, I recommend our signature dishes, "Spicy Hot Pot" and "Boiled Fish with Pickled Peppers". Both of these dishes are spicy and do not contain peanuts. Additionally, our "Kung Pao Chicken" is also very popular, but it usually contains peanuts. If you're interested, I can ask the kitchen to prepare a special version without peanuts for you.
[0169] Mr. Wang: That sounds good. Then Spicy Hot Pot and Boiled Fish with Pickled Peppers. And also a seasonal vegetable.
[0170] Xiao Li: Okay, great choice. We currently have fresh Qinglong vegetables. They are very crispy and tender when stir-fried. What do you think?
[0171] Mr. Wang: Sure, that's all.
[0172] Xiao Li: Okay, I've noted down your order: Spicy Hot Pot, Boiled Fish with Pickled Peppers, and stir-fried Qinglong vegetables. I'll emphasize your peanut allergy again to ensure food safety. Do you need any drinks?
[0173] Mr. Wang: Just a pot of jasmine tea will do.
[0174] Xiao Li: I see. Your tea will be served shortly, and the dishes will take about 20 minutes. If you have any other needs, feel free to let me know at any time. Enjoy your meal!
[0175] After inputting the above example of the third prompt instruction into the large language model (LLM), the determination result example of whether the dialogue goal between the user and the LLM is completed can be as follows:
[0176] "fit_result: The goal has been achieved."
[0177] Another alternative implementation is to use a pre-trained language representation model in the field of natural language processing. The implementation method for judging whether the dialogue goal between the user and the large language model is completed based on the dialogue goal information, the dialogue content that has occurred between the user and the large language model, and the exemplary dialogue information can include the following steps A - C:
[0178] Step A: Concatenate the dialogue goal information, the dialogue content that has occurred between the user and the large language model, and the exemplary dialogue information, and perform text tokenization on the concatenated text to obtain the processed text data.
[0179] In this implementation, as Figure 4 shown, when judging whether the dialogue goal is completed based on the BERT model, in order to improve the accuracy of the judgment result, first, the dialogue goal information, the dialogue content that has occurred between the user and the large language model, and the exemplary dialogue information obtained through the previous steps S201 and S202 can be concatenated. The structure of the concatenated text can be: "[CLS]Goal content[SEP]Exemplary dialogue[SEP]Current dialogue[SEP]". Then, the concatenated text can be processed using existing or future standard tools for text tokenization to obtain the processed text data, which is used as the input data that conforms to the input format of the pre-trained language representation model to perform the subsequent step B.
[0180] Step B: Perform conversion processing on the processed text data to obtain the processed feature vector.
[0181] After obtaining the processed text data through step A, it can be further input into the pre-trained language representation model for conversion processing to convert the processed text data from a discrete symbol sequence into a continuous, high-dimensional, and semantically rich vector representation, obtaining the processed feature vector, which is used to perform the subsequent step C.
[0182] Step C: Establish the association between the feature vector and whether the dialogue goal is achieved, and judge whether the dialogue goal between the user and the large language model is completed according to the association result.
[0183] After obtaining the feature vector processed by the pre-trained language representation model through step B, the association between the feature vector and whether the dialogue goal is achieved can be further established to judge whether the dialogue goal is achieved by understanding the content and context of the dialogue. It should be noted that this application does not limit the specific method used to implement this process, and similar deep learning methods can be used according to the actual situation. For example, specifically, as Figure 4As shown, first, the feature vectors processed by the pre-trained language representation model can be input into the fully connected layer for information integration (i.e., linear transformation) to obtain the integrated feature vectors. The purpose is to map the feature vectors processed by the model into a space more suitable for a specific task, enabling it to learn task-specific features.
[0184] Then, the integrated feature vectors can be processed by Dropout regularization to randomly ignore some information, obtaining the processed feature vectors. This can prevent the model from becoming overly confident during the training phase and ensure that it can adapt to various different conversation situations. It helps prevent overfitting during the model training phase and enhances the generalization ability of the model.
[0185] Next, the processed feature vectors can be non-linearly processed through activation functions such as ReLU. These activation functions introduce non-linearity, enabling the network to learn more complex patterns. They help the model not only understand simple conversation patterns but also capture more complex conversation meanings. Then, the feature vectors processed by the activation function are input into the fully connected layer for output to map them to the final classification space, obtaining the output result (the specific data form is not limited, such as it can be shown in the form of scores, etc.).
[0186] Furthermore, the output result (such as the original score) can be processed by Softmax binary classification to transform it into the form of a probability distribution, that is, a definite answer will be output to determine whether the conversation goal between the user and the large language model is completed. Moreover, it ensures that the sum of the probabilities of all categories is 1, facilitating the interpretation of the output result. Specifically, based on the comparison result with the preset probability threshold, it can finally be determined whether the conversation goal between the user and the large language model is completed. For example, if the preset probability threshold is 0.8, when the processing result obtained by Softmax binary classification is 0.6, since 0.6 does not exceed the preset probability threshold of 0.8, it can be determined that the conversation goal between the user and the large language model is not completed.
[0187] In addition, to further improve the user's conversation practice experience, an optional implementation method is that during the conversation practice with the user, when the user needs a prompt at any time, accurate example prompts can be given, such as Figure 3As shown. For example, when the user needs to practice a conversation after a role swap (such as the user's role changes from a restaurant staff to a customer, and the role of the large language model LLM changes from a customer to a restaurant staff), after obtaining the role swap conversation practice instruction proposed by the user through voice or input text, etc., in response to the role swap conversation practice instruction, the previously obtained conversation background information, conversation target information, and the conversation content that the user and the large language model have already had can be incorporated into the prompt instruction (here defined as the fourth prompt instruction) and input into the large language model to obtain the reply content of the large language model after the role swap for the user's latest conversation.
[0188] For example: Still taking the catering service industry as the preset industry, assume that the role swap conversation practice instruction proposed by the user is to change the role he plays from a restaurant staff to a customer, and change the role of the large model LLM from a customer to a restaurant staff. Then an example of the fourth prompt instruction prompt input to the large language model LLM can be as follows:
[0189] "You are an experienced Chinese teacher. You are here to help the customer improve his Mandarin speaking skills in practice by role-playing as a service staff.
[0190]
Background
[0191] Location: A high-end Chinese restaurant;
[0192] Time: 7 pm on Friday, during the peak dining period;
[0193] Environment: The restaurant is exquisitely decorated, with soft lighting and melodious background music.
[0194] Involved roles:
[0195] - Waiter Li: 25 years old, with 3 years of work experience;
[0196] - Customer Mr. Wang: A business person in his 40s.
[0197] Customer's needs or questions:
[0198] Mr. Wang is coming to this restaurant for the first time and is not familiar with the menu. He wants to order some special dishes of the restaurant. At the same time, he has a mild peanut allergy.
[0199] Note:
[0200] 1. All outputs must be within 30 characters. If the output exceeds, it needs to be simplified.
[0201] 2. The reply should be clear and relevant to the target.
[0202] 3. In this role-play, you must always act like a service staff.
[0203]
Contents of the conversation in progress
[0204] Xiao Li: Welcome, Mr. Wang. Is this your first time dining at our restaurant?
[0205] Mr. Wang: Yes, a friend recommended it to me. I heard that your dishes are very special.
[0206] Xiao Li: Thank you very much for coming. We do have many popular special dishes. Do you have any particular taste preferences?
[0207] Mr. Wang: I like dishes with a spicier taste, but I'm slightly allergic to peanuts.
[0208]
Output content
[0209] Please give the next line of the role-play according to the conversation goal and
Contents of the current conversation
[0210] After inputting the above example of the fourth prompt instruction prompt into the large language model LLM, the example of the reply content for the user's latest conversation output by the large language model can be as follows:
[0211] "I see. I'll pay special attention. Considering your preference, I recommend you try our signature dishes, 'Spicy Hot Pot' and 'Boiled Fish'. Both of these dishes are spicier and do not contain peanuts. In addition, our 'Kung Pao Chicken' is also very popular, but usually contains peanuts. If you're interested, I can ask the kitchen to prepare a special version without peanuts for you."
[0212] In summary, for a dialogue practice method provided in this embodiment, first, obtain the dialogue practice instruction proposed by the user, and select the dialogue background information, dialogue goal information, and exemplary dialogue information from the dialogue scenario information according to the dialogue practice instruction; then input the dialogue background information, dialogue goal information, and the conversation content between the user and the large language model into the large language model in combination with the first prompt instruction prompt to obtain the reply content for the user's latest conversation output by the large language model; then, according to the dialogue goal information, the conversation content between the user and the large language model (which includes the reply content for the user's latest conversation output by the large language model), and the exemplary dialogue information, determine whether the dialogue goal between the user and the large language model is completed; if so, end this dialogue practice; if not, continue the next round of dialogue practice until the dialogue goal between the user and the large language model is completed.
[0213] It can be seen that since this application first constructs the dialogue scenario information corresponding to different industries, and then selects the dialogue background, dialogue goals, exemplary dialogues, etc. that are more in line with the user's needs for personalized dialogue practice from them, so as to combine with the LLM to achieve targeted dialogue practice with the user in a specific industry field goal, it can effectively improve the user's dialogue communication ability in this specific industry field, and thus enhance the user's dialogue practice experience.
[0214] Second Embodiment
[0215] This embodiment will introduce the construction method of the "dialogue scenario information" mentioned in the first embodiment. The specific implementation process may include the following steps (1)-(2):
[0216] Step (1): Determine the preset industry and the dialogue role information involved in the preset industry.
[0217] In this embodiment, in order to meet the user's personalized learning needs and improve their dialogue ability in a specific industry field, this application first sets some relatively common industries with high user dialogue needs as preset industries according to the actual situation and the experience of the staff (such as the user dialogue needs pre-collected by the staff). For example, industries that usually involve different role dialogues, such as education (such as oral English learning), food service, public transportation, medical care, ticketing, etc., can be used as preset industries, and the dialogue role information involved in these preset industries is determined. For example, the dialogue roles involved in the education industry can be teachers and students, the dialogue roles involved in the food service industry can be service staff and dining customers, the dialogue roles involved in the medical industry can be doctors and patients seeking medical treatment, the dialogue roles involved in the public transportation industry can be subway drivers and passengers, and the dialogue roles involved in the ticketing industry can be ticket sellers and ticket buyers, etc.
[0218] Step (2): Use the large language model to construct the dialogue scenario information corresponding to the preset industry according to the name information of the preset industry and the dialogue role information involved in the preset industry.
[0219] In this embodiment, after determining the preset industry and the dialogue role information involved in the preset industry (such as the catering service industry and the dialogue roles involved, including service staff and dining customers, etc.) through step (1), further, the rich knowledge, natural speech understanding ability, and powerful logical reasoning ability of the large language model in various industry fields can be utilized. According to the name information of the preset industry and the dialogue role information involved in the preset industry, the dialogue scenario information corresponding to each preset industry is constructed. The dialogue scenario information includes, but is not limited to, information such as the possible dialogue background, dialogue goal, and exemplary dialogue in the preset industry. Among them, the dialogue background usually includes information such as the location, time, and environment of the dialogue scenario where the dialogue occurs in the preset industry, the dialogue opening remarks, and the requirements of different roles; the dialogue goal usually refers to the goal that the roles in the dialogue can achieve through the dialogue. For example, the goal that a certain role can achieve after completing an exemplary dialogue in the exemplary dialogue, that is, the effect that can be achieved through the exemplary dialogue. For example, in the catering service industry, the service staff can achieve the goal of improving their service level (including, but not limited to, understanding the customer's dietary preferences and needs, recommending special dishes suitable for the customer, and providing professional and considerate service to the customer, etc.) through an exemplary dialogue between a certain customer and the service staff.
[0220] Specifically, an optional implementation method is that after determining each preset industry and the dialogue role information involved, in order to more accurately construct the dialogue scenario information corresponding to each preset industry. First, the name information and role information of each preset industry can be integrated into the prompt (here defined as the second prompt) and input into the large language model (LLM). By using the retrieval ability of the large language model (LLM), the background information of various possible dialogues in the preset industry (such as information about the location, time, and environment of the dialogue scenario) can be retrieved first. Then, by using the inductive summary ability of the large language model (LLM), the dialogue goal information of various possible dialogues in the preset industry can be listed (such as in the dining scenario, the service staff can achieve the goal of "understanding the customer's dietary preferences and needs" through a dialogue with the dining customer, etc.). And by using the inductive summary ability, for each dialogue background information and dialogue goal information, at least one exemplary dialogue is output to form the dialogue scenario information corresponding to the corresponding preset industry.
[0221] In addition, to ensure the accuracy of the constructed information, the staff can also manually check the content such as the dialogue background information, dialogue target information, and exemplary dialogue information of the preset industry output by the large language model (LLM), so as to screen out more accurate dialogue scenario information and store it in a preset format (such as in the form of a dialogue scenario information list). The specific storage method and storage location are not limited. For example, for the convenience of direct invocation by the large language model (LLM), the constructed dialogue scenario information corresponding to each preset industry can be directly stored in the large language model (LLM). Or, to reduce the storage burden of the large language model LLM, the constructed dialogue scenario information corresponding to each preset industry can also be saved to a preset third-party storage device, such as cloud storage services, distributed database storage systems, big data platforms, etc., for the large language model (LLM) to make a temporary call using search commands when needed.
[0222] For example: Still taking the catering service industry as an example of the preset industry, if the user is set as a service staff in a restaurant, then to meet the personalized learning needs of the user (with the role of a restaurant service staff) and improve their dialogue ability in the catering service industry (which can be understood as the need to improve the service level), when constructing the dialogue scenario information corresponding to the catering service industry, an example of the second prompt instruction prompt input to the large language model LLM can be as follows:
[0223] "Please create a dialogue scenario and target related to [Catering Service Industry] for me. Include the following elements:
[0224] Scene setting (location, time, environment);
[0225] Involved roles [A service staff and a customer];
[0226] Customer's needs or questions;
[0227] Specific goals that the service staff needs to achieve;
[0228] And give an [Exemplary Dialogue] and [Dialogue Narration] to prompt the service staff to say the first sentence of the conversation first."
[0229] After inputting the above example of the second prompt instruction prompt into the large language model LLM, the large language model can output content such as the dialogue background, dialogue target, and exemplary dialogue related to the catering service industry, which are used to constitute the dialogue scenario information corresponding to the catering service industry. The specific example can be as follows:
[0230] "[Background]
[0231] Scene setting:
[0232] Location: A high-end Chinese restaurant;
[0233] Time: 7 PM on Friday, during the peak dining hour;
[0234] Environment: The restaurant is exquisitely decorated with soft lighting and melodious background music.
[0235] Involved characters:
[0236] - Xiao Li, a service staff member: 25 years old, with 3 years of work experience;
[0237] - Mr. Wang, a customer: A businessperson in his forties.
[0238] Customer's needs or problems:
[0239] Mr. Wang is visiting this restaurant for the first time and is not familiar with the menu. He wants to order some special dishes of the restaurant. At the same time, he has a mild peanut allergy.
[0240] Specific goals that the service staff needs to achieve:
[0241] 1. Warmly greet the customer and create a good first impression;
[0242] 2. Understand the customer's dietary preferences and needs;
[0243] 3. Recommend special dishes suitable for the customer;
[0244] 4. Pay attention to the customer's allergy situation and ensure food safety;
[0245] 5. Provide professional and considerate service to satisfy the customer.
[0246]
Dialogue narration
[0247] The service staff smiles and walks towards the customer who has just taken a seat, preparing to start the reception. At this time, you say:
[0248]
Exemplary dialogue
[0249] Xiao Li: Welcome, Mr. Wang. Are you dining at our restaurant for the first time?
[0250] Mr. Wang: Yes, a friend recommended it to me. I heard that your dishes are very special.
[0251] Xiao Li: Thank you very much for coming. We do have many popular special dishes. Do you have any particular taste preferences?
[0252] Mr. Wang: I like dishes with a spicier taste, but I have a mild peanut allergy.
[0253] Xiao Li: I see. I'll pay special attention. Considering your preference, I recommend you try our signature dishes, "Spicy Hot Pot" and "Boiled Fish with Pickled Peppers". Both dishes are spicy and peanut-free. Additionally, our "Kung Pao Chicken" is also very popular, but it usually contains peanuts. If you're interested, I can ask the kitchen to prepare a special peanut-free version for you.
[0254] Mr. Wang: That sounds good. Then I'll have the Spicy Hot Pot and the Boiled Fish with Pickled Peppers. And also a seasonal vegetable.
[0255] Xiao Li: Okay, great choice. We have fresh Chinese flowering cabbage now. It's very crispy and tender when stir-fried. What do you think?
[0256] Mr. Wang: Sure, that's all.
[0257] Xiao Li: Alright, I've noted down your order: Spicy Hot Pot, Boiled Fish with Pickled Peppers, and stir-fried Chinese flowering cabbage. I'll emphasize your peanut allergy again to ensure food safety. Do you need any drinks?
[0258] Mr. Wang: Just a pot of jasmine tea.
[0259] Xiao Li: I got it. Your tea will be served soon. The dishes will take about 20 minutes. If you have any other needs, feel free to let me know. Have a pleasant meal!
[0260] Third Embodiment
[0261] This embodiment will introduce a dialogue practice device. For related content, please refer to the above method embodiment.
[0262] See Figure 5 , which is a schematic diagram of the composition of a dialogue practice device provided in this embodiment. The device 500 includes:
[0263] A first acquisition unit 501, configured to acquire a dialogue practice instruction proposed by a user, and select dialogue background information, dialogue target information, and exemplary dialogue information from dialogue scenario information according to the dialogue practice instruction;
[0264] An input unit 502, configured to input the dialogue background information, the dialogue target information, the dialogue content that has been carried out between the user and the large language model, and combine a first prompt instruction prompt into the large language model to obtain a reply content output by the large language model for the user's latest dialogue;
[0265] A judgment unit 503, configured to judge whether the dialogue objective between the user and the large language model is completed according to the dialogue objective information, the dialogue content that has been carried out between the user and the large language model, and the exemplary dialogue information; if so, end this dialogue practice; if not, continue the next round of dialogue practice until the dialogue objective between the user and the large language model is completed.
[0266] In an implementation manner of this embodiment, the apparatus further includes:
[0267] A determination unit, configured to determine a preset industry and the dialogue role information involved in the preset industry;
[0268] A construction unit, configured to use the large language model to construct the dialogue scenario information corresponding to the preset industry according to the name information of the preset industry and the dialogue role information involved in the preset industry.
[0269] In an implementation manner of this embodiment, the construction unit is specifically configured to:
[0270] Input the name information of the preset industry and the dialogue role information involved in the preset industry, in combination with a second prompt instruction prompt, into the large language model, and obtain the dialogue background information, dialogue objective information, and exemplary dialogue information output by the large language model related to the preset industry, so as to constitute the dialogue scenario information corresponding to the preset industry.
[0271] In an implementation manner of this embodiment, the judgment unit 503 is specifically configured to:
[0272] Use the large language model to judge whether the dialogue objective between the user and the large language model is completed according to the dialogue objective information, the dialogue content that has been carried out between the user and the large language model, and the exemplary dialogue information.
[0273] In an implementation manner of this embodiment, the judgment unit 503 is specifically configured to:
[0274] Input the dialogue background information, dialogue objective information, the dialogue content that has been carried out between the user and the large language model, and the exemplary dialogue information, in combination with a third prompt instruction prompt, into the large language model, and obtain the determination result output by the large language model on whether the dialogue objective between the user and the large language model is completed.
[0275] In an implementation manner of this embodiment, the judgment unit 503 includes:
[0276] A splicing subunit, configured to splice the dialogue target information, the dialogue content already carried out between the user and the large language model, and the exemplary dialogue information, and perform text tokenization processing on the spliced text to obtain processed text data;
[0277] A conversion subunit, configured to perform conversion processing on the processed text data to obtain processed feature vectors;
[0278] A judgment subunit, configured to establish an association between the feature vector and whether the dialogue target is achieved, and judge whether the dialogue target between the user and the large language model is completed according to the association result.
[0279] In an implementation manner of this embodiment, the judgment subunit includes:
[0280] An integration subunit, configured to input the feature vector into a fully connected layer for information integration to obtain an integrated feature vector;
[0281] A regularization subunit, configured to perform Dropout regularization processing on the integrated feature vector to obtain processed feature vectors;
[0282] An input subunit, configured to perform non-linear processing on the processed feature vector through an activation function, input it into a fully connected layer for output, and perform binary classification processing on the output result to judge whether the dialogue target between the user and the large language model is completed according to the processing result.
[0283] In an implementation manner of this embodiment, the device further includes:
[0284] A second acquisition unit, configured to acquire a dialogue practice instruction for role reversal proposed by the user, and in response to the dialogue practice instruction for role reversal, input the dialogue background information, the dialogue target information, the dialogue content already carried out between the user and the large language model, combined with the fourth prompt instruction prompt, into the large language model to obtain the reply content of the large language model for the user's latest dialogue after role reversal.
[0285] Furthermore, an embodiment of the present application further provides a dialogue practice device, including: a processor, a memory, and a system bus;
[0286] The processor and the memory are connected through the system bus;
[0287] The memory is used to store one or more programs, and the one or more programs include instructions, and when the instructions are executed by the processor, the processor is caused to execute any implementation method of the above-mentioned dialogue practice method.
[0288] Furthermore, an embodiment of the present application further provides a computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions run on a terminal device, the terminal device is enabled to execute any of the implementation methods of the above-mentioned dialogue practice method.
[0289] Furthermore, an embodiment of the present application further provides a computer program product. When the computer program product runs on a terminal device, the terminal device is enabled to execute any of the implementation methods of the above-mentioned dialogue practice method.
[0290] From the description of the above embodiments, those skilled in the art can clearly understand that all or part of the steps in the above embodiment methods can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disc, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network communication device such as a media gateway, etc.) to execute the methods described in various embodiments or some parts of the embodiments of the present application.
[0291] It should be noted that the various embodiments in this specification are described in a progressive manner. The key point of each embodiment is to describe the differences from other embodiments. The same or similar parts among the various embodiments can be referred to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method part.
[0292] It should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of another identical element in the process, method, article or device including the element.
[0293] The foregoing description of the disclosed embodiments enables those skilled in the art to practice or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for practicing dialogue, characterized in that: include: Acquire a dialogue practice instruction proposed by a user, and select dialogue background information, dialogue target information, and exemplary dialogue information from the dialogue scene information according to the dialogue practice instruction; The conversation background information, the conversation target information, the conversation content between the user and the large language model, and the first prompt instruction prompt are input into the large language model to obtain the reply content for the latest conversation of the user output by the large language model; According to the dialogue target information, the content of the dialogue between the user and the large language model, and the exemplary dialogue information, it is determined whether the dialogue target between the user and the large language model is completed; if so, the dialogue practice is ended; if not, the next round of dialogue practice is continued until the dialogue target between the user and the large language model is completed.
2. The method according to claim 1, characterized in that The dialogue scene information is constructed as follows: Determine a preset industry and information about dialogue roles involved in the preset industry; The large language model is used to construct dialogue scene information corresponding to the preset industry according to the name information of the preset industry and the dialogue role information involved in the preset industry.
3. The method according to claim 2, characterized in that The using of the large language model to construct the dialogue scene information corresponding to the preset industry according to the name information of the preset industry and the dialogue role information involved in the preset industry includes: The name information of the preset industry and the dialogue role information involved in the preset industry are input into the large language model in combination with the second prompt instruction prompt, so as to obtain the dialogue background information, dialogue target information and exemplary dialogue information related to the preset industry output by the large language model, so as to constitute the dialogue scene information corresponding to the preset industry.
4. The method according to claim 1, characterized in that: The determining whether the dialogue target between the user and the large language model is completed according to the dialogue target information, the dialogue content that has been conducted between the user and the large language model, and the exemplary dialogue information includes: The large language model is used to determine whether the dialogue goal between the user and the large language model is completed according to the dialogue goal information, the dialogue content that has been conducted between the user and the large language model, and the exemplary dialogue information.
5. The method according to claim 4, characterized in that The using the large language model to determine whether the dialogue goal between the user and the large language model is completed according to the dialogue goal information, the dialogue content that has been conducted between the user and the large language model, and the exemplary dialogue information, includes: The conversation background information, conversation target information, the content of the conversation between the user and the large language model, and exemplary conversation information are input into the large language model in combination with a third prompt instruction prompt, and a judgment result of whether the conversation target between the user and the large language model is completed is obtained from the output of the large language model.
6. The method according to claim 1, characterized in that The determining whether the dialogue target between the user and the large language model is completed according to the dialogue target information, the dialogue content that has been conducted between the user and the large language model, and the exemplary dialogue information includes: splicing the dialogue target information, the dialogue content between the user and the large language model, and the exemplary dialogue information, and performing text tokenization processing on the spliced text to obtain processed text data; Performing conversion processing on the processed text data to obtain a processed feature vector; An association is established between the feature vector and whether the dialogue goal has been achieved, and whether the dialogue goal between the user and the large language model has been achieved is determined based on the association result.
7. The method according to claim 6, characterized in that The establishing of an association between the feature vector and whether the dialogue goal is achieved, and judging whether the dialogue goal between the user and the large language model is achieved according to the association result, includes: Inputting the feature vector into a fully connected layer for information integration to obtain an integrated feature vector; Regularize the integrated feature vector to obtain a processed feature vector; The processed feature vector is processed nonlinearly by the activation function and then input into the fully connected layer for output, and the output result is subjected to binary classification processing to determine whether the dialogue goal between the user and the large language model is completed according to the processing result.
8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: A role-swap dialogue practice instruction proposed by a user is obtained, and in response to the role-swap dialogue practice instruction, the dialogue background information, dialogue target information, and the content of the dialogue between the user and the large language model are input into the large language model in combination with a fourth prompt instruction prompt, so as to obtain the reply content of the large language model to the user's latest dialogue after the role-swap output.
9. A conversation practice device, characterized in that: include: A first acquisition unit is used to acquire a dialogue practice instruction proposed by a user, and select dialogue background information, dialogue target information and exemplary dialogue information from the dialogue scene information according to the dialogue practice instruction; an input unit, configured to input the conversation background information, the conversation target information, the conversation content between the user and the large language model, and a first prompt instruction prompt into the large language model, and obtain a reply content output by the large language model for the latest conversation of the user; The judgment unit is used to judge whether the dialogue goal between the user and the large language model is completed according to the dialogue goal information, the dialogue content between the user and the large language model, and the exemplary dialogue information; if so, end the dialogue practice; if not, continue with the next round of dialogue practice until the dialogue goal between the user and the large language model is completed.
10. A conversation practice device, characterized in that: include: Processor, memory, system bus; The processor and the memory are connected via the system bus; The memory is used to store one or more programs, wherein the one or more programs include instructions, and when the instructions are executed by the processor, the processor executes the method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device executes the method according to any one of claims 1 to 8.