A voice guidance system and method for large-model intelligent question and answer
Through the speech guidance system of large-scale intelligent Q&A, the confidence evaluation model and industry library are used to solve the problem of users' difficulty in expressing intentions in professional fields, and achieve more accurate intention recognition and answer matching.
Patent Information
- Application Number
- CN202410345777.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-26
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-03-26
AI Technical Summary
Existing database-based Q&A models have difficulties in identifying user intentions, especially when it is difficult for professional users to organize correct names and express intentions.
Using a large-scale intelligent Q&A voice guidance system, the user's question text is obtained, word segmentation and vectorization is performed, and the problem templates are matched with the industry library, and the confidence evaluation model is used to judge the correlation and verbal habits of the problem text, thereby guiding The user expresses his intention correctly.
It improves the accuracy of identifying user intentions, ensures that users can get more answers that match their intentions, and solves the problem of users' difficulty in expressing in professional fields.
Smart Images

Figure CN118227756B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of question-answering models, and in particular to a voice guidance system and method for large-model intelligent question-answering. Background Art
[0002] The existing database-based question-answering model will store a large amount of triple data in the database. These triple data are stored in the database in the form of vectors. When an external user asks a question, the user's intention can be obtained by matching the triple data with the user's question, and the corresponding knowledge can be output to help the external user.
[0003] However, in actual practice, users' questioning patterns are not fixed. Especially for some professional fields, it is difficult for users to organize correct names to express them. Therefore, it is often very difficult to accurately identify user intentions. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a voice guidance system and method for large-model intelligent question and answering to solve the problem of difficulty in identifying user intentions in the prior art.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] The present invention provides a voice guidance system for large-model intelligent question and answer, comprising the steps of:
[0007] An acquisition module, used to acquire a question text from an external user, wherein the question text is a text directly input by the external user, or is obtained by performing automatic speech recognition on the audio input by the external user;
[0008] A text processing module, used for segmenting the question text to obtain multiple keywords, and converting the multiple keywords into word vectors;
[0009] A matching module, used for matching the word vector with a question template in a pre-built industry library to obtain a matching degree, wherein the industry library includes a plurality of question and answer templates and knowledge materials of the plurality of question and answer templates, and the question and answer template includes a question template;
[0010] A confidence evaluation module, configured to, when the matching degree is less than a preset matching degree threshold, perform confidence evaluation on multiple single sentences in the question text based on a pre-built confidence evaluation model to obtain the confidence of the question text, wherein the confidence evaluation model includes the confidence of multiple words appearing simultaneously in a single sentence;
[0011] A guidance module is used to determine multiple question templates with the highest matching degree from the industry library based on the multiple keywords when the confidence of the question text is greater than zero and less than a preset confidence threshold, and guide external users based on the multiple question templates with the highest matching degree.
[0012] In an embodiment of the present application, the industry library includes a text library, and the construction process of the text library includes:
[0013] Obtain text materials on the target industry;
[0014] Segmenting the text material to obtain multiple text segments;
[0015] Performing triple extraction on the multiple text segments to obtain multiple triples, wherein the structure of the triples is head entity-relation-tail entity;
[0016] The triple entities are taken as nodes, and the nodes are connected based on the relationship between the triples to obtain the triple knowledge graph;
[0017] Calling a language model, generating multiple question templates based on multiple text fragments, and building a basic knowledge base based on the multiple question templates and corresponding text fragments, or building multiple questions according to the triple knowledge graph, and building a basic knowledge base based on the multiple questions and corresponding text fragments.
[0018] In an embodiment of the present application, the industry library includes an image library, and the construction process of the image library includes:
[0019] Extracting features from the image material to obtain material features, wherein the image material includes video material, audio material and image material;
[0020] Convert the industry materials into text to obtain a description text; and extract keywords from the description text to obtain text keywords;
[0021] Vectorizing the material characteristics to obtain a first characteristic vector A and a second characteristic vector B;
[0022] Constructing a composite vector C[A, B] based on the first feature vector A and the second feature vector B, and mixing the composite vector C[A, B] into an object with pre-labeled labels to obtain a mixed data set, wherein the labels include question labels and answer labels;
[0023] Clustering the mixed data set to obtain multiple data clusters, and using labels of objects in the same cluster as the synthetic vector C[A, B] as labels of the synthetic vector C[A, B];
[0024] An image library is constructed based on the synthetic vector C[A, B] and the label of the synthetic vector C[A, B].
[0025] In one embodiment of the present application, the process of constructing the confidence evaluation model includes:
[0026] Obtain corpus of target industry;
[0027] Perform word extraction on the corpus of the target industry to obtain multiple words, and extract the N entities with the highest frequency of occurrence from the multiple words to obtain the industry high-frequency entity E N ;
[0028] Extract each industry's high-frequency entity E from the multiple words N The associated word W N , and determine the high-frequency entity E in the industry N With the associated word W N The confidence level C(E N , W N ), where the conjunction W N For high frequency entities E N Words that appear in the same sentence, conjunctions W N It is an entity word or a relational word;
[0029]
[0030] In the formula, C is a fixed value, F(E N , W N ) is the industry high frequency entity E N With the associated word W N The frequency of occurrence in the same sentence, F(E N ) is the industry high frequency entity E N The frequency of occurrence of, X is the set frequency threshold, a is the scale factor, and b is the offset;
[0031] Based on multiple industry high frequency entities E N With multiple industry high frequency entities E N The confidence level of the associated word C(E N , W N )Build a confidence evaluation model.
[0032] In one embodiment of the present application, confidence evaluation is performed on multiple single sentences in the question text based on a pre-built confidence evaluation model to obtain the confidence of the question text, including:
[0033] Extracting words of the question text;
[0034] Compare the words in the question text with the high-frequency entities E in the confidence evaluation model NMake a match;
[0035] There is an industry high-frequency entity E in the question text i When determining the high-frequency entity E in the industry i The sentence where the word is located, and extract other words W in the sentence j ;
[0036] By querying the confidence evaluation model, the high-frequency entity E of the industry is determined i With the other words W j The confidence level C(E i , W j ), and sum up all the confidences of the question text to obtain the confidence of the question text ∑C(E i , W j ).
[0037] In one embodiment of the present application, when there are no high-frequency industry entities in the question text, a large language model will be called to perform an answer based on the question text.
[0038] In one embodiment of the present application, guiding external users based on multiple question templates with the highest matching degree includes:
[0039] Constructing guiding sentences based on multiple question templates with the highest matching degree;
[0040] The guiding sentence is output to an external user.
[0041] In one embodiment of the present application, it also includes:
[0042] When receiving a selection instruction from the user, an answer to the question template corresponding to the selection instruction is output, wherein the selection instruction is generated based on the guiding sentence.
[0043] In one embodiment of the present application, it also includes:
[0044] When no selection instruction from the user is received, a preset prompt is output to prompt the user to re-enter the question text.
[0045] The present application also provides a voice guidance method for large-model intelligent question answering, comprising the steps of:
[0046] Acquire a question text from an external user, wherein the question text is text directly input by the external user, or is obtained by performing automatic speech recognition on audio input by the external user;
[0047] Segmenting the question text to obtain multiple keywords, and converting the multiple keywords into word vectors;
[0048] Matching the word vector with a question template in a pre-built industry library to obtain a matching degree, wherein the industry library includes a plurality of question and answer templates and knowledge materials of the plurality of question and answer templates, and the question and answer template includes a question template;
[0049] When the matching degree is less than a preset matching degree threshold, confidence evaluation is performed on multiple single sentences in the question text based on a pre-constructed confidence evaluation model to obtain the confidence of the question text, wherein the confidence evaluation model includes the confidence of multiple words appearing simultaneously in a single sentence;
[0050] When the confidence of the question text is greater than zero and less than a preset confidence threshold, multiple question templates with the highest matching degrees are determined from the industry library based on the multiple keywords, and external users are guided based on the multiple question templates with the highest matching degrees.
[0051] The beneficial effects of the present invention are as follows: a voice guidance system and method for large-model intelligent question and answer of the present invention obtains the question text of an external user, then performs word segmentation and vectorization on the question text, and then matches the obtained word vector with the question template in the industry library to obtain the answer to the question. When there is no question template in the industry library whose matching degree with the word vector exceeds the matching threshold, the present application uses a pre-built confidence rating model to evaluate the confidence of the question text, so as to judge whether the question text input by the user is related to the corresponding industry, whether the multiple words appearing in a single sentence conform to the industry terminology habits, etc. When the confidence of the question text is greater than 0 and less than the preset confidence threshold, it means that the question text is related to the industry, but there is a problem with the question text. At this time, multiple question templates with the highest matching degree with the word vector of the question text are found, and a guiding sentence is constructed to guide the external user to ask questions. The present application guides the user to correctly express his intention through guidance, so as to obtain an answer that is more in line with the user's intention. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] The present invention will be further described below in conjunction with the accompanying drawings and embodiments:
[0053] Figure 1 It is a structural diagram of a voice guidance system for large-model intelligent question and answer shown in one embodiment of the present application;
[0054] Figure 2 This is a schematic diagram of the word vector conversion process in this application;
[0055] Figure 3 This is a schematic diagram of a boot process in an embodiment of the present application;
[0056] Figure 4 It is a flow chart of a voice guidance method for large-model intelligent question and answering shown in one embodiment of the present application;
[0057] Figure 5 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0058] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0059] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show the layers related to the present invention rather than being drawn according to the number, shape and size of the layers in actual implementation. In actual implementation, the type, quantity and proportion of each layer may be changed arbitrarily, and the layer layout may also be more complicated.
[0060] In the following description, numerous details are discussed to provide a more thorough explanation of embodiments of the present invention; however, it is apparent to one skilled in the art that embodiments of the present invention may be practiced without these specific details.
[0061] Figure 1 is a structural diagram of a large-model intelligent question-answering voice guidance system shown in an embodiment of the present application, such as Figure 1 As shown: A voice guidance system for large-model intelligent question and answer in this embodiment may include:
[0062] The acquisition module 110 is used to acquire a question text from an external user, wherein the question text is a text directly input by the external user, or is obtained by performing automatic speech recognition on the audio input by the external user;
[0063] The acquisition module 110 may acquire the question text of the external user through a network channel, and the external user may input the question text through a personal intelligent terminal.
[0064] A text processing module 120, configured to segment the question text to obtain a plurality of keywords, and convert the plurality of keywords into word vectors;
[0065] The text processing module 120 uses a word segmentation algorithm to perform word segmentation, such as a forward maximum matching algorithm, a reverse maximum matching algorithm, and a bidirectional maximum matching algorithm based on a vocabulary; a word segmentation method based on an N-gram language model of a statistical model, a word segmentation method based on HMM, a word segmentation method based on CRF, etc.
[0066] For example, an external user inputs a question text: "Rights Card Service Process", which can be decomposed into three words: "Rights Card", "Service" and "Process" through the word segmentation algorithm.
[0067] Figure 2 This is a schematic diagram of the word vector conversion process in this application. Figure 2 As shown in Figure 1, the conversion process of word vectors includes:
[0068] (1) segmenting the question text to obtain multiple words;
[0069] (2) Convert the multiple words into word vectors based on a table lookup, and extract the position codes of the multiple words based on an exponential function; the word vectors in this embodiment are converted by table lookup mapping, such as One-Hot encoding. The position code uses an exponential function to mark the position of each word.
[0070] (3) multiplying the word vector with a pre-constructed first parameter matrix W1 to obtain a word vector matrix; and multiplying the position code with a pre-constructed second parameter matrix W2 to obtain a position matrix;
[0071] (4) fusing the word vector matrix with the position matrix to obtain a fusion matrix;
[0072] (5) multiplying the fusion matrix by a pre-constructed third parameter matrix W3 to obtain a coding result;
[0073] (6) Convert the encoding result into a word vector based on table lookup.
[0074] The word vectors converted by the above process can be directly used as query vectors to perform query tasks in the industry database. The data in the industry database is also stored in the form of vectors converted by the above process. When matching, the vectors can be used to quickly execute matching algorithms, such as the cosine similarity algorithm.
[0075] A matching module 130, configured to match the word vector with a question template in a pre-built industry library to obtain a matching degree, wherein the industry library includes a plurality of question and answer templates and knowledge materials of the plurality of question and answer templates, and the question and answer template includes a question template;
[0076] Among them, the industry library in this application includes a text library and an image library. The text library is built based on text materials, and the image library is built based on videos and pictures.
[0077] Taking the text library as an example, the construction process of the text library includes:
[0078] (1) Obtain text materials of the target industry; the text materials can be PDF, text documents, etc.;
[0079] (2) segmenting the text material to obtain a plurality of text segments;
[0080] Specifically, the text material is segmented to obtain a plurality of text segments including:
[0081] Divide the article into sections and title levels within the article, with the smallest unit being paragraphs.
[0082] Divide the paragraph into m sentences according to the period
[0083] Determine the total length of the first i sentences that have not been assigned to any paragraph; when assigning for the first time, determine the total length of 1-i sentences.
[0084] When the total length of the first i sentences is less than or equal to N, the first i sentences are classified into the current paragraph;
[0085] When the total length of the first i sentences is greater than N, and the total length of the first i-1 sentences is less than N, the i-1th sentence, the i-th sentence, and the i+1th sentence are vectorized based on the pre-built encoder to obtain the first sentence vector, the second sentence vector, and the third sentence vector; the specific vectorization process is consistent with the vectorization process of the question text in the previous article, and will not be repeated here.
[0086] Calculate the first similarity between the first sentence vector and the second sentence vector, and calculate the second similarity between the second sentence vector and the third sentence vector; when the first similarity is greater than the second similarity, classify the i-th sentence into the current paragraph; when the first similarity is less than or equal to the second similarity, classify the i-th sentence as the first sentence not classified, and return to determine the total length of the first i sentences not classified into any paragraph, until all sentences are classified and multiple paragraphs are obtained.
[0087] In this embodiment, the above classification method is used to ensure that the length of each paragraph is as close to N as possible, thereby ensuring the consistency of the length and the coherence of the content of the paragraph, thereby providing a material basis for the establishment of a text library.
[0088] (3) performing triple extraction on the multiple text segments to obtain multiple triples, wherein the structure of the triples is head entity-relationship-tail entity;
[0089] In the text fragment, triples are extracted to construct a triple knowledge picture, for example: Wang Wei-occupation-poet, Wang Wei-birth year-693 AD.
[0090] (4) Taking the entities of the triples as nodes and connecting the nodes based on the relationships of the triples, a triple knowledge graph is obtained;
[0091] This application constructs a triple knowledge graph by merging the same entities, such as Wang Wei-occupation-poet-birth year-693 AD.
[0092] (5) Calling a language model, generating multiple question templates based on multiple text fragments, and constructing a basic knowledge base based on the multiple question templates and the corresponding text fragments, or constructing multiple questions according to the triple knowledge graph, and constructing a basic knowledge base based on the multiple questions and the corresponding text fragments.
[0093] This application generates question templates by calling the language model, for example, what is Wang Wei's occupation? In which year was Wang Wei born?
[0094] The above process directly uses files to build a text library. After building the text library, it is also necessary to build an image library to associate image materials with text materials. The construction process of the image library includes:
[0095] (1) extracting features from the image material to obtain material features, wherein the image material includes video material, audio material, and image material;
[0096] (2) converting the industry materials into text to obtain a description text; and extracting keywords from the description text to obtain text keywords;
[0097] (3) vectorizing the material characteristics to obtain a first characteristic vector A and a second characteristic vector B;
[0098] The audio material is extracted through a bidirectional LSTM and converted into a feature vector A through a coding table. The audio is converted into text through an ASR (Automatic Speech Recognition) model, and the obtained text is subjected to keyword extraction through a bidirectional LSTM and converted into a feature vector B through a coding table. The image is converted into a one-dimensional feature vector A through a CNN convolution; the image is converted into text through an OCR, and the obtained text is subjected to keyword extraction through a bidirectional LSTM and converted into a feature vector B through a coding table. For the video material, the audio track is first extracted to generate an audio file, and then the first feature vector A and the second feature vector B are obtained through the same processing steps as the audio material.
[0099] (4) constructing a composite vector C[A, B] based on the first feature vector A and the second feature vector B, and mixing the composite vector C[A, B] into an object with pre-labeled labels to obtain a mixed data set, wherein the labels include question labels and answer labels;
[0100] (5) clustering the mixed data set to obtain multiple data clusters, and using the labels of objects in the same cluster as the composite vector C[A, B] as the labels of the composite vector C[A, B];
[0101] (6) Construct an image library based on the synthetic vector C[A, B] and the label of the synthetic vector C[A, B].
[0102] This application mixes vector C into a bunch of pre-labeled objects, each of which is labeled with a QA label, and then clusters them to obtain a target cluster corresponding to vector C. The QA labels of other objects in the target cluster can be directly transferred to vector C, thereby automatically labeling vector C.
[0103] A confidence evaluation module 140 is used to perform confidence evaluation on multiple single sentences in the question text based on a pre-built confidence evaluation model to obtain the confidence of the question text when the matching degree is less than a preset matching degree threshold, wherein the confidence evaluation model includes the confidence of multiple words appearing in a single sentence at the same time;
[0104] The confidence in this application is used to evaluate whether the question text is relevant to the target industry and whether there is any inappropriate wording. A confidence of 0 means that the question text may not be relevant to the target industry, so a suitable answer cannot be matched from the industry library. A confidence between 0 and the matching threshold means that the question text is relevant to the target industry. However, for some reasons, the corresponding answer cannot be matched. The reasons include inappropriate wording, no corresponding knowledge in the industry library, etc.
[0105] The construction process of the confidence evaluation model includes:
[0106] (1) Obtain the corpus of the target industry; the corpus of the target industry can be consistent with the text material used to build the text library. You can also crawl the network corpus of the target industry as the corpus of the target industry.
[0107] (2) Extract words from the corpus of the target industry to obtain multiple words, and extract the N entities with the highest frequency of occurrence from the multiple words to obtain the industry high-frequency entity E N ;
[0108] This application divides the corpus into sentences according to punctuation marks, and then extracts words through a word segmentation algorithm. After obtaining the words, the frequency of occurrence of each word is counted, and the top N entities with the highest frequency are taken as the industry high-frequency entities E representing the target industry. N In addition to using statistical methods, manual labeling can also be used to obtain industry high-frequency entities E that can represent the industry. N .
[0109] (3) Extract each industry high-frequency entity E from the multiple words N The associated word W N , and determine the high-frequency entity E in the industry N With the associated word W N The confidence level C(E N , W N ), where the conjunction W N For high frequency entities E N Words that appear in the same sentence, conjunctions W N It is an entity word or a relational word;
[0110]
[0111] In the formula, C is a fixed value, F(E N , W N ) is the industry high frequency entity E N With the associated word W N The frequency of occurrence in the same sentence, F(E N ) is the industry high frequency entity E N The frequency of occurrence of, X is the set frequency threshold, a is the scale factor, and b is the offset;
[0112] Confidence C(E N , W N ) evaluates the industry's high-frequency entity E N With the associated word W N The probability of being used together in the same sentence. In this application, if the industry high-frequency entity E N With the associated word W NIf the frequency of transactions exceeds X, the high-frequency entity E in the industry can be fully trusted. N With the associated word W N Appearing in the same sentence, in this case, the confidence level is directly set to C.
[0113] If the industry high-frequency entity E N With the associated word W N If the frequency of the same entity exceeds 0 but does not exceed X, it means that the industry has a high-frequency entity E. N With the associated word W N The probability of using them together is low. In this case, by calculating the probability And use a as the scale factor and b as the offset to convert the probability Converted to confidence, where
[0114] If the industry high-frequency entity E N With the associated word W N The frequency of the same is 0, which means that in this industry, high-frequency entities E are generally not N With the associated word W N Among them, the conjunction W N It can be a word that has appeared in the corpus or a word that has not appeared. N To represent, in the subsequent matching, if the corresponding word is not found in the confidence rating model, W N Just assign the corresponding word.
[0115] (4) Based on multiple high-frequency entities E N With multiple industry high frequency entities E N The confidence level of the associated word C(E N , W N ) to build a confidence evaluation model. In order to facilitate subsequent matching, all words (high-frequency entities and related words) in the confidence evaluation model are stored in the form of word vectors, which can be converted according to the conversion method described above.
[0116] The above process was used to construct a confidence rating model for the target industry, which was used to evaluate whether there were any wording problems in the question text, providing a basis for subsequent guidance.
[0117] The confidence of the question text is obtained by performing confidence evaluation on multiple sentences in the question text based on a pre-built confidence evaluation model, including:
[0118] (1) Extract words from the question text; in addition, the extracted words need to be vectorized to obtain a query vector.
[0119] (2) Compare the words in the question text with the high-frequency entities E in the confidence evaluation modelN Make a match;
[0120] (3) There is an industry high-frequency entity E in the question text i When determining the high-frequency entity E in the industry i The sentence where the word is located, and extract other words W in the sentence j ;
[0121] Among them, there is an industry high-frequency entity E in the question text i , it can be said that the question text is related to the target industry. At this time, in order to further find the reason why the answer cannot be matched from the industry library, it is necessary to judge the confidence of the question text.
[0122] When there are no high-frequency industry entities in the question text, it means that the text output by the user is inconsistent with the target industry, and the industry library naturally cannot match the corresponding answer. At this time, the language model will be called to answer based on the question text.
[0123] (4) Determine the high-frequency entity E in the industry by querying the confidence evaluation model i With the other words W j The confidence level C(E i , W j ), and sum up all the confidences of the question text to obtain the confidence of the question text ∑C(E i , W j ).
[0124] This application directly searches for high-frequency entities E in the industry by querying the confidence evaluation model. i With other words W j The confidence level C(E i , W j ), and then the total confidence ∑C(E i , W j ). And the total confidence ∑C(E i , W j ) as the confidence of the question text.
[0125] The guidance module 150 is used to determine multiple question templates with the highest matching degree from the industry library based on the multiple keywords when the confidence of the question text is greater than zero and less than a preset confidence threshold, and guide external users based on the multiple question templates with the highest matching degree.
[0126] Specifically, it includes: constructing a guide sentence based on multiple question templates with the highest matching degree; and outputting the guide sentence to an external user.
[0127] For example: for searching: "Physical properties of anti-inflammatory drugs", no answer with a matching degree exceeding 95% is found in the industry database. After word segmentation, matching, and confidence calculation, it is determined that the question text is related to the target industry. At this time, multiple question templates with the highest matching degree are "Properties of anti-inflammatory drugs", "Time-dependent efficacy of anti-inflammatory drugs", etc. At this time, the guidance module 150 embeds multiple question templates with the highest matching degree into the preset template to generate: "Do you want to ask: Properties of anti-inflammatory drugs?" "Time-dependent efficacy of anti-inflammatory drugs?", thereby completing the guidance.
[0128] The user makes a selection based on the guidance and selects one of the questions as his or her intention.
[0129] When receiving a selection instruction from the user, an answer to the question template corresponding to the selection instruction is output, wherein the selection instruction is generated based on the guiding sentence.
[0130] When no selection instruction from the user is received, a preset prompt is output to prompt the user to re-enter the question text.
[0131] In addition, if the industry database does not match an answer with a matching degree exceeding the matching degree threshold, but the confidence is greater than the confidence threshold during the subsequent confidence evaluation, this means that there is no problem with the question text entered by the user, but the industry database does not include the corresponding knowledge point.
[0132] At this time, the guidance module 150 outputs: This model has not yet included this knowledge point.
[0133] Figure 3 Schematic diagram of the boot process in an embodiment of the present application, such as Figure 3 As shown, this application includes:
[0134] (1) Receive the user's question text;
[0135] (2) Segment and vectorize the question text to obtain word vectors;
[0136] (3) Match the word vector with the vector in the industry database to obtain the highest match;
[0137] (4) When the highest matching degree is greater than or equal to the preset matching degree threshold, the answer material corresponding to the highest matching degree is output; when the highest matching degree is less than the preset matching degree threshold, there may be a problem with the question text, or the corresponding answer industry library has not yet been included;
[0138] (5) When the highest matching degree is less than a preset matching degree threshold, the question text is evaluated by a preset confidence evaluation model to obtain the confidence of the question text;
[0139] (6) When the confidence of the question text is zero, it means that the question text is irrelevant to the industry, and the question text is handed over to the language model for processing; when the confidence of the question text is greater than zero and less than the preset confidence threshold, it means that there is a problem with the question text, and multiple question and answer templates with the highest matching degree with the question text are output for guidance; when the confidence of the question text is greater than or equal to the preset confidence threshold, it means that there is no problem with the user's question text, but the corresponding answer industry library has not yet been included.
[0140] A voice guidance system for large-model intelligent question and answer of the present invention obtains the question text of an external user, then performs word segmentation and vectorization on the question text, and matches the obtained word vector with the question template in the industry library to obtain the answer to the question. When there is no question template in the industry library whose matching degree with the word vector exceeds the matching threshold, the present application uses a pre-built confidence rating model to evaluate the confidence of the question text, so as to judge whether the question text input by the user is related to the corresponding industry, whether the multiple words appearing in a single sentence conform to the industry terminology habits, etc. When the confidence of the question text is greater than 0 and less than the preset confidence threshold, it means that the question text is related to the industry, but there is a problem with the question text. At this time, multiple question templates with the highest matching degree with the word vector of the question text are found, and a guiding sentence is constructed to guide external users to ask questions. The present application guides users to correctly express their intentions through guidance, so as to obtain answers that are more in line with the user's intentions.
[0141] like Figure 4 As shown, the present application also provides a voice guidance method for large-model intelligent question answering, comprising the steps of:
[0142] S410, obtaining a question text from an external user, wherein the question text is a text directly input by the external user, or is obtained by performing automatic speech recognition on an audio input by the external user;
[0143] S420, segmenting the question text to obtain multiple keywords, and converting the multiple keywords into word vectors;
[0144] S430, matching the word vector with a question template in a pre-built industry library to obtain a matching degree, wherein the industry library includes a plurality of question and answer templates and knowledge materials of the plurality of question and answer templates, and the question and answer template includes a question template;
[0145] S440, when the matching degree is less than a preset matching degree threshold, confidence evaluation is performed on multiple single sentences in the question text based on a pre-constructed confidence evaluation model to obtain the confidence of the question text, wherein the confidence evaluation model includes the confidence of multiple words appearing simultaneously in a single sentence;
[0146] S450, when the confidence of the question text is greater than zero and less than a preset confidence threshold, multiple question templates with the highest matching degree are determined from the industry library based on the multiple keywords, and external users are guided based on the multiple question templates with the highest matching degree.
[0147] A voice guidance method for large-model intelligent question and answer of the present invention obtains the question text of an external user, and then matches the obtained word vector with the question template in the industry library after word segmentation and vectorization to obtain the answer to the question. When there is no question template in the industry library whose matching degree with the word vector exceeds the matching threshold, the present application uses a pre-built confidence rating model to evaluate the confidence of the question text, so as to judge whether the question text input by the user is related to the corresponding industry, whether the multiple words appearing in a single sentence conform to the industry terminology habits, etc. When the confidence of the question text is greater than 0 and less than the preset confidence threshold, it means that the question text is related to the industry, but there is a problem with the question text. At this time, multiple question templates with the highest matching degree with the word vector of the question text are found, and a guiding sentence is constructed to guide the external user to ask questions. The present application guides the user to correctly express his intention through guidance, so as to obtain an answer that is more in line with the user's intention.
[0148] Figure 5 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Figure 5 The computer system 500 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0149] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 502 or the program loaded from the storage part 508 to the random access memory (RAM) 505, such as executing the method in the above embodiment. In RAM 503, various programs and data required for system operation are also stored. CPU 501, ROM 502 and RAM 503 are connected to each other through bus 504. Input / output (I / O) interface 505 is also connected to bus 504.
[0150] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed so that a computer program read therefrom is installed into the storage section 508 as needed.
[0151] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 509, and / or installed from a removable medium 511. When the computer program is executed by a central processing unit (CPU) 501, various functions defined in the system of the present application are executed.
[0152] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0153] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0154] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0155] Another aspect of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor of a computer, the computer executes the above method. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.
[0156] Another aspect of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method provided in each of the above embodiments.
[0157] The above embodiments are only preferred embodiments for fully illustrating the present application, and the protection scope of the present application is not limited thereto. Any equivalent substitution or change made by a person skilled in the art based on the present application is within the protection scope of the present application.
Claims
1. A voice guidance system for intelligent question and answer, characterized in that: include: An acquisition module, used to acquire a question text from an external user, wherein the question text is a text directly input by the external user, or is obtained by performing automatic speech recognition on the audio input by the external user; A text processing module, used for segmenting the question text to obtain multiple keywords, and converting the multiple keywords into word vectors; A matching module, used for matching the word vector with a question template in a pre-built industry library to obtain a matching degree, wherein the industry library includes a plurality of question and answer templates and knowledge materials of the plurality of question and answer templates, and the question and answer template includes a question template; A confidence evaluation module is used to perform confidence evaluation on multiple single sentences in the question text based on a pre-constructed confidence evaluation model when the matching degree is less than a preset matching degree threshold, so as to obtain the confidence of the question text, wherein the confidence evaluation model includes the confidence of multiple words appearing in a single sentence at the same time; the construction process of the confidence evaluation model includes: obtaining the corpus of the target industry; performing word extraction on the corpus of the target industry to obtain multiple words, and extracting the most frequently appearing word among the multiple words; Entities, get the industry's high-frequency entities ; Extract high-frequency entities of each industry from the multiple words Related words of , and identify high-frequency entities in the industry Related words Confidence , where the conjunction For high-frequency entities in the industry Words that appear in the same sentence, conjunctions It is an entity word or a relational word; In the formula, is a fixed value, High-frequency entities in the industry Related words The frequency of occurrence in the same sentence, High-frequency entities in the industry The frequency of occurrence of is the set frequency threshold, is the scale factor, Offset; based on multiple industry high-frequency entities With multiple industry high-frequency entities The confidence of the associated words Constructing a confidence evaluation model; performing confidence evaluation on multiple single sentences in the question text based on the pre-constructed confidence evaluation model to obtain the confidence of the question text, including: extracting words from the question text; comparing the words in the question text with high-frequency entities in the confidence evaluation model; Matching; There are high-frequency entities in the industry in the question text When determining the high-frequency entities in the industry The sentence where the word is located, and extract other words in the sentence ; Determine the high-frequency entities in the industry by querying the confidence evaluation model With the other words Confidence , and sum up all the confidences of the question text to obtain the confidence of the question text ; A guidance module is used to determine multiple question templates with the highest matching degree from the industry library based on the multiple keywords when the confidence of the question text is greater than zero and less than a preset confidence threshold, and guide external users based on the multiple question templates with the highest matching degree.
2. According to claim 1, the voice guidance system for intelligent question and answer is characterized in that: The industry library includes a text library, and the construction process of the text library includes: Obtain text materials on the target industry; Segmenting the text material to obtain multiple text segments; Performing triple extraction on the multiple text segments to obtain multiple triples, wherein the structure of the triples is head entity-relation-tail entity; The triple entities are taken as nodes, and the nodes are connected based on the relationship between the triples to obtain the triple knowledge graph; Calling a language model, generating multiple question templates based on multiple text fragments, and building a basic knowledge base based on the multiple question templates and corresponding text fragments, or building multiple questions according to the triple knowledge graph, and building a basic knowledge base based on the multiple questions and corresponding text fragments.
3. According to the intelligent question-answering voice guidance system of claim 1, it is characterized in that: The industry library includes an image library, and the construction process of the image library includes: Extracting features from image materials to obtain material features, wherein the image materials include video materials, audio materials, and image materials; Converting the image material into text to obtain a description text; and extracting keywords from the description text to obtain text keywords; Vectorize the material characteristics to obtain the first eigenvector and the second eigenvector ; Based on the first feature vector and the second eigenvector Construct the composite vector C\left [ {A,B} \right ] , and the resultant vector C\left [ {A,B} \right ] Mixing into the pre-labeled objects to obtain a mixed data set, wherein the labels include question labels and answer labels; Cluster the mixed data set to obtain multiple data clusters, and combine them with the synthetic vector C\left [ {A,B} \right ] The labels of objects in the same cluster are used as the composite vector C\left [ {A,B} \right ] Labels; Based on the synthetic vector C\left [ {A,B} \right ] and the resultant vector C\left [ {A,B} \right ] The labels are used to build the image library.
4. According to claim 1, the voice guidance system for intelligent question and answer is characterized in that: When there are no high-frequency industry entities in the question text, the language model will be called to perform an answer based on the question text.
5. The voice guidance system for intelligent question and answer according to claim 1, characterized in that: Guide external users based on multiple most matching question templates, including: Constructing guiding sentences based on multiple question templates with the highest matching degree; The guiding sentence is output to an external user.
6. The voice guidance system for intelligent question and answer according to claim 5, characterized in that: Also includes: When receiving a selection instruction from the user, an answer to the question template corresponding to the selection instruction is output, wherein the selection instruction is generated based on the guiding sentence.
7. The voice guidance system for intelligent question and answer according to claim 5, characterized in that: Also includes: When no selection instruction from the user is received, a preset prompt is output to prompt the user to re-enter the question text.
8. A voice guidance method for intelligent question and answer, characterized in that: Includes steps: Acquire a question text from an external user, wherein the question text is text directly input by the external user, or is obtained by performing automatic speech recognition on audio input by the external user; Segmenting the question text to obtain multiple keywords, and converting the multiple keywords into word vectors; Matching the word vector with a question template in a pre-built industry library to obtain a matching degree, wherein the industry library includes a plurality of question and answer templates and knowledge materials of the plurality of question and answer templates, and the question and answer template includes a question template; When the matching degree is less than a preset matching degree threshold, a confidence evaluation is performed on multiple single sentences in the question text based on a pre-constructed confidence evaluation model to obtain the confidence of the question text, wherein the confidence evaluation model includes the confidence of multiple words appearing in a single sentence at the same time; the construction process of the confidence evaluation model includes: obtaining the corpus of the target industry; performing word extraction on the corpus of the target industry to obtain multiple words, and extracting the most frequently appearing word among the multiple words; Entities, get the industry's high-frequency entities ; Extract high-frequency entities of each industry from the multiple words Related words of , and identify high-frequency entities in the industry Related words Confidence , where the conjunction For high-frequency entities in the industry Words that appear in the same sentence, conjunctions It is an entity word or a relational word; In the formula, is a fixed value, High-frequency entities in the industry Related words The frequency of occurrence in the same sentence, High-frequency entities in the industry The frequency of occurrence, is the set frequency threshold, is the scale factor, is an offset; based on multiple industry high-frequency entities With multiple industry high-frequency entities The confidence of the associated words Constructing a confidence evaluation model; performing confidence evaluation on multiple single sentences in the question text based on the pre-constructed confidence evaluation model to obtain the confidence of the question text, including: extracting words from the question text; comparing the words in the question text with high-frequency entities in the confidence evaluation model; Matching; There are high-frequency entities in the industry in the question text When determining the high-frequency entities in the industry The sentence where the word is located, and extract other words in the sentence ; Determine the high-frequency entities in the industry by querying the confidence evaluation model With the other words Confidence , and sum up all the confidences of the question text to obtain the confidence of the question text ; When the confidence of the question text is greater than zero and less than a preset confidence threshold, multiple question templates with the highest matching degrees are determined from the industry library based on the multiple keywords, and external users are guided based on the multiple question templates with the highest matching degrees.
Citation Information
Patent Citations
Intelligent question answering system and method based on question matching
CN114003709A
Question and answer matching method and device, electronic equipment and storage medium
CN115221298A
