A large model-based voice dialogue retrieval method, device and medium
By constructing a database and its inverted index, and using dialogue templates, a large speech recognition model, and fuzzy matching algorithms, the problems of inflexibility in traditional database retrieval methods and high cold start rates in voice dialogue retrieval systems have been solved, achieving efficient and accurate voice retrieval and improving user experience.
Patent Information
- Application Number
- CN202411916744.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2044-12-24
AI Technical Summary
Traditional database retrieval methods are inflexible, existing voice dialogue retrieval systems have high cold start costs, and the limitations of semantic understanding result in low accuracy and recall of retrieval results, as well as a lack of flexibility in dialogue responses.
Construct a database to be searched and its inverted index database, interact with users using preset dialogue templates, convert speech into pinyin search information through a large speech recognition model, match field values in the inverted index database using a fuzzy matching algorithm, and guide users to further filter or supplement search information based on the matching results.
It improves search efficiency and accuracy, enables flexible search methods, reduces cold start costs, and enhances user experience.
Smart Images

Figure CN120011589B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of voice retrieval, and particularly relates to a voice dialogue retrieval method based on a large model, a device and a medium. BACKGROUND
[0002] In the current information society, as an important tool for storing and managing a large amount of data, the retrieval efficiency and convenience of a database are directly related to the efficiency of data utilization. Traditional database retrieval methods mostly rely on text input, and users need to input retrieval keywords or sentences through a keyboard or other devices. This method is not flexible and efficient in some scenarios. In particular, in mobile device and smart home scenarios, users prefer to complete database retrieval operations through voice interaction.
[0003] However, existing voice dialogue retrieval systems often have some problems. For example, some systems rely on a large amount of training data to build models, resulting in high cold start costs, and the generalization ability of the model may be insufficient for specific domain database retrieval tasks. In addition, some systems have limitations in semantic understanding and are difficult to accurately understand the complex intentions and expressions of users, resulting in low accuracy and recall rate of retrieval results. Some systems also lack flexibility in generating dialogue responses and cannot dynamically adjust according to the actual needs of users and the dialogue state.
[0004] Therefore, a voice dialogue retrieval method based on a large model is proposed to solve the above problems. SUMMARY
[0005] The embodiments of the present application provide a voice dialogue retrieval method based on a large model, a device and a medium, which solve the technical problems of inflexible traditional database retrieval methods and high cold start costs of existing voice dialogue retrieval systems.
[0006] In a first aspect, the embodiments of the present application provide a voice dialogue retrieval method based on a large model, characterized in that the method comprises: constructing a database to be retrieved and an inverted index database associated with the database to be retrieved; wherein the database to be retrieved is a database comprising a plurality of literal field values, and the inverted index database is a database in which the plurality of literal field values in the database to be retrieved are converted into a plurality of pinyin field values; based on a preset script template, communicating with the user to collect the user's retrieval voice; wherein the script template can guide the user how to ask questions, and communicate with the user according to the field value; based on a preset voice recognition large model, processing the retrieval voice to convert the retrieval voice into pinyin retrieval information; wherein the pinyin retrieval information is information comprising a plurality of pinyin field values; based on a preset fuzzy matching algorithm, matching the pinyin retrieval information and the inverted index database, collecting pinyin field values with a matching degree greater than a preset matching degree threshold, to obtain a first number of to-be-processed field values; wherein the matching degree has a value range of 0 to 1; determining whether the first number of to-be-processed field values is greater than a preset number threshold; if yes, processing the first number of to-be-processed field values based on the script template to generate screening voice, and collecting the user's retrieval voice based on the screening voice; if no, processing the pinyin retrieval information based on the script template to generate voice information, and reminding the user to input the retrieval voice based on the voice information; if no, and the first number is 0, reminding the user to re-input the retrieval voice based on the script template; if yes, and there is a pinyin field value with a matching degree of 1, determining that the pinyin field value is a retrieval field value; based on the retrieval field value, retrieving the database to be retrieved to obtain a retrieval result; when the retrieval result is unique, processing the retrieval result based on the script template and replying to the user; when the retrieval result is not unique, comparing the to-be-processed field value with the retrieval result to determine a missing field value, and processing the missing field value based on the script template to collect the user's retrieval voice.
[0007] In an implementation manner of the present application, the constructing of the database to be retrieved and the inverted index database associated with the database to be retrieved specifically comprises: constructing the database to be retrieved; performing pinyin conversion on each literal field value in the database to be retrieved to generate a corresponding pinyin field value; establishing an association between the pinyin field value and the original literal field value to form the inverted index database.
[0008] In an implementation manner of the present application, the processing of the retrieval voice based on the preset voice recognition large model to convert the retrieval voice into pinyin retrieval information specifically comprises: processing the retrieval voice based on the voice recognition large model to convert the retrieval voice into pinyin retrieval information; and / or processing the retrieval voice based on a preset voice recognition algorithm to convert the retrieval voice into retrieval literal; when the user confirms the retrieval literal, processing the retrieval literal information based on a preset information extraction algorithm to generate a to-be-queried field value; processing the to-be-queried field value based on a preset natural language processing algorithm to generate pinyin retrieval information.
[0009] In an implementation form of the application, the pinyin retrieval information is matched with the inverted index database based on a preset fuzzy matching algorithm, and pinyin field values with a matching degree greater than a preset matching degree threshold are collected to obtain the first number of to-be-processed field values, specifically including: calculating the matching degree of the pinyin retrieval information and each pinyin field value in the inverted index database based on the fuzzy matching algorithm; and taking the pinyin field values with a matching degree greater than the preset matching degree threshold as the to-be-processed field values.
[0010] In an implementation form of the application, if yes, the first number of to-be-processed field values are processed based on the dialogue template to generate a screening voice, and the retrieval voice of the user is collected based on the screening voice, specifically including: determining a processing flow; processing the first number of to-be-processed field values according to the processing flow to generate a screening voice prompt containing the first number of to-be-processed field values; converting the screening voice prompt into a voice signal through voice synthesis technology and playing it to the user; and collecting the retrieval voice given by the user according to the screening voice prompt.
[0011] In an implementation form of the application, if no, the pinyin retrieval information is processed based on the dialogue template to generate voice information, and the user is reminded to re-input the retrieval voice based on the voice information, specifically including: determining a processing flow; when the first number is less than the number threshold, processing the to-be-retrieved field values based on the dialogue template to generate a confirmation voice prompt containing the to-be-retrieved field values; converting the confirmation voice prompt into a voice signal through voice synthesis technology and playing it to the user; and collecting the retrieval voice re-input by the user.
[0012] In an implementation form of the application, when the retrieval result is not unique, the to-be-processed field values are compared with the field values in the retrieval result to determine the missing field values, and the missing field values are processed based on the dialogue template to collect the retrieval voice of the user, specifically including: when the retrieval result is not unique, comparing the to-be-processed field values with the field values in the retrieval result to determine the missing field values; generating an inquiry voice containing the missing field values based on the dialogue template and playing it to the user; and collecting the retrieval voice given by the user according to the inquiry voice.
[0013] In an implementation form of the application, the method further includes: recording the retrieval history of the user during the retrieval process to update the voice recognition large model.
[0014] In a second aspect, the embodiments of the present application also provide a voice dialogue retrieval device based on a large model, the device comprising: at least one processor; and a memory in communication connection with 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 to enable the at least one processor to: construct a database to be retrieved and an inverted index database associated with the database to be retrieved; wherein the database to be retrieved is a database comprising a plurality of literal field values, and the inverted index database is a database converting the plurality of literal field values in the database to be retrieved into a plurality of pinyin field values; based on a preset dialogue template, communicate with a user to collect retrieval voice of the user; wherein the dialogue template can guide the user how to ask questions, and communicate with the user according to the field values; based on a preset voice recognition large model, process the retrieval voice to convert the retrieval voice into pinyin retrieval information; wherein the pinyin retrieval information is information comprising a plurality of pinyin field values; based on a preset fuzzy matching algorithm, match the pinyin retrieval information and the inverted index database, collect pinyin field values with a matching degree greater than a preset matching degree threshold, to obtain a first number of to-be-processed field values; wherein the matching degree has a value range of 0 to 1; determine whether the first number of to-be-processed field values is greater than a preset number threshold; if yes, based on the dialogue template, process the first number of to-be-processed field values to generate screening voice, and based on the screening voice, collect retrieval voice of the user; if yes, and there is a pinyin field value with a matching degree of 1, determine that the pinyin field value is a retrieval field value; if no, based on the dialogue template, process the pinyin retrieval information to generate voice information, and based on the voice information, remind the user to re-input the retrieval voice; based on the retrieval field value, retrieve the database to be retrieved to obtain a retrieval result; when the retrieval result is unique, based on the dialogue template, process the retrieval result, and reply to the user; when the retrieval result is not unique, compare the to-be-processed field values with the retrieval result to determine missing field values, and based on the dialogue template, process the missing field values to collect retrieval voice of the user.
[0015] In a third aspect, the embodiments of the present application also provide a nonvolatile computer storage medium based on a large model for voice dialogue retrieval, which stores computer executable instructions. The computer executable instructions are configured to: construct a database to be retrieved and an inverted index database associated with the database to be retrieved; wherein the database to be retrieved is a database including a plurality of literal field values, and the inverted index database is a database converting the plurality of literal field values in the database to be retrieved into a plurality of pinyin field values; based on a preset script template, communicate with the user to collect the retrieval voice of the user; wherein the script template can guide the user how to ask questions, and communicate with the user according to the field value; based on a preset voice recognition large model, process the retrieval voice to convert the retrieval voice into pinyin retrieval information; wherein the pinyin retrieval information is information including a plurality of pinyin field values; based on a preset fuzzy matching algorithm, match the pinyin retrieval information and the inverted index database, collect the pinyin field values with a matching degree greater than a preset matching degree threshold, to obtain a first number of to-be-processed field values; wherein the matching degree ranges from 0 to 1; determine whether the first number of to-be-processed field values is greater than a preset number threshold; if yes, based on the script template, process the first number of to-be-processed field values to generate screening voice, and based on the screening voice, collect the retrieval voice of the user; if yes, and there is a pinyin field value with a matching degree of 1, determine that the pinyin field value is a retrieval field value; if no, based on the script template, process the pinyin retrieval information to generate voice information, and based on the voice information, remind the user to re-input the retrieval voice; based on the retrieval field value, retrieve the database to be retrieved to obtain a retrieval result; when the retrieval result is unique, based on the script template, process the retrieval result, and reply to the user; when the retrieval result is not unique, compare the to-be-processed field value with the retrieval result to determine a missing field value, and based on the script template, process the missing field value to collect the retrieval voice of the user.
[0016] The embodiments of the present application provide a large model-based voice dialogue retrieval method, device and medium, which at least have the following technical effects:
[0017] By constructing the database to be searched and its corresponding inverted index database, the quick conversion of the literal field value and the pinyin field value is realized, and the retrieval efficiency is greatly improved. The preset dialogue template is used to interact with the user, guide the user to ask the retrieval question, and convert the user's retrieval voice into pinyin retrieval information based on the voice recognition large model. The fuzzy matching algorithm is used for matching in the inverted index database, and the field values highly related to the retrieval voice can be collected. According to the number and quality of the matching results, the user is intelligently guided to further filter or supplement the retrieval information, and the accuracy of the retrieval result is ensured. When the retrieval result is unique, the user is directly replied; when the result is not unique, the missing field value is determined by comparison, and the user is guided to supplement, so as to accurately meet the user's retrieval demand and improve the user experience, thereby realizing the effects of flexible retrieval mode and low cold start cost to a certain extent. BRIEF DESCRIPTION OF DRAWINGS
[0018] The accompanying drawings, which are included to provide a further understanding of the present application, constitute a part of this application and help to explain the illustrative embodiments of the present application and their descriptions. The accompanying drawings do not constitute an undue limitation on the present application. In the drawings:
[0019] Figure 1 A flowchart of a voice dialogue retrieval method based on a large model is provided for the embodiments of the present application.
[0020] Figure 2 An internal structure schematic diagram of a voice dialogue retrieval device based on a large model is provided for the embodiments of the present application. DETAILED DESCRIPTION
[0021] To make the purpose, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be described in detail below in combination with the embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0022] The embodiments of the present application provide a voice dialogue retrieval method, device and medium based on a large model, to solve the technical problems of the traditional database retrieval mode being not flexible and the cold start cost of the existing voice dialogue retrieval system being high.
[0023] The technical solutions of the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0024] Figure 1 A flowchart of a voice dialogue retrieval method based on a large model is provided for the embodiments of the present application. As shown in Figure 1As shown, the embodiment of the present application provides a large model-based voice dialogue retrieval method, which specifically includes the following steps:
[0025] Step 100, constructing a database to be retrieved and an inverted index database associated with the database to be retrieved; wherein the database to be retrieved is a database including a plurality of literal field values, and the inverted index database is a database converting the plurality of literal field values in the database to be retrieved into a plurality of pinyin field values.
[0026] Constructing a database to be retrieved including a plurality of literal field values, and constructing an inverted index database based on the database, wherein the inverted index database converts the literal field values into pinyin field values.
[0027] Step 101, constructing a database to be retrieved.
[0028] Collecting and organizing the original data to be retrieved to form a database including a plurality of literal field values. The literal field values can be any form of Chinese text, such as article titles, content abstracts, keywords, etc.
[0029] For example, constructing a database to be retrieved about Chinese ancient poems, the titles and contents of the ancient poems can be collected from various sources, and the titles and contents are stored as literal field values in the database.
[0030] That is, a record in the database includes fields "title" and "content", which correspond to the title and full text of an ancient poem, respectively.
[0031] Step 102, converting each literal field value in the database to be retrieved into a corresponding pinyin field value.
[0032] Using a pinyin conversion tool or algorithm, each literal field value in the database to be retrieved is converted into a corresponding pinyin field value. The pinyin field value is a string composed of the corresponding pinyin of Chinese characters, which is used for subsequent retrieval operations.
[0033] Referring to step 101, continuing to take the ancient poem database as an example, for the title "Jingye Si" of an ancient poem, a pinyin conversion tool can be used to convert it to "jing4ye4si1". Similarly, the content of the ancient poem also needs to be converted into pinyin word by word.
[0034] Step 103, establishing an association between the pinyin field value and the original literal field value to form an inverted index database.
[0035] In the inverted index database, the association between the pinyin field value and the original literal field value is established. In this way, when the user searches by pinyin, the corresponding literal field value and the document where it is located can be quickly found according to the pinyin field value.
[0036] In the inverted index of the ancient poetry database, we can create an index item for each pinyin field value (such as "jing4ye4si1") and associate it with the original literal field value (such as "Jing Ye Si") and the document containing the field value. When the user inputs the pinyin "jing4ye4si1" for retrieval, the corresponding ancient poetry title and content can be found immediately.
[0037] Step 200, based on the preset dialogue template, communicate with the user to collect the user's search voice; wherein the dialogue template can guide the user how to ask questions, and communicate with the user according to the field value.
[0038] The dialogue template is a series of question or reply templates preset according to common search scenarios and user needs, which can guide the user how to ask questions and make it easier to understand the user's intention.
[0039] First, according to the target application scenario and user needs, design a series of dialogue templates. These templates can include opening remarks to guide users to ask questions, question methods for specific field values, and user responses, etc. For example, in the book search scenario, the dialogue template includes "Please tell me the author or title of the book you want to find" and so on.
[0040] After receiving the user's voice input or triggering the interaction, select the appropriate dialogue template to interact with the user according to the current context or user's historical behavior. Use speech synthesis technology (TTS) to convert the dialogue template into voice output to guide the user how to ask questions.
[0041] After the user asks questions according to the guidance of the dialogue template, use speech recognition technology (ASR) to collect and recognize the user's search voice.
[0042] For example, a smart book search system, users can interact with the system through voice to find books of their interest.
[0043] Preset dialogue template:
[0044] Opening remarks: "Hello, welcome to use the smart book search system. Please tell me which book you want to find."
[0045] Guiding questions: "You can tell me the author, title or keywords of the book."
[0046] User's reply example: "I want to find 'Dream of Red Chamber'."
[0047] Communicate with the user:
[0048] System (through TTS output): "Hello, welcome to use the smart book search system. Please tell me which book you want to find."
[0049] User (through voice recognition input): "I want to find a book about A Dream of Red Mansions".
[0050] Step 300, processing the retrieval voice based on the preset voice recognition large model to convert the retrieval voice into pinyin retrieval information; wherein the pinyin retrieval information is information including multiple pinyin field values.
[0051] The pinyin retrieval information is information composed of multiple pinyin field values, which is used for subsequent retrieval operations.
[0052] Step 301, processing the retrieval voice based on the voice recognition large model to convert the retrieval voice into pinyin retrieval information.
[0053] The voice recognition large model (such as a deep learning model) is used to recognize and process the retrieval voice of the user. The large model can use a large amount of training data and complex network structure to more accurately recognize phonemes, syllables and words in the voice and convert them into pinyin representation.
[0054] Even if there are differences or ambiguities in the user's pronunciation, the large model can intelligently correct it through context and voice features to generate relatively accurate pinyin content, and extract keywords from the pinyin content according to actual needs and training data to generate pinyin retrieval information.
[0055] It can be understood that the voice recognition large model is trained based on existing large models according to actual needs, and will not be described again.
[0056] However, this processing method is not visible to the user, and if there is an error, it cannot be corrected in time. Therefore, steps 302 to 304 can also be used to accurately input the user's voice.
[0057] Step 302, processing the retrieval voice based on the preset voice recognition algorithm to convert the retrieval voice into retrieval text.
[0058] The retrieval voice is converted into retrieval text by the traditional voice recognition algorithm, and the converted retrieval text can be used for subsequent information extraction and pinyin generation steps.
[0059] Step 303, when the user confirms the retrieval text, processing the retrieval text information based on the preset information extraction algorithm to generate the field value to be queried.
[0060] The converted retrieval text will be displayed to the user through the display, and the user can correct the retrieval text. After the user confirms the retrieval text, the information extraction algorithm is used to extract the key information from the retrieval text to generate the field value to be queried.
[0061] For example, the field value to be queried can be the title of a book, the name of an author, a keyword, etc., which is used for subsequent retrieval operations. This step ensures accurate communication of user intent and improves the accuracy of retrieval.
[0062] Step 304: Based on the preset natural language processing algorithm, the field value to be queried is processed to generate pinyin retrieval information.
[0063] The field value to be queried is further processed using a natural language processing algorithm to convert it into pinyin retrieval information. The natural language processing algorithm can analyze the syntax, semantics, and context information of the field value to more accurately generate the corresponding pinyin representation. In this way, even if the field value contains complex characters, multi-sound characters, etc., accurate pinyin retrieval information can be generated.
[0064] In one example, the user says the retrieval voice: "I want to find the book 'Dream of Red Mansion'."
[0065] The retrieval voice is processed using a speech recognition large model and directly converted into pinyin retrieval information. Due to the intelligent correction ability of the large model, even if there is a slight difference in the user's pronunciation, accurate pinyin retrieval information can be generated: "hong2lou2meng4."
[0066] Alternatively, steps 302 to 304 are selected.
[0067] The retrieval voice is converted into retrieval text using a speech recognition algorithm: "I want to find the book 'Dream of Red Mansion'."
[0068] After the user confirms that the retrieval text is correct, an information extraction algorithm is used to extract the field value to be queried from the retrieval text: "Dream of Red Mansion."
[0069] The field value to be queried is converted into pinyin retrieval information using a natural language processing algorithm: "hong2lou2meng4."
[0070] Step 400: Based on the preset fuzzy matching algorithm, the pinyin retrieval information is matched with the inverted index database to collect pinyin field values with a matching degree greater than a preset matching degree threshold to obtain a first number of field values to be processed; wherein the matching degree has a value range of 0 to 1.
[0071] The fuzzy matching algorithm can consider the similarity and difference between pinyin, giving more flexible matching results. The matching degree threshold is a value between 0 and 1, which is used to control the strictness of the matching. The first number of field values to be processed refers to the number of pinyin field values that meet the matching degree threshold condition.
[0072] Step 401: Based on the fuzzy matching algorithm, the matching degree of the pinyin retrieval information and each pinyin field value in the inverted index database is calculated.
[0073] The fuzzy matching algorithm is used to calculate the matching degree between the pinyin search information and each pinyin field value in the inverted index database. The fuzzy matching algorithm can use various methods such as edit distance, cosine similarity, and Jaccard similarity to calculate the similarity between two pinyin strings. For each pinyin field value, the algorithm will give a matching degree value with the pinyin search information, and the closer the value is to 1, the higher the matching degree.
[0074] Step 402, the pinyin field value with a matching degree greater than the preset matching degree threshold is taken as a to-be-processed field value.
[0075] According to the preset matching degree threshold, the pinyin field values that meet the condition are filtered. The matching degree of each pinyin field value with the pinyin search information is compared, and if the matching degree is greater than the matching degree threshold, the pinyin field value is taken as a to-be-processed field value. In this way, a group of pinyin field values with high similarity to the pinyin search information can be collected for subsequent retrieval processing.
[0076] For example, referring to the above example, an inverted index database containing the pinyin of the book name is constructed.
[0077] The user speaks the search voice, and the embodiment of the application converts it into pinyin search information: "hong2long2meng4".
[0078] The fuzzy matching algorithm is used to calculate the matching degree between the pinyin search information and each pinyin field value in the inverted index database. For the pinyin field value "hong2lou2meng4" (corresponding to the correct pinyin of the book "Hong Lou Meng") in the database, the algorithm calculates a matching degree of 0.85.
[0079] The preset matching degree threshold is 0.8. Therefore, for the pinyin field value "hong2lou2meng4" with a matching degree of 0.85, it is taken as a to-be-processed field value.
[0080] Step 500, determining whether the first number of to-be-processed field values is greater than a preset number threshold.
[0081] By determining whether the first number of to-be-processed field values obtained by the fuzzy matching algorithm exceeds the preset number threshold, the retrieval result is further optimized. The number threshold is a preset integer value used to control the number range of the retrieval result, avoiding too many or too few results leading to poor user experience.
[0082] If the first number is greater than the number threshold, it means that the retrieval result is too much, which may contain a large amount of irrelevant or redundant information, or the retrieval condition is relatively broad, and further processing or filtering is needed; if the first number is less than or equal to the number threshold, it means that the number of retrieval results is moderate, and subsequent processing or display can be directly performed.
[0083] For example, an inverted index database containing the pinyin of book names is constructed, and a quantity threshold of 10 is set.
[0084] Pinyin search information: "ke1huan4xiao3shuo1".
[0085] The fuzzy matching algorithm is used to calculate the matching degree of the pinyin search information and each pinyin field value in the inverted index database, and the to-be-processed field values that meet the matching degree threshold condition are obtained.
[0086] The number of to-be-processed field values, i.e., the first number, is 15, which is greater than the preset quantity threshold 10.
[0087] Since the first number is greater than the quantity threshold, the system determines that the search result is too much and needs to be further processed or filtered.
[0088] Step 600, if yes, the first number of to-be-processed field values are processed based on the dialogue template to generate a filtering voice, and the user's search voice is collected based on the filtering voice.
[0089] When the system determines that the first number of to-be-processed field values is greater than the preset quantity threshold, it means that the initial search result is too much, and the user needs to be guided to perform more accurate search. At this time, the system will process the to-be-processed field values based on the preset dialogue template, generate a filtering voice prompt containing filtering conditions, and play it to the user, so that the user can give more specific search voice according to the prompt.
[0090] Step 601, determine the processing flow.
[0091] It can be understood that the processing flow is the flow of executing step 600, and it has been determined which dialogue template to use.
[0092] Step 602, process the first number of to-be-processed field values according to the processing flow to generate a filtering voice prompt containing the first number of to-be-processed field values.
[0093] According to the determined processing flow, the most representative field values are selected from the first number of to-be-processed field values as filtering conditions. Then, using the preset dialogue template, these filtering conditions are combined into a clear filtering voice prompt. It can be understood that this prompt should contain enough information so that the user can perform secondary search according to the prompt.
[0094] Step 603, convert the filtering voice prompt into a voice signal through voice synthesis technology and play it to the user.
[0095] The screening voice prompt is converted into a voice signal by using a voice synthesis technology, and is played to the user through a loudspeaker or other audio output device. In this way, the user can hear a voice prompt containing the screening condition, and can perform a secondary search according to the prompt.
[0096] Step 604: Collect the search voice given by the user according to the screening voice prompt.
[0097] After the user hears the screening voice prompt, the user is waited for to give a secondary search voice. The search voice of the user is collected through a microphone or other audio input device.
[0098] For example, refer to the above example. It is judged that the initial search result (i.e., the first number of field values to be processed) is greater than the preset number threshold.
[0099] The processing flow is determined, and a voice template about screening in the voice template is selected (please give more specific screening information about xx).
[0100] The most representative author, publication year and rating information are selected from the initial search result, and the screening voice prompt is generated by using the voice template: “Do you want to find a science fiction novel written by which author? Or do you want to find which publication year? Or do you have a requirement for the rating of the book?”.
[0101] The screening voice prompt is converted into a voice signal by using a voice synthesis technology, and is played to the user.
[0102] After the user hears the screening voice prompt, the user gives a secondary search voice: “I want to find a science fiction novel written by Liu Cixin, published after 2010, and rated higher than 8 points”.
[0103] The secondary search voice of the user is collected, and subsequent processing and analysis are performed to obtain more accurate search results.
[0104] Step 700: If no, the pinyin search information is processed based on the voice template to generate voice information, and the user is reminded to input the search voice based on the voice information.
[0105] Step 701: The processing flow is determined.
[0106] Refer to step 601, which is not repeated here.
[0107] Step 702: When the first number is less than the number threshold, the field value to be searched is processed based on the voice template to generate a confirmation voice prompt including the field value to be searched.
[0108] When the search result is less than the number threshold, it is highly probable that the search target needed by the user is included in the first number of fields to be searched, and a confirmation voice prompt is generated based on the dialogue template and the pinyin search information. This prompt should contain the key information of the user's original search request and be expressed in a questioning or confirming manner to guide the user to confirm.
[0109] For example, if the user's pinyin search information is "hong3lou3meng4, liu2lao3lao3" (Hong Lou Meng Liu Laolao), the chapters in Hong Lou Meng that contain Liu Laolao include chapters 6, 39, 40, 41, and 113, then the confirmation voice prompt is: "Are you looking for the sixth chapter, when Liu Laolao first visited the Rongguo Mansion; or chapters 39 to 41, when Liu Laolao visited the Rongguo Mansion and visited the Grand View Garden; or chapter 113, when the Jia Mansion was searched and Liu Laolao visited Feng Jie."
[0110] Step 703, convert the confirmation voice prompt into a voice signal through voice synthesis technology and play it to the user.
[0111] The generated confirmation voice prompt is converted into a voice signal using voice synthesis technology and played to the user through a speaker or other audio output device.
[0112] Step 704, collect the user's re-input search voice.
[0113] After the user hears the confirmation voice prompt, wait for the user to re-input the search voice.
[0114] Step 800, if no, and the first number is 0, then remind the user to re-input the search voice based on the dialogue template.
[0115] When the first number is 0, i.e. no matching items are found, it means that the user's search request may not be correctly understood or there is no related content in the database. At this time, a guiding voice prompt is generated based on the preset dialogue template to remind the user to re-input the search voice in order to more accurately obtain the required information.
[0116] Step 900, if yes, and there is a pinyin field value with a matching degree of 1, then determine the pinyin field value as the search field value.
[0117] When there is a pinyin field value with a matching degree of 1, i.e. a field value that is exactly the same as the user's input pinyin is found. When such a field value exists, it can be directly determined as the user's search field value without further confirmation or inquiry to the user. This can simplify the search process and improve search efficiency.
[0118] Step 1000, search the database to be searched based on the search field value to obtain the search result.
[0119] After determining the retrieval field value, a search is performed in the database to be searched according to the field value. Relevant information is found in the database according to the retrieval field value, and a search result is generated.
[0120] Step 1100, when the search result is unique, processing the search result based on the dialogue template, and replying to the user.
[0121] When the search result is unique, it means that the information that completely matches the user's search request is found. At this time, based on the preset dialogue template, the search result is formatted to generate a clear and concise reply voice, which is played to the user through the intelligent voice assistant. In this way, the user can directly obtain the required information without further filtering or confirmation.
[0122] Step 1200, when the search result is not unique, comparing the field value to be processed with the search result to determine the missing field value, and processing the missing field value based on the dialogue template to collect the user's search voice.
[0123] When the search result is not unique, it means that the user's search request may be too broad or ambiguous, causing the system to be unable to accurately determine the user's search intent. At this time, the system needs to compare the field value to be processed (i.e. the field value converted from the user's input search request) with the field value in the search result to find out the missing field value that can further clarify the user's intent. Then, the system will generate an inquiry voice containing these missing field values based on the preset dialogue template, and play it to the user to guide the user to supplement the information.
[0124] Step 1201, when the search result is not unique, comparing the field value to be processed with the field value in the search result to determine the missing field value.
[0125] The field values to be processed are compared one by one with each field value in the search result to find out those field values that are not explicitly mentioned in the user's search request but exist in the search result. These field values are usually key information that can further narrow the search range and clarify the user's intent. For example, if the user searches for "science fiction novels", and there are several science fiction novels by different authors and published by different publishers in the search result, then "author" and "publisher" are missing field values.
[0126] Step 1202, generating an inquiry voice containing the missing field values based on the dialogue template, and playing it to the user.
[0127] After determining the missing field values, an inquiry voice containing these missing field values is generated based on the preset dialogue template. For example: "Which author do you want to find the science fiction novel written by? Or which publisher is it published by?" Then the inquiry voice is played to the user through the loudspeaker or other audio output device.
[0128] Step 1203, collect the search voice given by the user according to the inquiry voice.
[0129] After the user hears the inquiry voice, the user will wait for further search voice given by the user according to the prompt.
[0130] The embodiments of the present application also include the following methods:
[0131] Record the search history of the user in the search process to update the large model of speech recognition. This content is prior art and will not be repeated here.
[0132] The above is the method embodiment of the present application. Based on the same inventive concept, the embodiments of the present application also provide a large model-based voice dialogue search device, the structure of which is as shown in Figure 2 .
[0133] Figure 2 A large model-based voice dialogue search device internal structure diagram is provided for the embodiments of the present application. As shown in Figure 2 , the device includes:
[0134] at least one processor 201;
[0135] and a memory 202 in communication connection with the at least one processor;
[0136] Among them, the memory 202 stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor 201 to enable the at least one processor 201 to:
[0137] A database to be searched and an inverted index database associated with the database to be searched are constructed; wherein the database to be searched is a database including a plurality of literal field values, and the inverted index database is a database converting the plurality of literal field values in the database to be searched into a plurality of pinyin field values; a user is communicated based on a preset script template to collect the user's search voice; wherein the script template can guide the user how to ask questions, and communicate with the user according to the field value; the search voice is processed based on a preset voice recognition large model to convert the search voice into pinyin search information; wherein the pinyin search information is information including a plurality of pinyin field values; the pinyin search information is matched with the inverted index database based on a preset fuzzy matching algorithm, and pinyin field values with a matching degree greater than a preset matching degree threshold are collected to obtain a first number of to-be-processed field values; wherein the matching degree has a value range of 0 to 1; it is judged whether the first number of to-be-processed field values is greater than a preset number threshold; if yes, the first number of to-be-processed field values are processed based on the script template to generate screening voice, and the user's search voice is collected based on the screening voice; if yes, and there is a pinyin field value with a matching degree of 1, the pinyin field value is determined as a search field value; if no, the pinyin search information is processed based on the script template to generate voice information, and the user is reminded to re-input the search voice based on the voice information; the database to be searched is searched based on the search field value to obtain a search result; when the search result is unique, the search result is processed based on the script template and replied to the user; when the search result is not unique, the to-be-processed field value is compared with the search result to determine a missing field value, and the missing field value is processed based on the script template to collect the user's search voice.
[0138] Some embodiments of the present application provide a non-volatile computer storage medium for voice dialogue search based on a large model corresponding to Figure 1 , which stores computer executable instructions, and the computer executable instructions are configured to:
[0139] Construct a database to be searched and an inverted index database associated with the database to be searched; wherein the database to be searched is a database including a plurality of literal field values, and the inverted index database is a database converting the plurality of literal field values in the database to be searched into a plurality of pinyin field values; exchange with a user based on a preset script template to collect the user's search voice; wherein the script template can guide the user how to ask questions, and exchange with the user according to the field value; process the search voice based on a preset voice recognition large model to convert the search voice into pinyin search information; wherein the pinyin search information is information including a plurality of pinyin field values; match the pinyin search information and the inverted index database based on a preset fuzzy matching algorithm, collect pinyin field values with a matching degree greater than a preset matching degree threshold, to obtain a first number of to-be-processed field values; wherein the matching degree has a value range of 0 to 1; determine whether the first number of to-be-processed field values is greater than a preset number threshold; if yes, process the first number of to-be-processed field values based on the script template to generate screening voice, and collect the user's search voice based on the screening voice; if yes, and there is a pinyin field value with a matching degree of 1, determine that the pinyin field value is a search field value; if no, process the pinyin search information based on the script template to generate voice information, and remind the user to re-input the search voice based on the voice information; search the database to be searched based on the search field value to obtain a search result; when the search result is unique, process the search result based on the script template and reply to the user; when the search result is not unique, compare the to-be-processed field value with the search result to determine a missing field value, and process the missing field value based on the script template to collect the user's search voice.
[0140] Each of the embodiments in the present application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the difference from other embodiments. In particular, for the Internet of Things device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiments.
[0141] The system and medium provided by the embodiments of the present application are one-to-one corresponding to the method, so the system and medium also have similar beneficial technical effects as the method. Since the beneficial technical effects of the method have been described in detail above, the beneficial technical effects of the system and medium will not be described here.
[0142] Those skilled in the art will appreciate that embodiments of the application can be readily used as software, hardware, or a combination of software and hardware. In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0143] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more functions specified in the flowchart block or blocks. Figure 1 means for functionally implementing one or more functions specified in the flowchart block or blocks.
[0144] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure 1 one or more functions specified in the flowchart block or blocks. Figure 1 means for functionally implementing one or more functions specified in the flowchart block or blocks.
[0145] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more functions specified in the flowchart block or blocks. Figure 1 means for functionally implementing one or more functions specified in the flowchart block or blocks.
[0146] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0147] The memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) about which the computing device can execute program instructions. The memory can also include non-volatile memory, such as read-only memory (ROM) or flash memory. The memory is an example of computer readable media.
[0148] Computer-readable media includes permanent and non-permanent, movable and non-movable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.
[0149] It should also be noted that the terms "comprising", "containing", or any other variant thereof are intended to cover non-exclusive inclusions, so that a process, method, article or apparatus that includes a list of elements does not only include those elements, but also includes other elements not explicitly listed, or further includes elements inherent in such a process, method, article or apparatus. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.
[0150] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in the scope of claims of the present application.
Claims
1. A method for retrieving a voice dialogue based on a large model, characterized in that, The method comprises: constructing a database to be searched and an inverted index database associated with the database to be searched; wherein the database to be searched is a database comprising a plurality of literal field values, and the inverted index database is a database converting the plurality of literal field values in the database to be searched into a plurality of pinyin field values; communicating with the user based on a preset script template to collect the user's search voice; wherein the script template can guide the user how to ask questions, and communicate with the user according to the field value; processing the search voice based on a preset voice recognition large model to convert the search voice into pinyin search information; wherein the pinyin search information is information comprising a plurality of pinyin field values; matching the pinyin search information and the inverted index database based on a preset fuzzy matching algorithm, collecting pinyin field values with a matching degree greater than a preset matching degree threshold to obtain a first number of to-be-processed field values; wherein the matching degree ranges from 0 to 1; determining whether the first number of to-be-processed field values is greater than a preset number threshold; if yes, processing the first number of to-be-processed field values based on the script template to generate screening voice, and collecting the user's search voice based on the screening voice; if no, processing the pinyin search information based on the script template to generate voice information, and reminding the user to input search voice based on the voice information; if no, and the first number is 0, then reminding the user to re-input search voice based on the script template; if yes, and there is a pinyin field value with a matching degree of 1, then determining the pinyin field value as a search field value; searching the database to be searched based on the search field value to obtain a search result; when the search result is unique, processing the search result based on the script template and replying to the user; when the search result is not unique, comparing the to-be-processed field value with the search result to determine a missing field value, and processing the missing field value based on the script template to collect the user's search voice.
2. The large model-based voice dialogue retrieval method according to claim 1, characterized in that, Constructing a database to be searched and an inverted index database associated with the database to be searched, specifically comprising: constructing a database to be searched; performing pinyin conversion on each literal field value in the database to be searched to generate corresponding pinyin field values; establishing an association between the pinyin field values and the original literal field values to form an inverted index database.
3. The large model-based voice dialogue retrieval method according to claim 1, characterized in that, Processing the search voice based on a preset voice recognition large model to convert the search voice into pinyin search information, specifically comprising: processing the search voice based on the voice recognition large model to convert the search voice into pinyin search information; and / or processing the search voice based on a preset voice recognition algorithm to convert the search voice into search text; when the user confirms the search text, processing the search text information based on a preset information extraction algorithm to generate a to-be-queried field value; processing the to-be-queried field value based on a preset natural language processing algorithm to generate pinyin search information.
4. The large model-based voice dialogue retrieval method according to claim 3, characterized in that, The pinyin retrieval information is matched with the inverted index database based on a preset fuzzy matching algorithm, and pinyin field values with a matching degree greater than a preset matching degree threshold are collected to obtain a first number of to-be-processed field values, specifically including: The matching degree of the pinyin retrieval information and each pinyin field value in the inverted index database is calculated based on the fuzzy matching algorithm; The pinyin field values with a matching degree greater than the preset matching degree threshold are taken as to-be-processed field values.
5. The large model-based voice dialogue retrieval method according to claim 1, characterized in that, If yes, the first number of to-be-processed field values are processed based on the dialogue template to generate a screening voice, and the retrieval voice of the user is collected based on the screening voice, specifically including: Determine the processing flow; The first number of to-be-processed field values are processed according to the processing flow to generate a screening voice prompt containing the first number of to-be-processed field values; The screening voice prompt is converted into a voice signal through voice synthesis technology and played to the user; The retrieval voice given by the user according to the screening voice prompt is collected.
6. The large model-based voice dialogue retrieval method according to claim 1, characterized in that, If no, the pinyin retrieval information is processed based on the dialogue template to generate voice information, and the user is reminded to re-input the retrieval voice based on the voice information, specifically including: Determine the processing flow; When the first number is less than the number threshold, the to-be-retrieved field value is processed based on the dialogue template to generate a confirmation voice prompt containing the to-be-retrieved field value; The confirmation voice prompt is converted into a voice signal through voice synthesis technology and played to the user; The retrieval voice re-input by the user is collected.
7. The large model-based voice dialogue retrieval method according to claim 1, characterized in that, When the retrieval result is not unique, the to-be-processed field value is compared with the field value in the retrieval result to determine the missing field value, and the missing field value is processed based on the dialogue template to collect the retrieval voice of the user, specifically including: When the retrieval result is not unique, the to-be-processed field value is compared with the field value in the retrieval result to determine the missing field value; An inquiry voice containing the missing field value is generated based on the dialogue template and played to the user; The retrieval voice given by the user according to the inquiry voice is collected.
8. The large model-based voice dialogue retrieval method according to claim 1, characterized in that, The method further includes: The retrieval history of the user is recorded during the retrieval process to update the voice recognition large model. 9.A large model-based voice dialogue search device, characterized by, The device includes: At least one processor; And a memory connected in communication with 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 to enable the at least one processor to: Build a to-be-retrieved database and an inverted index database associated with the to-be-retrieved database; wherein the to-be-retrieved database is a database containing a plurality of character field values, and the inverted index database is a database converting a plurality of character field values in the to-be-retrieved database into a plurality of pinyin field values; Exchange with the user based on a preset dialogue template to collect the retrieval voice of the user; wherein the dialogue template can guide the user how to ask, and exchange with the user according to the field value; The search voice is processed based on a preset voice recognition large model to convert the search voice into pinyin search information; wherein the pinyin search information is information including multiple pinyin field values; The pinyin search information is matched with the inverted index database based on a preset fuzzy matching algorithm, and pinyin field values with a matching degree greater than a preset matching degree threshold are collected to obtain a first number of to-be-processed field values; wherein the matching degree ranges from 0 to 1; It is judged whether the first number of to-be-processed field values is greater than a preset number threshold; If yes, the first number of to-be-processed field values is processed based on the script template to generate a screening voice, and the search voice of the user is collected based on the screening voice; If yes, and there is a pinyin field value with a matching degree of 1, the pinyin field value is determined as a search field value; If no, the pinyin search information is processed based on the script template to generate voice information, and the user is reminded to re-input the search voice based on the voice information; The to-be-searched database is searched based on the search field value to obtain a search result; When the search result is unique, the search result is processed based on the script template, and the user is replied; When the search result is not unique, the to-be-processed field value is compared with the search result to determine a missing field value, and the missing field value is processed based on the script template to collect the search voice of the user.
10. A non-transitory computer storage medium storing computer-executable instructions for large model-based speech dialogue retrieval, the computer-executable instructions comprising: The computer executable instructions are configured: A to-be-searched database and an inverted index database associated with the to-be-searched database are constructed; wherein the to-be-searched database is a database including multiple character field values, and the inverted index database is a database converting the multiple character field values in the to-be-searched database into multiple pinyin field values; A user is communicated based on a preset script template to collect the search voice of the user; wherein the script template can guide the user how to ask, and communicate with the user according to the field value; The search voice is processed based on a preset voice recognition large model to convert the search voice into pinyin search information; wherein the pinyin search information is information including multiple pinyin field values; The pinyin search information is matched with the inverted index database based on a preset fuzzy matching algorithm, and pinyin field values with a matching degree greater than a preset matching degree threshold are collected to obtain a first number of to-be-processed field values; wherein the matching degree ranges from 0 to 1; It is judged whether the first number of to-be-processed field values is greater than a preset number threshold; If yes, the first number of to-be-processed field values is processed based on the script template to generate a screening voice, and the search voice of the user is collected based on the screening voice; If yes, and there is a pinyin field value with a matching degree of 1, the pinyin field value is determined as a search field value; If no, the pinyin search information is processed based on the script template to generate voice information, and the user is reminded to re-input the search voice based on the voice information; The to-be-searched database is searched based on the search field value to obtain a search result; when the search result is unique, processing the search result based on the dialogue template and replying to the user; when the search result is not unique, comparing the to-be-processed field value with the search result to determine a missing field value, and processing the missing field value based on the dialogue template to collect the search voice of the user.
Citation Information
Patent Citations
Intelligent query method and device based on user voice, equipment and storage medium
CN115588430A
Speech recogniton method, apparatus, device and readable storage medium
US20210193143A1