Intelligent interaction method, system, electronic device and storage medium applied to program
Through the use of intelligent interaction methods and AI directors, the problems of low director efficiency and audience fatigue in variety show production are solved, and the efficiency and interactivity of program production are improved.
Patent Information
- Application Number
- CN202410995919.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2044-07-24
AI Technical Summary
During the production process of variety shows, directors need to spend a lot of time on tedious work, which results in low work efficiency and makes the audience easily fall into viewing and aesthetic fatigue.
Using intelligent interaction methods, the user's voice is collected through the pre-built AI director, converted into text, and matched using the keyword document library and question and answer library. If the matching fails, intent recognition is performed. If the user is producing a program, the intent category associated The tool generates program production text. If it is not produced, it obtains vertical domain knowledge and generates text answers through anthropomorphic large models.
It improves the director's work efficiency, reduces tedious work, enriches the viewability and interest of the program, and avoids the audience's viewing fatigue.
Smart Images

Figure CN118551846B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and more specifically, to an intelligent interaction method, system, electronic device and storage medium applied to a program. Background Art
[0002] With the rapid development of Internet technology, variety shows have become an indispensable entertainment program in people's lives; current variety shows require directors to make overall plans and undertake a lot of tedious and repetitive work, such as itinerary planning, script writing, copywriting, etc. These tasks not only consume a lot of the director's time, resulting in low work efficiency of the director, but also the variety shows produced only by the director based on his own experience can easily make the audience fall into viewing and aesthetic fatigue.
[0003] Therefore, how to provide a variety show production method to improve the director's work efficiency and prevent the audience from falling into viewing and aesthetic fatigue is a problem that needs to be solved urgently. Summary of the invention
[0004] In view of this, the present invention provides an intelligent interaction method, system, electronic device and storage medium applied to programs, with the purpose of improving the work efficiency of human directors in producing programs and preventing viewers from falling into viewing and aesthetic fatigue.
[0005] A first aspect of the present invention provides an intelligent interaction method applied to a program, which is applied to a pre-built AI director, and the method includes:
[0006] Collecting the voice input by the user and converting the voice into text;
[0007] Determine whether there is a keyword document matching the text in the keyword document library;
[0008] If there is no keyword document matching the text in the keyword document library, determine whether there is a text answer matching the document in the question and answer library;
[0009] If there is no text answer matching the text in the question and answer database, perform intent recognition on the text to obtain a corresponding intent recognition result;
[0010] Determining whether the user is producing a program according to the intention recognition result;
[0011] If the user is producing a program, a downstream tool associated with the intent category in the intent recognition result is used to perform a corresponding intent task according to the text, and a corresponding program production text is obtained and output, so that the user can produce a corresponding program using the program production text;
[0012] If the user does not produce a program, obtain vertical field knowledge related to the text;
[0013] A first prompt is generated according to the text and the vertical domain knowledge, and a corresponding text answer is outputted according to the first prompt integrated with the vertical domain knowledge through an anthropomorphic large model; wherein the anthropomorphic large model is obtained by training low-rank matrices A and B using pre-trained weights and fine-tuning data.
[0014] Optionally, the determining whether there is a keyword document matching the text in the keyword document library includes:
[0015] Extracting keywords from the text and determining whether the keywords exist in a keyword document library;
[0016] If the keyword exists in the keyword document library, determining that a keyword document matching the text exists in the keyword document library;
[0017] If the keyword does not exist in the keyword document library, it is determined that there is no keyword document matching the text in the keyword document library.
[0018] Optionally, the method further includes:
[0019] If there is a keyword document matching the text in the keyword document library, obtain the keyword document corresponding to the keyword from the keyword document library, and concatenate the text and its keyword document into a second prompt;
[0020] The anthropomorphic model outputs a text answer to the text according to the second prompt.
[0021] Optionally, the determining whether there is a text answer matching the text in the question and answer database includes:
[0022] Calculating the similarity between the text and each similar question in the question-and-answer database, and determining whether there is a similar question with a similarity to the text greater than a first preset threshold;
[0023] If there is a similar question whose similarity to the text is greater than a first preset threshold, determining that there is a text answer matching the text in the question and answer library;
[0024] If there is no similar question whose similarity to the text is greater than a first preset threshold, it is determined that there is no text answer matching the text in the question and answer library.
[0025] Optionally, the method further includes:
[0026] If there is a text answer matching the text in the question-and-answer database, a similar question whose similarity to the text is greater than a first preset threshold is determined as a target similar question matching the text;
[0027] The answer corresponding to the standard question that is associated with the target similar question is used as the text answer for the text matching.
[0028] Optionally, the low-rank matrix A and the low-rank matrix B are trained using pre-trained weights and fine-tuning data to obtain an anthropomorphic large model, including:
[0029] Collecting fine-tuning data, wherein the fine-tuning data includes a plurality of question-answer pairs;
[0030] Inputting the plurality of question-answer pairs into a low-rank matrix A and a low-rank matrix B, so that the low-rank matrix A and the low-rank matrix B are trained using the plurality of question-answer pairs to obtain an initial anthropomorphic large model;
[0031] The low-rank matrix weights in the initial anthropomorphic model and the pre-set pre-training weights are merged to obtain target weights, and the target weights are used to adjust the parameters of the initial anthropomorphic model to obtain the anthropomorphic model.
[0032] Optionally, if the user does not produce a program, obtaining vertical field knowledge related to the text includes:
[0033] If the user has not produced a program, determining whether there is an associated downstream tool for the intent category in the intent recognition result;
[0034] If there is no downstream tool associated with the intent category, convert the text into a target text vector;
[0035] Calculating the cosine similarity between the text vector and each target text vector in the vector database, and determining whether there is a target text vector whose cosine similarity with the text vector is greater than a second preset threshold;
[0036] If there is a text vector whose cosine similarity with the target text vector is greater than a second preset threshold, converting the target text vector whose cosine similarity with the text vector is greater than the second preset threshold into a target text; wherein the target text is vertical domain knowledge related to the text;
[0037] If there is an associated downstream tool for the intent category, the vertical domain knowledge of the text is acquired according to the downstream tool associated with the intent category.
[0038] A second aspect of the present invention provides an intelligent interactive system applied to a program, applied to a pre-built AI director, the system comprising:
[0039] A voice conversion unit, used to collect the voice input by the user and convert the voice into text;
[0040] A first judgment unit, used to judge whether there is a keyword document matching the text in the keyword document library;
[0041] A second judgment unit is used to judge whether there is a text answer matching the document in the question and answer library if there is no keyword document matching the text in the keyword document library;
[0042] An intention recognition unit, configured to perform intention recognition on the text to obtain a corresponding intention recognition result if there is no text answer matching the text in the question and answer library;
[0043] A third judgment unit, used for judging whether the user is producing a program according to the intention recognition result;
[0044] A program production text output unit is used to, if the user is producing a program, use the downstream tool associated with the intent category to perform the corresponding intent task according to the text, obtain and output the corresponding program production text, so that the user can use the program production text to produce the corresponding program;
[0045] A vertical field knowledge acquisition unit, used for acquiring vertical field knowledge related to the text if the user does not produce a program;
[0046] The first output unit is used to generate a first prompt based on the text and the vertical domain knowledge, and output a corresponding text answer based on the first prompt that integrates the vertical domain knowledge through an anthropomorphic large model; wherein the anthropomorphic large model is obtained by training the low-rank matrix A and the low-rank matrix B by the training unit using pre-trained weights and fine-tuning data.
[0047] The third aspect of the present invention provides an electronic device, comprising: a processor and a memory, wherein the processor and the memory are connected via a communication bus; wherein the processor is used to call and execute a program stored in the memory; and the memory is used to store a program, wherein the program is used to implement the intelligent interaction method applied to a program as provided in the first aspect of the present invention.
[0048] A fourth aspect of the present invention provides a computer-readable storage medium, in which computer-executable instructions are stored. The computer-executable instructions are used to execute the intelligent interaction method applied to a program as provided in the first aspect of the present invention.
[0049] The present invention provides an intelligent interaction method, system, electronic device and storage medium applied to a program. An AI director can be pre-built so that the AI director can collect the voice input by the user and convert the voice into text. In the case that there is no keyword document with text matching in the keyword document library and there is no text answer with text matching in the question and answer library, the text is subjected to intent recognition to obtain a corresponding intent recognition result. If it is determined according to the intent recognition result that the user is currently performing corresponding program production, a downstream tool associated with the intent category can be used to perform a corresponding intent task according to the text, obtain and output a corresponding program production text, so that the user can use the program production text to produce the corresponding program, which can avoid the user from performing a large amount of tedious and repetitive work, thereby improving the user's work efficiency in producing the program and avoiding the user from falling into aesthetic fatigue. If it is determined according to the intent recognition result that the user is not currently performing corresponding program production, that is, the user may be recording a program, the vertical field knowledge related to the text can be obtained, and a first prompt can be generated according to the text and the vertical field knowledge. Finally, a corresponding text answer can be output according to the first prompt with the vertical field knowledge integrated through an anthropomorphic large model, so as to realize interaction with the user recording the program, enrich the watchability and fun of the program, increase the effect of the program, improve the user's viewing experience, and avoid the user from falling into viewing fatigue. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of the present invention 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, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0051] Figure 1 A schematic diagram of a flow chart of an intelligent interactive method applied to a program provided by an embodiment of the present invention;
[0052] Figure 2 An example diagram of an intent category and its associated downstream tools is provided for an embodiment of the present invention;
[0053] Figure 3 A method provided in an embodiment of the present invention uses pre-trained weights and fine-tuning data to train low-rank matrix A and low-rank matrix B to obtain a structural diagram of an anthropomorphic large model;
[0054] Figure 4 A schematic diagram of the structure of an intelligent interactive system applied to a program provided by an embodiment of the present invention;
[0055] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0056] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0057] In this application, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0058] In order to better understand the present invention, the technical terms involved in the present invention are explained below.
[0059] Rule engine: It is a technology based on keyword documents and semantic matching, which can answer user questions based on the question and answer library and keyword documents.
[0060] Intent recognition technology: is an intent recognition model built on a large model that can identify user intentions.
[0061] Anthropomorphic large model: It is a pre-trained large language model fine-tuning technology based on Transformer and Lora, which allows AI to imitate the speech of a specified person and have relevant knowledge in the vertical field.
[0062] RAG: It is a large-model knowledge retrieval enhancement (RAG) technology that allows AI to learn vertical domain knowledge (documents).
[0063] m3e: is a vector model used to convert text into vectors, which facilitates the calculation of text similarity and thus performs text matching and text recall tasks.
[0064] Agent: It is a large-model intelligent body technology. The main principle is to let the large model think for itself by writing prompts and perform tasks autonomously according to user intentions.
[0065] tools: A downstream task tool that can be called autonomously by large models to complete downstream tasks.
[0066] Automatic Speech Recognition (ASR), Speech Synthesis Model with Variational Inference, Normalized Flow, and Adversarial Training (VITS): is an acoustic model that can convert speech to text and text to speech.
[0067] In the embodiment of the present invention, with the development of artificial intelligence (AIGC) technology, especially the emergence of large model technology, in order to improve the work efficiency of human directors and avoid the audience from falling into viewing and aesthetic fatigue, the present invention uses large model technology, natural language processing, RAG, ASR and speech synthesis (Text To Speech, TTS) and other technologies, combined with artificial intelligence (AI) to build an AI director. Specifically, the rule engine, intent recognition model, anthropomorphic large model, RAG, m3e, agent, tool and other technologies can be used to build the brain (processor) of the AI director, the ASR technology can be used to build the ears of the AI director, and the VITS technology can be used to build the mouth of the AI director. Finally, the constructed AI director is used to assist the human director in the production and recording of the program, which can not only improve the work efficiency of the human director, but also avoid the audience from falling into viewing and aesthetic fatigue. In addition, controlling the AI director to participate in the recording of the variety show and interacting with the guests participating in the recording of the program in real time can also enrich the watchability and fun of the variety show, increase the effect of the variety show, and improve the user's viewing experience.
[0068] See also Figure 1 , shows a flow chart of an intelligent interactive method applied to a program provided by an embodiment of the present invention, the intelligent interactive method applied to the program is applied to a pre-built AI director, and the intelligent interactive method applied to the program specifically includes the following steps:
[0069] S101: Collect the voice input by the user and convert the voice into text.
[0070] In the embodiment of the present invention, speech with various timbres and its text may be collected, and the collected speech and its text may be used to fine-tune the non-autoregressive end-to-end speech recognition paraformer model to obtain an ASR model.
[0071] In the specific process of executing step S101, the user's voice can be collected through the AI director's ears, and the collected voice can be input into a pre-fine-tuned ASR model, so that the ASR model can convert the input voice into corresponding text.
[0072] S102: Determine whether there is a keyword document with text matching in the keyword document library; if there is no keyword document with text matching in the keyword document library, execute step S103; if there is a keyword document with text matching in the keyword document library, execute step S110.
[0073] In an embodiment of the present invention, a corresponding keyword document library may be pre-constructed, and the pre-constructed keyword document library may be deployed to a rule engine; wherein the keyword document library includes a plurality of keywords and their keyword documents.
[0074] In some embodiments, variety show information of each variety show, as well as information such as profiles of celebrities participating in each variety show, can be collected, keyword documents corresponding to pre-set keywords can be extracted from the variety show information and celebrity profiles, and a corresponding keyword document library can be generated based on each keyword and its keyword document.
[0075] It should be noted that the keyword document may be a knowledge document, wherein the knowledge document may be vertical field knowledge related to certain fields, characters, landscapes, etc., which is not limited in this embodiment of the present invention.
[0076] In the specific process of executing step S102, after obtaining the text corresponding to the voice input by the user, the corresponding keywords can be extracted from the text through the rule engine, and it can be determined whether the keyword exists in the keyword document library. If not, it can be determined that there is no keyword document matching the text in the keyword document library, and step S103 is executed to determine whether there is a text answer matching the text in the question and answer library; if so, it can be determined that there is a keyword document matching the text in the keyword document library, and then step S110 can be executed to obtain the keyword document matching the text from the keyword document library.
[0077] S103: Determine whether there is a text answer with text matching in the question and answer database; if there is no text answer with text matching in the question and answer database, execute step S104; if there is a text answer with text matching in the question and answer database, execute step S109.
[0078] In an embodiment of the present invention, a corresponding question and answer library may be pre-constructed and deployed to a rule engine; wherein the question and answer library includes a plurality of question and answer combinations consisting of standard questions, similar questions and answers.
[0079] In some embodiments, multiple standard questions and their answers may be collected in advance, and at least one similar question may be derived from each standard question, and each similar question may be constructed into a corresponding question-answer combination with its corresponding standard question and its answer, and a corresponding question-answer library may be generated based on each constructed question-answer combination. For example, a standard question may be "What are the tourist attractions in Changbai Mountain?", and similar questions derived from the standard question may be "What is fun in Changbai Mountain?", "What are the fun places in Changbai Mountain", etc.
[0080] In the specific process of executing step S103, when it is determined that there is no keyword document in the keyword document library that matches the text corresponding to the voice input by the user, it can be further determined whether there is a target similar question matching the text among the similar questions in the question and answer library. If so, it can be determined that there is a text answer matching the text in the question and answer library, that is, step S109 is executed; if not, it can be determined that there is no text answer matching the text in the question and answer library, and then step S104 can be executed.
[0081] It should be noted that the rule engine can also be used to first determine whether there is a text answer with text matching in the question and answer library. After determining that there is no text answer with text matching in the question and answer library, it can then be determined whether there is a keyword document with text matching in the keyword document library. That is, step S103 can be executed first, and then step S102 can be executed.
[0082] It should also be noted that the rule engine can also be used to simultaneously determine whether there is a text answer with text matching in the question and answer library, and determine whether there is a keyword document with text matching in the keyword document library, that is, to execute step S102 and step S103 at the same time. The execution order of step S102 and step S103 is not limited in this embodiment of the present invention.
[0083] Optionally, the process of determining whether there is a text answer with text matching in the question and answer library can be specifically: calculating the similarity between the text and each similar question in the question and answer library, and determining whether there are similar questions whose similarity to the text is greater than a first preset threshold; if there are similar questions whose similarity to the text is greater than the first preset threshold, determining that there is a text answer with text matching in the question and answer library; if there are no similar questions whose similarity to the text is greater than the first preset threshold, determining that there is no text answer with text matching in the question and answer library.
[0084] S104: Perform intent recognition on the text to obtain corresponding intent recognition results.
[0085] In an embodiment of the present invention, intent classification data can be collected in advance, and the data can be analyzed and sorted according to text content-intent category to obtain corresponding intent classification data, wherein the intent text data includes multiple groups of text type-intent category data; the LLama2 model is fine-tuned using the intent classification data to obtain an intent recognition model that can recognize intent types.
[0086] In some embodiments, the intent category may be a drawing category, a storyboard writing category, a planning copywriting category, an itinerary planning category, a prop arrangement category, a variety game design category, an AI song creation category, a chatting category, a time and weather inquiry category, a navigation category, an entertainment category, etc., which is not limited in this embodiment of the present invention.
[0087] In the process of specifically executing step S104, when it is determined that there is no keyword document in the keyword document library corresponding to the text input by the user, and there is no text answer to the text in the question and answer library, the text can be input into a pre-trained intent recognition model, so that the intent recognition model performs intent recognition based on the input text and outputs the intent recognition result of the text.
[0088] It should be noted that the intent recognition result can be empty, or indicate that there is a corresponding intent category.
[0089] S105: Determine whether the user is producing a program based on the intention recognition result; if the user is producing a program, execute step S106; if the user is not producing a program, execute step S107.
[0090] In an embodiment of the present invention, each pre-set intent category can be classified and processed to obtain multiple intent categories belonging to the program production category and multiple intent categories belonging to the program recording category. For example, each intent category includes a drawing category, a storyboard writing category, a planning copywriting category, an itinerary planning category, a props arrangement category, a variety game design category, an AI song creation category, a chat category, a time and weather inquiry category, a navigation category, an entertainment category, etc. Each intent category is classified and processed to obtain intent categories belonging to the program production category, which are drawing category, storyboard writing category, planning copywriting category, itinerary planning category, props arrangement category, variety game design category, and AI song creation category; and intent categories belonging to the program recording category, which are chat category, time and weather inquiry category, navigation category, and entertainment category.
[0091] It is worth noting that in the embodiments of the invention, for each intent category of the program production category, the downstream tools associated with the intent category can be set through the agent technology. For some intent categories of the program recording category, the downstream tools associated with the partial categories can also be set through the agent technology. For example, the downstream tools associated with each intent category under the program production category, such as the drawing category, the storyboard writing category, the prop arrangement category, etc. can be set. The downstream tools associated with some intent categories under the program recording category, such as the navigation category, the inquiry time and weather category, etc. can be set. Figure 2 shown.
[0092] In the specific process of executing step S105, after obtaining the intention recognition result of the text corresponding to the voice input by the user, it can be further determined whether the intention recognition result is empty. If the intention recognition result is empty, it can be considered that the user is not producing the program, and may be recording the program, and then step S107 can be executed; if the intention recognition result is not empty, it can be determined that there is an intention category indicated in the intention recognition result, and it can be further determined whether the intention category belongs to the intention category under the program production category. If so, it can be determined that the user is producing the program, and then step S106 can be executed; if not, it can be determined that the user is not producing the program, and may be recording the program, and then step S107 can be executed.
[0093] S106: Utilize the downstream tool associated with the intent category to execute the corresponding intent task according to the text, obtain and output the corresponding program production text, and enable the user to produce the corresponding program using the program production text.
[0094] In the specific process of executing step S106, when the user is producing a program, the intent category can be input into the anthropomorphic model, and the agent can be used to control the anthropomorphic model to select the downstream tool associated with the intent category according to the intent category, and the selected downstream tool can be used to complete the corresponding intent task (downstream task) according to the text corresponding to the voice input by the user, and the corresponding program production text can be obtained and output, thereby achieving the purpose of assisting the user (human director) in program production, reducing the user's large amount of tedious and repetitive work when producing the program, thereby improving the user's work efficiency in producing the program and avoiding the audience from falling into aesthetic fatigue when watching the program later.
[0095] S107: Acquire text-related vertical domain knowledge.
[0096] In the process of specifically executing step S107, when it is determined that the user is not producing a program, it can be considered that the user is currently recording a program, that is, the AI director is participating in the recording of the program. At this time, if the intent recognition result is not empty, the AI director can determine whether the intent category indicated in the intent recognition result has an associated downstream tool; if there is an intent category with an associated downstream tool, the vertical domain knowledge of the text is obtained according to the downstream tool associated with the intent category; if there is no associated downstream tool for the intent category, or the intent recognition result is empty, the vertical domain knowledge corresponding to the text can be directly searched from a pre-established preset knowledge base.
[0097] In some embodiments, when it is determined that there is an associated downstream tool for the intent category, the intent category is input into the anthropomorphic model, and the agent controls the anthropomorphic model to select the downstream tool associated with the intent category according to the intent category, and uses the selected downstream tool to obtain the vertical domain knowledge corresponding to the text. For example: when the intent category is to query the weather and time category, if the text is to query the weather and time of Changbai Mountain, then the agent can be used to control the anthropomorphic model to call the corresponding search tool according to the query weather and time category to query the weather and time (vertical domain knowledge) corresponding to Changbai Mountain according to the text.
[0098] It should be noted that the first prompt may be: Please answer the user's question "the text corresponding to the voice input by the user" based on the following knowledge content "vertical field knowledge".
[0099] Optionally, the process of searching for vertical domain knowledge corresponding to a text from a pre-established preset knowledge base can specifically be: converting the text into a target text vector; calculating the cosine similarity between the text vector and each target text vector in the vector database, and determining whether there is a target text vector whose cosine similarity with the text vector is greater than a second preset threshold; if there is a text vector whose cosine similarity with the target text vector is greater than the second preset threshold, converting the target text vector whose cosine similarity with the text vector is greater than the second preset threshold into a target text; wherein the target text is the vertical domain knowledge related to the text; if there is no text vector whose cosine similarity with the target text vector is greater than the second preset threshold, a corresponding prompt can be directly generated for the text, and the generated prompt can be input into the anthropomorphic large model, so that the anthropomorphic large model searches for the text answer corresponding to the text based on its own search capability.
[0100] It should be noted that each target text vector in the vector database is generated based on the vertical field text in the preset knowledge base; specifically, each vertical field text in the preset knowledge base can be segmented according to the subject paragraphs to obtain the target text (vertical field knowledge) corresponding to each subject, and each target text is converted into a corresponding target text vector through the m3e model, and finally each target text vector is stored in the vector database.
[0101] For example, if the vertical field text is information related to tourist attractions in Changbai Mountain, it can be segmented according to each attraction in Changbai Mountain (theme paragraph) to obtain the short text (target text) corresponding to each attraction.
[0102] S108: Generate a first prompt based on the text and vertical domain knowledge, and output a corresponding text answer based on the first prompt integrated with the vertical domain knowledge through the anthropomorphic large model.
[0103] In the specific process of executing step S108, after obtaining the vertical domain knowledge of the text, the text and its vertical domain knowledge can be spliced into prompts that conform to the input of the anthropomorphic model (for the sake of easy distinction, the prompts spliced together from the text and its vertical domain knowledge are called first prompts). The first prompts are input into the anthropomorphic model, so that the anthropomorphic model can sort out the text answer of the text according to the first prompts and output the text answer of the text.
[0104] In an embodiment of the present invention, the low-rank matrix A and the low-rank matrix B may be trained in advance using pre-trained weights and fine-tuning data to obtain a large anthropomorphic model.
[0105] Optionally, the process of training low-rank matrix A and low-rank matrix B using pre-trained weights and fine-tuning data to obtain an anthropomorphic large model can be specifically as follows: collecting fine-tuning data, wherein the fine-tuning data includes multiple question-answer pairs; inputting the multiple question-answer pairs into low-rank matrix A and low-rank matrix B, so that low-rank matrix A and low-rank matrix B are trained using multiple question-answer pairs to obtain an initial anthropomorphic large model; merging the low-rank matrix weights in the initial anthropomorphic large model with the pre-set pre-training weights to obtain the target weights, and using the target weights to adjust the parameters of the initial anthropomorphic large model to obtain the anthropomorphic large model.
[0106] It should be noted that the weight of the LLama2 model can be fixed by Lora technology, and the fixed weight of the LLama2 model is determined as the pre-training weight. The setting method of the pre-training weight can be set according to the actual application, and this embodiment of the present invention is not limited here.
[0107] In the actual application process, corresponding character data, character dialogue data, character style data, knowledge data and other data can be collected in advance; the character data, character dialogue data, character style data and knowledge data can be pre-processed, and the pre-processed character data, character dialogue data, character style data and knowledge data can be organized into a json file (pre-training data) in the format of question-answer; wherein, json includes multiple question-answer pairs.
[0108] Using multiple question-answer pairs Figure 3 The low-rank matrix A and low-rank matrix B shown in the figure are trained; during training, the model uses the initial weights to predict the questions in each question-answer pair and obtains the corresponding predicted answers; the predicted answers of each question-answer pair are close to the answers in each question-answer pair as the training goal, the parameters in the low-rank matrix A and low-rank matrix B in the model are adjusted, and the parameters of the adjusted low-rank matrix A and low-rank matrix B are multiplied to obtain the weights of the initial anthropomorphic large model (low-rank matrix weights); the weights of the initial anthropomorphic large model and the pre-set pre-training weights are combined to obtain the target weights, and the target weights are used to adjust the parameters of the initial anthropomorphic large model to obtain the anthropomorphic large model. Among them, the initial weights are composed of the weights obtained by multiplying the pre-training weights and the parameters of the low-rank matrix A with the parameters of the low-rank matrix B.
[0109] In summary, by obtaining the vertical domain knowledge of the text, splicing the text and its vertical domain knowledge, and finally feeding the spliced first prompt to the anthropomorphic large model, the anthropomorphic large model can directly answer the user's questions (text answers) based on the vertical domain knowledge related to the text, so that the text answers are more accurate.
[0110] Furthermore, after obtaining the text answer to the text, the AI director can use the TTS model to convert the text answer into corresponding speech through the AI director's mouth and play the speech.
[0111] It should be noted that speech data of different human voices can be collected and preprocessed, and the VITS model can be trained using the preprocessed speech data to obtain a TTS model.
[0112] S109: Determine similar questions whose similarity to the text is greater than a first preset threshold as target similar questions that match the text, and use answers corresponding to standard questions that are associated with the target similar questions as text answers for text matching.
[0113] In an embodiment of the present invention, a pre-constructed question-answer pair language representation model (Bidirectional Encoder Representations from Transformers, BERT) model can be used to train a corresponding semantic matching model, so that the text corresponding to the voice input by the user and each similar question in the question-answer library can be subsequently input into the trained semantic matching model, so that the semantic matching model calculates the similarity between the text and each similar question, and determines at least one similar question whose similarity with the text exceeds a first preset threshold. Finally, among the determined similar questions, the similarity question with the highest similarity to the text can be determined as the target similar question; or, any similar question among the determined similar questions can be determined as the target similar question, and finally, the answer corresponding to the standard question that has an associated relationship with the target similar question is used as the text answer for the text matching.
[0114] It should be noted that BERT stands for Bidirectional Encoder Representations from Transformer, which pre-trains deep bidirectional representations by jointly conditioning on the left and right contexts in all layers.
[0115] S110: Obtain keyword documents corresponding to the keywords from the keyword document library, and concatenate the text and its keyword documents into a second prompt, and output a text answer of the text according to the second prompt through an anthropomorphic model.
[0116] In the specific process of executing step S110, when it is determined that there is a keyword document matching the text in the keyword document library, the keyword document matching the text is obtained from the keyword document library, and the text and the keyword document matching it are spliced into a prompt that conforms to the input of the anthropomorphic model (for ease of distinction, the prompt spliced with the text and the keyword document matching it is called the second prompt), so that the anthropomorphic model sorts out the text answer of the text according to the keyword document matching the text, and outputs the text answer.
[0117] For example, the second prompt may be: Please answer the user's question "the text corresponding to the voice input by the user" based on the following knowledge content "keyword document".
[0118] In summary, by obtaining the text-matching keyword document, then splicing the text and its keyword document, and finally feeding the spliced second prompt to the anthropomorphic large model, the anthropomorphic large model can directly answer the user's question (text answer) based on the text-matching keyword document, so that the text answer is more accurate.
[0119] The present invention provides an intelligent interaction method applied to a program, which collects the voice input by the user through an AI director and converts the voice into text, so that when there is a keyword document with text matching in a keyword document library, the text answer of the text can be directly sorted out from the keyword document to quickly answer the user's question; when there is a text answer to the text in a question and answer library, the text answer to the text is directly obtained from the question and answer library, which can also achieve the purpose of quickly answering the user's question.
[0120] When there is no keyword document with text matching in the keyword document library, and there is no text answer with text matching in the question and answer library, intent recognition is performed on the text to obtain the corresponding intent recognition result. If the intent recognition result indicates that there is an intent category, and the intent category belongs to the program production category, it means that the user is currently performing the corresponding program production. The downstream tools associated with the intent category can be used to perform the corresponding intent task according to the text, and the corresponding program production text can be obtained and output, so that the user can use the program production text to produce the corresponding program, which can avoid the user from performing a lot of tedious and repetitive work, thereby improving the user's work efficiency in program production and avoiding the user from falling into aesthetic fatigue.
[0121] If the intent recognition result does not indicate a schematic category at this time, or the intent category does not belong to the program production category, it means that the AI director may be participating in the recording of the program and can obtain vertical domain knowledge related to the text and generate a first prompt based on the text and vertical domain knowledge. Finally, the anthropomorphic large model outputs the corresponding text answer based on the first prompt that integrates the vertical domain knowledge, so as to interact with the users who record the program, enrich the watchability and fun of the program, increase the effect of the program, improve the user's viewing experience, and avoid users from falling into viewing fatigue.
[0122] Based on the intelligent interaction method applied to a program provided by the above-mentioned embodiment of the present invention, correspondingly, the embodiment of the present invention also provides an intelligent interaction system applied to a program, such as Figure 4 As shown, the intelligent interactive system applied to the pre-built AI director includes:
[0123] The speech conversion unit 41 is used to collect the speech input by the user and convert the speech into text;
[0124] A first judging unit 42 is used to judge whether there is a keyword document with text matching in the keyword document library;
[0125] The second judgment unit 43 is used to judge whether there is a text answer with a document matching in the question and answer library if there is no keyword document with a text matching in the keyword document library;
[0126] The intention recognition unit 44 is used to perform intention recognition on the text if there is no text answer matching the text in the question and answer database, and obtain a corresponding intention recognition result;
[0127] The third judging unit 45 is used to judge whether the user is making a program according to the intention recognition result;
[0128] The program production text output unit 46 is used to use the downstream tool associated with the intent category to perform the corresponding intent task according to the text when the user is producing the program, obtain and output the corresponding program production text, so that the user can use the program production text to produce the corresponding program;
[0129] A vertical field knowledge acquisition unit 47 is used to acquire vertical field knowledge related to the text if the user has not produced the program;
[0130] The text answer output unit 48 is used to generate a first prompt based on the text and vertical domain knowledge, and output a corresponding text answer based on the first prompt integrated with the vertical domain knowledge through an anthropomorphic model; wherein the anthropomorphic model is obtained by training low-rank matrix A and low-rank matrix B using preset training data.
[0131] The specific principles and execution processes of each unit in the intelligent interaction system applied to programs disclosed in the above-mentioned embodiment of the present invention are the same as the intelligent interaction method applied to programs disclosed in the above-mentioned embodiment of the present invention. Please refer to the corresponding parts of the intelligent interaction method applied to programs disclosed in the above-mentioned embodiment of the present invention, and no further details will be given here.
[0132] The present invention provides an intelligent interactive system applied to a program, which can pre-build an AI director so that the AI director can collect the voice input by the user and convert the voice into text, so that when there is no keyword document with text matching in the keyword document library and there is no text answer with text matching in the question and answer library, the text is used for intention recognition to obtain a corresponding intention recognition result. If it is determined according to the intention recognition result that the user is currently performing corresponding program production, the downstream tool associated with the intention category can be used to perform the corresponding intention task according to the text, obtain and output the corresponding program production text, so that the user can use the program production text to produce the corresponding program, which can avoid the user from performing a large amount of tedious and repetitive work, thereby improving the user's work efficiency in producing the program and avoiding the user from falling into aesthetic fatigue; if it is determined according to the intention recognition result that the user is not currently performing corresponding program production, that is, the user may be recording the program, the text-related vertical field knowledge can be obtained, and the first prompt can be generated according to the text and the vertical field knowledge. Finally, the corresponding text answer is output according to the first prompt integrating the vertical field knowledge through the anthropomorphic large model, so as to realize interaction with the user recording the program, enrich the watchability and fun of the program, increase the effect of the program, improve the user's viewing experience, and avoid the user from falling into viewing fatigue.
[0133] Optionally, the first judging unit includes:
[0134] The first judgment subunit is used to extract keywords from the text and judge whether the keywords exist in the keyword document library;
[0135] A first determining unit is used to determine whether there is a keyword document with a text match in the keyword document library if the keyword exists in the keyword document library;
[0136] The second determining unit is configured to determine that there is no keyword document with a text match in the keyword document library if the keyword does not exist in the keyword document library.
[0137] Optionally, the intelligent interactive system applied to a program provided by an embodiment of the present invention further includes:
[0138] A concatenation unit is used to obtain a keyword document corresponding to the keyword from the keyword document library if there is a keyword document with text matching in the keyword document library, and concatenate the text with the keyword document into a second prompt;
[0139] The second output unit is used to output a text answer of the text according to the second prompt through the anthropomorphic model.
[0140] Optionally, the second judgment unit includes:
[0141] A second judgment subunit is used to calculate the similarity between the text and each similar question in the question-answer database, and to judge whether there is a similar question with a similarity to the text greater than a first preset threshold;
[0142] A third determining unit is used to determine whether there is a text answer with text matching in the question and answer database if there is a similar question with a similarity with the text greater than a first preset threshold;
[0143] The fourth determining unit is used to determine that there is no text answer with text matching in the question and answer database if there is no similar question with a similarity with the text greater than a first preset threshold.
[0144] Optionally, the intelligent interactive system applied to a program provided by an embodiment of the present invention further includes:
[0145] A fifth determination unit is used to determine, if there is a text answer with text matching in the question and answer database, a similar question with a similarity with the text greater than a first preset threshold as a target similar question matching the text;
[0146] The third output unit is used to use the answer corresponding to the standard question that is associated with the target similar question as the text answer for text matching.
[0147] Optional training modules include:
[0148] A collecting unit, configured to collect fine-tuning data, wherein the fine-tuning data includes a plurality of question-answer pairs;
[0149] A training subunit, used for inputting a plurality of question-answer pairs into a low-rank matrix A and a low-rank matrix B, so that the low-rank matrix A and the low-rank matrix B are trained using the plurality of question-answer pairs to obtain an initial anthropomorphic large model;
[0150] The adjustment unit is used to merge the low-rank matrix weights in the initial anthropomorphic large model with the pre-set pre-training weights to obtain the target weights, and use the target weights to adjust the parameters of the initial anthropomorphic large model to obtain the anthropomorphic large model.
[0151] Optional, vertical domain knowledge acquisition unit, including:
[0152] A third judgment unit is used to judge whether there is an associated downstream tool in the intent category in the intent recognition result if the user has not produced the program;
[0153] A first conversion unit, configured to convert the text into a target text vector if there is no associated downstream tool for the intent category;
[0154] A fourth judgment unit, used to calculate the cosine similarity between the text vector and each target text vector in the vector database, and to judge whether there is a target text vector whose cosine similarity with the text vector is greater than a second preset threshold;
[0155] A second conversion unit is used to convert the target text vector whose cosine similarity with the target text vector is greater than the second preset threshold into a target text if there is a text vector whose cosine similarity with the target text vector is greater than the second preset threshold; wherein the target text is vertical domain knowledge related to the text;
[0156] The acquisition unit is used to acquire the vertical domain knowledge of the text according to the downstream tool associated with the intent category if there is an associated downstream tool for the intent category.
[0157] The present application embodiment provides an electronic device, such as Figure 5 As shown, the electronic device includes a processor 501 and a memory 502, the memory 502 is used to store program codes and data applied to intelligent interaction of programs, and the processor 501 is used to call program instructions in the memory to execute the steps shown in the intelligent interaction method applied to programs in the above embodiment.
[0158] An embodiment of the present application provides a storage medium, which includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the intelligent interaction method applied to the program shown in the above embodiment.
[0159] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, in which the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0160] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0161] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one 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 invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
[0162] The above are only preferred embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. An intelligent interactive method applied to a program, characterized in that: Applied to a pre-built AI director, the method includes: Collecting the voice input by the user and converting the voice into text; Determine whether there is a keyword document matching the text in the keyword document library; If there is no keyword document matching the text in the keyword document library, determine whether there is a text answer matching the text in the question and answer library; If there is no text answer matching the text in the question and answer database, perform intent recognition on the text to obtain a corresponding intent recognition result; Determining whether the user is producing a program according to the intention recognition result; If the user is producing a program, a downstream tool associated with the intent category in the intent recognition result is used to perform a corresponding intent task according to the text, and a corresponding program production text is obtained and output, so that the user can produce a corresponding program using the program production text; If the user does not produce a program, vertical domain knowledge related to the text is obtained; the vertical domain knowledge is a target text corresponding to each topic obtained by segmenting each vertical domain text in a pre-established preset knowledge base according to topic paragraphs; Generate a first prompt according to the text and the vertical domain knowledge, and output a corresponding text answer according to the first prompt integrated with the vertical domain knowledge through an anthropomorphic model; wherein the anthropomorphic model is obtained by training low-rank matrix A and low-rank matrix B using pre-trained weights and fine-tuning data; If there is a text answer matching the text in the question-and-answer database, a similar question whose similarity to the text is greater than a first preset threshold is determined as a target similar question matching the text; The answer corresponding to the standard question that is associated with the target similar question is used as the text answer for the text matching; If there is a keyword document matching the text in the keyword document library, obtain the keyword document corresponding to the keyword from the keyword document library, and concatenate the text and its keyword document into a second prompt; The anthropomorphic model outputs a text answer to the text according to the second prompt.
2. The method according to claim 1, characterized in that The determining whether there is a keyword document matching the text in the keyword document library includes: Extracting keywords from the text and determining whether the keywords exist in a keyword document library; If the keyword exists in the keyword document library, determining that a keyword document matching the text exists in the keyword document library; If the keyword does not exist in the keyword document library, it is determined that there is no keyword document matching the text in the keyword document library.
3. The method according to claim 1, characterized in that The determining whether there is a text answer matching the text in the question and answer database includes: Calculating the similarity between the text and each similar question in the question-and-answer database, and determining whether there is a similar question with a similarity to the text greater than a first preset threshold; If there is a similar question whose similarity to the text is greater than a first preset threshold, determining that there is a text answer matching the text in the question and answer library; If there is no similar question whose similarity to the text is greater than a first preset threshold, it is determined that there is no text answer matching the text in the question and answer library.
4. The method according to claim 1, characterized in that The low-rank matrix A and low-rank matrix B are trained using pre-trained weights and fine-tuning data to obtain an anthropomorphic large model, including: Collecting fine-tuning data, wherein the fine-tuning data includes a plurality of question-answer pairs; Inputting the plurality of question-answer pairs into a low-rank matrix A and a low-rank matrix B, so that the low-rank matrix A and the low-rank matrix B are trained using the plurality of question-answer pairs to obtain an initial anthropomorphic large model; The low-rank matrix weights in the initial anthropomorphic model and the pre-set pre-training weights are merged to obtain target weights, and the target weights are used to adjust the parameters of the initial anthropomorphic model to obtain the anthropomorphic model.
5. The method according to claim 1, characterized in that If the user does not produce a program, obtaining vertical domain knowledge related to the text includes: If the user has not produced a program, determining whether there is an associated downstream tool for the intent category in the intent recognition result; If there is no downstream tool associated with the intent category, convert the text into a target text vector; Calculating the cosine similarity between the text vector and each target text vector in the vector database, and determining whether there is a target text vector whose cosine similarity with the text vector is greater than a second preset threshold; If there is a text vector whose cosine similarity with the target text vector is greater than a second preset threshold, converting the target text vector whose cosine similarity with the text vector is greater than the second preset threshold into a target text; wherein the target text is vertical domain knowledge related to the text; If there is an associated downstream tool for the intent category, the vertical domain knowledge of the text is acquired according to the downstream tool associated with the intent category.
6. An intelligent interactive system applied to a program, characterized in that: Applied to a pre-built AI director, the system includes: A voice conversion unit, used to collect the voice input by the user and convert the voice into text; A first judgment unit, used to judge whether there is a keyword document matching the text in the keyword document library; A second judgment unit is used to judge whether there is a text answer matching the text in the question and answer library if there is no keyword document matching the text in the keyword document library; an intention recognition unit, configured to perform intention recognition on the text to obtain a corresponding intention recognition result if there is no text answer matching the text in the question and answer library; A third judgment unit, used for judging whether the user is producing a program according to the intention recognition result; A program production text output unit is used to, if the user is producing a program, use the downstream tool associated with the intent category to perform the corresponding intent task according to the text, obtain and output the corresponding program production text, so that the user can use the program production text to produce the corresponding program; A vertical field knowledge acquisition unit, used for acquiring vertical field knowledge related to the text if the user has not produced a program; the vertical field knowledge is a target text corresponding to each topic obtained by segmenting each vertical field text in a pre-established preset knowledge base according to topic paragraphs; A first output unit is used to generate a first prompt according to the text and the vertical domain knowledge, and output a corresponding text answer according to the first prompt integrated with the vertical domain knowledge through an anthropomorphic model; wherein the anthropomorphic model is obtained by training the low-rank matrix A and the low-rank matrix B by the training unit using pre-training weights and fine-tuning data; A concatenation unit, configured to obtain a keyword document corresponding to the keyword from the keyword document library if a keyword document matching the text exists in the keyword document library, and concatenate the text with its keyword document into a second prompt; A second output unit, configured to output a text answer of the text according to the second prompt through the anthropomorphic model; a fifth determining unit, configured to determine, if a text answer matching the text exists in the question-and-answer database, a similar question having a similarity with the text greater than a first preset threshold as a target similar question matching the text; The third output unit is used to use the answer corresponding to the standard question that is associated with the target similar question as the text answer for the text matching.
7. An electronic device, characterized in that: include: A processor and a memory, wherein the processor and the memory are connected via a communication bus; wherein the processor is used to call and execute a program stored in the memory; The memory is used to store a program, and the program is used to implement the intelligent interaction method applied to a program as described in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to execute the intelligent interaction method applied to a program as described in any one of claims 1-5.
Citation Information
Patent Citations
Intelligent question and answer method and system based on traffic big data
CN113239163A
Intention recognition method and electronic equipment
CN113806473A
Intention recognition method, interaction system and equipment
CN114625878A
Question and answer model construction method, knowledge base creation method, question and answer search method and electronic equipment
CN116842151A
Text data intelligent analysis method, device and equipment
CN117236315A
