Intelligent assistant method and system based on large model
By building a vector knowledge base and using a large model intelligent assistant method, the problems of low matching speed and accuracy of intelligent assistants in existing technologies are solved, and more accurate understanding of user needs and answer generation are achieved.
Patent Information
- Application Number
- CN202510881810.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-27
- Publication Date
- 2025-10-17
AI Technical Summary
Existing intelligent assistant technology has problems with slow matching speed and low accuracy in knowledge retrieval and business processing, and large models are unable to deeply understand user semantics, resulting in the inability to provide satisfactory answers.
Build a vector knowledge base, store original knowledge documents and question-answer pairs as a vector database, combine large models for retrieval enhancement, generate answers through entity and intent recognition, use pre-trained speech recognition models to improve the recognition efficiency of voice input, and select appropriate tools for processing according to different scenarios.
It improves the accuracy and speed of knowledge matching, can more accurately understand user needs, provide answers that are more in line with user intentions, and meet the needs of different scenarios.
Smart Images

Figure CN120806133A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of large model applications, and in particular to a large model-based intelligent assistant method and system. BACKGROUND
[0002] The existing intelligent assistant technology has two problems. First, the conventional rule matching method is used for knowledge retrieval, and the matching content is less. When the knowledge rules are too many, the matching speed will decrease, and the matching accuracy is strongly dependent on the matching rules. Second, the current conventional intelligent assistant only supports some knowledge feedback and does not support business handling. These two aspects limit the expansion of the intelligent assistant capability, resulting in a lack of flexibility and adaptability. Therefore, when facing complex scenarios, the intelligent assistant cannot effectively handle the situation, and the answer cannot satisfy the user.
[0003] Large model technology refers to a class of artificial intelligence models with a large number of parameters constructed by a neural network structure. In the traditional natural language processing field, a large language model is often used to complete natural language processing. The large language model is a deep learning model trained using a large amount of text data. The model learns and simulates the complex rules of human language through a layer-by-layer neural network structure, achieving a text generation capability close to human level. The large language model can achieve deep thinking of user intent through context text, thereby obtaining an answer more in line with the user's intent. However, the large model itself does not have the ability to handle business and is prone to "hallucinations" during data processing. Therefore, the existing large model-based intelligent assistant technology cannot deeply understand user semantics and can only mechanically perform rule matching, which cannot accurately grasp the user's needs and provide more accurate problem-solving strategies. SUMMARY
[0004] To solve the above problems, the present application provides a large model-based intelligent assistant method and system. The original knowledge file and the related information of the existing question and answer pairs are cut into vectors and stored in a vector database to form a vector knowledge base. The vector knowledge base is used as an external retrieval data source to enhance the retrieval of the large model. The large model is used to identify user intent and select tools, and the corresponding processing feedback is obtained according to different tool types.
[0005] According to some embodiments, the present application adopts the following technical solution: A large model-based intelligent assistant method for providing question and answer results for user questions, comprising: Constructing entity recognition prompt words to identify entities in user questions through a large model; Constructing intent recognition and tool selection prompt words to identify user intent in user questions through a large model and determine the tools to be used; Retrieving relevant information from a pre-constructed vector knowledge base based on the assembled user question and entity, and the large model combines the retrieved relevant information to enhance the generation of answer text; According to the user intention and the tool, the answer text is processed, and the final question and answer result is output; The construction of the vector knowledge base is that the intelligent question and answer pair is obtained from the original knowledge file by using the large model, the existing question and answer pair is fused to form a question and answer data set, the original knowledge file and the question and answer data set are stored in a vector database, and the vector knowledge base is formed.
[0006] According to some embodiments, the present application adopts the following technical scheme: An intelligent assistant system based on a large model is used to provide question and answer results for user questions, comprising: A first recognition module is configured to construct an entity recognition prompt word and identify entities in a user question by using a large model; A second recognition module is configured to construct an intention recognition and tool selection prompt word, identify the user intention in the user question by using a large model, and determine the tool to be used; An enhanced generation module is configured to retrieve relevant information from a pre-constructed vector knowledge base based on the assembled user question and entity, and the large model combines the retrieved relevant information to enhance the generation of answer text; An answer processing module is configured to process the answer text according to the user intention and the tool, and output the final question and answer result; The construction of the vector knowledge base is that the intelligent question and answer pair is obtained from the original knowledge file by using the large model, the existing question and answer pair is fused to form a question and answer data set, the original knowledge file and the question and answer data set are stored in a vector database, and the vector knowledge base is formed.
[0007] According to some embodiments, the present application adopts the following technical scheme: A computer program product comprising a computer program, which, when executed by a processor, implements the intelligent assistant method based on a large model.
[0008] According to some embodiments, the present application adopts the following technical scheme: A non-transitory computer readable storage medium for storing computer instructions, which, when executed by a processor, implements the intelligent assistant method based on a large model.
[0009] According to some embodiments, the present application adopts the following technical scheme: An electronic device comprises a processor, a memory and a computer program; wherein the processor is connected with the memory, and the computer program is stored in the memory; when the electronic device is running, the processor executes the computer program stored in the memory, so that the electronic device executes the method for realizing the intelligent assistant based on a large model.
[0010] Compared with the prior art, the beneficial effects of the present application are: The intelligent assistant method and system based on a large model provided by the present application provide retrieval enhancement for a large model based on the context retrieval and deep thinking capabilities of the large model, using a vector knowledge base as retrieval material, solve the limitations that traditional intelligent assistants cannot deeply understand user semantics and can only mechanically perform rule matching, and can more accurately grasp the needs of users and give more accurate problem solving strategies.
[0011] The intelligent assistant method based on a large model provided by the present application, in the vector knowledge base construction process, first, the original knowledge files are uniformly converted into markdown format, which is beneficial to reduce the influence of the difference between text structures of different formats on data analysis. Second, in addition to the original knowledge files, the knowledge base also increases the question and answer pair information to enrich the original knowledge data set. The question and answer pair content is a concise and accurate question and answer, which effectively helps the large model to accurately answer; in addition to the historical accumulated question and answer pair information, the intelligent question and answer pair information extracted from the original knowledge files by the large model is also used to enrich the question and answer pair content, improve the accuracy and accuracy of matching. Third, different cutting strategies are adopted for different data to be cut, and different key information is added in different cutting, which can effectively guarantee the integrity of the data and improve the accuracy of matching; fourth, index fields are added for specific fields (such as profile information) to improve the efficiency of retrieval.
[0012] The intelligent assistant method based on a large model provided by the present application, in the original problem processing stage, uses a pre-trained speech recognition model to convert the voice input text, and in the pre-training process, uses relevant corpus for pre-training to improve the recognition efficiency of the speech recognition model for professional field vocabulary, and obtains more accurate text to improve the accuracy of subsequent large model recognition.
[0013] The intelligent assistant method based on a large model provided by the present application, in the entity recognition stage, according to the preset entity of the business field, the entity is highly related to the profile information and the professional knowledge of the business field in the vector knowledge base, and each entity is preset with related values, which can help the large model to more accurately match the related knowledge field and reduce the retrieval range.
[0014] The application provides a large model-based intelligent assistant method, in an intent recognition and tool selection stage, presetting an intent scene to which an intelligent assistant can be applied, and presetting tools available for each scene, requiring a large model to select different tools according to different intents to realize data routing of different scenes, and preventing the large model from being randomly used.
[0015] The application provides a large model-based intelligent assistant method, in an information retrieval stage, first, splicing original problem text and recognized entities and matching with a vector knowledge base to improve matching speed through keyword and problem matching, second, using a sparse vector matrix and a dense vector matrix to obtain a related matching set, which can effectively avoid the knowledge 'leakage' phenomenon caused by one matching mode, and improve the accuracy of problem matching, third, reordering matching results to improve the arrangement order of knowledge with higher similarity to improve matching efficiency, and fourth, preferentially using matched knowledge to answer, reducing inaccurate answers caused by large model 'hallucination'.
[0016] The application provides a large model-based intelligent assistant method, in an answer output feedback stage, according to different scenes, different processing is performed, different needs of users in different scenes can be met, and practicability is improved. BRIEF DESCRIPTION OF DRAWINGS
[0017] The accompanying drawings, which form a part of this specification, are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification. The embodiments of these drawings are set forth to explain the present application and do not limit the present application in any manner.
[0018] Figure 1 A large model-based intelligent assistant method flowchart of embodiment 1. Figure 2 A medical insurance vector knowledge base construction method flowchart of embodiment 1.
[0019] Figure 3 A medical insurance intelligent processing process diagram based on a large model of embodiment 1.
[0020] Figure 4 An original matching text and medical insurance vector knowledge base matching method flowchart of embodiment 1. DETAILED DESCRIPTION
[0021] The application will be further described below in conjunction with the drawings and embodiments.
[0022] It should be noted that the following detailed description is exemplary and is intended to provide further explanation of the application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as generally understood by one of ordinary skill in the art to which the application belongs.
[0023] It is to be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of example embodiments in accordance with the present application. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in this specification, specify the presence of stated features, steps, operations, elements, components, and / or groups thereof, but do not preclude the presence or addition of one or more other features, steps, operations, elements, components, and / or groups thereof.
[0024] Embodiment 1 Retrieval-augmented Generation is one of the current popular large model front technologies, which combines language models and information retrieval techniques to retrieve relevant information from a large document set, and then uses this retrieved information to guide text generation, which can improve the quality and accuracy of large model prediction; the intelligent assistant method and system based on large model described in this embodiment combines the current intelligent assistant technology, large language model and retrieval enhancement technology, so as to help the intelligent assistant to better complete knowledge retrieval, business recommendation and other work, including: Step one, build entity recognition prompt words, identify entities in user questions through large models; Step two, build intent recognition and tool selection prompt words, identify user intent in user questions through large models, and determine the tools to be used; Step three, based on the assembled user question and entity, retrieve relevant information from the pre-constructed vector knowledge base, and the large model combines the retrieved relevant information to enhance the generation of answer text; Step four, according to the user intent and the tool, process the answer text, and output the final question and answer result; Among them, the construction of the vector knowledge base is to use a large model to obtain intelligent question and answer pairs from original knowledge files and existing question and answer pairs to form a question and answer data set, store the original knowledge files and the question and answer data set into a vector database, and form a vector knowledge base.
[0025] The implementation process of the medical insurance intelligent assistant method based on a large model will be described in detail below with medical insurance question and answer as a specific application scenario, as shown in Figure 1 , specifically as follows: Step S1: Preprocess the original knowledge file, extract the knowledge profile information of the file, use a large model to obtain intelligent question and answer pairs from the original knowledge file and existing question and answer pairs to form a question and answer data set, store the original knowledge file and the question and answer data set into a vector database, and form a medical insurance vector knowledge base, as shown in Figure 2 . Step S11: preprocessing the original knowledge file, generating a file unique identification code based on the file content, and converting the original knowledge file into Markdown format. The original knowledge file includes policy documents, guidelines, business processes, and policy interpretations.
[0026] Step S111: Batch number generation file id for original knowledge file, md5 encryption based on document content, get encrypted file unique identification code, store file name, file id, file unique identification code, file path to database to form original knowledge file information.
[0027] Step S112: Remove duplicate files according to the file unique identification code.
[0028] Step S113: Format conversion of original knowledge file, convert original knowledge file to Markdown format through different data conversion methods according to original knowledge file format to avoid differences in subsequent processing logic, converted file id is consistent with original knowledge file id, save converted file document path information to corresponding original knowledge file information.
[0029] Step S12: File knowledge profile extraction, prefer regular expressions to obtain relevant knowledge, manually maintain if regular expressions cannot be obtained, relevant knowledge profile information includes region, validity period, and business scope.
[0030] Step S121: The region identification based on regular expression, identify the region of the input document to obtain the geographical region of the document. Analyze the Markdown file of the input document, process the title information and text content in the file, combine regular expressions and string matching to extract address information, and save the region information to the corresponding original knowledge file information.
[0031] Step S122: The effective period identification based on regular expression, identify the time information of the input document to determine the effective period of the document content. Analyze the Markdown file of the input document, construct a regular expression for time identification, extract time information with keywords such as "effective since publication date", "effective period expires", and "annual". Traverse each sentence in the document and use regular expressions to match the time information. Determine the effective deadline of the document based on the context understanding, if there is no effective period, do not extract, finally save the effective deadline to the corresponding original knowledge file information in a data structure.
[0032] Step S123: The regular expression-based business category identification identifies the business category to which the document belongs. The business category should be a further classification of the complex business field, such as insurance, payment, reimbursement, etc. in the medical insurance field, corresponding to the original knowledge file information, so as to perform subsequent field-related question and answer processing.
[0033] The Markdown file of the input document is parsed, the title information and menu information in the file are processed, the regular expression for business type identification is constructed, the business types with keywords such as "insurance policy", "payment policy", "reimbursement standard", "maternity benefits" are extracted, and the corresponding business category code information is obtained by matching with the stored business category in the library. With the help of context understanding, it is further judged whether the business category is accurate, and the final business category is saved to the corresponding original knowledge file information.
[0034] Original knowledge file information structure: {file name, file id, file unique identification code, file path storage, converted file document path, belonging area, valid period, business category} Step S13: The traditional accumulated medical insurance question and answer pairs are processed, and the effective question and answer pairs are extracted based on the original knowledge file using a large model. The processed accumulated medical insurance question and answer pairs and the effective knowledge question and answer pairs generated by the large model are merged to form a medical insurance intelligent question and answer data set.
[0035] Step S131: The traditional accumulated medical insurance question and answer pairs are processed, and the knowledge profile information such as belonging area, valid period, and business category is added to form an accumulated question and answer pair data set, including question number, question, answer, belonging area, valid period, and business category fields. The accumulated question and answer pairs include traditional question and answer accumulated question and answer pairs and official answer question and answer pairs.
[0036] Step S132: Based on the original knowledge file, the effective intelligent question and answer pairs are extracted using a large model, and the intelligent question and answer pairs generated by the large model are audited to ensure the accuracy of the question and answer.
[0037] Step S1321: Data assembly, for each original knowledge file, the profile information and the content of the converted Markdown file are merged to form question and answer pair extraction source data, providing source data for subsequent large model prompt words. The merged question and answer pair extraction source data structure is as follows: {profile information (belonging area, valid period, business category) + converted file data}.
[0038] Step S1322: Question and answer pair extraction prompt assembly is used to assist the large model in understanding and extracting the document content, mainly composed of "question and answer pair extraction role definition", "question and answer pair extraction task description", "question and answer pair extraction text content", "question and answer pair extraction example", and "question and answer pair extraction restriction condition".
[0039] The question and answer pair extraction role definition indicates the role of the large model, such as "you are a business expert in the medical insurance field, good at extracting key knowledge".
[0040] The question and answer pair extraction task description requires the large model to extract question and answer pairs from the text content and propose extraction requirements.
[0041] The question and answer pair extraction text content is the question and answer pair extraction source data structure spliced in step S1321; The question and answer pair extraction restriction condition proposes restriction conditions for question and answer pair extraction, including at least that the question and answer pair is derived from the text content, the question and answer pair representation, the question and answer pair quality requirement, and the question and answer pair extraction number requirement.
[0042] The question and answer pair extraction example provides a reference extraction example for the large model, which should include an input text segment example and a question and answer pair example generated based on the text segment.
[0043] Step S1323: Use the large model to extract question and answer pairs and filter based on the restriction conditions of the question and answer pair extraction prompt, to obtain valid question and answer pairs in the document. The prompt generated in step S1322 is transmitted to the large model, and the result information output by the large model is obtained. The question and answer result is parsed according to the data format required by the prompt, and the question and answer pair information output by the large model is obtained.
[0044] Step S1324: Add profile information to the question and answer pairs generated by the large model, and use the profile information (including the region, validity period, and business category) in the original knowledge file information as the profile information of the question and answer pairs generated for the corresponding file.
[0045] Step S1325: Audit and adjust the question and answer pairs generated by the large model to ensure the accuracy of the model generation results, and optimize the prompt of the large model according to the audit effect to improve the efficiency of the large model in identifying question and answer pairs.
[0046] Step S133: Merge the original accumulated question and answer pairs and the question and answer pairs generated by the large model to form a medical insurance problem data set, and store the problem data set data in the database according to a fixed format.
[0047] The storage method should be: {question number, question, answer, region, validity period, business category}.
[0048] Step S14: The medical insurance problem data set and the Markdown file corresponding to the original knowledge file are cut according to the rules, the document is cut into data blocks more suitable for storage and retrieval, and the medical insurance vector knowledge base is formed by storing the data blocks into the vector database.
[0049] Step S141: For the medical insurance problem data set, a question and answer type cutting method is used for processing, and the question and answer pairs are cut and stored in a vector.
[0050] Specifically, the question and answer pair cutting method extracts the question, answer, belonging area, valid period, and business category of each question based on the question and answer pair information stored in the medical insurance problem data set, and judges the size of all information corresponding to each question. When the size of all information is less than 4000 characters, all information of the question is cut into one block. When the size of all information is higher than 4000 characters, the size of the question and answer is calculated, and the question information is cut into multiple blocks, each with a size less than 4000 characters, and each cut block should contain question, answer cut block, belonging area, valid period, and business category.
[0051] Specifically, each question cut block after cutting processing should contain the following contents: (cut block id, question number, question, answer / answer cut block, belonging area, valid period, business category).
[0052] Step S142: Title type cutting, if there is a title in the document structure based on the converted document in Markdown format, the title type cutting algorithm is used for processing.
[0053] Specifically, the document to be cut is traversed, and each line is checked to see if it is a title. When it is a title, it is put into the title set. If it is a text, it is put into the text set with the title. The document is cut according to the smallest title, and each cut block contains the smallest title and the corresponding text content. The size of the cut block is analyzed, and the smaller cut block is merged with other cut blocks under the upper title until the best cut block size (such as 256b, 512b) is reached. If all cut blocks under the upper title are still smaller than the best cut block, all titles and texts under the upper title are merged into one cut block, and so on.
[0054] Specifically, after merging and arranging the cut blocks, the corresponding upper title content is added to each cut block according to the title set content, such as a three-level title cut block that needs to add a two-level title.
[0055] Specifically, the file profile information is supplemented for each cut block, and the profile information of the original knowledge file is used as the profile information of each cut block.
[0056] Specifically, each title type cut block should contain the following contents: (chunk id, file id, region, valid period, business category, title and content under the title) Step S143: For the document that cannot use the title type chunk, the general type chunk is used, and the general type algorithm is used for chunk processing.
[0057] Specifically, in the general chunking mode, based on the Markdown format document, the standard size of each block is freely selected between 256-1024 characters, the context is accurately cut according to the set split symbol “"\n\n","\n","。|!|?","\.\s|\!\s|\?\s",";|;\s",",|,\s"”, and the overlapping part between adjacent data blocks is controlled to be kept within 128 characters as much as possible, thereby ensuring the integrity of each block of content.
[0058] Specifically, after the document is chunked, file profile information is supplemented for each chunk, and the profile information of the original knowledge file is used as the profile information of each chunk.
[0059] Specifically, each general type chunk should include the following contents: (file id, region, valid period, business category, chunk content).
[0060] Step S144: The chunked data is stored in the vector database by converting the chunking result into a vector through text embedding, forming a medical insurance vector knowledge base; on the basis of the medical insurance vector knowledge base, a vector index is constructed, and an index is created relying on the file name, the region, the business category, the valid period and the like, which is used for realizing fast vector retrieval.
[0061] Step S2: input the user's original question, and process the original question, analyze the user's intention through a large model, and select appropriate tools, process and feedback according to the identified intention and selected tools, and the relevant business scope includes medical insurance business handling, policy retrieval, business guide, chat and others, as shown in Figure 3 . Step S21: obtain the input question, support multiple input methods including but not limited to keyboard input and voice input, judge the format of the input question, if the input format is voice, execute step S22, if the input question format is text, the input is the original question text, execute step S23.
[0062] Step S22: use a pre-trained speech recognition model to convert the input voice file into a processable text format.
[0063] Step S221: Pre-training the open-source speech recognition model using medical insurance related voice data to improve the recognition efficiency of professional field voice.
[0064] Step S2211: Data preparation, collect and label a large amount of voice data consistent with the medical insurance scene, such as medical insurance related dialogue, medical insurance policy file broadcast voice, medical diagnosis and treatment process voice, etc.), the data should cover common medical insurance, medical terms (such as drug names, reimbursement ratio, diagnosis and treatment items, medical insurance types, etc.), the data should cover different speakers, different background noise, different speech speed and other diversified conditions.
[0065] Step S2212: Divide the voice data into training set and validation set according to a certain proportion, select a smaller learning rate (such as 1e-5), and monitor the performance of the medical insurance related validation set during the training process, complete the model pre-training.
[0066] Step S222: Input the voice file into the pre-trained speech recognition model, process the audio signal by the model, and output the corresponding text information to form the original question text.
[0067] Step S23: Construct an entity recognition agent, and use the power of a large model to identify and extract key entities in the original question text.
[0068] Step S231: Define entity types, define entities through enumeration based on the classification method of medical insurance business data, and the entity should be key information with classification attributes related to the business. In this embodiment, the year, validity period, population category, business category, and belonging medical insurance division can be enumerated as entity information. According to the business situation, an entity information is prepared for each entity, and each entity information should include entity code, entity name, and mapping relationship. The entity code is a unique identification ID of the entity; the entity name is the Chinese identification name of the entity; and the mapping relationship is the possible value of the entity, such as the population category can be {workers: A; residents: B; flexible employment: C}.
[0069] Step S232: Assemble entity recognition prompt words to assist the large model in understanding and identifying entities, which mainly consists of "entity recognition role definition", "entity range", "entity recognition restriction conditions", etc. Combine the original question with the context to assemble complete prompt word information.
[0070] The entity recognition role definition is to formulate the role of the large model at this stage, such as "you are still an entity recognition expert, and can accurately identify the key words in the user's request".
[0071] The entity range is all the entity information defined in step 231. The entity recognition restriction condition: should contain the format requirement of output, the entity recognition content requirement, output the entity code and entity value according to the requirement, and require the large model to contact the context for auxiliary extraction.
[0072] Step S233: submit the entity recognition prompt word and the question text to the large model, identify the contained entity information from the question text according to the prompt word by the large model, including entity code and entity value, output the question entity information, if the original question text and the entity are not related, output null value.
[0073] Step S24: construct an intent recognition and tool selection agent, set the intent range and the corresponding tool, generate an intent recognition and tool prompt word, further analyze the user's true intent with the help of the large model, clarify the direction of this round of question, and determine the medical insurance tool to be used.
[0074] Step S241: intent range setting, based on the business scope of medical insurance intelligent question and answer, circle the known intent categories, including policy retrieval, business guide, chat, medical insurance business handling and others. Each intent should contain intent name and intent description.
[0075] Step S242: set the tools that can be used by medical insurance intelligent question and answer according to the intent range category, to facilitate the large model to identify.
[0076] Step S2421: for business handling type demand, according to the type of business handling, formulate exclusive tools for all businesses that can provide online handling, each business corresponds to a tool.
[0077] Specifically, each business tool should contain tool code, tool name, tool description, tool type and tool access method. The tool code is the unique identification code of the tool; the tool name should be the business name, the tool description is a brief Chinese description of the purpose of the tool; the tool type is the corresponding business type, including dynamic query and function jump; the tool access method is the access method of calling the tool, using QL expression to represent the access method of the tool.
[0078] Step S2422: for policy query type, business guide type, chat type and other intents, formulate an exclusive tool respectively, each tool needs to contain tool code, tool name and tool description, and formulate an additional medical insurance bottom tool to solve the intents related to medical insurance but cannot be identified as business handling, policy query and business guide type.
[0079] Specifically, a policy retrieval tool is developed, wherein the tool code is a unique identification symbol, the tool name is policy retrieval, and the tool description is used to indicate the types of policies that can be queried, such as employee insurance payment policy, resident insurance payment policy, long-term care insurance payment policy, employee reimbursement policy, resident reimbursement policy, childbirth reimbursement policy, and long-term care reimbursement policy.
[0080] Specifically, a service guide tool is developed, wherein the tool code is a unique identification symbol, the tool name is service guide, and the tool description is used to provide service guides for medical insurance-related businesses, such as how to query, how to handle, where to handle, and how to handle.
[0081] Specifically, a medical insurance business bottom-up tool is developed, which is selected when the user's intention is related to medical insurance but no corresponding tool is found. The tool code is a unique identification code, the tool name is medical insurance business bottom-up tool, and the tool description indicates the use of this tool to query, handle, and consult medical insurance business when there is no suitable tool.
[0082] Specifically, a chat tool is developed, wherein the tool code is a unique identification symbol, the tool name is chat, and the tool description is used to provide non-medical insurance business category chat, requiring the large model to answer through its own ability.
[0083] Step S243: Assemble the intent and tool selection prompt words, which are used to assist the large model in understanding and identifying the intent, selecting and applying the tool, and mainly composed of "intent and tool selection role definition", "user intent range", "tool list", "intent and tool selection limit conditions", "intent and tool selection context", etc. to assemble complete prompt word information.
[0084] The intent and tool selection role definition: specifies a role for the large model in this stage to achieve intent recognition and medical insurance tool selection.
[0085] The user intent range: the intent categories and intent descriptions set in step S241.
[0086] The tool list: the complete tool list set in step S242, including the tool code, tool name, and tool description of each tool.
[0087] The intention and tool selection restriction condition: requiring the large model to select the user intention from the user intention according to the context and the current round of user request, and selecting the corresponding tool according to the user intention. The intention is to handle the business, and the highly similar business handling tool is selected from the business handling tool; the intention is to handle the business guide, and the business guide tool is selected, and the large model is required to select a number of related business tools in the candidate tool list; the intention is to search for policies, and the policy search tool is selected; the intention is to chat, and the chat tool is selected; the intention is to select the medical insurance business bottom-up tool.
[0088] The intention and tool selection context: including the current problem and the historical problem, assisting the large model to understand the user intention.
[0089] Step S244: intention and tool identification, inputting the user question and intention and the tool selection prompt word into the large model, the large model performing analysis and screening according to the prompt word information, outputting the question and answer result according to the data format required by the prompt word, so as to obtain the intention and tool output by the large model.
[0090] Step S245: when the intention recognition is policy search, business guide, chat, other, step S25 is executed, and when the medical insurance business handling is recognized, step S26 is executed.
[0091] Step S25: search enhancement generation, combining the framework of information search and text generation, searching for related information from the knowledge base, and inputting the information as a prompt word to the large model, enhancing the ability of the model to process knowledge-intensive tasks, and obtaining the answer text, as shown in Figure 4 Step S251: when the user intention is policy search, business guide and other, the original question and the recognized entity are assembled and matched with the medical insurance vector knowledge base through vector similarity to obtain related knowledge data for search enhancement.
[0092] Step S2511: through the original question text and the entity recognition result of step S233, the information such as year, business category, population category and belonging area is assembled, the question and the entity assembly result are spliced into the original matching text, and the vector similarity is matched with the problem data set in the medical insurance knowledge base and the cut data of the original knowledge file. In the matching process, the entity information is matched first to narrow the search data range, and then the original matching text is used to match the problem data set and the cut data of the original knowledge file.
[0093] Step S2512: Use BM25 (Best Matching 25) to convert the original matching text into a sparse vector matrix, and match it with the question dataset and the original knowledge file blocks in the medical vector knowledge base. The matching with the question dataset blocks only matches the questions, while the original knowledge file blocks match the entire block content. According to the correlation, the top n highly relevant questions are matched to generate the first matching set S1{( , ), ( , ),…,( , ),}in is the nth candidate block id, Score the similarity of the nth slice. Step 2513: Use the BGE (BAAI General Embedding) model to convert the original matching text into a dense vector matrix, and match it with the question dataset and the original knowledge file block in the medical insurance knowledge base. The matching with the question dataset block only matches the questions in the block, and the original knowledge file block matches the entire block content. According to the correlation, the top m highly relevant questions are matched to generate the second matching set S2{( , ), ( , ),…,( , ),}in is the mth candidate block id, Score the similarity of the mth slice.
[0094] Step 2514: Set the model image factor for the sparse vector matrix and the dense vector matrix respectively, calculate the final score result of each slice object through the comprehensive scoring algorithm, and output the first x (x <m+n)个结果,形成第三匹配集合。
[0095] The calculation formula of the comprehensive scoring algorithm is:
[0096] in, is the score value corresponding to the object in the S1 set, is the score corresponding to the object in set S1. If the object only appears in a single set, its comprehensive score is the similarity score of that single set. w1 and w2 are the model influence factors corresponding to the two models, w1 + w2 = 1, and γ is the reward coefficient (0 < γ < 1). When an object exists in both sets, the score of the object is increased by adding a reward value.
[0097] Step S252: The third matching set is processed again using a reordering model, which places the most semantically relevant knowledge at the top of the set, outputting a fourth reordered matching set.
[0098] Step S253: Information retrieval prompt assembly, including information retrieval role definition, retrieved relevant information, information retrieval context, intent information, information retrieval restriction conditions.
[0099] The information retrieval role definition: In this phase, a role is assigned to the large model, which is related to the identified intent.
[0100] The retrieved relevant information: the main knowledge information referred to by the large model, which comes from the cut knowledge information corresponding to the fourth matching set generated in step S252. If it is a chat type, this part of data is empty.
[0101] The information retrieval context: retrieval history dialogue information, complete the context information; The intent information: the user intent identified in step S244; The information retrieval restriction condition: requires the large model to preferentially refer to the answer in the knowledge base for answering, and output the answer in a fixed format. If the content in the knowledge base cannot meet the requirements, the large model is required to expand the answer according to its own ability.
[0102] Step S254: The information retrieval prompt generated in step S253 is submitted to the large model, and the large model generates an answer text based on the analysis capability of the large model.
[0103] Step S255: Based on the determined question and answer in the knowledge base, the existing question is taken as input, the result generated by the large model is matched with the existing question and answer, the accuracy of the large model query question is checked, and the prompt is optimized to improve the efficiency of the large model answer.
[0104] Step S26: Output the question and answer result in different ways according to the user intent.
[0105] Step S261: When the user intent is identified as business handling, the configuration information related to the tool is obtained according to the obtained tool number, the tool name is output externally, and whether to perform specific business handling is triggered by the user, and after triggering, the business is processed according to the tool type.
[0106] Specifically, if the tool type is dynamic query type, the interface is called to query data based on QL (Query Language) expression content. Specifically, if the tool type is a function jump type, jump to the corresponding function page according to the url path configured in QL to perform business query and handling; Step S262: When the user's intention is to guide the business, the question text answer information output in step S254 is displayed through streaming output, and the tool selected additionally in the tool selection stage is output. If the user has needs, the corresponding tool is selected to perform business processing.
[0107] Step S263: When the user's intention is policy retrieval, chat and others, the question text answer information output in step S254 is displayed through streaming output.
[0108] Embodiment 2 In an embodiment of the present application, an intelligent assistant system based on a large model is provided for providing question and answer results for user questions, comprising: A first recognition module configured to construct an entity recognition prompt word and identify an entity in a user question through a large model; A second recognition module configured to construct an intent recognition and tool selection prompt word, identify a user intention in a user question through a large model, and determine a tool to be used; An enhanced generation module configured to retrieve related information from a pre-constructed vector knowledge base based on the assembled user question and entity, and a large model combines the retrieved related information to enhance the generation of an answer text; An answer processing module configured to process an answer text according to a user intention and a tool, and output a final question and answer result; The construction of the vector knowledge base is to use a large model to obtain intelligent question and answer pairs from original knowledge files, fuse the existing question and answer pairs to form a question and answer dataset, store the original knowledge files and the question and answer dataset into a vector database to form a vector knowledge base.
[0109] Embodiment 3 In an embodiment of the present application, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the intelligent assistant method based on a large model.
[0110] Embodiment 4 In an embodiment of the present application, a non-transitory computer readable storage medium is provided for storing computer instructions, which, when executed by a processor, implement the intelligent assistant method based on a large model.
[0111] Embodiment 5 An embodiment of the present application provides an electronic device, comprising a processor, a memory and a computer program; wherein the processor is connected with the memory, and the computer program is stored in the memory; when the electronic device is running, the processor executes the computer program stored in the memory, so that the electronic device executes the method for realizing the intelligent assistant based on a large model.
[0112] The present application is described with reference to flowcharts and / or block diagrams of the method, device (system) and computer program product according to embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing devices to produce a machine, so that the instructions executed by the computer or other programmable data processing devices generate a device for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus for performing the functions specified in one or more flows and / or blocks.
[0113] These computer program instructions can also be loaded into a computer or other programmable data processing device to cause a series of operation steps to be executed on the computer or other programmable data processing device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable data processing device provide a process for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus for performing the functions specified in one or more flows and / or blocks.
[0114] Although the specific embodiments of the present application are described above with reference to the drawings, the description is not a limitation on the scope of protection of the present application, and those skilled in the art should understand that various modifications or changes made on the basis of the technical solutions of the present application without creative labor are still within the scope of protection of the present application.
Claims
1. An intelligent assistant method based on a large model, characterized in that: Used to provide question-and-answer results for user questions, including: Construct entity recognition prompt words and use large models to identify entities in user questions; Build intent recognition and tool selection prompts to identify user intent in user questions through a large model and determine the tool to use; Based on the assembled user questions and entities, relevant information is retrieved from the pre-built vector knowledge base. The large model combines the retrieved relevant information to enhance the generated answer text; Process the answer text based on user intent and tools, and output the final question-answering results; Among them, the construction of the vector knowledge base is to use a large model to obtain intelligent question and answer pairs from the original knowledge files and fuse them with existing question and answer pairs to form a question and answer dataset, and store the original knowledge files and question and answer datasets in the vector database to form a vector knowledge base.
2. The intelligent assistant method based on a large model as claimed in claim 1, characterized in that: The entity recognition prompt word consists of entity recognition role definition, entity scope, and entity recognition restriction conditions; The intent recognition and tool selection prompt consists of the intent and tool selection role definition, user intent scope, tool list, intent and tool selection constraints, and intent and tool selection context; The user intent scope is based on the business scope of intelligent question and answer, and defines supported intent categories, including business processing, policy retrieval, service guide, chat, and others; The tool list is to set corresponding tools for different intent categories.
3. The intelligent assistant method based on a large model as claimed in claim 1, characterized in that: The specific steps of constructing the vector knowledge base are as follows: Preprocess the original knowledge files; Extract the knowledge profile of the file from the pre-processed original knowledge file; The traditional accumulated question-answer pairs are processed, and valid question-answer pairs are extracted using a large model based on the original knowledge file. The processed accumulated question-answer pairs and the valid answer pairs generated by the large model are merged to form a question-answer dataset. The problem data set and the pre-processed original knowledge file are cut into pieces according to the rules and stored in the vector database to form a vector knowledge base.
4. The intelligent assistant method based on a large model according to claim 1, characterized in that: The process of retrieving relevant information from the pre-built vector knowledge base is as follows: The original question and the identified entities are assembled and matched with the vector knowledge base. The sparse vector matrix and the dense vector matrix are combined with the model influence factor to obtain the text matching set related to the question. The text matching set is processed twice using the re-ranking model, the knowledge with the closest semantics is placed at the top of the set, and the re-ranked text matching set is output. The corresponding knowledge information of the text matching set is used as the retrieved relevant information.
5. The intelligent assistant method based on a large model as claimed in claim 1, characterized in that: The large model combines the retrieved relevant information to enhance the generated answer text, specifically: Construct information retrieval prompt words, including information retrieval role definition, retrieved relevant information, information retrieval context, intention information, and information retrieval constraints; The generated information retrieval prompt words are submitted to the big model, and the big model generates the answer text. With the help of the big model's analysis capabilities, the answer text of the question is generated.
6. The intelligent assistant method based on a large model according to claim 1, characterized in that: The answer text is processed according to the user's intention and the tool, specifically: When the user's intention is to handle a business, the configuration information related to the corresponding tool is obtained, and the tool name is output externally. The user triggers whether to carry out specific business handling. After the trigger, the business is processed according to the tool type; When the user's intent is to provide guidance, the answer text to the question will be displayed through streaming output, and the tools selected during the tool selection phase will also be output; When the user intent is policy retrieval, chat, or other situations, the answer text is displayed through streaming output.
7. An intelligent assistant system based on a large model, characterized in that: Used to provide question-and-answer results for user questions, including: The first recognition module is configured to: construct entity recognition prompt words and recognize entities in user questions through a large model; The second recognition module is configured to: construct intent recognition and tool selection prompt words, identify the user intent in the user question through the large model, and determine the tool to be used; The enhanced generation module is configured to: retrieve relevant information from the pre-built vector knowledge base based on the assembled user questions and entities, and enhance the generated answer text by combining the retrieved relevant information with the large model; The answer processing module is configured to: process the answer text according to the user's intention and the tool, and output the final question and answer result; Among them, the construction of the vector knowledge base is to use a large model to obtain intelligent question and answer pairs from the original knowledge files and fuse them with existing question and answer pairs to form a question and answer dataset, and store the original knowledge files and question and answer datasets in the vector database to form a vector knowledge base.
8. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the large model-based intelligent assistant method described in any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium, characterized in that The non-transitory computer-readable storage medium is used to store computer instructions, and when the computer instructions are executed by the processor, an intelligent assistant method based on a large model as described in any one of claims 1 to 6 is implemented.
10. An electronic device, characterized in that: include: A processor, a memory, and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory to enable the electronic device to implement a large model-based intelligent assistant method as described in any one of claims 1-6.
Citation Information
Cited By
Question and answer interaction method, device and equipment based on large model and storage medium
CN121301547A
A large model-based question and answer interaction method and device, equipment and storage medium
CN121301547B
Intelligent heat supply customer service system, method, medium, equipment and program product
CN121745952A