Enterprise knowledge base question answering method, apparatus, and medium based on fusion retrieval
By constructing a three-channel hybrid retrieval system that combines vector semantics, keywords, and knowledge graph retrieval, the problem of low answer accuracy in enterprise knowledge base question-answering systems has been solved, achieving high recall and accuracy in retrieval results generation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- MOBIDROP (ZHEJIANG) CO LTD
- Filing Date
- 2026-04-30
- Publication Date
- 2026-07-21
AI Technical Summary
In existing enterprise knowledge base question-answering systems, the single search method suffers from semantic generalization and ambiguity, resulting in low answer accuracy and an inability to understand user intent and handle ambiguity caused by polysemy.
A three-channel hybrid retrieval system is constructed, which combines vector semantic retrieval, keyword retrieval, and knowledge graph retrieval, executes them in parallel, and fuses the results to generate high-quality answers.
It significantly improves the recall and accuracy of retrieval, understands users' deep semantics and ensures precise keyword matching, handles complex associative reasoning problems, and generates high-quality answers.
Smart Images

Figure CN122432398A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and information retrieval, specifically to the design of optimizing the accuracy of information retrieval in the question-and-answer process of an enterprise knowledge base. Background Technology
[0002] An enterprise knowledge base is a centralized platform within an organization for systematically collecting, storing, organizing, managing, and sharing its core knowledge assets. These knowledge assets typically include structured data and unstructured documents. Structured data includes databases and tables, while unstructured documents include technical documents, product manuals, market reports, and meeting minutes. An enterprise knowledge base serves as a precise and professional source of information within an organization.
[0003] In practical applications, enterprise employees frequently use the intelligent question-and-answer function of the enterprise knowledge base. Employees input query data, and the enterprise knowledge base returns corresponding query results; its core implementation relies on retrieval technology. In existing technologies, enterprise knowledge bases often use a single retrieval method, commonly vector semantic retrieval and keyword retrieval.
[0004] However, a single search method has certain technical limitations, particularly in the accuracy of the results. Specifically, while single vector semantic search can understand synonyms, near-synonyms, and semantic associations, it suffers from semantic generalization, easily returning broad content that is semantically related but does not directly and precisely answer the question. Furthermore, it may miss key documents that use drastically different vocabulary but are actually highly relevant in content.
[0005] On the other hand, while single-keyword retrieval can ensure an exact literal match, it is prone to rigidity and fails to understand user intent. For queries with different expressions but the same meaning, the retrieval will fail due to keyword mismatch, resulting in low recall. It also cannot handle the ambiguity caused by polysemy. Summary of the Invention
[0006] The purpose of this invention is to provide a question-answering method, device, and medium for enterprise knowledge bases based on fusion retrieval. It constructs a three-channel hybrid retrieval system that executes knowledge graph-based association retrieval, vector semantic retrieval, and keyword-based precise retrieval in parallel, and fuses the results from these three channels with configurable weights. By fusing semantic and keyword retrieval, the system complements each other's weaknesses, significantly improving retrieval recall and accuracy. Through knowledge graph-based association retrieval, the system gains the ability to handle multi-hop and complex reasoning queries, thereby increasing the accuracy and correctness of answers during the question-answering process.
[0007] In a first aspect, the present invention provides a question-answering method for an enterprise knowledge base based on fusion retrieval, comprising the following steps:
[0008] Accept user queries;
[0009] Based on the query statement, an intermediate result set is obtained through a three-channel retrieval; the three channels include a vector semantic retrieval channel, a keyword retrieval channel, and a knowledge graph retrieval channel.
[0010] The intermediate result set contains search results from three channels, with the vector semantic channel containing vector similarity scores and the keyword search channel containing keyword matching scores.
[0011] The intermediate result set is fused and reordered to generate a candidate information list;
[0012] Based on the content of the candidate information list, an answer is generated using a large language model.
[0013] In a second aspect, the present invention provides an electronic device, including a processor and a memory; the processor is connected to the memory; the memory is used to store executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, for executing the method described thereon.
[0014] In a third aspect, the present invention provides a computer-readable storage medium for storing a computer program that, when executed by a processor, can perform the method described thereon.
[0015] In summary, the present invention has the following beneficial effects:
[0016] 1. By employing a three-channel hybrid retrieval system—comprising parallel execution of vector semantic retrieval, keyword retrieval, and knowledge graph retrieval—the limitations of single retrieval strategies are effectively overcome. It not only understands the deep semantics of user queries but also ensures precise keyword matching and leverages knowledge graphs to handle complex relational reasoning problems. This significantly improves the recall and comprehensiveness of retrieval results from the source, laying a solid foundation for generating high-quality answers.
[0017] 2. By fusing scores of document blocks appearing simultaneously in both vector and keyword search results, a comprehensive score is generated and ranked accordingly, achieving quantitative integration and preliminary evaluation of multi-source heterogeneous search results. This mechanism allows for better selection of high-quality documents with both high semantic relevance and high literal matching, providing a more reasonable initial queue for subsequent deep ranking and optimizing the intermediate results of the search process.
[0018] 3. By merging vector similarity scores with a preset weight greater than keyword matching scores, semantic understanding is established as the dominant factor over literal matching at the technical level. This approach prioritizes semantic relevance, thus better aligning with human interaction habits in intelligent question answering.
[0019] 4. By placing the triplet data and their confidence scores obtained from knowledge graph retrieval, along with the comprehensive scores of document segmentation, into the same ranking system, a deep synergy between structured graph knowledge and unstructured document knowledge is achieved, enhancing the system's ability to answer complex relational questions.
[0020] 5. Before the search, the user query is subjected to comprehensive preprocessing including standardization, keyword extraction, vectorization and entity recognition, which generates accurate and consistent standardized input for the subsequent parallel three-channel search.
[0021] 6. Before generating the answer, a token limit is applied to the context to ensure that the total amount of text input to the large language model is strictly adapted to its preset context length processing capacity. This avoids problems such as model generation failure, response truncation, or resource waste caused by excessively long input text, ensuring the stability and reliability of the question-and-answer process, and enabling the system to adapt to various large language models with different context window sizes.
[0022] 7. After answer generation, a multi-dimensional quality assessment of both the retrieval and generation ends is automatically performed, enabling real-time, quantitative monitoring of system performance. By evaluating key indicators such as contextual accuracy and answer fidelity, the quality of the retrieval and generation processes can be continuously diagnosed, ensuring the long-term stability and reliability of the question-and-answer service. Attached Figure Description
[0023] Figure 1 Flowcharts illustrating several embodiments of the enterprise knowledge base question-answering method based on fusion retrieval in this specification are shown.
[0024] Figure 2 The flowchart shows the sub-steps in the result fusion and reordering step;
[0025] Figure 3 Schematic diagrams of the structure of electronic devices according to various embodiments of this specification are shown. Detailed Implementation
[0026] The present invention will be further described in detail below with reference to the accompanying drawings.
[0027] The technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings.
[0028] The terms "first," "second," "third," etc., in the description, claims, and accompanying drawings are used to distinguish different objects, not to describe a particular order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion.
[0029] The following description provides examples and does not limit the scope, applicability, or examples set forth in the claims. Changes may be made to the function and arrangement of the described elements without departing from the scope of this specification. Various processes or components may be appropriately omitted, substituted, or added to the examples. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Furthermore, features described with respect to some examples may be combined into other examples.
[0030] Figure 1 This document presents flowcharts for several enterprise knowledge base question-answering methods 100 based on fusion retrieval disclosed in this specification.
[0031] For example, method 100 is executed by a software system. This system may employ a distributed system architecture and may be deployed in an enterprise's private server cluster.
[0032] The system consists of a series of collaborative services and components, such as the query understanding service, hybrid retrieval service, knowledge graph service, re-ranking service, context building service, and large language model gateway service, which will be mentioned below. These services can be developed, deployed, and extended independently as microservices and communicate with each other through well-defined API interfaces.
[0033] Box 101 implements the initial step of method 100, namely query understanding and preprocessing. The core purpose of box 101 is to receive the user's raw natural language query and, through a series of parallel automated processes, transform it into a structured, standardized intermediate representation that can be directly used by different downstream retrieval modules. This step ensures that subsequent retrieval processes can operate based on accurate and consistent input.
[0034] The input data for box 101 is the raw query string submitted by the user through the client interface or API. For example, consider a user asking, "What are the workflows / tools for single-cell transcriptome data analysis?" This string serves as the most basic data input query understanding module.
[0035] After receiving the original query string, the system does not immediately perform a search, but instead starts four key sub-processing flows in parallel to perform in-depth parsing and transformation of the query.
[0036] For example, text standardization is performed first. Specifically, the built-in text standardization program cleans and normalizes the query string. This includes converting full-width characters to half-width characters, converting traditional Chinese to simplified Chinese, removing leading and trailing whitespace and unnecessary special characters, and standardizing the capitalization of English words. This process aims to eliminate noise and ambiguous formatting in the input text, creating a unified text benchmark.
[0037] Next, keyword extraction is performed. The standardized query text (“What are some single-cell transcriptome experimental platforms?”) is input into the keyword extraction component. This component typically integrates the Jieba word segmentation tool for vocabulary segmentation and is supplemented by keyword extraction algorithms for analysis, such as the TF-IDF algorithm based on term frequency-inverse document frequency. The algorithm extracts the content words that best represent the core intent of the query by evaluating the importance of words in the query. After this processing, the extracted keyword list is: [“single-cell”, “transcriptome”, “platform”]. This list will be used for subsequent precise keyword retrieval.
[0038] Next, the query is vectorized. The standardized complete query text is input into a pre-trained text embedding model. In this example, a semantic encoding model such as BGE is used. This model maps the query text into a high-dimensional dense vector of fixed dimensions, which represents the overall meaning of the query in the semantic space. For example, the model outputs a 512-dimensional floating-point vector, such as [0.12, -0.45, ..., 0.78]. This query vector will be used for subsequent vector semantic retrieval.
[0039] In addition, entity recognition is performed. This is to support subsequent knowledge graph retrieval, and the standardized query text is input into a named entity recognition model. This model is responsible for identifying and extracting named entities mentioned in the query, such as omics, algorithms, processes, methods, diseases, drugs, and technical terms. In this example, the entity identified by the NER model is: [“single cell”]. This list of identified entities will serve as the query key for accessing the knowledge graph.
[0040] After the parallel processing described above, box 101 finally outputs a structured intermediate data object, which encapsulates all the preprocessing results and serves as the input for the next retrieval step.
[0041] An example output object may specifically contain the following fields:
[0042] Original query: string, value is "What are the workflows / tools for single-cell transcriptome data analysis?".
[0043] Standardized query: string, value is "What are the workflows / tools for single-cell transcriptome data analysis?".
[0044] Keyword list: array, values are ["single cell", "transcriptomics", "data analysis", "process / tool"].
[0045] Query vector: 512-dimensional floating-point vector with values [0.12, -0.45, …, 0.78].
[0046] Identify entity list: array, with values of ["single cell"].
[0047] At this point, box 101 has completed the transformation from user natural language to machine-processable structured data, providing accurate input for subsequent parallel multi-channel retrieval.
[0048] In box 102, method 100 performs multi-channel parallel retrieval. This is the core retrieval stage of method 100, and its core purpose is to simultaneously launch three independent retrieval channels based on the structured query representation produced in box 101, and search for candidate information related to the user query from different dimensions and modalities of the knowledge base.
[0049] The input data for box 102 originates entirely from the output of box 101, namely the structured object containing the multimodal query representation. At this point, the system invokes three independent retrieval engines in parallel, processing the input through three channels: vector semantic retrieval, keyword precise retrieval, and knowledge graph retrieval. These are detailed below.
[0050] Channel 1: Vector Semantic Retrieval. This channel is driven by a vector retrieval engine. The engine sends the received query vector to a vector database. In this embodiment, the database is a PostgreSQL database integrated with the pgvector extension. The database pre-stores document vectors generated from all document blocks in the knowledge base using the same text embedding model. The engine performs cosine similarity calculation, quickly finding the Top-N document vectors (e.g., Top-20) most similar to the query vector in the vector space, and obtains their corresponding original document blocks.
[0051] The system allows configuration of a similarity threshold, such as 0.5, for initial screening. The similarity score, ranging from 0 to 1, serves as an initial assessment of the relevance of the result.
[0052] For example, the tools or components used in this channel can be a vector retrieval engine, a database that supports vector similarity search, such as pgvector.
[0053] After the retrieval, the output of this channel is a list of vector retrieval results. Each entry in this list represents a document chunk matched by vector similarity, containing the document chunk ID, the chunk text content, and its vector similarity score.
[0054] Example entry: {doc_chunk_id: 123, content: "Single-cell transcriptome data analysis is a rapidly developing field, and a complete toolchain has now been formed, from raw data processing to advanced biological interpretation."
[0055] Based on the technical documentation in the knowledge base, its core processes and mainstream tools can be summarized as follows: ", vector_score: 0.88}.
[0056] Channel Two: Precise Keyword Search. This search method can be based on fuzzy matching using LIKE, or it can be a more efficient full-text search. The system calculates a keyword matching score for each successfully matched document segment. This score is usually derived from a combination of factors such as word frequency, word position in the document, and inverse document frequency. For example, the score is higher if the word appears in the title.
[0057] For example, the tools or components used in this channel could be a keyword search module, a full-text index of a relational database, or a dedicated full-text search engine such as Elasticsearch.
[0058] After the search, the output of this channel is a list of keyword search results. Each entry in the list represents a document chunk matched by the keyword, including the document chunk ID, the chunk text content, and its keyword matching score.
[0059] Example entry: {doc_chunk_id: 123, content: "A standard single-cell RNA-seq analysis typically includes the following key steps:}
[0060] 1. Raw data quality control and preprocessing: Quality assessment, adapter filtering, and low-quality sequence filtering are performed on the raw sequencing data generated by sequencing.
[0061] 2. Sequence alignment and quantification: The cleaned sequences are aligned to the reference genome, and the expression level of each gene in each cell is calculated (generating an expression matrix).
[0062] 3. Cell and gene quality control: Filtering low-quality cells (such as cells with an excessively high proportion of mitochondrial genes or too few detected genes) and cells with low gene expression.
[0063] Channel 3: Knowledge Graph Retrieval. This channel can be driven by a knowledge graph retrieval module. The knowledge graph retrieval module connects to a graph database, such as Neo4j.
[0064] The graph database has been built and stored with knowledge graphs automatically extracted from enterprise documents. Nodes represent entities, such as genes, proteins, cells, omics, diseases, drugs, and technological concepts. Edges represent relationships between entities, such as "cell screening," "microfluidics," and "gene expression." The module uses the entity "single cell" from the received list of identified entities as the starting point for its query. Using a graph query language such as Cypher, it traverses the graph to find directly connected relationship paths and associated entities.
[0065] For example, query all triples with "single cell" as the head entity and "data analysis" as the relation type.
[0066] After the retrieval, the output of this channel is the knowledge graph retrieval results. These results are a set of structured relational data, typically represented as a list of triples or paths.
[0067] Example output: [{head_entity: "Single Cell", relation: "Data Analysis", tail_entity: "Seurat Analysis Flow"}, {head_entity: "Single Cell", relation: "Data Analysis", tail_entity: "Scanpy Analysis Flow"}]
[0068] The three channels can be processed sequentially or in parallel. After processing, an intermediate result set is generated. This intermediate result set includes the vector retrieval result list, keyword retrieval result list, and knowledge graph retrieval result set mentioned above.
[0069] In box 103, the results of method 100 are merged and reordered.
[0070] Specifically, in box 103, the heterogeneous and multimodal candidate results obtained from the three parallel channels in box 102, as described above, are integrated into a unified list of high-quality information arranged in descending order of relevance to the user's final query. Box 103 addresses the limitations of a single retrieval strategy by ensuring high accuracy and high knowledge relevance of the information delivered to the answer generation stage through a two-level mechanism of "hybrid initial screening" and "deep evaluation."
[0071] After receiving the intermediate result set described above, box 103 performs result fusion and reordering on the intermediate results. This step is also the core step of this invention. Its sub-steps can be as follows: Figure 2 As shown.
[0072] Specifically, in box 1031, result alignment and knowledge injection are performed. For example, the tool components used are rule templates or lightweight text generation programs. The structured knowledge graph retrieval results are converted into natural language descriptive text, aligning its form with document chunks. For instance, a list of triples is converted into a text fragment: “Knowledge Graph Display: Single-Cell Transcriptome Data Analysis Workflow / Tools: Seurat and Scanpy.” This text is considered a special candidate entry with a specific source identifier and assigned a high initial base score, such as 0.90, to participate in subsequent ranking.
[0073] Box 1032, preliminary score fusion.
[0074] The tools used in box 1032 can be a score normalization algorithm and a configurable weight fusion unit.
[0075] In box 1032, for the vector retrieval result list and the keyword retrieval result list, the system performs score fusion for the same document chunk that appears in both lists, such as document chunks with both doc_chunk_id 123. A preset, configurable weight is used to calculate the comprehensive score using a weighted summation formula. For example, with a vector weight of 0.7 and a keyword weight of 0.3, the comprehensive score is calculated as: vector_score * 0.7 + keyword_score * 0.3. For chunks that appear in only one list, their original score or a score after simple normalization is used directly. All document chunks, including text fragments from knowledge graph transformation, are initially sorted based on their comprehensive score or initial score to form a preliminary candidate list for fusion.
[0076] Box 1033, deep semantic reordering.
[0077] The system pairs the user's original query, "What are the workflows / tools for single-cell transcriptome data analysis?", with the text content of each candidate item in the preliminary fusion candidate list and inputs it into a re-ranking model.
[0078] For example, a cross-encoder model like BGE-Reranker-v2-m3 can be used. This model performs deep bidirectional attention interaction computation on the "query-candidate text" pair, outputting a re-ranking score that more accurately reflects the direct relevance between the two. Subsequently, the system performs a final re-ranking of all candidate entries based on this new re-ranking score. The final output is a final candidate list after deep fusion and semantic re-ranking. This list is arranged from high to low re-ranking score, and each entry contains the core text content used to generate the answer and its metadata. For example:
[0079] {content: “Knowledge graph shows: Seurat (R): Currently the most popular and comprehensive single-cell analysis toolkit, covering almost all aspects from quality control, standardization, dimensionality reduction, clustering to differential expression.”, rerank_score:0.99, source: “kg”, chunk_id: null}
[0080] {content: “Scanpy (Python): A powerful single-cell analysis tool based on Seurat, closely integrated with the Python machine learning ecosystem.”, rerank_score: 0.97, source: “doc”, chunk_id: 123}
[0081] {content: “Upstream Processing: Cell Ranger (10x Genomics Official): A dedicated workflow for 10x Genomics platform data, completing the generation of expression matrices from raw data.”, rerank_score: 0.89, source: “doc”, chunk_id: 456}
[0082] In the above text, "doc" after "source" indicates a document retrieved from vector or keyword searches, and "chunk_id" is the document ID. "rerank_score" is the overall score calculated using a weighted summation formula with preset weights.
[0083] The "kg" annotation after "source" indicates a Knowledge Graph, representing the output from a knowledge graph retrieval. Its "rerank_score" is not the overall score mentioned above, but rather the confidence score corresponding to the knowledge graph retrieval result. This confidence score is based on a computable objective metric.
[0084] The selection and comprehensive rules for these objective indicators can be set by engineers according to specific implementation methods.
[0085] For example, a score based on graph statistics can be used. That is, the system can calculate the "strength of evidence" of the query results in the knowledge graph.
[0086] For example, relation frequency can be used. That is, if the relation "single-cell transcriptome -> data analysis -> Seurat analysis workflow" is mentioned and extracted multiple times in the source document, then the frequency of this relation can be used as a weighting factor. Path weights can also be used; when constructing a knowledge graph, large language models (LLMs) or specialized models used to extract entities and relations typically output a confidence score for the extraction results. This score can be used as the initial confidence of the knowledge association. Graph node importance can also be used: if the associated tail entity, such as "single cell," has high centrality in the graph, it indicates that it is an important concept, and the weight of the association can be increased accordingly.
[0087] In some embodiments, an auxiliary score based on vector similarity can also be used. Entities and relations in the knowledge graph can themselves be vectorized. The system can calculate the cosine similarity between the query vector and the vector of the text converted from knowledge graph triples as an auxiliary score reflecting semantic relevance.
[0088] In box 104, adaptive context RAG construction is used to implement method 100.
[0089] Box 104 is a formatted context that maximizes information density and is semantically coherent, which is constructed from the candidate information list generated by Box 103 within the fixed context length limit of the target large language model.
[0090] Specifically, the input to box 104 is the final candidate list output from box 103, which is a list sorted in descending order of rerank_score. Each entry contains fields such as content (text content) and source (source identifier). For example, after sorting, it would look like this:
[0091] Entry 1: {content: “Knowledge graph shows: Seurat (R): Currently the most popular and comprehensive single-cell analysis toolkit, covering almost all aspects from quality control, standardization, dimensionality reduction, clustering to differential expression.”, rerank_score: 0.99, source: “kg”}
[0092] Entry 2: {content: “…Scanpy (Python): A Python-based Seurat analogue single-cell analysis tool, equally powerful and closely integrated with the Python machine learning ecosystem…”, rerank_score: 0.97,source: “doc”, chunk_id: 123}
[0093] Entry 3: {content: “…Upstream processing: Cell Ranger (10x Genomics official): A dedicated workflow for 10xGenomics platform data, completing the generation of expression matrices from raw data…”, rerank_score:0.89, source: “doc”, chunk_id: 456}
[0094] In addition, it includes a context token limit value, which is a preset system parameter that indicates the maximum number of tokens that the selected answer generation large language model can accept in a single request, for example, max_context_tokens:8192.
[0095] It also includes a Token budget configuration value, which is a set of preset reserved Token values used to calculate the actual Token space available for loading search content. For example, it may include:
[0096] The number of tokens reserved for the model to generate answers, for example, 1000. The number of tokens used for system commands and prompt word templates, for example, 500. The number of tokens used for the user query itself, for example, 20. The number of tokens for the safety margin, for example, 200, to prevent exceeding the limit due to calculation errors.
[0097] The system calls the context building service and sequentially performs processing methods from existing technologies, such as calculating the available token budget, intelligent selection and content truncation, and formatting encapsulation, and finally outputs a context string whose length meets the model limit, whose information has been prioritized and whose format is standardized.
[0098] For example: [Source: kg] The knowledge graph shows: Seurat (R): Currently the most popular and comprehensive single-cell analysis toolkit, covering almost all aspects from quality control, standardization, dimensionality reduction, clustering to differential expression. [Source: doc-123] Scanpy (Python) is a Python-based Seurat counterpart to single-cell analysis tools, with equally powerful functions and close integration with the Python machine learning ecosystem. [Source: doc-456] Upstream processing of single-cell transcriptome data: Cell Ranger (10xGenomics official): A dedicated workflow for 10x Genomics platform data, completing the generation from raw data to expression matrices.
[0099] The above strings are the final prompt words submitted directly to the large language model to generate the answer.
[0100] Box 105 is used to implement the answer generation and result return of method 100. In some preferred embodiments, box 105 also plays a role in quality assessment.
[0101] The input to Box 105 comes from the formatted text output from Box 104, containing the most relevant source information, as well as the user's original query, the initial question, "What are the workflows / tools for single-cell transcriptome data analysis?". The input to Box 105 also includes system prompt templates, predefined instruction templates, used to guide the large language model in generating a formatted answer based on context.
[0102] Subsequently, the formatted text, the user's original query, and the system's prompt word template are combined and input into a large language model to generate a natural language answer. In actual use, while or after the answer is generated, the system parses the answer text and automatically matches and associates the key statements with the source identifiers ([source: kg], [source: doc-123], etc.) marked in the formatted context, establishing a citation link between the answer and the source material.
[0103] In some embodiments, a RAG quality assessment is also included. The system invokes the quality assessment module to perform a multi-dimensional automated assessment of the question-and-answer interaction. This includes assessment at the retrieval end and assessment at the generation end.
[0104] The retrieval-side evaluation calculates contextual precision, assessing the proportion of the provided context that is truly relevant to the question. The generation-side evaluation calculates fidelity, evaluating whether the generated answer is strictly based on the provided context and its relevance, assessing whether the answer directly addresses the original question. This process can employ existing techniques such as rule-based matching and vector similarity calculation, or the "LLM-as-Judge" method, which uses another large language model as the evaluator to score the quality.
[0105] Box 105 ultimately outputs a response packet, which is returned to the user interface or the caller.
[0106] For example: Answer:
[0107] I. Core Analysis Process
[0108] A standard single-cell RNA-seq analysis typically includes the following key steps:
[0109] 1. Raw data quality control and preprocessing: Quality assessment, adapter filtering, and low-quality sequence filtering are performed on the raw sequencing data generated by sequencing.
[0110] 2. Sequence alignment and quantification: The cleaned sequences are aligned to the reference genome, and the expression level of each gene in each cell is calculated (generating an expression matrix).
[0111] 3. Cell and gene quality control: Filtering low-quality cells (such as cells with an excessively high proportion of mitochondrial genes or too few genes detected) and cells with low gene expression.
[0112] 4. Data standardization and correction: Eliminate technical noise, such as differences in sequencing depth, and perform batch effect correction.
[0113] 5. Feature selection and dimensionality reduction: Screen for highly variable genes and use methods such as PCA, t-SNE, or UMAP for dimensionality reduction and visualization.
[0114] 6. Cell clustering and annotation: Cells are grouped based on expression profile similarity, and biological annotation of cell types is performed using known marker genes.
[0115] 7. Differential expression and function analysis: Compare gene expression differences in different cell populations or under different conditions, and perform downstream analyses such as pathway enrichment.
[0116] II. Mainstream Tools and Software Packages
[0117] The following are commonly used tools in each stage (mainly based on the R / Python ecosystem):
[0118] 1. Comprehensive Analysis Suite (One-Stop Solution)
[0119] (1) Seurat (R): Currently the most popular and comprehensive single-cell analysis toolkit, covering almost all aspects from quality control, standardization, dimensionality reduction, clustering to differential expression.
[0120] (2) Scanpy (Python): A Python-based benchmarking tool for Seurat, with equally powerful functions and closely integrated with the Python machine learning ecosystem.
[0121] (3) Scater / Scran (R): Focuses on quality control, processing and basic statistical analysis of single-cell data, and is often used in conjunction with Seurat.
[0122] 2. Upstream sequence processing
[0123] (1) Cell Ranger (10x Genomics official): A dedicated workflow for 10x Genomics platform data, which completes the generation of expression matrices from raw data.
[0124] (2) STARsolo, Alevin, kallisto | bustools: Efficient comparison and comparison tools suitable for data from multiple platforms.
[0125] 3. Batch effect correction and integration
[0126] Harmony, Seurat's IntegrateData function, BBKNN, Scanorama: used to integrate data from multiple samples or batches, eliminating technical variations.
[0127] 4. Cell type annotation
[0128] SingleR, scCATCH, celldex: Automatic or semi-automatic annotation of cell types using a reference dataset.
[0129] Cell marker gene databases, such as PanglaoDB and CellMarker, are used for manual annotation.
[0130] 5. Trajectory Inference and Quasi-Time Series Analysis
[0131] Monocle (2 / 3), Slingshot, PAGA: used to infer cell differentiation trajectories and sequencing.
[0132] 6. Advanced Analysis
[0133] (1) Intercellular communication: CellPhoneDB, CellChat.
[0134] (2) Transcription factor regulation: SCENIC.
[0135] (2) Copy number variation inference: inferCNV.
[0136] Source citations: [from knowledge graph], [from document 123], [from document 456]
[0137] Summary of this session quality assessment:
[0138] Contextual precision: 0.85; Answer fidelity: 0.90; Answer relevance: 0.88.
[0139] At this point, the system has completed an end-to-end intelligent question-answering process, from querying to obtaining high-quality, evaluable, and traceable answers. The integrated quality assessment provides direct data support for system performance monitoring, iterative optimization, and credibility presentation.
[0140] In some embodiments, the enterprise knowledge base question-and-answer system disclosed in this invention also includes identity authentication and access control design. For example, user Li Si, belonging to the three-tier organizational structure of "Company A - Cloud Product Department - Architecture Group," logs into the system, selects "Cloud Product Department Knowledge Base" and "Company Public Knowledge Base" on the interface, and initiates a query: "What are the pricing standards for cloud server CVM?"
[0141] Subsequently, the system performs identity authentication and permission resolution. A user identity token and a request context are required. In this embodiment, at stage 101, i.e., the query preprocessing stage, the system first invokes the access control service before initiating the search. This service performs the following operations:
[0142] Decrypt the user_token, call the enterprise's unified identity authentication service, and obtain the detailed identity information of user "Li Si", including the organizational structure path to which he belongs: company: Tencent, department: Cloud_Product, group: Architecture.
[0143] Subsequently, based on the organizational structure information, the access control database is queried. The database contains a table named `knowledge_base_access_control`, which records the authorization relationships between knowledge bases and organizational structure nodes, namely companies, departments, groups, and individuals. The service executes a query to retrieve a list of all knowledge base IDs that "Li Si" has the right to access. The results may include: all knowledge bases under his "Cloud Product Department" (such as `knowledge_base_cloud`), company-level public knowledge bases (such as `knowledge_base_public`), and specific knowledge bases actively shared with him by other teams.
[0144] Subsequently, the list of knowledge base IDs ["knowledge_base_cloud", "knowledge_base_public"] in the user request was compared with the calculated list of authorized access. The verification found that both existed in the allowed list, and the permission was granted.
[0145] For example, the output of this process is a security context object, where the key field is a list of knowledge base IDs allowed for this session: allowed_kb_ids: ["knowledge_base_cloud", "knowledge_base_public", ...]. This object will be passed as metadata to all subsequent steps.
[0146] Therefore, in box 102 mentioned above, that is, the mixed retrieval stage, all three channels of vector retrieval, keyword retrieval and knowledge graph retrieval add allowed_kb_ids as a mandatory filter condition to their query statements when executing queries.
[0147] All search results originate solely from knowledge bases that the user has access to. Data from knowledge bases that the user does not have access to is completely excluded at the search level and will not appear in any intermediate results.
[0148] By embedding access control into the process in the form of a security context and extending it through all data access layers, cross-organizational and cross-team data leaks are effectively prevented, ensuring the security of information boundaries.
[0149] Figure 3 A block diagram of an electronic device 300 that can implement various embodiments of the present disclosure is shown. For example... Figure 3 As shown, device 300 includes a processor 301, which can perform various appropriate actions and processes based on computer program instructions loaded into random access memory (RAM) 303 according to computer program instructions stored in read-only memory (ROM) 302. RAM 303 may also store various programs and data required for the operation of device 300. The processor 301, ROM 302, and RAM 303 are interconnected via bus 304. Input / output (I / O) interface 305 is also connected to bus 304.
[0150] The various processes and procedures described above, such as method 100, can be executed by processor 301. For example, in some embodiments, method 100 may be implemented as a software program tangibly contained in a machine-readable medium. In some embodiments, part or all of the software program may be loaded and / or installed on device 300 via ROM 302. When the software program is loaded into RAM 303 and executed by processor 301, one or more actions of method 300 described above may be performed.
[0151] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0152] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing. Furthermore, although operations are depicted in a specific order, this should be understood as requiring that such operations be performed in the specific order shown or in sequential order, or requiring that all illustrated operations be performed to achieve the desired result. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the foregoing discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single implementation. Conversely, various features described in the context of a single implementation may also be implemented individually or in any suitable sub-combination in multiple implementations.
[0153] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A question-answering method for enterprise knowledge bases based on fusion retrieval, characterized in that: It includes the following steps: Accept user queries; Based on the query statement, an intermediate result set is obtained through a three-channel retrieval; the three channels include a vector semantic retrieval channel, a keyword retrieval channel, and a knowledge graph retrieval channel. The intermediate result set contains search results from three channels, with the vector semantic channel containing vector similarity scores and the keyword search channel containing keyword matching scores. The intermediate result set is fused and reordered to generate a candidate information list; Based on the content of the candidate information list, an answer is generated using a large language model.
2. The enterprise knowledge base question-answering method based on fusion retrieval according to claim 1, characterized in that: In the process of fusing and reordering the intermediate result set, the same document segment that appears in both the vector retrieval results and the keyword retrieval results is selected. The vector similarity score and the keyword matching score corresponding to the document segment are fused to generate a comprehensive score. The candidate information list reflects each document segment and its corresponding comprehensive score, and is sorted according to the comprehensive score.
3. The enterprise knowledge base question-answering method based on fusion retrieval according to claim 2, characterized in that: When fusing the vector similarity score and the keyword matching score, a preset weight is used for calculation, and the weight value of the vector similarity score is greater than the weight value of the keyword matching score.
4. The enterprise knowledge base question-answering method based on fusion retrieval according to claim 2, characterized in that: The retrieval results of the knowledge graph retrieval channel include multiple sets of triple data of head entities, tail entities, and relation types, as well as the confidence score corresponding to each set of triple data. The confidence scores and the comprehensive scores of each document block are sorted together and reflected in the candidate information list.
5. The enterprise knowledge base question-answering method based on fusion retrieval according to claim 4, characterized in that: The confidence score corresponding to each set of triplet data is a score based on graph statistics or an auxiliary score based on vector similarity; the score based on graph statistics is derived from the frequency of use of relationships and / or from the importance of graph nodes.
6. The enterprise knowledge base question-answering method based on fusion retrieval according to claim 1, characterized in that: Before obtaining the intermediate result set through three-channel retrieval based on the question statement, the question statement is subjected to query understanding and preprocessing, which includes text standardization, keyword extraction, query vectorization, and entity recognition.
7. The enterprise knowledge base question-answering method based on fusion retrieval according to claim 1, characterized in that: During the process of generating an answer using a large language model based on the content of the candidate information list, a limit is imposed on the context tokens, and the large language model accepts the maximum number of tokens according to this limit value.
8. The enterprise knowledge base question-answering method based on fusion retrieval according to claim 1, characterized in that: After the large language model generates the answer, the question and answer are evaluated at both the retrieval end and the generation end. The retrieval end evaluation includes contextual precision evaluation, which is used to evaluate the proportion of the provided context that is truly relevant to the question. The generation end evaluation includes computational fidelity evaluation, which is used to evaluate the relevance of the generated answer.
9. An electronic device, comprising a processor and a memory; the processor being connected to the memory; the memory being used to store executable program code; the processor running a program corresponding to the executable program code by reading the executable program code stored in the memory, for performing the method as described in any one of claims 1-8.
10. A computer-readable storage medium for storing a computer program, characterized in that, When the computer program is executed by a processor, it is capable of performing the method as described in any one of claims 1-8.