Voice conversation method and device, equipment, storage medium and product
Through the text matching model and large language model of the cloud service platform, context matching is carried out by combining user input and historical dialogue information to generate prompt words to improve the accuracy of voice conversations, solving the problem of user intention identification in the existing technology, and improving the problem of The effect and user experience of voice conversations.
Patent Information
- Application Number
- CN202411401603.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2044-10-09
AI Technical Summary
When handling complex scenarios such as multiple rounds of user conversations, the prior art cannot effectively distinguish the user's actual intentions, resulting in poor voice conversation effects.
Through the large language model and text matching model in the cloud service platform, the voice information and historical dialogue information input by the user are obtained, context matching is performed, the matching target text information is generated, and the large language model is input as a prompt word to generate More accurate voice information for answering.
It improves the effect of voice conversations, enhances the user experience, and can more accurately identify the user's actual intentions in multiple rounds of conversation scenarios, providing a response that is more in line with user needs.
Smart Images

Figure CN119314478A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing technology, and in particular to voice dialogue methods, devices, equipment, storage media and products. Background Art
[0002] At present, with the development of artificial intelligence, the functions of smart watches are also increasing. Among them, the voice conversation function of smart watches is a specific application of modern artificial intelligence technology in the field of wearable devices. It usually includes technologies such as speech recognition, natural language processing, and speech synthesis, allowing users to interact with devices through voice, perform various operations, and obtain information.
[0003] In the related technologies, natural language processing technology is usually used to understand the user's natural language commands and generate corresponding text information for responses, and then speech synthesis technology is used to convert the text information into speech output, provide speech feedback, and enhance the user experience. However, the natural language processing technology in the related technologies only focuses on one piece of information input by the current user. When processing complex scenarios such as multiple rounds of user conversations, it is unable to identify the user's actual intentions, resulting in poor voice dialogue effects.
[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of this application is to provide a voice conversation method, which aims to solve the technical problem that when processing complex scenarios such as multiple rounds of user conversations, the user's actual intention cannot be identified, resulting in poor voice conversation effects.
[0006] To achieve the above purpose, the present application proposes a voice dialogue method, which is applied to a cloud service platform, in which a large language model is deployed. The voice dialogue method includes: Acquire voice information input by a user and historical conversation information of the user, and perform text recognition on the voice information to obtain initial text information; Based on the historical conversation information and the initial text information, context matching is performed through a preset text matching model to obtain matched target text information; Generating prompt words corresponding to the target text information; The prompt word is input into a preset large language model, and the answer voice information output by the large language model is received and output, wherein the answer voice information is generated by the large language model based on the answer output instruction to generate a sentence for the prompt word.
[0007] Optionally, the step of performing context matching based on the historical conversation information and the initial text information through a preset text matching model to obtain matched target text information includes: Determining conversation scenario information of the initial text information; Based on the conversation scene information, the historical conversation information is filtered to obtain filtered historical conversation information, wherein the filtered historical conversation information and the current initial text information belong to the same conversation scene; Perform correlation matching on the filtered historical conversation information and the initial text information to obtain correlation values of each filtered historical conversation information, and retain the historical conversation information whose correlation value is greater than a preset correlation value threshold in the filtered historical conversation information to obtain secondary filtered historical conversation information; The historical dialogue information after secondary screening and the initial text information are combined to form matched target text information containing complete context information.
[0008] Optionally, before the step of acquiring the voice information input by the user and the historical conversation information of the user, and performing text recognition on the voice information to obtain initial text information, the method includes: Acquire a text information sample, a historical conversation text sample of the text information sample, and a matching text tag of the text information sample; Based on the text information samples, the historical conversation text samples and the matching text labels, the preset model to be trained is iteratively trained to obtain a text matching model.
[0009] Optionally, the step of iteratively training a preset model to be trained based on the text information sample, the historical conversation text sample and the matching text label to obtain a text matching model includes: Obtaining conversation time information of the historical conversation text sample; Determining a time weight based on the conversation time information; Based on the text information samples, the time weights, the historical conversation text samples and the matching text labels, the preset model to be trained is iteratively trained to obtain a text matching model.
[0010] Optionally, the step of iteratively training a preset model to be trained based on the text information sample, the time weight, the historical conversation text sample and the matching text label to obtain a text matching model includes: Based on the text information sample, the time weight and the historical conversation text sample, context matching is performed through a preset model to be trained to obtain a predicted matching result; Calculate the difference between the predicted matching result and the matching text label to obtain an error result; Based on the error result, determining whether the error result meets an error standard indicated by a preset error threshold range; If the error result does not meet the error standard indicated by the preset error threshold range, then return to the step of performing context matching based on the text information sample, the time weight and the historical conversation text sample through the preset model to be trained to obtain a predicted matching result, and stop training until the error result meets the error standard indicated by the preset error threshold range to obtain a text matching model.
[0011] Optionally, the step of generating a prompt word corresponding to the target text information includes: Extracting keywords from the target text information to obtain keyword information; Based on a preset text expansion template set, template matching is performed on the keyword information to obtain a target expansion template; The target text information and the target expansion template are combined to obtain a prompt word.
[0012] In addition, to achieve the above-mentioned purpose, the present application also proposes a voice dialogue device, the voice dialogue device comprising: An acquisition module is used to acquire the voice information input by the user and the historical conversation information of the user, and perform text recognition on the voice information to obtain initial text information; A matching module, configured to perform context matching based on the historical conversation information and the initial text information through a preset text matching model to obtain matched target text information; A generating module, used for generating prompt words corresponding to the target text information; The output module is used to input the prompt word into a preset large language model, receive and output the answer voice information output by the large language model, wherein the answer voice information is generated by the large language model based on the answer output instruction to generate a sentence for the prompt word.
[0013] In addition, to achieve the above-mentioned purpose, the present application also proposes a voice conversation device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the voice conversation method described above.
[0014] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the voice dialogue method described above are implemented.
[0015] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the voice dialogue method described above are implemented.
[0016] One or more technical solutions proposed in this application have at least the following technical effects: Compared with the related art, which usually uses natural language processing technology to understand the user's natural language commands and generate corresponding reply text information, and then uses speech synthesis technology to convert the text information into speech output, provide speech feedback, and enhance the user experience. However, the natural language processing technology in the related art only focuses on a piece of information input by the current user. When processing complex scenarios such as multiple rounds of user conversations, it is impossible to distinguish the user's actual intention, resulting in poor effect of voice dialogue. In this application, the text matching model in the cloud service platform matches the user's historical dialogue information and the initial text information input by the user to obtain the matched target text information, and inputs the prompt word of the target text information into the preset large language model to obtain and output the answer voice information generated by the large language model to the user. It is understandable that after receiving the text information input by the current user, the cloud service platform first needs to match the historical dialogue information to obtain the matched target text information, wherein the matched target text information is the text information of the complete context obtained by contacting multiple rounds of conversations. The prompt word generated according to the matched target text information can enable the large language model to more accurately identify the user's actual intention, thereby improving the effect of voice dialogue and thus improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0019] Figure 1 A flowchart of the first embodiment of the voice dialogue method of the present application is provided; Figure 2 A flowchart of the second embodiment of the voice dialogue method of the present application is provided; Figure 3 This is a schematic diagram of the module structure of the voice dialogue device according to an embodiment of the present application; Figure 4This is a schematic diagram of the device structure of the hardware operating environment involved in the voice dialogue method in the embodiment of the present application.
[0020] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0021] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0022] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0023] The main solution of the embodiment of the present application is: obtaining voice information input by a user and the historical conversation information of the user, and performing text recognition on the voice information to obtain initial text information; based on the historical conversation information and the initial text information, performing context matching through a preset text matching model to obtain matched target text information; generating prompt words corresponding to the target text information; inputting the prompt words into a preset large language model, receiving and outputting the answer voice information output by the large language model, wherein the answer voice information is generated by the large language model based on the answer output instruction and performing sentence generation on the prompt words.
[0024] In this embodiment, the cloud service platform is used as the execution entity. For the convenience of description, it will be described as "platform" hereinafter.
[0025] In the related art, natural language processing technology is usually used to understand the user's natural language commands and generate corresponding text information for reply, and then speech synthesis technology is used to convert the text information into speech output, provide speech feedback, and enhance the user experience. However, the natural language processing technology in the related art only focuses on one piece of information input by the current user. When processing complex scenarios such as multiple rounds of user conversations, it is unable to identify the user's actual intention, resulting in poor voice dialogue effects.
[0026] The present application provides a solution to realize voice conversation on a smart watch, improve the effect of voice conversation, and thus improve the user experience.
[0027] From the above embodiments, it can be seen that the present application uses the text matching model in the cloud service platform to perform context matching on the user's historical conversation information and the initial text information input by the user to obtain the matched target text information, and inputs the prompt words of the target text information into the preset large language model to obtain and output the answer voice information generated by the large language model to the user. It is understandable that after receiving the text information input by the current user, the cloud service platform first needs to match the historical conversation information to obtain the matched target text information, wherein the matched target text information is the text information with the complete context obtained by connecting multiple rounds of conversations, and the prompt words generated according to the matched target text information can enable the large language model to more accurately identify the user's actual intention, thereby improving the effect of voice conversation and further improving the user experience.
[0028] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device, a terminal system, etc. that can realize the above functions. The following takes a voice dialogue device as an example to illustrate this embodiment and the following embodiments.
[0029] Based on this, the present application embodiment provides a voice dialogue method, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the voice dialogue method of the present application.
[0030] In this embodiment, the voice dialogue method includes steps S100 to S400: Step S100, obtaining voice information input by a user and historical conversation information of the user, and performing text recognition on the voice information to obtain initial text information; It should be noted that the voice dialogue method is applied to a cloud service platform, in which a large language model is deployed, wherein the cloud service platform is an online platform that provides remote computing resources and services. It allows users to access and use computing resources such as storage, software, databases, networks, servers, etc. through the Internet without having to make a large amount of capital investment or maintenance work on local computers or servers. Specifically, the cloud service platform is connected to the smart watch worn by the user, and the cloud service platform provides the user with a voice dialogue service, that is, the cloud service platform receives the user's voice information, understands its meaning and outputs the corresponding answering voice information.
[0031] In a specific implementation, the voice information input by the user refers to the audio data recorded by the user through a voice input device or application. The historical conversation information of the user refers to the voice / or text conversation information of the same user with the cloud service platform at a historical time, including but not limited to the user input information, the answer information output by the platform, and the user's satisfaction with the answer information.
[0032] In the specific implementation, the platform obtains the user's voice information and historical conversation information by providing an API interface. The specific platform can record and store the user's historical conversation information with an intelligent robot or other services, and obtain the user's historical conversation information through the historical conversation recording function.
[0033] In a specific implementation, the platform performs text recognition on the voice information to obtain initial text information. Specifically, the platform converts the user's voice input into text information in real time through a preset voice recognition technology. For example, the platform supports a single sentence mode based on a pre-developed real-time voice recognition service, which is suitable for scenarios that require interaction with the system, such as outbound calls, control commands, etc.
[0034] Step S200, based on the historical conversation information and the initial text information, context matching is performed through a preset text matching model to obtain matched target text information; It should be noted that the text matching model refers to a pre-trained deep neural network model for text matching, which is specifically a text matching model obtained by iteratively training a preset model to be trained based on the text information samples, the historical conversation text samples and the matching text labels.
[0035] In a specific implementation, the target text information after matching refers to other words or sentences in the text that are related to the currently processed word or phrase. Specifically, the target text information after matching in this application includes user historical questions and user latest questions. It is understandable that there are often multiple rounds of conversations in the process of user question-answering interaction. In this scenario, the user's latest question is asked after the user's historical question, that is, the user's latest question is raised on the user's historical question. For example, the user's historical question is: "What does artificial intelligence mean?", and the user's latest question is: "What is the model?", that is, in the multi-round conversation scenario, the user's actual intention is to explain the meaning of the model in the field of artificial intelligence. Therefore, the combination of user historical questions and user's latest questions needs to be considered in this application, rather than only answering the user's latest question. If only the user's latest question is considered, for the user's "what is the model" text, the answer text usually explains the meaning of the model in various fields, and cannot accurately identify the user's actual intention, that is, explain the meaning of the model in the field of artificial intelligence. In this application, the cloud service platform will consider multiple rounds of user conversations, identify the user's actual intention is to explain the meaning of the model in the field of artificial intelligence, and output accurate answering voices that satisfy the user to the user, thereby improving the effect of voice dialogue and thus improving user experience.
[0036] In a specific implementation, the platform performs context matching based on the historical conversation information and the initial text information through a preset text matching model to obtain the matched target text information, including: Determine the conversation scenario information of the initial text information; based on the conversation scenario information, filter the historical conversation information to obtain filtered historical conversation information, wherein the filtered historical conversation information and the current initial text information belong to the same conversation scenario; perform correlation matching on the filtered historical conversation information and the initial text information to obtain correlation values of each filtered historical conversation information, and retain the historical conversation information whose correlation value in the filtered historical conversation information is greater than a preset correlation value threshold to obtain secondary filtered historical conversation information; combine the secondary filtered historical conversation information and the initial text information to form matched target text information containing complete context information.
[0037] It should be noted that the conversation scene information refers to the background information, situation setting, participant information, topic development, etc. involved in the conversation process, which together constitute the environment and context in which the conversation occurs. The device extracts the corresponding conversation scene information from the conversation to be extracted. For example, if the conversation to be extracted is: "Recommend the best route home", the platform determines that the conversation scene information is a route query related scene in the transportation field.
[0038] In a specific implementation, the platform filters out corresponding historical conversation information from the historical conversation information according to the conversation scene information of the initial text information, and the filtered historical conversation information belongs to the same conversation scene as the current initial text information, that is, one screening is to filter out historical conversation information of different conversation scenes, and only retain historical conversation information of the same conversation scene as the initial text information.
[0039] In a specific implementation, after the platform filters out historical conversation information of the same conversation scenario, it is necessary to perform correlation matching on multiple historical conversation information. The correlation matching usually takes into account the knowledge correlation between the historical conversation information and the initial text information and the context fluency after the text connection. The higher the knowledge correlation and the context fluency, the greater the correlation value of the historical conversation information. Through secondary screening, the platform only retains historical conversation information whose correlation value is greater than a preset correlation value threshold, that is, the historical conversation information after secondary screening, so as to accurately find the associated context information of the initial text information. Finally, the platform combines the historical conversation information after secondary screening with the initial text information to form the matched target text information containing complete context information.
[0040] It should be noted that the correlation matching between historical dialogue information and initial text information is affected by the time weight and dialogue satisfaction evaluation weight, where the time weight is determined based on the time interval between the historical dialogue information and the initial text information. The closer the time interval is, the stronger the correlation between the historical dialogue information and the initial text information is, and the greater the time weight is; the farther the time interval is, the weaker the correlation between the historical dialogue information and the initial text information is, and the smaller the time weight is. The dialogue satisfaction evaluation weight is determined based on the user's satisfaction evaluation of the historical dialogue information. The higher the user's evaluation of the historical dialogue information, the more interested the user is in further conversations about the associated knowledge. Therefore, the stronger the correlation between the initial text information subsequently input by the user and the historical dialogue information is, the higher the dialogue satisfaction evaluation weight is; the lower the user's evaluation of the historical dialogue information is, the less interested the user is in further conversations about the associated knowledge is, and the weaker the correlation between the initial text information subsequently input by the user and the historical dialogue information is, the lower the dialogue satisfaction evaluation weight is.
[0041] Furthermore, since the influence of the time dimension is more accurate than the influence of satisfaction, the present application sets the time weight to be greater than the satisfaction evaluation weight, that is, the influence of the time weight on the relevant value is greater than the satisfaction evaluation weight.
[0042] Step S300, generating prompt words corresponding to the target text information; It should be noted that prompts are a type of input used to guide or stimulate artificial intelligence (AI) systems, especially large language models (LLMs), to perform specific tasks. The corresponding large language models are deployed on the platform. By converting the target text information into prompts, the large language models can more accurately identify the user's actual intentions, thereby improving the effect of voice dialogue and further improving the user experience.
[0043] In a specific implementation, the platform generates a prompt word corresponding to the target text information, including: Keyword extraction is performed on the target text information to obtain keyword information; template matching is performed on the keyword information based on a preset text expansion template set to obtain a target expansion template; and text combination is performed on the target text information and the target expansion template to obtain a prompt word.
[0044] In a specific implementation, the keyword information of a text refers to the most important words in the text, which can represent the core meaning, theme or concept of the text. The identification and extraction of keywords are crucial for tasks such as text analysis, information retrieval, and content summarization. Keyword information usually includes meaningful nouns and verbs. The extended template set refers to a set of pre-set templates that are used to expand into templates that are easier for large language models to understand.
[0045] In the specific implementation, after the platform obtains the keyword information, it performs template matching on the keyword information based on the preset text expansion template set to obtain the target expansion template. Specifically, it matches according to the question classification information in the keyword information. If it is a knowledge-based question, it usually matches templates such as "what is the meaning, what is the logical deduction process", for example, the user enters a description "in cross-neighborhood feature aggregation, the self-attention mechanism is used to perform cross-neighborhood feature aggregation on the brother neighborhoods belonging to the same parent neighborhood", and the matched template is "what is the meaning of this description, what is the deduction logic", which is combined with the prompt word, that is, "in cross-neighborhood feature aggregation, the self-attention mechanism is used to perform cross-neighborhood feature aggregation on the brother neighborhoods belonging to the same parent neighborhood". What is the meaning of this description and what is the deduction logic. By automatically generating prompt words, the large language model can more accurately identify the user's actual intention, thereby improving the effect of voice dialogue and thus improving user experience.
[0046] Step S400, input the prompt word into a preset large language model, receive and output the answer voice information output by the large language model, wherein the answer voice information is generated by the large language model based on the answer output instruction to generate a sentence for the prompt word.
[0047] It should be noted that the target big language model refers to an artificial intelligence model that has been trained with a large amount of data and has the ability to understand and generate natural language text. In this embodiment, the target big language model is specifically a generative code big model, which adopts an autoregressive decoding model. Since the traditional code big model generally responds to instructions of business knowledge type, this application fine-tunes the big model's capabilities based on business knowledge to enhance the model's ability to follow business knowledge instructions when outputting response sentences.
[0048] In a specific implementation, the platform inputs the prompt word into a preset large language model, receives and outputs the answering voice information output by the large language model, wherein the answering voice information is generated by the large language model based on the answering output instruction to generate a sentence for the prompt word.
[0049] Furthermore, the platform can also identify whether the text information of the prompt word is a target feature question, where the target feature question refers to text information containing multiple questions or a question that can be converted into multiple answer steps. The large language model performs a multi-step intermediate process derivation on the prompt word based on the answer output instruction to generate an answer voice information containing multiple step process derivation. The answer voice information derived from multiple step processes contains multi-level structured question logic. The answer voice information derived from multiple step processes can make it easier for users to understand the answer to the question, thereby improving the effect of voice dialogue and further improving user experience.
[0050] Compared with the related art, which usually uses natural language processing technology to understand the user's natural language commands and generate corresponding reply text information, and then uses speech synthesis technology to convert the text information into speech output, provide speech feedback, and enhance the user experience. However, the natural language processing technology in the related art only focuses on a piece of information input by the current user. When processing complex scenarios such as multiple rounds of user conversations, it is impossible to distinguish the user's actual intention, resulting in poor effect of voice dialogue. In this application, the text matching model in the cloud service platform matches the user's historical dialogue information and the initial text information input by the user to obtain the matched target text information, and inputs the prompt word of the target text information into the preset large language model to obtain and output the answer voice information generated by the large language model to the user. It is understandable that after receiving the text information input by the current user, the cloud service platform first needs to match the historical dialogue information to obtain the matched target text information, wherein the matched target text information is the text information of the complete context obtained by contacting multiple rounds of conversations. The prompt word generated according to the matched target text information can enable the large language model to more accurately identify the user's actual intention, thereby improving the effect of voice dialogue and thus improving user experience.
[0051] Based on the above first embodiment, the present application also proposes another embodiment, referring to Figure 2 , the voice dialogue method comprises: Step A100, obtaining a text information sample, a historical conversation text sample of the text information sample, and a matching text tag of the text information sample; It should be noted that the text information sample refers to the sample with text information used for model training; the historical conversation text sample of the text information sample is the sample with historical conversation text corresponding to the text information sample used for model training; the matching text label of the text information sample refers to the matching result label between the manually annotated text information sample and the historical conversation text sample.
[0052] Step A200, based on the text information sample, the historical conversation text sample and the matching text label, iteratively train the preset model to be trained to obtain a text matching model.
[0053] It can be understood that the text matching model of the present application is trained based on the text information samples, the historical conversation text samples and the matching text labels. Through the training of the neural network model, the text information samples and their corresponding historical conversation text samples can be quickly and accurately matched one-to-many, so that it can match one or more historical conversation text samples with the highest relevance from the historical conversation text samples, thereby improving the accuracy of text matching.
[0054] In a specific implementation, the platform iteratively trains a preset model to be trained based on the text information sample, the historical conversation text sample, and the matching text label to obtain a text matching model, including: Acquire the conversation time information of the historical conversation text sample; determine the time weight based on the conversation time information; iteratively train the preset model to be trained based on the text information sample, the time weight, the historical conversation text sample and the matching text label to obtain a text matching model.
[0055] It should be noted that the correlation matching between the historical conversation information and the initial text information is affected by the time weight, where the time weight is determined based on the time interval between the historical conversation information and the initial text information. The closer the time interval, the stronger the correlation between the historical conversation information and the initial text information, and the greater the time weight; the farther the time interval, the weaker the correlation between the historical conversation information and the initial text information, and the smaller the time weight.
[0056] This application improves the accuracy of identifying the correlation between historical conversation information and initial text information by adding time weight.
[0057] In another embodiment, the correlation matching between the historical conversation information and the initial text information is also affected by the conversation satisfaction evaluation weight, which is determined based on the user's satisfaction evaluation of the historical conversation information. The higher the user's evaluation of the historical conversation information, the more interested the user is in further engaging in a conversation on the associated knowledge. Therefore, the stronger the correlation between the initial text information subsequently input by the user and the historical conversation information, the higher the conversation satisfaction evaluation weight. The lower the user's evaluation of the historical conversation information, the less interested the user is in further engaging in a conversation on the associated knowledge. Therefore, the weaker the correlation between the initial text information subsequently input by the user and the historical conversation information, the lower the conversation satisfaction evaluation weight.
[0058] Furthermore, since the influence of the time dimension is more accurate than the influence of satisfaction, the present application sets the time weight to be greater than the satisfaction evaluation weight, that is, the influence of the time weight on the relevant value is greater than the satisfaction evaluation weight.
[0059] That is, in another embodiment, the platform obtains the conversation time information and user satisfaction rating value of the historical conversation text sample; determines the time weight based on the conversation time information, and determines the conversation satisfaction rating weight based on the user satisfaction rating value; and iteratively trains the preset model to be trained based on the text information sample, the conversation satisfaction rating weight, the time weight, the historical conversation text sample, and the matching text label to obtain a text matching model.
[0060] In a specific implementation, the present application further improves the accuracy of identifying the correlation between historical conversation information and initial text information by adding time weight and satisfaction evaluation weight.
[0061] In a specific implementation, the platform iteratively trains a preset model to be trained based on the text information sample, the time weight, the historical conversation text sample, and the matching text label to obtain a text matching model, including: Based on the text information sample, the time weight and the historical conversation text sample, context matching is performed through a preset model to be trained to obtain a predicted matching result; the predicted matching result and the matching text label are difference calculated to obtain an error result; based on the error result, it is determined whether the error result meets the error standard indicated by a preset error threshold range; if the error result does not meet the error standard indicated by the preset error threshold range, the step of returning to the step of performing context matching based on the text information sample, the time weight and the historical conversation text sample through a preset model to be trained to obtain a predicted matching result, and the training is stopped until the error result meets the error standard indicated by the preset error threshold range to obtain a text matching model.
[0062] It should be noted that first, the platform performs context matching based on the text information sample, the time weight and the historical conversation text sample through a preset model to be trained to obtain a predicted matching result, wherein the model to be trained is a preset initial model that has the ability to basically match the text information sample and the historical conversation text sample to predict the matching result, and the predicted matching result is the predicted matching result generated by the model to be trained matching and identifying the text information sample, the time weight and the historical conversation text sample.
[0063] It is understandable that the platform then calculates the difference between the predicted matching result and the matching text label to obtain an error result, that is, verifies whether the result obtained by the model in training is consistent with the known result, and calculates the difference between the results to obtain an error result.
[0064] It should be noted that the platform determines whether the error result meets the error standard indicated by the preset error threshold range based on the error result. Specifically, since there is an error between the result after model training and the actual result, the error result is allowed to be within the preset error threshold range, so as to further determine whether the error result meets the error standard indicated by the preset error threshold range.
[0065] It is understandable that if the error result does not meet the error standard indicated by the preset error threshold range, it means that the error of the model in this training is too large. The platform returns to the step of performing context matching based on the text information sample, the time weight and the historical conversation text sample through the preset model to be trained to obtain a predicted matching result, that is, performing iterative training until the error result meets the error standard indicated by the preset error threshold range and then stops training to obtain a text matching model, thereby improving the matching accuracy of the text matching model.
[0066] It should be noted that the above examples are only used to understand the present invention and do not constitute a limitation on the method for applying spare capacity of the present invention. More simple transformations based on this technical concept are all within the scope of protection of the present invention.
[0067] This application also provides a voice dialogue device, please refer to Figure 3 , the voice dialogue device comprises: The acquisition module 10 is used to acquire the voice information input by the user and the historical conversation information of the user, and perform text recognition on the voice information to obtain initial text information; A matching module 20, configured to perform context matching based on the historical conversation information and the initial text information through a preset text matching model to obtain matched target text information; A generating module 30, used to generate prompt words corresponding to the target text information; The output module 40 is used to input the prompt word into a preset large language model, receive and output the answering voice information output by the large language model, wherein the answering voice information is generated by the large language model based on the answering output instruction to generate a sentence for the prompt word.
[0068] Optionally, the matching module 20 includes: A determination module, used to determine the conversation scenario information of the initial text information; A primary screening module, configured to screen the historical conversation information based on the conversation scenario information to obtain screened historical conversation information, wherein the screened historical conversation information and the current initial text information belong to the same conversation scenario; A secondary screening module, used to perform correlation matching between the filtered historical conversation information and the initial text information to obtain correlation values of each filtered historical conversation information, and retain the historical conversation information whose correlation value is greater than a preset correlation value threshold in the filtered historical conversation information to obtain the secondary filtered historical conversation information; The combination module is used to combine the historical dialogue information after the secondary screening with the initial text information to form matched target text information containing complete context information.
[0069] Optionally, the voice dialogue device further includes: A sample acquisition module, used to acquire text information samples, historical conversation text samples of the text information samples, and matching text tags of the text information samples; The training module is used to iteratively train the preset model to be trained based on the text information sample, the historical conversation text sample and the matching text label to obtain a text matching model.
[0070] Optionally, the training module includes: A dialogue time information acquisition module, used to acquire the dialogue time information of the historical dialogue text sample; A weight determination module, used to determine a time weight based on the conversation time information; The text matching model training module is used to iteratively train the preset model to be trained based on the text information sample, the time weight, the historical conversation text sample and the matching text label to obtain a text matching model.
[0071] Optionally, the text matching model training module includes: A prediction matching module, configured to perform context matching based on the text information sample, the time weight and the historical conversation text sample through a preset model to be trained to obtain a prediction matching result; A difference calculation module, used for performing difference calculation between the predicted matching result and the matching text label to obtain an error result; A judgment module, configured to judge, based on the error result, whether the error result satisfies an error standard indicated by a preset error threshold range; The iterative training module is used to return to the step of performing context matching based on the text information sample, the time weight and the historical conversation text sample through a preset model to be trained to obtain a predicted matching result if the error result does not meet the error standard indicated by the preset error threshold range, and stop training until the error result meets the error standard indicated by the preset error threshold range to obtain a text matching model.
[0072] Optionally, the generating module 30 includes: A keyword extraction module, used to extract keywords from the target text information to obtain keyword information; A template matching module, used to perform template matching on the keyword information based on a preset text expansion template set to obtain a target expansion template; The text combining module is used to combine the target text information with the target expansion template to obtain a prompt word.
[0073] The voice dialogue device provided by the present application adopts the voice dialogue method in the above embodiment, which can solve the technical problem of voice dialogue of smart watches. Compared with the prior art, the beneficial effects of the voice dialogue device provided by the present application are the same as the beneficial effects of the voice dialogue method provided by the above embodiment, and other technical features in the voice dialogue device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0074] The present application provides a voice dialogue device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the voice dialogue method in the above-mentioned embodiment 1.
[0075] Reference below Figure 4, which shows a schematic diagram of the structure of a voice dialogue device suitable for implementing the embodiment of the present application. The voice dialogue device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The voice dialogue device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0076] like Figure 4 As shown, the voice dialogue device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the voice dialogue device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the voice dialogue device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a voice dialogue device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0077] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0078] The voice dialogue device provided by the present application adopts the voice dialogue method in the above embodiment to solve the technical problem of voice dialogue. Compared with the prior art, the beneficial effects of the voice dialogue device provided by the present application are the same as the beneficial effects of the voice dialogue method provided by the above embodiment, and other technical features in the voice dialogue device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0079] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0080] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0081] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, wherein the computer-readable program instructions are used to execute the voice dialogue method in the above-mentioned embodiment.
[0082] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0083] The computer-readable storage medium may be included in the voice dialogue device; or may exist independently without being assembled into the voice dialogue device.
[0084] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the voice dialogue device, the voice dialogue device performs voice dialogue.
[0085] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0086] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a portion of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that, in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, as well as combinations of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0087] The modules described in the embodiments of the present application can be implemented in software or in hardware. Among them, the name of the module does not constitute a limitation on the unit itself in some cases.
[0088] The readable storage medium provided by the present application is a computer-readable storage medium. The computer-readable storage medium stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned voice dialogue method, and can solve the technical problems of voice dialogue. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as those of the voice dialogue method provided by the above embodiments, and will not be elaborated here.
[0089] The present application also provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the steps of the voice dialogue method as described above.
[0090] The computer program product provided by the present application can solve the technical problems of voice dialogue. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as those of the voice dialogue method provided by the above embodiments, and will not be elaborated here.
[0091] The above are only some embodiments of the present application, and thus do not limit the patent scope of the present application. Any equivalent structural transformation made under the technical concept of the present application by using the content of the specification and drawings of the present application, or any direct / indirect application in other related technical fields, is included in the patent protection scope of the present application.
Claims
1. A voice dialogue method, characterized in that: Applied to a cloud service platform, a large language model is deployed in the cloud service platform, and the voice dialogue method includes: Acquire voice information input by a user and historical conversation information of the user, and perform text recognition on the voice information to obtain initial text information; Based on the historical conversation information and the initial text information, context matching is performed through a preset text matching model to obtain matched target text information; Generating prompt words corresponding to the target text information; The prompt word is input into a preset large language model, and the answer voice information output by the large language model is received and output, wherein the answer voice information is generated by the large language model based on the answer output instruction to generate a sentence for the prompt word.
2. The voice dialogue method according to claim 1, characterized in that: The step of performing context matching based on the historical conversation information and the initial text information through a preset text matching model to obtain matched target text information includes: Determining conversation scenario information of the initial text information; Based on the conversation scene information, the historical conversation information is filtered to obtain filtered historical conversation information, wherein the filtered historical conversation information and the current initial text information belong to the same conversation scene; Perform correlation matching on the filtered historical conversation information and the initial text information to obtain correlation values of each filtered historical conversation information, and retain the historical conversation information whose correlation value is greater than a preset correlation value threshold in the filtered historical conversation information to obtain secondary filtered historical conversation information; The historical dialogue information after secondary screening and the initial text information are combined to form matched target text information containing complete context information.
3. The voice dialogue method according to claim 1, wherein: Before the step of acquiring the voice information input by the user and the historical conversation information of the user, and performing text recognition on the voice information to obtain the initial text information, the method includes: Acquire a text information sample, a historical conversation text sample of the text information sample, and a matching text tag of the text information sample; Based on the text information samples, the historical conversation text samples and the matching text labels, the preset model to be trained is iteratively trained to obtain a text matching model.
4. The voice dialogue method according to claim 3, characterized in that: The step of iteratively training a preset model to be trained based on the text information sample, the historical conversation text sample and the matching text label to obtain a text matching model includes: Obtaining conversation time information of the historical conversation text sample; Determining a time weight based on the conversation time information; Based on the text information samples, the time weights, the historical conversation text samples and the matching text labels, the preset model to be trained is iteratively trained to obtain a text matching model.
5. The voice dialogue method according to claim 4, characterized in that: The step of iteratively training the preset model to be trained based on the text information sample, the time weight, the historical conversation text sample and the matching text label to obtain the text matching model includes: Based on the text information sample, the time weight and the historical conversation text sample, context matching is performed through a preset model to be trained to obtain a predicted matching result; Calculate the difference between the predicted matching result and the matching text label to obtain an error result; Based on the error result, determining whether the error result meets an error standard indicated by a preset error threshold range; If the error result does not meet the error standard indicated by the preset error threshold range, then return to the step of performing context matching based on the text information sample, the time weight and the historical conversation text sample through the preset model to be trained to obtain a predicted matching result, and stop training until the error result meets the error standard indicated by the preset error threshold range to obtain a text matching model.
6. The voice dialogue method according to claim 1, wherein: The step of generating a prompt word corresponding to the target text information includes: Extracting keywords from the target text information to obtain keyword information; Based on a preset text expansion template set, template matching is performed on the keyword information to obtain a target expansion template; The target text information and the target expansion template are combined to obtain a prompt word.
7. A voice dialogue device, characterized in that: The device comprises: An acquisition module is used to acquire the voice information input by the user and the historical conversation information of the user, and perform text recognition on the voice information to obtain initial text information; A matching module, configured to perform context matching based on the historical conversation information and the initial text information through a preset text matching model to obtain matched target text information; A generating module, used for generating prompt words corresponding to the target text information; The output module is used to input the prompt word into a preset large language model, receive and output the answer voice information output by the large language model, wherein the answer voice information is generated by the large language model based on the answer output instruction to generate a sentence for the prompt word.
8. A voice dialogue device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the voice dialogue method according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the voice dialogue method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the voice dialogue method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Voice interaction method and device and terminal equipment
CN111428483A
Dialogue processing method, question rewriting model training method and device
CN114626384A
Intelligent dialogue method and device, electronic equipment and medium
CN116910226A
Anthropomorphic dialogue method and device based on natural language model and electronic equipment
CN117493529A
Conversation processing method and device, electronic equipment and storage medium
CN117932036A
Cited By
Method and device for assisting foreign language learning based on AI large language model
CN120452433A
Intelligent voice interaction method and device based on large language model
CN120727012A
Real-time voice interaction method and system based on large model
CN120853551A
Man-machine conversation implementation method and device, electronic equipment and computer storage medium
CN121256005A
Large model session compression method and device, equipment, storage medium and product
CN121389975A