Intelligent question and answer method and system, electronic equipment and intelligent question and answer big model
By identifying user intentions and using pre-generated high-frequency full-text question answers or multi-source heterogeneous knowledge retrieval to generate answers, the problem of low efficiency and reliability when answering questions in the intelligent question-answer system is solved, and fast and accurate question-and-answer responses and content integrity and consistency are achieved.
Patent Information
- Application Number
- CN202510468035.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-15
- Publication Date
- 2025-05-13
AI Technical Summary
The existing intelligent question-and-answer system has low efficiency and reliability when answering questions.
An intelligent question-and-answer method is proposed to identify user intentions by receiving query information reported by the user terminal. If the user intends to be a preset high-frequency Q&A intention, directly obtain and send the pre-generated high-frequency full-text questions answers; if it is not a high-frequency Q&A intention, perform multi-source heterogeneous knowledge retrieval and generate answer information.
By generating high-frequency full-text answers in advance, fast and accurate Q&A responses can be achieved, significantly improve the efficiency of reply, and ensure the integrity and consistency of content through multi-source heterogeneous knowledge retrieval.
Smart Images

Figure CN119988573A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent question answering technology, and in particular to an intelligent question answering method, system, electronic equipment, and intelligent question answering large model. Background Art
[0002] An intelligent question-answering system is a system that uses natural language processing and artificial intelligence technologies to understand questions asked by users in a human way and provide accurate and useful answers through search, reasoning or other methods. However, the efficiency and reliability of intelligent question-answering methods in related technologies are low when answering questions. Summary of the invention
[0003] The present invention aims to solve one of the technical problems in the related art at least to a certain extent. To this end, the first object of the present invention is to provide an intelligent question-answering method to improve the efficiency and reliability of answering questions.
[0004] A second aspect of the present invention is to provide an electronic device.
[0005] The third object of the present invention is to propose a large model of intelligent question and answer.
[0006] The fourth objective of the present invention is to provide an intelligent question-answering system.
[0007] To achieve the above-mentioned purpose, the first aspect of the embodiment of the present invention proposes an intelligent question and answer method, which includes: receiving query information reported by a user terminal, and obtaining user intention based on the query information; if the user intention is a preset high-frequency question and answer intention, obtaining a pre-generated high-frequency full-text question answer corresponding to the user intention, and sending the high-frequency full-text question answer to the user terminal; if the user intention is not a preset high-frequency question and answer intention, performing multi-source heterogeneous knowledge retrieval, generating answer information based on the retrieval results, and sending the answer information to the user terminal, wherein the multi-source heterogeneous knowledge retrieval includes at least one of searching in a pre-generated knowledge base based on the query information and performing a network search based on the query information.
[0008] In addition, the intelligent question-answering method according to the embodiment of the present invention may also have the following additional technical features: In some embodiments of the present invention, retrieval is performed in the knowledge base according to the query information, including: performing fuzzy search on short texts in the knowledge base through the query information, and obtaining a first preset number of first target short texts according to the search results; vectorizing the query information to obtain a first text vector; performing similarity matching on the first text vector and the second text vector, and obtaining a second preset number of target second text vectors according to the matching results, and using the short texts corresponding to the second preset number of the target second text vectors as second target short texts, wherein the second text vector is a text vector obtained by vectorizing the short texts in the knowledge base; and obtaining a knowledge base retrieval result according to the first target short text and the second target short text.
[0009] In some embodiments of the present invention, obtaining a knowledge base retrieval result based on the first target short text and the second target short text includes: obtaining an initial text paragraph set, wherein the initial text paragraph set includes text paragraphs corresponding to the first target short text and text paragraphs corresponding to the second target short text in the knowledge base; performing deduplication processing on the initial text paragraph set to obtain a candidate related text paragraph set; for each text paragraph in the related text paragraph set, obtaining the similarity between the text paragraph and the query information, and taking the text paragraphs with a similarity greater than a preset similarity threshold as the knowledge base retrieval result.
[0010] In some embodiments of the present invention, when the multi-source heterogeneous knowledge retrieval includes searching in a pre-generated knowledge base according to the query information, generating answer information based on the retrieval results includes: obtaining a pre-generated full-text summary of the documents in the knowledge base and historical conversation information of the current session; integrating the knowledge base retrieval results, the query information, the full-text summary and the historical conversation information, and using the integrated result as the answer information.
[0011] In some embodiments of the present invention, when the multi-source heterogeneous knowledge retrieval includes searching in a pre-generated knowledge base according to the query information and performing a network search according to the query information, generating answer information based on the retrieval results includes: obtaining a pre-generated full-text summary of the documents in the knowledge base and historical conversation information of the current session; integrating the knowledge base retrieval results, the query information, the full-text summary, the historical conversation information and the network retrieval data, and using the integrated result as the answer information.
[0012] In some embodiments of the present invention, after sending the answer information to the user terminal, the method includes: obtaining the similarity between the answer information and the original reference information, wherein the original reference information includes the query information and the knowledge base retrieval results; when the similarity is less than a preset similarity threshold, generating risk warning information, and sending the risk warning information to the user terminal.
[0013] In some embodiments of the present invention, there are multiple knowledge bases, and for each knowledge base, multiple high-frequency question and answer intentions and high-frequency full-text question answers corresponding to the high-frequency question and answer intentions are pre-generated.
[0014] To achieve the above objectives, a second aspect of the present invention proposes an electronic device, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the computer program is executed by the processor, the above intelligent question-answering method is implemented.
[0015] To achieve the above objectives, the third aspect of the present invention proposes a large intelligent question-answering model, including the above electronic device.
[0016] To achieve the above objectives, the fourth aspect of the present invention proposes an intelligent question-answering system, including the above-mentioned intelligent question-answering large model.
[0017] According to the intelligent question-answering method, system, electronic device, and intelligent question-answering model of the embodiment of the present invention, the method includes: receiving query information reported by a user terminal, obtaining user intent according to the query information; if the user intent is a preset high-frequency question-answering intent, obtaining a pre-generated high-frequency full-text question answer corresponding to the user intent, and sending the high-frequency full-text question answer to the user terminal; if the user intent is not a preset high-frequency question-answering intent, performing multi-source heterogeneous knowledge retrieval, generating answer information according to the retrieval results, and sending the answer information to the user terminal, wherein the multi-source heterogeneous knowledge retrieval includes at least one of searching in a pre-generated knowledge base according to the query information and searching the network according to the query information. By generating high-frequency full-text question answers in advance, a fast and accurate question-answering response is achieved, and the efficiency of the reply is significantly improved. The pre-generated answers are verified multiple times to ensure the integrity and consistency of the content. Through this setting, when a user asks a common question, the cached high-frequency full-text question answer can be directly called without re-reasoning and calculating, effectively reducing resource usage.
[0018] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1is a flow chart of an intelligent question-answering method according to an embodiment of the present invention; Figure 2 is a flow chart of an example of an intelligent question-answering method of the present invention; Figure 3 is a flow chart of another example of an intelligent question-answering method of the present invention; Figure 4 is a flowchart of another example of an intelligent question-answering method of the present invention; Figure 5 is a flowchart of another example of an intelligent question-answering method of the present invention; Figure 6 is a flowchart of another example of an intelligent question-answering method of the present invention; Figure 7 is a flowchart of another example of an intelligent question-answering method of the present invention; Figure 8 is a structural block diagram of an electronic device according to an embodiment of the present invention; Fig. 9 It is a structural block diagram of the intelligent question-answering model of an embodiment of the present invention; Fig.10 It is a structural block diagram of the intelligent question-answering system according to an embodiment of the present invention. DETAILED DESCRIPTION
[0020] The following describes the intelligent question-answering method, system, electronic device, and intelligent question-answering model of the embodiments of the present invention with reference to the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements with the same or similar functions. The embodiments described with reference to the accompanying drawings are exemplary and should not be construed as limiting the present invention.
[0021] Figure 1 It is a flow chart of the intelligent question-answering method according to an embodiment of the present invention.
[0022] like Figure 1 As shown, the intelligent question answering method includes: S11, receiving query information reported by the user terminal, and obtaining the user intention according to the query information.
[0023] S12: If the user intention is a preset high-frequency question-answering intention, a pre-generated high-frequency full-text question answer corresponding to the user intention is obtained, and the high-frequency full-text question answer is sent to the user terminal.
[0024] S13, if the user intention is not a preset high-frequency question-answer intention, a multi-source heterogeneous knowledge retrieval is performed, and answer information is generated based on the retrieval results, and the answer information is sent to the user terminal, wherein the multi-source heterogeneous knowledge retrieval includes at least one of searching in a pre-generated knowledge base based on the query information and performing a network search based on the query information.
[0025] Specifically, a knowledge base is generated in advance, and high-frequency question and answer intentions and high-frequency full-text question answers corresponding to the high-frequency question and answer intentions are pre-set. When a user inputs query information, the user's intention is first identified based on the query information. At this time, if the user's intention is the preset high-frequency question and answer intention, it means that the high-frequency full-text question answers corresponding to the user's intention have been saved in the knowledge base, and the answer can be directly used as a reply to the user's query information.
[0026] It should be noted that the above-mentioned high-frequency question-and-answer intentions and high-frequency full-text question answers may be intentions and answers generated based on the knowledge stored in the knowledge base.
[0027] Therefore, by generating answers to high-frequency full-text questions in advance, we can achieve fast and accurate Q&A responses, significantly improving the efficiency of responses. The pre-generated answers are verified multiple times to ensure the integrity and consistency of the content. With this setting, when users ask common questions, they can directly call the cached answers to high-frequency full-text questions without re-inference calculation, effectively reducing resource usage.
[0028] It should be noted that if it is recognized that the user's intention is not the preset high-frequency question and answer intention, it is necessary to perform multi-source heterogeneous knowledge retrieval based on the query information to obtain retrieval results in order to generate answer information to reply to the user based on the retrieval results.
[0029] In some embodiments of the present invention, intelligent question answering methods are used for large models.
[0030] In some embodiments of the present invention, there are multiple knowledge bases, and for each knowledge base, multiple high-frequency question and answer intentions and high-frequency full-text question answers corresponding to the high-frequency question and answer intentions are pre-generated.
[0031] The following is a specific example to illustrate how to generate high-frequency question-answering intentions and high-frequency full-text question answers.
[0032] First, information preprocessing is performed.
[0033] Step one: Create a knowledge base.
[0034] First, text upload and knowledge base creation. Specifically, users upload file data (structured text / unstructured files), and the system automatically processes and creates the corresponding knowledge base. In addition, a knowledge base ID is generated. There are multiple knowledge base IDs, which correspond to multiple knowledge bases one by one.
[0035] Second, document information association. Specifically, the knowledge base is associated with document information, and the relationship between the knowledge base and the document is stored and managed using a relational database. In this way, the document information contained in the knowledge base can be associated.
[0036] Third, file storage. Specifically, the system provides options to decide whether to store the original file information. The specific storage method is as follows: for JSON structured data, it is stored as a JSON file and then stored in the minio (an open source distributed object storage server) database. For unstructured data, the original file is stored in the minio database.
[0037] Step 2: Original search text analysis, including structured data analysis and unstructured data analysis.
[0038] Structured data analysis: For the structured data input by the system, first analyze its data format (such as JSON), and parse and extract the fields and text information contained therein. The extracted structured text is integrated into paragraphs according to content relevance to ensure the logic and integrity of the text paragraphs. In addition to the core search text information, other metadata information associated with the text, such as file source, category, creation time, etc., is also integrated to provide more contextual support in subsequent search and question-and-answer sessions.
[0039] Unstructured document analysis: For unstructured documents (such as PDF, Word, PPT documents, etc.), first identify their type and use the appropriate text reading method. If it is a readable text format, directly extract the text information of the document. If it is a document containing pictures (such as scanned copies), use OCR (optical character recognition) technology to identify and extract text content to ensure the integrity of text information. According to the content characteristics and logical structure of the document, the extracted text is paginated and segmented, so that the data has a clear hierarchy in the database, which is convenient for calling and displaying during retrieval.
[0040] Step 3: Construct short-long text pairs. This can enhance the retrieval accuracy.
[0041] First, text segmentation. Specifically, the complete text extracted from structured and unstructured data is segmented into long and short texts to create a pair of "short-long text" combinations. Specifically: Short text: The text is segmented into separate sentences by punctuation marks, and these sentences are used as short texts to enhance adaptability to precise queries. Long text: The text of the original paragraph is retained as long text, which is suitable for broader or fuzzy semantic retrieval. This design of short-long text pairs makes it easier for the system to call text information of appropriate granularity according to needs in subsequent queries to improve the accuracy and efficiency of retrieval.
[0042] Second, short text vector generation. Specifically, the NLP (Natural Language Processing) text vector model is used to generate semantic vectors for each short text, which facilitates efficient vector retrieval based on semantic similarity. Through this vectorization method, the semantic content of short texts is abstracted into numerical vectors, and the system can quickly and accurately match the user's query information with the knowledge base content during retrieval.
[0043] The fourth step is to build a vector database.
[0044] First, store text information and its vectors: Generate and store vectors for each text information (short-long text pair) in the knowledge base, laying the foundation for fast retrieval.
[0045] Second, store metadata: In addition to text information, the vector database also contains knowledge base ID (Identifier), file ID, and other metadata information of documents and unstructured data to ensure the accuracy of retrieval and the traceability of information.
[0046] Secondly, pre-generation and rapid response of answers to high-frequency full-text questions.
[0047] The first step is full-text content retrieval: using the above knowledge base ID, retrieve all the text content in the knowledge base from the ES (Elasticsearch, a distributed document database) database and extract all the content for subsequent processing.
[0048] The second step is to segment the full text: determine whether the full text length is suitable for providing as a single input to the large language model. If the text is too long, the full text content is segmented according to the maximum context length supported by the large language model; the paragraphs overlap appropriately to ensure the continuity of the context and the accuracy of the question and answer when generating the answer.
[0049] The third step is to pre-generate high-frequency questions and answers to pre-generate answers to high-frequency full-text questions.
[0050] Full text summary: Extract the core points of the document content with high precision, accurately summarize the main idea and key information of the document, and ensure that the key points and logical context are presented. Generate independent summaries for each segment of the full text content, and then integrate the summaries of each segment to generate a systematic full text summary.
[0051] Full text structure analysis: The system analyzes the content framework and structural hierarchy of the document, clearly showing the logical relationship and importance of each chapter or module to help users quickly grasp the overall structure of the document. In this process, the segmented structure is analyzed segment by segment, and after integration, a comprehensive structural map is formed.
[0052] Mind map generation: Based on the structural framework analysis, a clear mind map is generated to display the content context and relationship hierarchy in a graphical way, so that users can quickly gain an intuitive understanding of complex information and form a deep level of cognition.
[0053] Recommended questions: Generate high-level key guiding questions based on the document topic and segmented content, guiding users to explore the depth and breadth of the content from different dimensions. Generate questions segment by segment and simplify and remove duplicates to ensure that the generated questions cover key concepts and are inspiring and coherent.
[0054] Recommended related reading materials: Based on the document theme and core content, a list of recommended suitable extended reading materials is automatically generated to provide users with highly relevant and inspiring external information sources to help users broaden their horizons and deeply understand the document theme.
[0055] Therefore, through pre-generated full-text summaries, structural analysis, mind maps, recommended questions, etc., comprehensive document understanding support is provided to users, while personalized related reading recommendations are provided to help users explore and expand knowledge in depth, achieving efficient and high-quality user experience. When it is necessary to obtain answers to high-frequency full-text questions, the answers to high-frequency full-text questions are obtained from the database storing answers to high-frequency full-text questions according to the knowledge base ID.
[0056] In some embodiments of the present invention, retrieval is performed in a knowledge base based on query information, including: performing fuzzy search on short texts in the knowledge base through the query information, and obtaining a first preset number of first target short texts based on the search results; vectorizing the query information to obtain a first text vector; performing similarity matching on the first text vector and the second text vector, and obtaining a second preset number of target second text vectors based on the matching results, and using the short texts corresponding to the second preset number of target second text vectors as second target short texts, wherein the second text vector is a text vector obtained by vectorizing the short texts in the knowledge base; and obtaining a knowledge base retrieval result based on the first target short text and the second target short text.
[0057] The following is a description of a specific embodiment in which there are multiple knowledge bases.
[0058] Specifically, when the user intention is not a preset high-frequency question-and-answer intention, it is executed as follows.
[0059] Query information vectorization: Use the NLP model to vectorize the query information and generate a semantic vector. The generated semantic vector is used as the first text vector to facilitate subsequent vector retrieval.
[0060] After obtaining the first text vector, a hybrid search is performed. Specifically, the query information, the first text vector, and the knowledge base ID are combined in ES to perform a hybrid search to find the n text paragraphs with the highest similarity, including: Fuzzy search: fuzzy match the short texts in the knowledge base through query information, identify texts that are close to the query information, and obtain a first preset number of first target short texts.
[0061] Vector retrieval: vectorize the short text in the knowledge base to obtain the second text vector. Since there are usually multiple short texts in the knowledge base, the number of second text vectors is also multiple. Use the first text vector to perform similarity matching with the second text vector of the short text in the knowledge base to find the second text vector that is semantically closest to the query information, and use the short text corresponding to the second text vector as the second target short text.
[0062] Among them, among multiple knowledge bases, it is necessary to identify the knowledge base corresponding to the ID according to the knowledge base ID, and then perform the above-mentioned mixed search in the identified knowledge base.
[0063] In some embodiments of the present invention, a knowledge base retrieval result is obtained based on a first target short text and a second target short text, including: obtaining an initial text paragraph set, wherein the initial text paragraph set includes text paragraphs corresponding to the first target short text and text paragraphs corresponding to the second target short text in the knowledge base; performing deduplication processing on the initial text paragraph set to obtain a candidate related text paragraph set; for each text paragraph in the related text paragraph set, obtaining the similarity between the text paragraph and the query information, and taking the text paragraphs with a similarity greater than a preset similarity threshold as the knowledge base retrieval result.
[0064] Specifically, after obtaining the first target short text and the second target short text, the knowledge base is queried for text paragraphs corresponding to the first target short text, and the knowledge base is queried for text paragraphs corresponding to the second target short text, and a set is formed based on the text paragraphs obtained by the query to obtain a text paragraph set.
[0065] After obtaining the text paragraph set, the text paragraphs in the text paragraph set are deduplicated, and the deduplicated set is the candidate related text paragraph set.
[0066] After obtaining a set of related text paragraphs, similarity screening can be performed, and before similarity screening, re-ranking can be performed.
[0067] The above reordering may be to apply an NLP vector reordering model to reorder the original query information and the text paragraphs in the related text paragraph set.
[0068] The above similarity screening is to remove text paragraphs with low similarity according to a preset similarity threshold, and finally retain highly relevant text paragraphs.
[0069] After completing the similarity screening, content integration can also be performed, that is, the final relevant text paragraphs are integrated according to the similarity level, and the sorted text paragraph content is used as the knowledge base retrieval result to provide rich contextual information for downstream questions and answers.
[0070] In some embodiments of the present invention, when multi-source heterogeneous knowledge retrieval includes searching in a pre-generated knowledge base based on query information, answer information is generated based on the retrieval results, including: obtaining a pre-generated full-text summary of the documents in the knowledge base and historical conversation information of the current session; integrating the knowledge base retrieval results, query information, full-text summary and historical conversation information, and using the integrated results as answer information.
[0071] That is to say, when multi-source heterogeneous knowledge retrieval includes searching in a pre-generated knowledge base according to query information, the multi-source heterogeneous knowledge retrieval consists of three parts: 1. Searching in a pre-generated knowledge base according to query information to obtain knowledge base retrieval results, 2. Searching in a preset database that stores full-text summaries to obtain full-text summaries, 3. Searching in a preset database that stores historical conversation information to obtain historical conversation information of the current session.
[0072] The following is an example of how the intelligent question-answering method is used in a large model.
[0073] Specifically, when a user initiates a conversation with the big model, the user may send multiple query information to ask multiple questions. The big model needs to save the conversation information between it and the user, including the queries initiated by the user and its own replies, until the user ends the conversation.
[0074] At this time, when receiving the latest query information from the user, the large model not only needs to generate an answer to the latest query information, but also needs to obtain the historical conversation information of the latest query information in the current session. Therefore, by integrating the historical conversation content, the context information is incorporated into the current question-and-answer process, making the answer more coherent and in line with the conversation context.
[0075] In addition, it is also necessary to obtain a pre-generated full-text summary. Specifically, a pre-generated full-text summary is randomly extracted from the knowledge base using the knowledge base ID so that the core content of the document can be quickly presented in the Q&A. This method enhances the coherence and centrality of the conversation, ensuring that users can accurately obtain the key points of the knowledge base in a concise summary and have a clearer overall understanding of the information in subsequent conversations.
[0076] A search is performed in a pre-generated knowledge base according to the query information to obtain a knowledge base search result.
[0077] After obtaining the knowledge base search results, historical conversation information and full-text summary, the knowledge base search results, query information, full-text summary and historical conversation information can be integrated, and the integrated results can be used as answer information.
[0078] In some embodiments of the present invention, when multi-source heterogeneous knowledge retrieval includes searching in a pre-generated knowledge base based on query information and performing a network search based on the query information, answer information is generated based on the retrieval results, including: obtaining a pre-generated full-text summary of the documents in the knowledge base and historical conversation information of the current session; integrating the knowledge base retrieval results, query information, full-text summary, historical conversation information and network retrieval data, and using the integrated results as answer information.
[0079] That is to say, when multi-source heterogeneous knowledge retrieval includes searching in a pre-generated knowledge base according to query information and performing network retrieval according to the query information, the multi-source heterogeneous knowledge retrieval consists of four parts: 1. Searching in a pre-generated knowledge base according to the query information to obtain the knowledge base retrieval results, 2. Searching in a preset database that stores full-text summaries to obtain full-text summaries, 3. Searching in a preset database that stores historical conversation information to obtain historical conversation information of the current session, 4. Performing network retrieval according to the query information to obtain network retrieval results.
[0080] Specifically, in order to improve the timeliness of the answer information, the system can selectively perform network information retrieval to obtain the latest relevant data, and obtain network retrieval data based on the latest relevant data. The specific steps are as follows: Retrieval query information rewriting: By combining the contextual dialogue information and the user's query information, the original query information is rewritten using a large language model, aiming to improve the accuracy and precision of network retrieval, thereby better meeting the user's query needs. The original query information is the query information that has not been rewritten.
[0081] Retrieval information acquisition: Use the rewritten query information to search on the Internet and obtain N latest network information fragments to supplement the knowledge base data.
[0082] Re-ranking: semantically re-rank the rewritten query information and the web search information text, and sort the search results according to the relevance between the web search information text and the query information.
[0083] Similarity integration: Integrate the sorted network information according to the similarity, extract and merge the most relevant information to obtain network search results, and provide the latest and most relevant content for the final answer.
[0084] After obtaining the network search results, the knowledge base search results, query information, full-text summary, historical conversation information and network search data are integrated, and the integrated results are used as answer information.
[0085] In some embodiments of the present invention, after sending the answer information to the user terminal, the method includes: obtaining the similarity between the answer information and the original reference information, wherein the original reference information includes the query information and the knowledge base retrieval results; when the similarity is less than a preset similarity threshold, generating risk warning information, and sending the risk warning information to the user terminal.
[0086] The following is a description of the details with reference to a specific embodiment.
[0087] Specifically, see Figure 2 , including the following steps: Information preprocessing: Create a knowledge base, parse files to build a knowledge base information group. Specifically, before building a question-answering system, first create a knowledge base. This process includes parsing and filtering multiple types of input data (such as structured data json, unstructured documents pdf, doc, docx, ppt, pptx, etc.) to extract core information. Through natural language processing technology and information extraction methods, effective information is converted into structured data for storage, ensuring the wide coverage and easy retrieval of knowledge base content, and providing support for subsequent query matching.
[0088] Pre-generation of high-frequency full-text questions and answers: Pre-generate high-frequency full-text knowledge questions and answers for each knowledge base. Specifically, for each knowledge base, pre-generate standard answers for a variety of high-frequency question and answer scenarios in advance, including high-frequency question and answer intentions and corresponding high-frequency full-text question answers, covering common full-text questions, including full-text summaries, full-text structure analysis, full-text structure mind maps, document recommendation questions, and related reading material recommendations. When the user's intention is a preset high-frequency question and answer intention, a random copy is directly selected from the corresponding pre-generated answers and provided. This not only ensures the accuracy and completeness of the information, but also significantly shortens the response time and reduces the burden of real-time generation, thereby effectively improving the response speed and processing efficiency of knowledge questions and answers.
[0089] Question and answer retrieval: Multi-source information retrieval builds context and stores multi-source information related to the question. Specifically, after the user enters the query information, it is determined whether the user's intention is a high-frequency question and answer intention. If so, the answer is directly output, otherwise question and answer retrieval is performed. The retrieval process is as follows: the system combines vector retrieval and fuzzy search to initiate a search in the knowledge base. Vector retrieval is based on a semantic vector model to ensure the matching accuracy of query information with relevant information in the knowledge base; while fuzzy search is used to improve the recognition of similar words or expression variants. Through these two methods, documents that are highly relevant to the query information are comprehensively screened, and historical conversations and generated full-text summaries are integrated, and network retrieval information is added when necessary. The system integrates the retrieval results, historical conversations, and network retrieval information into contextual prompt information for the large language model to ensure that the input information is comprehensive, accurate, and coherent.
[0090] Large language model question answering: The large language model obtains contextual prompt information, streams questions and answers, and stores answers. Specifically, after obtaining appropriate contextual prompt information, the system uses the large language model to stream answers to query information. The large language model uses contextual prompt information for reasoning and answer generation, and obtains answers that are accurate in content and consistent in context.
[0091] For example, after obtaining the knowledge base retrieval results, query information, full-text summary, historical conversation information and network retrieval data, the knowledge base retrieval results, query information, full-text summary, historical conversation information and network retrieval data can be integrated to obtain context prompt information, and then the context prompt information is sent to the user terminal as the reply information to the user.
[0092] Hallucination detection: Hallucination detection is performed based on the search information and the large language model question and answer answers. Specifically, to ensure the reliability of the question and answer, the system performs hallucination detection (i.e., generated content that is untrue or off-topic) after obtaining the answer information of the large language model. Specifically, the system compares the model output, the original query information, and the knowledge base retrieval and related documents retrieved from the network to determine the accuracy and consistency of the answer content, identify potential hallucination information, and prompt the answer to prevent users from obtaining inaccurate information.
[0093] That is to say, after generating the answer information, it is also necessary to perform hallucination detection on the answer information, that is, to obtain the similarity between the answer information and the original reference information. When the similarity is less than the preset similarity threshold, risk warning information is generated and sent to the user terminal.
[0094] It should be noted that if a network search is performed when generating the answer information, the original reference information also includes the network search results.
[0095] In some embodiments of the present invention, for each query information, when the above integration results are obtained, a unique query information ID can also be generated for the query information, and a key-value database (such as redis) is used to record the source of the multi-source information (including knowledge base ID, document source, page number, etc.) and model context prompt information. The specific contents include: original information source: marking the source of each reference information (such as knowledge base, network search results, etc.) to ensure that its source identification is retained when multi-source information is integrated, context prompt information: storing context prompt information related to the query information, which is convenient for quick call and context consistency in subsequent questions and answers.
[0096] At this time, in order to generate the final answer information based on the prompt information, the generated query information ID can be used to retrieve the corresponding context prompt information from redis to provide the necessary background information for the model answer, so as to realize the use of the model to answer.
[0097] When generating the final answer information, the obtained contextual prompt information can be used as input to generate an answer to the query information through the model to ensure the relevance and accuracy of the answer.
[0098] Moreover, the generated answer information can be stored in a key-value database (such as redis) using the query information ID to facilitate subsequent queries and backtracking of the conversation context to achieve a continuous conversation experience.
[0099] In order to realize hallucination judgment, the generated query information ID can be used to retrieve the original reference information of the corresponding query information and the answer of the large model to the query information from redis, and then the similarity between the answer information generated by the model and the original reference information is evaluated. If the similarity is lower than the set threshold, a risk prompt is output to remind the user that there may be a risk of inaccurate information; if the similarity meets the requirements, the answer is returned normally to ensure the reliability of the answer.
[0100] In a specific embodiment of the present invention, the intelligent question-answering method includes the following steps.
[0101] Step s110: The user initiates the creation of a knowledge base, and uploads files and related information. Different file information formats are used for structured data and unstructured data. The file information format can be JSON format.
[0102] A unique identifier generated for the knowledge base .
[0103] Step s111: parse the files structure, build the document information relationship in the knowledge base, and generate a , that is, each Associated n( )indivual ; Among them, files are files.
[0104] Step s112: If you need to store the original file in minIO, name the file name for each file , in .
[0105] Above That is the above association of .
[0106] Step s120: parse the original text information of the file according to the file format and integrate it in sections. When the file is structured data, parse the file structure and integrate the text information in sections. When the file is unstructured data, use appropriate text reading methods for different data formats. Readable text is read directly, and unreadable text is read using optical character recognition technology. After reading, integrate the text according to page number and paragraph to obtain a paragraph text set. . is a collection of paragraph texts, For n paragraphs of text, is the i-th paragraph text, where i is greater than or equal to 1 and less than or equal to n.
[0107] Step s130: construct short and long text pairs for the sorted text content of the document, and Split paragraph text into k short texts by punctuation marks , each short text Associate original paragraph text , forming a "short-long text pair", for Build "short-long text pairs":
[0108] is the jth short text, j is greater than or equal to 1 and less than or equal to k, is a set of k short texts, is constructed as short-long text pairs.
[0109] Step s131: Generate the short text in each "short-long text" pair using the NLP text vector model Generated text vector , expand the "short-long text pair" to: , ,
[0110] .
[0111] Step s140: The above-constructed "short-long text pair" information and its associated , , page numbers and other related information are stored in the Elasticsearch database for subsequent knowledge base retrieval.
[0112] Step s210: For each Retrieve the full text content from the Elasticsearch database.
[0113] Step s220: Segment the full text content according to the contextual prompt length supported by the large language model, with a certain length of overlap between segments, so that the full text is divided into m long segments .
[0114] is a collection of m long fragments, is m long segments.
[0115] Step s230: Pre-generation of high-frequency questions and answers.
[0116] Step s2301: Pre-generate a full-text summary.
[0117] Step s23010: For the full text content of the overlapping segments, use the large language model to generate an independent segment text summary for each segment to form a segment text summary set: .
[0118] Summarizes the collection of segmented texts, Provide a summary of the specific text segment.
[0119] Step s23011: Use the large language model to integrate the segmented text summaries into a complete full-text summary .
[0120] Step s23012: Repeat steps S23010-S23011 several times to generate multiple different versions of the full text summary: .
[0121] This is a summary of the full text. This is a summary of the full text for multiple versions.
[0122] Step s2302: Pre-generate full-text structure analysis.
[0123] Step s23020: For the full text content of the overlapping segments, use the large language model to generate a structured segmented text analysis for each segment. The segmented analysis results are output in Markdown (a lightweight markup language) format to obtain a segmented text structure analysis set: .
[0124] A collection of segmented text structure analysis. Segmented text structure analysis.
[0125] Step s23021: All the segmented structure analysis results obtained in step S23020 are integrated through the large language model to generate a complete full-text structure analysis text, that is, .
[0126] Step s23022: Repeat steps S23020-S23021 several times to generate multiple different versions of the full text structure analysis: .
[0127] It is a collection of full text structure analysis. It is a full text structural analysis of multiple different versions.
[0128] Step s2303: Pre-generate a full-text mind map: Based on the full-text structure analysis Markdown generated in step S2302, automatically construct a full-text mind map corresponding to the knowledge base by parsing the logical structure and content hierarchy of the document.
[0129] Step s2304: Pre-generate full-text question recommendations.
[0130] Step s23040: Based on the full text content that has been segmented into overlapping sections, generate a number of recommended questions for each section and construct a section question list: .
[0131] For a list of paragraph questions, For specific paragraph questions.
[0132] Step s23041: perform deduplication processing on the generated segmented recommendation question list and integrate it to obtain the overall full-text recommendation question set: .
[0133] Recommended question sets for the full text, For specific full text recommendations questions.
[0134] Step s2305: Pre-generate recommended reading materials.
[0135] Step s23050: Build a recommended reading material database and obtain a large amount of high-quality reading resources from open channels in advance, covering multi-dimensional information such as course content, course titles, recommended videos, etc., so as to provide systematic extended content support.
[0136] Step s23051: Combined with the full text summary generated in step S2301, multi-level retrieval is carried out through the NLP vector model. Using a hybrid method of vector retrieval and fuzzy search, materials that are highly relevant to the full text summary are efficiently matched to generate a recommended reading list, ensuring that the recommended content is highly consistent with the subject and information needs of the user's query.
[0137] Step s310: The user initiates a question and answer session, enters query information, and is given a list of associated knowledge base IDs , using the NLP vector generation model to generate text vectors for query information , and the text vector as the first text vector.
[0138] Step s311: Identify and classify the user's query information, and systematically determine whether the user's intention is a high-frequency question and answer intention. If it is a high-frequency question and answer intention, directly select a random answer from the high-frequency full-text question answers pre-generated in step s230 as a response, and end the process. If it does not meet the high-frequency question and answer intention, enter the subsequent process.
[0139] Step s312: Comprehensive use Initiate a hybrid search with the query information to the Elasticsearch database. The search scope is the knowledge base corresponding to the knowledge base ID, and the top N "short-long text pairs" most relevant to the query information. Return the text and its related information etc., no text vector is output.
[0140] Step s313: remove duplicate text paragraphs obtained according to the search results to obtain a set of candidate related text paragraphs.
[0141] Step s314: Use the NLP vector rearrangement model to rearrange the deduplicated text paragraphs and the query information, remove the paragraph text whose similarity with the original query information is lower than a preset threshold, and arrange the remaining text in reverse order of similarity to obtain the sorted text paragraphs.
[0142] Step s315: Integrate into knowledge base search prompt context in order of similarity: .
[0143] Retrieve hint context for knowledge base, It is the text paragraph after deduplication processing.
[0144] Step s320: If you choose to add network information retrieval, then combine the conversation context information and the query input by the user, use the large language model to intelligently rewrite the original query to generate a more accurate search query and obtain network search data. .
[0145] based on Go to the open network information retrieval platform to retrieve n relevant documents, each record contains text, source URL and release time.
[0146] Step s321: Use the NLP vector rearrangement model to retrieve network data Rearrange and remove The web search texts with similarity lower than the threshold are sorted, and the remaining texts are sorted in reverse order of similarity to obtain the sorted web search texts: .
[0147] Retrieve text collections for the web, Retrieve text for a specific network.
[0148] Step s331: Integrate the network search texts in the order of rearranged similarity to form a network search prompt context: .
[0149] Prompt context for network retrieval, It is a network search text paragraph obtained by integrating network search texts.
[0150] Step s340: Integrate the historical conversation information in the current session to form a historical conversation context prompt .
[0151] Step s350: Use the knowledge base ID to retrieve the full text summary pre-generated in the knowledge base from the SQL database, and randomly select a full text summary as .
[0152] Step s350: Integrate knowledge base search, network search, historical dialogue and full text summary to obtain complete context prompt information
[0153] .
[0154] Provides contextual information.
[0155] Step s351: Generate a unique query information ID for the query information, use the key-value database redis to store the context prompt information corresponding to the query information ID as well as the knowledge base and network search original data, and return the query information ID as well as the knowledge base and network search original data.
[0156] Step s410: Use the query information ID to request a question and answer from the large language model service. The service retrieves the corresponding context prompt information from Redis through the query information ID.
[0157] Step s411: Send the context prompt information as input to the large language model, and the large language model generates and outputs an answer.
[0158] Step s412: After the large language model answer is generated, the complete answer result is associated with the query information ID and stored in redis.
[0159] Step s510: Use the query information ID to retrieve the original network and knowledge base search information, as well as the answer content of the large language model from redis. Compare the similarity between the answer content and the original reference information, and determine whether the model answer has hallucinations based on the set similarity threshold.
[0160] In a specific embodiment of the present invention, see Figure 3 When the user uploads a file, a new knowledge base interface is added. After the new knowledge base interface is added, the intelligent question and answer knowledge base creation service (upload knowledge base) can be executed, and then the knowledge base and database can be updated. The update is executed through the SQL (Structured Query Language) database.
[0161] Moreover, when executing the intelligent question-answering knowledge base creation service, redis upload is also required, that is, the file information (including various additional conditions), knowledge base ID, whether minio storage is required, etc. need to be sent to redis. At this time, it is necessary to continuously poll from redis to obtain the file information that needs to be parsed, and perform file parsing services on the obtained files, send the parsed intelligent summary, mind map, recommended reading and other high-frequency full-text question answers to the SQL database, store the parsed vector, text, metadata information and other knowledge base text information in es (that is, the above-mentioned ES database), and store the original file in minio when minio storage is required.
[0162] When a user initiates a question and answer query (query information), the question and answer intention is first determined. The user intention is obtained based on the query (query information) sent by the user, and then the query intention is determined to see whether it is a high-frequency full-text question and answer, that is, whether the user intention is the preset high-frequency question and answer intention.
[0163] If it is determined that the user's intention is the preset high-frequency question and answer intention, the pre-generated high-frequency question and answer answer (that is, the above-mentioned high-frequency full-text question answer) is directly requested from the SQL database and the answer is returned.
[0164] If it is determined that the user's intention is not the preset high-frequency question-and-answer intention, a multi-source heterogeneous retrieval service is executed.
[0165] Specifically, executing the intelligent question and answer multi-source heterogeneous retrieval service includes the following steps.
[0166] 2. es retrieves relevant information from the knowledge base.
[0167] In this way, the knowledge base retrieval results can be obtained.
[0168] 3. Redis retrieves the conversation history and updates the history record.
[0169] In this way, historical conversation information can be obtained from redis.
[0170] 4. Get pre-generated full-text summaries of the knowledge base.
[0171] In this way, it is possible to obtain the full-text summary from the SQL database.
[0172] 5. Search the web for content that is highly relevant to the query.
[0173] In this way, it is possible to use historical conversation information and the original query in combination for retrieval, and the query can be rewritten to open the network search service and obtain network search results.
[0174] 6. Redis uploads large model context prompt information (prompt).
[0175] 7. Return multi-source heterogeneous reference auxiliary information (i.e. the original reference information mentioned above) and queryid.
[0176] 8. Use queryid to initiate a streaming request.
[0177] 9. Use queryid to get information from redis.
[0178] 10. Streaming returns the answer to the question.
[0179] 11. After the Q&A session, upload the complete answer to redis.
[0180] In a specific embodiment of the present invention, see Figure 4,In order to implement file preprocessing, the user uploads a file that includes structured ,data and unstructured data. After the user uploads the data, a knowledge base is created and a ,unique knowledge base ID is generated, and the SQL database data is ,updated, including the association information between the knowledge base and ,the file.
[0181] Furthermore, it is determined whether the data is structured data. If it is structured data, structured text data parsing is performed; if it is unstructured data, unstructured text data parsing is performed.
[0182] After completing the data parsing, the file text information is paged and segmented, short-long text pairs are constructed, short text vector information is generated, and the generated information is stored in the es database.
[0183] Moreover, after completing the data parsing, it is necessary to determine whether the original text needs to be stored. If necessary, the unstructured data is stored in the minio database in the original file format, and the structured data is saved as a json file and stored in the minio database.
[0184] In a specific embodiment of the present invention, see Figure 5 ,First, the user asks a question and initiates a Q&A.
[0185] After the user initiates a question and answer, the question and answer text is obtained, which includes the query information input by the user, and then the question and answer text is vectorized and relevant information is retrieved.
[0186] When performing relevant information retrieval, it is necessary to obtain historical conversation records, and to pre-generate a full-text summary through a SQL database search knowledge base. In addition, it is necessary to determine whether it is necessary to use network search to realize network search and network search data related to user questions and answers. It is also necessary to determine whether it is necessary to associate a database to realize es database retrieval of knowledge base and question-and-answer related text to obtain knowledge base retrieval results.
[0187] After completing the retrieval, you can mix the multi-source heterogeneous retrieval results to build a large model question and answer context prompt information, and after obtaining the context prompt information, generate a unique dialogue queryid (that is, the query information ID) for the question, and use redis to store the large model question and answer prompts (that is, the answer information output to the user terminal) and multi-source heterogeneous information sources (that is, the original reference information mentioned above).
[0188] In a specific embodiment of the present invention, see Figure 6 In order to send the answer information to the user terminal, we first use the queryID to initiate the large model question and answer, and then use the queryID to retrieve the context prompt information from redis, use the large language model to start streaming the answer to the question, and use the queryID to return the answer to redis after the streaming return.
[0189] In a specific embodiment of the present invention, see Figure 7 In order to realize hallucination detection, we first use queryID to initiate hallucination detection, that is, we need to use queryID to retrieve relevant multi-source information (that is, the above-mentioned historical conversation information) from redis, and we also need to use queryID to retrieve the large model answer (that is, the above-mentioned answer information) from redis, and then perform similarity comparison, and use the threshold to determine whether the large model answer has hallucinations.
[0190] In summary, the intelligent question-answering method of the embodiment of the present invention includes: receiving query information reported by the user terminal, obtaining the user intention according to the query information; if the user intention is a preset high-frequency question-answering intention, obtaining the pre-generated high-frequency full-text question answer corresponding to the user intention, and sending the high-frequency full-text question answer to the user terminal; if the user intention is not a preset high-frequency question-answering intention, performing multi-source heterogeneous knowledge retrieval, generating answer information according to the retrieval results, and sending the answer information to the user terminal, wherein the multi-source heterogeneous knowledge retrieval includes at least one of searching in a pre-generated knowledge base according to the query information and searching the network according to the query information. By generating the high-frequency full-text question answer in advance, a fast and accurate question-answering response is achieved, and the efficiency of the reply is significantly improved. The pre-generated answer is verified multiple times to ensure the integrity and consistency of the content. Through this setting, when the user asks a common question, the cached high-frequency full-text question answer can be directly called without re-reasoning and calculating, effectively reducing resource usage. Moreover, by comprehensively searching for relevant documents in the knowledge base, network search data, pre-generated full-text summaries, and historical conversation information, etc., it provides accurate, coherent, central and timely contextual prompts for large model question and answer. This mechanism effectively improves the accuracy of large model question and answer in complex knowledge scenarios, enabling it to integrate multi-party information, deeply understand user intentions, reduce deviations, and respond more consistently, significantly enhancing user experience and comprehensiveness of information retrieval. Through the collaborative management of databases such as Elasticsearch, SQL, redis, and minio, multi-source heterogeneous data is systematically classified and integrated according to its characteristics, and accurate indexing and efficient call of data are achieved, ensuring the optimized management of different data types, improving the concurrent performance and scalability of information processing, and providing a stable, agile and scalable data support architecture for large-scale question and answer scenarios. By introducing the illusion judgment mechanism, it provides an additional layer of security for the answers of large models. This mechanism effectively identifies and reduces potential inaccuracies by comparing the model-generated content with the original reference information, thereby improving the reliability of answers and user trust, which not only strengthens the accuracy of the question and answer system, but also provides higher security for information interaction in complex scenarios.
[0191] Furthermore, the present invention provides an electronic device.
[0192] Figure 8 It is a structural block diagram of an electronic device according to an embodiment of the present invention.
[0193] like Figure 8 As shown, the thermal management controller 500 includes: a processor 501 and a memory 503. The processor 501 and the memory 503 are connected, such as through a bus 502. Optionally, the electronic device 500 may also include a transceiver 504. It should be noted that in actual applications, the transceiver 504 is not limited to one, and the structure of the electronic device 500 does not constitute a limitation on the embodiments of the present invention.
[0194] The processor 501 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of the present invention. The processor 501 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0195] The bus 502 may include a path to transmit information between the above components. The bus 502 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 502 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0196] The memory 503 is used to store a computer program corresponding to the intelligent question-answering method of the above embodiment of the present invention, and the computer program is controlled and executed by the processor 501. The processor 501 is used to execute the computer program stored in the memory 503 to implement the content shown in the above method embodiment.
[0197] in, Figure 8The electronic device 500 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0198] The electronic device of the embodiment of the present invention, by implementing the intelligent question-answering method of the above embodiment, generates answers to high-frequency full-text questions in advance, achieves fast and accurate question-answering responses, and significantly improves the efficiency of replies. The pre-generated answers are verified multiple times to ensure the integrity and consistency of the content. Through this setting, when users ask common questions, they can directly call the cached answers to high-frequency full-text questions without re-inference calculation, effectively reducing resource usage.
[0199] Furthermore, the present invention proposes a large intelligent question-answering model.
[0200] Fig. 9 It is a structural block diagram of the intelligent question-answering model of an embodiment of the present invention.
[0201] like Fig. 9 As shown, the intelligent question and answer model 100 includes the above-mentioned electronic device 500.
[0202] The intelligent question-answering model of the embodiment of the present invention, through the above-mentioned electronic device, generates answers to high-frequency full-text questions in advance, so as to achieve fast and accurate question-answering responses and significantly improve the efficiency of responses. The pre-generated answers are verified multiple times to ensure the integrity and consistency of the content. Through this setting, when users ask common questions, they can directly call the cached answers to high-frequency full-text questions without re-inference calculation, which effectively reduces resource usage.
[0203] Furthermore, the present invention proposes an intelligent question-answering system.
[0204] Fig.10 It is a structural block diagram of the intelligent question-answering system according to an embodiment of the present invention.
[0205] like Fig.10 As shown, the intelligent question answering system 10 includes the above-mentioned intelligent question answering large model 100.
[0206] The intelligent question-answering system of the embodiment of the present invention, through the above-mentioned intelligent question-answering big model, generates answers to high-frequency full-text questions in advance, achieves fast and accurate question-answering responses, and significantly improves the efficiency of responses. The pre-generated answers are verified multiple times to ensure the integrity and consistency of the content. Through this setting, when users ask common questions, they can directly call the cached answers to high-frequency full-text questions without re-inference calculation, effectively reducing resource usage.
[0207] It should be noted that the logic and / or steps represented in the flowchart or described in other ways herein can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, device or equipment (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or equipment and execute instructions), or in combination with these instruction execution systems, devices or equipment. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or equipment, or in combination with these instruction execution systems, devices or equipment. More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection portion with one or more wirings (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0208] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiment, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0209] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0210] In the description of this specification, the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and cannot be understood as a limitation on the present invention.
[0211] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0212] In the description of this specification, unless otherwise specified, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements, unless otherwise clearly defined. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0213] In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may mean that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. Moreover, a first feature being "above", "above" or "above" a second feature may mean that the first feature is directly above or obliquely above the second feature, or simply means that the first feature is higher in level than the second feature. A first feature being "below", "below" or "below" a second feature may mean that the first feature is directly below or obliquely below the second feature, or simply means that the first feature is lower in level than the second feature.
[0214] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. An intelligent question-answering method, characterized in that: The method comprises: Receiving query information reported by a user terminal, and obtaining user intention according to the query information; If the user intention is a preset high-frequency question-answering intention, obtaining a pre-generated high-frequency full-text question answer corresponding to the user intention, and sending the high-frequency full-text question answer to the user terminal; If the user intention is not a preset high-frequency question-and-answer intention, a multi-source heterogeneous knowledge retrieval is performed, answer information is generated based on the retrieval results, and the answer information is sent to the user terminal, wherein the multi-source heterogeneous knowledge retrieval includes at least one of searching in a pre-generated knowledge base based on the query information and performing a network search based on the query information.
2. The intelligent question-answering method according to claim 1, characterized in that: Searching the knowledge base according to the query information includes: Performing a fuzzy search on the short texts in the knowledge base using the query information, and obtaining a first preset number of first target short texts according to the search results; Performing vectorization processing on the query information to obtain a first text vector; Performing similarity matching on the first text vector and the second text vector, obtaining a second preset number of target second text vectors according to the matching results, and using the short texts corresponding to the second preset number of the target second text vectors as second target short texts, wherein the second text vector is a text vector obtained by vectorizing the short texts in the knowledge base; A knowledge base search result is obtained according to the first target short text and the second target short text.
3. The intelligent question-answering method according to claim 2, characterized in that: The obtaining of a knowledge base search result according to the first target short text and the second target short text includes: Acquire an initial text paragraph set, wherein the initial text paragraph set includes a text paragraph corresponding to the first target short text and a text paragraph corresponding to the second target short text in the knowledge base; Deduplication processing is performed on the initial text paragraph set to obtain a candidate related text paragraph set; For each text paragraph in the relevant text paragraph set, the similarity between the text paragraph and the query information is obtained, and the text paragraphs with similarity greater than a preset similarity threshold are taken as the knowledge base retrieval results.
4. The intelligent question-answering method according to claim 1, characterized in that: When the multi-source heterogeneous knowledge retrieval includes searching a pre-generated knowledge base according to the query information, generating answer information according to the search results includes: Obtaining a pre-generated full-text summary of the documents in the knowledge base and historical conversation information of the current session; The knowledge base search result, the query information, the full text summary and the historical conversation information are integrated, and the integrated result is used as the answer information.
5. The intelligent question-answering method according to claim 1, characterized in that: When the multi-source heterogeneous knowledge retrieval includes searching in a pre-generated knowledge base according to the query information and performing a network search according to the query information, generating answer information according to the search results includes: Obtaining a pre-generated full-text summary of the documents in the knowledge base and historical conversation information of the current session; The knowledge base search result, the query information, the full text summary, the historical conversation information and the network search data are integrated, and the integrated result is used as the answer information.
6. The intelligent question-answering method according to claim 1, characterized in that: After sending the answer information to the user terminal, the method includes: Acquire the similarity between the answer information and the original reference information, wherein the original reference information includes the query information and the knowledge base search result; When the similarity is less than a preset similarity threshold, risk warning information is generated and sent to the user terminal.
7. The intelligent question-answering method according to claim 1, characterized in that: There are multiple knowledge bases, and for each knowledge base, multiple high-frequency question and answer intentions and high-frequency full-text question answers corresponding to the high-frequency question and answer intentions are pre-generated.
8. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and running on the processor, wherein when the computer program is executed by the processor, the intelligent question-answering method according to any one of claims 1 to 7 is implemented.
9. A large intelligent question-answering model, characterized in that: Comprising an electronic device according to claim 8.
10. An intelligent question-answering system, characterized in that: Including the intelligent question and answer model according to claim 9.
Citation Information
Patent Citations
Large model question and answer result optimization method, system and device
CN117540010A
File question and answer method and device and electronic equipment
CN117556099A
Question and answer reply method and system based on large model, terminal and storage medium
CN117609475A
Question answering method and device based on knowledge base, computer equipment and storage medium
CN117688151A
Intelligent question answering method and system for information security field, medium and equipment
CN118051602A
Cited By
Answer output method and device based on semiconductor knowledge base and medium
CN121051218A
Knowledge question and answer method based on multiple agents and heterogeneous data sources
CN121092679A
Large-model multi-path retrieval question and answer parameter and data source tuning method under multi-round question and answer
CN121146095A
Answer generation method and device based on semiconductor knowledge base and medium
CN121256004A
Data query method and system
CN121278169A