Document retrieval control methods, systems and servers
By combining semantic models to perform in-depth analysis of documents and building a knowledge base based on user profiles, the document retrieval process is optimized, solving the problems of low retrieval accuracy and long response time in the RAG system, and achieving efficient and accurate document retrieval.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-15
- Publication Date
- 2026-03-10
AI Technical Summary
Existing retrieval augmentation (RAG) systems suffer from decreased retrieval accuracy and increased response time when faced with massive amounts of diverse documents. They also lack intelligent knowledge base recommendation capabilities, and manual classification is inefficient and lacks semantic understanding.
By combining semantic models to perform in-depth analysis of documents, the original documents uploaded by users are obtained. A knowledge base is built using the semantic analysis results and user profile data. Vector retrieval is then performed to generate relevant document fragments, thus optimizing the document retrieval process.
It improves retrieval accuracy and efficiency, reduces the retrieval scope, and solves the problems of insufficient recommendation accuracy, low level of intelligence, and long response time in traditional RAG systems.
Smart Images

Figure CN121327210B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of document retrieval technology, and in particular to a document retrieval control method, system and server. Background Technology
[0002] As enterprises deepen their digital transformation, various organizations have accumulated massive amounts of electronic documents, including technical documents, policy documents, business process documents, training materials, and more. These documents contain the company's core knowledge assets, and how to efficiently retrieve and utilize this knowledge has become a key issue in improving organizational efficiency.
[0003] Retrieval-Augmented Generation (RAG) technology, as a mainstream knowledge retrieval solution, vectorizes documents and builds knowledge bases to provide relevant background knowledge for large language models, thereby generating more accurate and targeted answers. Existing multi-knowledge-base RAG systems primarily rely on manually preset knowledge base classification rules, requiring professionals to manually develop classification systems based on business needs. After documents are uploaded, administrators or business experts manually review the content and assign them to the appropriate knowledge base. When users search, knowledge base selection is based on simple keyword matching or manually assigned rules. It is evident that existing RAG systems lack intelligent knowledge base recommendation capabilities, and their classification rules and recommendation strategies are relatively fixed. Therefore, when faced with massive amounts of diverse documents, traditional RAG systems suffer from decreased retrieval accuracy and increased response time. Summary of the Invention
[0004] In view of this, the purpose of this invention is to provide a document retrieval control method, system, and server. This method can combine semantic models to perform in-depth analysis of documents during the document analysis process, thereby solving the problems of low efficiency and insufficient semantic understanding ability of traditional RAG systems. In addition, this method can combine semantic models to fully understand user needs and output the knowledge base most relevant to the query information, reducing the retrieval scope and improving retrieval efficiency and accuracy, thereby solving the problems of insufficient recommendation accuracy, low level of intelligence, poor retrieval accuracy, and long response time of traditional RAG systems.
[0005] In a first aspect, embodiments of the present invention provide a document retrieval control method, the method comprising:
[0006] Document acquisition steps: Acquire the original document uploaded by the user, determine the document parsing strategy using the type parameter of the original document, and parse the text data corresponding to the original document according to the document parsing strategy to obtain the document data corresponding to the original document;
[0007] Document analysis steps: Determine the semantic analysis results corresponding to the document data based on the file name corresponding to the original document, and determine the content topic parameters and content type parameters of the document data based on the semantic analysis results;
[0008] Knowledge base construction steps: Construct the knowledge base corresponding to the document data using content topic parameters and content type parameters, and determine the metadata corresponding to the knowledge base based on the document data;
[0009] User profile management steps: Based on the query information corresponding to the user, determine the static attribute features and dynamic query features corresponding to the user, and determine the user profile data corresponding to the user through the static attribute features and dynamic query features;
[0010] Recommended control steps: Construct structured information corresponding to the query information using user profile data and metadata, and obtain multiple sub-knowledge bases corresponding to the structured information from the knowledge base;
[0011] Search execution steps: Determine the search parameters corresponding to multiple sub-knowledge bases, and use the search parameters to perform vector search on multiple sub-knowledge bases to obtain the document fragments corresponding to the query information;
[0012] Result generation steps: Generate document search results for the user based on document fragments and their corresponding query information.
[0013] Optional document retrieval steps include:
[0014] Obtain one or more original documents uploaded by users, such as technical documents, policy documents, business process documents, and training materials, and determine the type parameters using the document format of the original documents;
[0015] The document parsing library corresponding to the original document is determined based on the type parameter, and the document parsing strategy corresponding to the original document is determined through the document parsing library.
[0016] The document parsing strategy is used to extract the text data contained in the original document and calculate the MD5 hash value corresponding to the text data.
[0017] After deduplicating the text data using the MD5 hash value, the original document data is obtained.
[0018] Optional document analysis steps include:
[0019] Obtain the file name corresponding to the original document, and after truncating the file name based on preset tags, obtain the attribute string corresponding to the original document;
[0020] The semantic analysis prompts corresponding to the document data are determined by using attribute strings, and the semantic analysis results and content summary results corresponding to the semantic analysis prompts are obtained by using a preset semantic model.
[0021] The business domain parameters and professional direction parameters corresponding to the document data are determined by semantic analysis results and content summaries, and the content topic parameters are determined based on the business domain parameters and professional direction parameters.
[0022] The writing style parameters, keyword parameters, and structural feature parameters corresponding to the document data are determined by semantic analysis results and content summaries, and the content type parameters are determined based on the writing style parameters, keyword parameters, and structural feature parameters.
[0023] Optional knowledge base construction steps include:
[0024] Determine the document feature parameters corresponding to the document data based on the content topic parameters and content type parameters;
[0025] Semantic models are used to determine the knowledge base allocation strategy and knowledge base construction strategy corresponding to document feature parameters.
[0026] The target library in the knowledge base is determined based on the knowledge base allocation strategy, and the metadata of the knowledge base is determined based on the attribute parameters of the target library.
[0027] A knowledge base is built based on the knowledge base construction strategy to construct the knowledge base corresponding to the document data, and the metadata is determined according to the name parameters, description parameters and tag parameters corresponding to the knowledge base.
[0028] Optional profile management steps include:
[0029] Determine the corresponding user information query instructions and user behavior query instructions based on the query information;
[0030] The system uses user information query commands to obtain user-related role tag data, department affiliation data, permission level data, and professional field data, and uses the role tag data, department affiliation data, permission level data, and professional field data to determine the user's corresponding static attribute characteristics;
[0031] The system utilizes user behavior query commands to obtain user-related topic type data, business scenario data, and urgency data, and then uses this data to determine the user's dynamic query characteristics.
[0032] User profile data corresponding to a user is determined based on static attribute features and dynamic query features.
[0033] Optional, recommended control steps include:
[0034] Structured information is constructed by combining static attribute features and dynamic query features corresponding to user profile data, metadata corresponding to the knowledge base, and query information.
[0035] Utilize structured information to determine the knowledge base filtering prompts corresponding to the query information, and use semantic models to obtain the knowledge base list corresponding to the knowledge base filtering prompts;
[0036] Use a knowledge base list to retrieve multiple sub-knowledge bases corresponding to structured information from the knowledge base.
[0037] Optionally, the retrieval execution steps include:
[0038] The RAG retrieval parameters corresponding to the query information are determined based on the range parameters corresponding to multiple sub-knowledge bases.
[0039] After searching multiple sub-knowledge bases using RAG retrieval parameters, the similarity between the RAG retrieval parameters and the vector index parameters corresponding to the multiple sub-knowledge bases is obtained.
[0040] Obtain the vector index corresponding to the similarity greater than a preset threshold, use the vector index to determine the corresponding document knowledge block in multiple sub-knowledge bases, and determine the document fragment corresponding to the query information based on the document knowledge block.
[0041] Optional, the result generation step includes:
[0042] Determine the corresponding document synthesis prompts for the user based on the document fragments and their corresponding query information;
[0043] Semantic models are used to obtain document synthesis results corresponding to document synthesis prompts, and document retrieval results are determined based on the document synthesis results.
[0044] Secondly, the present invention provides a document retrieval and control system, the system comprising:
[0045] The document acquisition module is used to acquire the original document uploaded by the user, determine the document parsing strategy using the type parameter of the original document, and parse the text data corresponding to the original document according to the document parsing strategy to obtain the document data corresponding to the original document.
[0046] The document analysis module is used to determine the semantic analysis results of the document data based on the file name corresponding to the original document, and to determine the content topic parameters and content type parameters of the document data based on the semantic analysis results.
[0047] The knowledge base construction module is used to construct the knowledge base corresponding to the document data using content topic parameters and content type parameters, and to determine the metadata corresponding to the knowledge base based on the document data.
[0048] The profile management module is used to determine the static attribute features and dynamic query features of a user based on the query information corresponding to the user, and to determine the user profile data corresponding to the user through the static attribute features and dynamic query features.
[0049] The recommendation control module is used to construct structured information corresponding to the query information through user profile data and metadata, and to obtain multiple sub-knowledge bases in the knowledge base that correspond to the structured information.
[0050] The retrieval execution module is used to determine the retrieval parameters corresponding to multiple sub-knowledge bases, and to perform vector retrieval on multiple sub-knowledge bases using the retrieval parameters to obtain the document fragments corresponding to the query information;
[0051] The results generation module is used to generate document search results for the user based on document fragments and their corresponding query information.
[0052] Thirdly, embodiments of the present invention also provide a server, including a processor and a memory, the memory storing computer-executable instructions that can be executed by the processor, the processor executing the computer-executable instructions to implement the steps of the document retrieval control method provided in the first aspect.
[0053] Fourthly, embodiments of the present invention also provide a storage medium storing computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the steps of the document retrieval control method provided in the first aspect.
[0054] This invention provides a document retrieval control method, system, and server. In the document retrieval control process, the method first acquires the original document uploaded by the user, determines the document parsing strategy using the type parameters of the original document, and parses the text data corresponding to the original document according to the parsing strategy to obtain the document data corresponding to the original document. Then, it determines the semantic analysis result corresponding to the document data based on the file name corresponding to the original document, and determines the content topic parameters and content type parameters of the document data based on the semantic analysis result. Subsequently, it constructs a knowledge base corresponding to the document data using the content topic parameters and content type parameters, and determines the metadata corresponding to the knowledge base based on the document data. Then, it determines the static attribute features and dynamic query features corresponding to the user based on the user's query information, and determines the user profile data corresponding to the user through the static attribute features and dynamic query features. Subsequently, it constructs structured information corresponding to the query information using the user profile data and metadata, and obtains multiple sub-knowledge bases corresponding to the structured information in the knowledge base. Then, the retrieval execution steps include: determining the retrieval parameters corresponding to the multiple sub-knowledge bases, and performing vector retrieval on the multiple sub-knowledge bases using the retrieval parameters to obtain the document fragments corresponding to the query information. Finally, it generates the document retrieval results corresponding to the user based on the document fragments and their corresponding query information. This method can combine semantic models to perform in-depth analysis of documents during document analysis, thereby solving the problems of low efficiency and insufficient semantic understanding in traditional RAG systems. In addition, this method can fully understand user needs by combining semantic models and output the most relevant knowledge base to the query information, reducing the search scope and improving search efficiency and accuracy. This solves the problems of insufficient recommendation accuracy, low level of intelligence, poor search accuracy and long response time in traditional RAG systems.
[0055] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.
[0056] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0057] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0058] Figure 1 A flowchart of a document retrieval control method provided in an embodiment of the present invention;
[0059] Figure 2 A flowchart of document acquisition step S101 of a document retrieval control method provided in an embodiment of the present invention;
[0060] Figure 3 A flowchart of document analysis step S102 of a document retrieval control method provided in an embodiment of the present invention;
[0061] Figure 4 A flowchart of the knowledge base construction step S103 of a document retrieval control method provided in an embodiment of the present invention;
[0062] Figure 5 A flowchart of the profile management step S104 of a document retrieval control method provided in an embodiment of the present invention;
[0063] Figure 6 A flowchart of the recommended control step S105 of a document retrieval control method provided in an embodiment of the present invention;
[0064] Figure 7 A flowchart of the retrieval execution step S106 of a document retrieval control method provided in an embodiment of the present invention;
[0065] Figure 8 A flowchart of the result generation step S107 of a document retrieval control method provided in an embodiment of the present invention;
[0066] Figure 9 A flowchart of another document retrieval control method provided in an embodiment of the present invention;
[0067] Figure 10 This is a schematic diagram of the structure of a document retrieval control system provided in an embodiment of the present invention;
[0068] Figure 11 This is a schematic diagram of the structure of a server provided in an embodiment of the present invention.
[0069] icon:
[0070] 1010 - Document Acquisition Module; 1020 - Document Analysis Module; 1030 - Knowledge Base Construction Module; 1040 - Profile Management Module; 1050 - Recommendation Control Module; 1060 - Retrieval Execution Module; 1070 - Result Generation Module;
[0071] 101 - Processor; 102 - Memory; 103 - Bus; 104 - Communication interface. Detailed Implementation
[0072] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0073] To facilitate understanding of this embodiment, a document retrieval control method disclosed in this embodiment of the invention will first be described in detail, such as... Figure 1 As shown, the method includes:
[0074] Document acquisition step S101: Acquire the original document uploaded by the user, determine the document parsing strategy using the type parameter of the original document, and parse the text data corresponding to the original document according to the document parsing strategy to obtain the document data corresponding to the original document.
[0075] First, the original documents uploaded by users (such as PDF, Word, Excel, and other file formats) are acquired. The document type parameters (i.e., document format category; different formats have different parsing logics. For example, PDF requires processing layout and embedded text, Excel requires extracting structured table data, and Word can directly extract the main text content) are then matched according to the identified type parameters. Next, a corresponding document parsing strategy is matched based on the identified type parameters (e.g., OCR text recognition is used to assist parsing for image-based PDFs, and formula preservation is used for Word documents with formulas). Finally, the text data (including main text, titles, and annotations) in the original document is extracted and formatted according to this parsing strategy, ultimately yielding structured or semi-structured document data, laying the foundation for subsequent document analysis and knowledge base construction.
[0076] Document analysis step S102: Determine the semantic analysis result corresponding to the document data based on the file name corresponding to the original document, and determine the content topic parameter and content type parameter of the document data based on the semantic analysis result.
[0077] After obtaining the document data, the original document filename is used as the core entry point (the filename usually contains the core information of the document). The filename is combined with the document data and input into the semantic model for analysis, resulting in a semantic analysis result containing core keywords and information association logic. Based on this semantic analysis result, two key parameters are further decomposed: one is the content topic parameter, and the other is the content type parameter (i.e., the functional attributes of the document, such as plan type, report type, contract type, data statistics table, etc.). These two parameters will directly determine the subsequent classification logic of the document in the knowledge base, ensuring that the document data can be accurately classified.
[0078] Knowledge base construction step S103: Construct the knowledge base corresponding to the document data using the content topic parameters and content type parameters, and determine the metadata corresponding to the knowledge base based on the document data.
[0079] Using the content topic parameters and content type parameters obtained in step S102 as classification dimensions, all parsed document data is categorized and stored to construct a multi-dimensional knowledge base corresponding to the document data (e.g., divided into product development, market operation, and human resources libraries by topic, and further subdivided into solution sub-libraries, report sub-libraries, etc., under each topic library by type). At the same time, for each knowledge base, key descriptive information is extracted from the corresponding document data to generate metadata corresponding to the knowledge base (including document creation time, author, core keywords, storage path, update time, associated document identifiers, etc.). The metadata is equivalent to the index tags of the knowledge base, which can greatly improve the positioning efficiency during subsequent retrieval.
[0080] Profile management step S104: Based on the query information corresponding to the user, determine the static attribute features and dynamic query features corresponding to the user, and determine the user profile data corresponding to the user through the static attribute features and dynamic query features.
[0081] When a user initiates a search request, the system first parses the user's input query information. Based on this query information and relevant user data, two types of features are extracted: static attribute features (i.e., relatively fixed user attributes, such as user identity "product development engineer", department "R&D department", common business area "product iteration management", etc.) and dynamic query features (i.e., dynamic information related to the current query, such as the current query keyword "R&D progress node", query intent "get time node data", and product iteration plan preferences associated in historical query records, etc.). Subsequently, the static attribute features and dynamic query features are integrated to construct user profile data that accurately reflects user needs and identity attributes, avoiding misjudgments of needs caused by "only looking at query terms without considering user identity" (for example, when searching for "R&D progress", R&D engineers need detailed data, while management needs summary reports).
[0082] Recommended control step S105: Construct structured information corresponding to the query information through user profile data and metadata, and obtain multiple sub-knowledge bases in the knowledge base that correspond to the structured information.
[0083] The user profile data generated in step S104 is matched and analyzed with the knowledge base metadata generated in step S103. For example, the R&D engineer + attention progress node in the user profile is associated with "topic = product development + type = progress report" in the metadata. Based on this association, structured information corresponding to the query information is constructed (i.e., clear search filtering conditions: "topic = product development"; "type = progress-related documents"; "user identity = R&D engineer"). Then, based on this structured information, all local knowledge bases that meet the conditions are filtered from the total knowledge base, that is, multiple sub-knowledge bases corresponding to the structured information (such as "product development - progress report sub-base"; "product development - iteration plan sub-base"). By narrowing the search scope, the computational load of subsequent searches is reduced from the source.
[0084] Retrieval execution step S106: Determine the retrieval parameters corresponding to multiple sub-knowledge bases, and use the retrieval parameters to perform vector retrieval on multiple sub-knowledge bases to obtain the document fragments corresponding to the query information.
[0085] For the multiple sub-knowledge bases selected in step S105, the retrieval parameters corresponding to each sub-knowledge base are first determined (including the similarity threshold for vector retrieval, such as only retaining results with a vector similarity ≥85% to the query information, the upper limit of the number of retrieval results, the limit on the length of the extracted fragments, etc. The parameters of different sub-bases can be dynamically adjusted according to the document density. For example, the report sub-base needs a higher similarity threshold to ensure data accuracy). Then, the query information and the document data in the sub-knowledge bases are converted into semantic vectors. Vector retrieval is performed by calculating the cosine similarity between the vectors (compared to traditional keyword retrieval, vector retrieval can understand semantic associations). Finally, the part of the content that is most semantically relevant to the query information is selected from the sub-knowledge bases to obtain the document fragments corresponding to the query information (avoiding the return of complete documents, which would increase the user's screening cost).
[0086] Result generation step S107: Generate the document retrieval results corresponding to the user based on the document fragments and their corresponding query information.
[0087] The document fragments obtained in step S106 are processed a second time: First, the fragments are sorted in descending order according to their similarity to the query information to ensure that the most relevant fragments are displayed first; second, a source identifier (such as the corresponding sub-knowledge base name and the full document link) and a content summary (briefly describing the matching points between the fragment and the query information) are added to each fragment; finally, the processed document fragments are integrated into a clear and easy-to-read document retrieval result corresponding to the user, based on the user's query information, which ensures the accuracy of the results and improves the efficiency of the user in obtaining information.
[0088] Optionally, the document acquisition step S101 is responsible for receiving, formatting, extracting text content, deduplicating, and extracting basic metadata from the user-uploaded original document. Specifically, as follows... Figure 2 As shown, it includes:
[0089] Step S201: Obtain one or more original documents uploaded by the user, such as technical documents, policy documents, business process documents, and training materials, and determine the type parameters using the document format of the original documents.
[0090] The system first receives original documents uploaded by users. These documents cover common types across various business scenarios, such as technical documents in the technology research and development field (e.g., product design specifications, code development manuals), policy documents in the government or enterprise management field (e.g., industry standards, company regulations), business process documents in the business operations field (e.g., approval process guidelines, customer service standards), and training materials in the human resources field (e.g., new employee onboarding manuals, job skills training courseware). Uploading of a single or multiple document types simultaneously is supported. After acquiring the document, the system identifies its format suffix (e.g., .pdf, .docx, .xlsx, .txt, etc.) or underlying file structure to determine the original document's type parameters (i.e., format category identifiers, such as "PDF format," "Word format," "Excel format," etc.). The core function of the type parameters is to provide a basis for subsequently selecting the appropriate parsing tool, as different document formats store text differently (e.g., PDF may contain scanned image content, while Excel stores data in table cells).
[0091] Step S202: Determine the document parsing library corresponding to the original document based on the type parameter, and determine the document parsing strategy corresponding to the original document through the document parsing library.
[0092] Based on the type parameters obtained in step S201, the corresponding document parsing library is matched from a preset toolset. For example, for PDF documents, a parsing library that supports layout parsing and OCR (Optical Character Recognition) (such as PyPDF2, Tesseract) is called; for Word documents, a parsing library that can directly extract structured text (such as python-docx) is called; and for Excel documents, a parsing library that supports table data extraction (such as pandas) is called. After the document parsing library is determined, a specific document parsing strategy is generated based on the library's functional characteristics and the potential characteristics of the original document (such as whether it is a scanned PDF, whether it contains complex formulas or charts). For example, if the PDF is identified as a scanned image, the parsing strategy will include the step of "first performing OCR to recognize the text in the image, and then extracting the recognition results"; if it is a Word document with complex tables, the parsing strategy will explicitly state the rule of "preserving the table structure and extracting the cell content according to the row and column relationships" to ensure the integrity and structural accuracy of the text data.
[0093] Step S203: Extract the text data contained in the original document using the document parsing strategy, and calculate the MD5 hash value corresponding to the text data.
[0094] Following the document parsing strategy determined in step S202, the original document undergoes deep processing to extract all text data, including not only the main text but also titles, subtitles, headers and footers, footers, footers, footers, captions below charts, and text information within tables, ensuring no critical information is omitted. After extraction, the MD5 hash value is calculated for the obtained complete text data (plain text content after removing formatting tags). An MD5 hash value is a 128-bit binary value generated by a hash algorithm, possessing uniqueness and irreversibility: identical text content will generate completely identical hash values, while even minor differences in the text (such as an extra space) will result in drastically different hash values. Calculating this value provides a precise comparison basis for subsequent deduplication processing.
[0095] Step S204: After deduplicating the text data using the MD5 hash value, the document data corresponding to the original document is obtained.
[0096] The MD5 hash value calculated in step S203 is compared with the hash values of the stored document data. If the same hash value exists, it means that the currently extracted text data is completely consistent with the content of the stored document (belonging to a duplicate document), and only one copy of the data is retained. If the hash values are all different, it is determined to be a new document, and the currently extracted text data is retained. After deduplication, the final structured, non-duplicate text information is the document data corresponding to the original document. This step effectively avoids storing duplicate content in the knowledge base, saving storage resources and reducing redundant information interference during subsequent retrieval, laying the foundation for efficient analysis and retrieval.
[0097] In specific scenarios, the document acquisition process supports multiple mainstream document formats such as PDF, Word, Excel, PowerPoint, and TXT. During content parsing, document parsing libraries such as docling and markitdown can be used to extract plain text content and basic metadata (such as filename, size, and creation time) from files of different formats. When deduplicating documents, the MD5 hash value of each document's content is calculated. By comparing these hash values, fast and efficient document deduplication is achieved, preventing duplicate information from appearing in the knowledge base.
[0098] Optionally, document analysis step S102 can perform in-depth analysis of the document content based on a large model, such as... Figure 3 As shown, it includes:
[0099] Step S301: Obtain the file name corresponding to the original document, and after truncating the file name based on the preset marker, obtain the attribute string corresponding to the original document.
[0100] First, the filename of the original document (e.g., "2025_Finance Department_Expense Reimbursement Approval Standard.pdf") is obtained, and the filename is structurally extracted based on preset delimiters (such as underscores "_", spaces "", parentheses "()", etc., which are usually used to split key information when manually naming the document). For example, for the above filename, after splitting by underscores, we can get fragments such as "2025", "Finance Department", "Expense Reimbursement Approval Standard", and "pdf". From these fragments, the parts that reflect the core attributes of the document are selected (excluding non-critical information such as format suffixes), and finally the attribute strings corresponding to the original document are formed (e.g., "2025, Finance Department, Expense Reimbursement Approval Standard"). These attribute strings are important anchors for subsequent semantic analysis, which can help large models quickly locate the potential related information of the document.
[0101] Step S302: Use attribute strings to determine the semantic analysis prompts corresponding to the document data, and use a preset semantic model to obtain the semantic analysis results and content summary results corresponding to the semantic analysis prompts.
[0102] Based on the attribute string obtained in step S301, semantic analysis prompts are constructed. These prompts explicitly require the large model to perform in-depth analysis of the document data, combining key attributes in the filename (such as "Finance Department" and "Expense Reimbursement"). For example, the prompt might be: "Please analyze the document content, combining the attributes 'Finance Department' and 'Expense Reimbursement Approval Specifications', and output the core semantic relationships of the document (such as the business processes involved and key entities) and a content summary (briefly summarizing the core information of the document)." Subsequently, a pre-defined semantic model (such as a large language model based on Transformer, capable of understanding complex text semantics) is invoked, and the document data and prompts are input into the model. Through contextual understanding of the document content and keyword association analysis, the model outputs two parts: first, semantic analysis results (including logical relationships within the document and extended dimensions of core issues); second, content summary results (a concise description of the core content of the document, such as "This document stipulates the application conditions, approval process, and handling methods for expense reimbursement by the Finance Department").
[0103] Step S303: Determine the business domain parameters and professional direction parameters corresponding to the document data through semantic analysis results and content summaries, and determine the content topic parameters based on the business domain parameters and professional direction parameters.
[0104] From the semantic analysis results and content summary obtained in step S302, two key parameters are further extracted: business domain parameters, which reflect the macro business scope to which the document belongs, such as "corporate financial management" and "administrative logistics" from "finance department, expense reimbursement"; and professional direction parameters, which focus on the specific sub-field of the document, such as "expense approval process" and "financial compliance management" from approval specifications.
[0105] By integrating business domain parameters and professional direction parameters, the content theme parameters are ultimately determined, which are the core topics of the document, such as "Approval standards and process requirements for expense reimbursement in corporate financial management." This parameter precisely defines the core content of the document, providing a key basis for subsequent knowledge base classification.
[0106] Step S304: Determine the writing style parameters, keyword parameters, and structural feature parameters corresponding to the document data through semantic analysis results and content summary, and determine the content type parameters based on the writing style parameters, keyword parameters, and structural feature parameters.
[0107] Based on the semantic analysis results and content summary from step S302, three more key parameters are extracted:
[0108] The writing style parameter reflects the language characteristics and formality of a document. For example, "standard documents" usually have an "instructional and clause-based" style, while "training documents" are mostly "explanatory and case-based".
[0109] Keyword parameters represent frequently occurring words in the document that represent core functions, such as "approval process," "responsible department," and "penalty for violations."
[0110] Structural feature parameters characterize the document's organizational form, such as "chapter-clause style", "flowchart + text description style", "problem-solution style", etc.
[0111] In specific scenarios, the document analysis step can perform deep parsing of document content based on a large model. As the core of document understanding, this step can call a large language model to perform deep semantic analysis and feature extraction on the preprocessed text content. The implementation process can integrate one or more large language models based on the Transformer architecture (such as DeepSeek, Qwen, etc.) via API.
[0112] During filename semantic parsing, specific prompts can be designed to guide the large-scale model in analyzing filenames and extracting key information such as time, department, document security level, and business domain. In content summary generation, the large-scale model is guided to generate multi-level content summaries (e.g., paragraph-level, document-level, topic-level) to concisely summarize the core content of the document. For document type identification, based on features such as writing style, keywords, and structure, the large-scale model can determine the document's type, such as technical documents, policy documents, business processes, and training materials. The topic domain extraction process leverages the large-scale model's semantic understanding capabilities to identify and extract one or more business domains or professional areas to which the document belongs.
[0113] This step can be performed in batches, supporting batch and asynchronous calls to documents to improve the processing efficiency of massive amounts of documents.
[0114] Optionally, in knowledge base construction step S103, based on the analysis results, the documents are automatically categorized and the knowledge base is dynamically created and updated, such as... Figure 4 As shown, it includes:
[0115] Step S401: Determine the document feature parameters corresponding to the document data based on the content topic parameters and content type parameters.
[0116] First, based on the content topic parameters (such as "approval standards for expense reimbursement in corporate financial management") and content type parameters (such as "internal management standard documents") determined in step S102, the two are integrated to extract document feature parameters that comprehensively represent the document's characteristics. Document feature parameters are a structured integration of the document's core attributes, and may include: topic keywords (such as "expense reimbursement," "approval standards"), type identifiers (such as "management standards"), related business areas (such as "financial management"), and core function descriptions (such as "clarifying reimbursement processes and compliance requirements"). These parameters are equivalent to the document's "feature tags," providing a precise basis for the subsequent allocation and construction of the knowledge base.
[0117] Step S402: Use the semantic model to determine the knowledge base allocation strategy and knowledge base construction strategy corresponding to the document feature parameters.
[0118] Then, the document feature parameters obtained in step S401 are input into a preset semantic model (such as a large language model with classification and decision-making capabilities). The model analyzes the matching degree between the feature parameters and the existing knowledge base system, and outputs two types of key strategies:
[0119] The knowledge base allocation strategy is used to determine whether document data should be assigned to an existing knowledge base or whether a new dedicated knowledge base needs to be created. For example, if the feature parameters highly match the theme and type of the existing "Enterprise Financial Management Standards Library" (similarity ≥ 90%), the strategy may be "assign to the existing library"; if the feature parameters are a completely new theme (such as "AI Product Development Compliance Standards", which has no corresponding existing library), the strategy is "create a new knowledge base".
[0120] The knowledge base construction strategy clarifies the structural design rules of the knowledge base, including data storage format (such as storing text vectors in a vector database and structured attributes in a relational database), hierarchical classification method (such as a three-level classification of "topic-subtopic-type"), and index construction rules (such as creating indexes by keywords and timestamps). For example, for process documents, the construction strategy may require "creating hierarchical indexes according to the applicable scenario and step order".
[0121] Step S403: Determine the target library in the knowledge base based on the knowledge base allocation strategy, and determine the metadata of the knowledge base based on the attribute parameters of the target library.
[0122] If the allocation strategy in step S402 is "included in the existing knowledge base," then based on the matching rules explicitly stated in the strategy, the most suitable target library (such as the "Enterprise Financial Management Standards Library" mentioned above) is located from the existing knowledge base system. Subsequently, the attribute parameters of this target library (including the library's subject scope, creation time, number of documents, associated departments, update frequency, etc.) are extracted and combined with the document's own characteristic parameters to generate the basic part of the knowledge base metadata. For example, the metadata will include information such as "target library identifier," "category path in the target library," and "relevance to other documents in the target library," ensuring that the document can be accurately located in the target library.
[0123] Step S404: Construct a knowledge base corresponding to the document data based on the knowledge base construction strategy, and determine the metadata according to the name parameters, description parameters and tag parameters corresponding to the knowledge base.
[0124] If the allocation strategy in step S402 is "create a new knowledge base," then a dedicated knowledge base is created for the document data according to the rules of the construction strategy: including defining the storage structure of the base, initializing the indexing system, and setting access permissions. Simultaneously, key information is extracted from document feature parameters and the construction process to generate the knowledge base's name parameters (e.g., "AI Product R&D Compliance Specifications Library," generated based on content topics), description parameters (e.g., "Storing compliance processes and risk control documents involved in the AI product R&D stage," generated based on content summaries), and tag parameters (e.g., "AI R&D," "Compliance Management," "Technical Documents," generated based on keyword parameters). These parameters are integrated into the metadata, forming complete knowledge base metadata (including name, description, tags, creation time, number of documents, etc.), providing a core index for rapid matching during subsequent retrieval.
[0125] In specific scenarios, the knowledge base construction step automatically categorizes documents and creates or updates the knowledge base based on the document features output from the document analysis step. The implementation is as follows:
[0126] Automatic classification: Taking the document type, topic domain, and other features extracted in the document analysis steps as input, and using the classification or clustering capabilities of the large language model, it determines which existing knowledge base the document should belong to, or whether a new knowledge base needs to be created.
[0127] Knowledge base creation: When it is determined that a new knowledge base needs to be created, the creation process will be automatically executed, and the large model will be called to automatically generate metadata such as the name, description and tags of the new knowledge base based on a set of categorized document contents.
[0128] Incremental Updates: Supports incremental updates. When a new document is uploaded, the above analysis and classification process will be executed automatically, and it will be accurately assigned to the most suitable knowledge base.
[0129] Optionally, the user profile management step S104 is responsible for managing and analyzing user information to provide a basis for personalized recommendations, such as... Figure 5 As shown, it includes:
[0130] Step S501: Determine the user information query instruction and user behavior query instruction corresponding to the user based on the query information.
[0131] First, the user's query input (such as "Please provide the progress report of the R&D department's projects this quarter") is parsed to identify key clues related to the user's own attributes and the current query behavior. Based on these clues, two types of query instructions are generated:
[0132] User information query commands are used to trigger the retrieval of basic user attribute data, such as "querying the user's role, department, and permission level";
[0133] User behavior query commands are used to trigger the analysis of a user's current query behavior characteristics, such as "analyze the topic, associated scenarios, and urgency of the query." These two types of commands respectively point to the user's "fixed attributes" and "dynamic needs," providing a clear direction for subsequent feature extraction.
[0134] Step S502: Use the user information query command to obtain the user's corresponding role tag data, department affiliation data, permission level data and professional field data, and determine the user's corresponding static attribute characteristics through the role tag data, department affiliation data, permission level data and professional field data.
[0135] This step executes the user information query instruction generated in step S501, retrieving four types of core data from the user base database:
[0136] Role tag data: A user's identity within the organization, such as "R&D Engineer", "Department Manager", "Intern", etc., reflecting the user's job responsibilities;
[0137] Departmental affiliation data: The specific department to which the user belongs, such as "Artificial Intelligence R&D Department", "Marketing Operations Department", "Finance Department", etc., which are related to the user's business scope;
[0138] Permission level data: The user's access permission level, such as "regular user", "administrator", "advanced user", etc., determines the scope of documents that can be retrieved;
[0139] Professional domain data: This reflects the user's professional background or frequently involved business areas, such as "machine learning," "supply chain management," and "legal compliance," thus showcasing the user's knowledge base.
[0140] By integrating and structuring these four types of data, static attribute features corresponding to users are formed. These features are stable and will not change with query behavior in the short term. For example, "Senior engineer in the R&D department, with professional background in the field of AI, and has permission to view project documents".
[0141] Step S503: Use user behavior query commands to obtain the user's corresponding topic type data, business scenario data, and urgency level data, and determine the user's corresponding dynamic query characteristics through the topic type data, business scenario data, and urgency level data.
[0142] This step executes the user behavior query instruction generated in step S501, and extracts three types of dynamic data by combining the text content of the query information, contextual information (such as whether it was submitted during working hours, whether it contains keywords such as "urgent"), and historical query records:
[0143] Topic type data: The core topic of the current query, such as "AI project progress in the R&D department" in the example above, which clearly indicates the content focus of the user;
[0144] Business scenario data: The specific business scenario associated with the query behavior, such as "project phase report", "daily progress tracking", "problem investigation", etc., reflecting the application scenario of the query;
[0145] Urgency level data: The user's timeliness requirement for the query results, such as "immediately needed", "within 24 hours", "no clear time limit", etc., is determined by keywords in the query (such as "urgent" or "as soon as possible") or submission time (such as outside working hours).
[0146] Based on these three types of data, dynamic query features corresponding to users are constructed. These features are real-time and change with the content and scenario of each query. For example, "The current query topic is AI project progress, the associated scenario is project report, and the need is urgent."
[0147] Step S504: Determine the user profile data corresponding to the user based on static attribute features and dynamic query features.
[0148] The static attribute features obtained in step S502 and the dynamic query features obtained in step S503 are fused together to form a complete user profile. During the fusion process, static features provide the user's "identity background" (e.g., "R&D engineer + AI field"), while dynamic features supplement the user's "current needs" (e.g., "checking AI project progress + urgent report"). Combined, the profile accurately reflects "who is checking, what they are checking, and why they are checking." For example, the final profile might be: "Senior AI engineer in R&D department, urgently needs to obtain the progress report of this quarter's AI project for project phase reporting." This type of profile data provides a personalized basis for subsequent search scope filtering and result priority ranking, ensuring that recommended documents not only conform to the user's identity and permissions but also accurately match their current needs.
[0149] In specific scenarios, this step is responsible for building and managing users' static and dynamic contextual features, providing a basis for intelligent recommendations. During static feature management, it's necessary to maintain basic user information, including role tags (such as R&D, sales, and management), department affiliation, permission level, and professional field. During dynamic contextual analysis, by analyzing users' current query behavior in real time, contextual features such as query topic type, business scenario, and urgency level are extracted.
[0150] Optionally, the recommended control step S105 intelligently decides and recommends the most relevant knowledge base based on user queries and profiles, such as... Figure 6 As shown, it includes:
[0151] Step S601: Construct structured information by using the static attribute features and dynamic query features corresponding to the user profile data, the metadata corresponding to the knowledge base, and the query information.
[0152] This step integrates multi-dimensional information to construct structured information for filtering the knowledge base. This information includes three core elements:
[0153] Static and dynamic characteristics of user profile data: Static attributes (such as "R&D engineer, AI professional field") determine the user's identity, permissions and knowledge background, while dynamic query characteristics (such as "query AI project progress, urgent needs") reflect the current specific needs;
[0154] Metadata of the knowledge base: includes the subject scope, type tags, related fields, update time, etc. (e.g., the metadata of "AI Project Management Library" may be marked "Subject = Project Progress Tracking, Type = Report, Related Department = R&D Department").
[0155] Original query information: The specific search content entered by the user (such as "the progress report of the AI project in the R&D department this quarter") serves as the direct basis for demand matching.
[0156] By logically linking these three types of information according to "user identity - demand topic - knowledge base attributes," structured information is ultimately formed. For example: "The user is an AI engineer in the R&D department and urgently needs to obtain the AI project progress report for this quarter. Match the knowledge base with the topic 'AI project progress,' the type 'report,' and the associated department 'R&D department.'" This type of structured information is essentially a clear set of filtering criteria, providing clear standards for subsequent knowledge base selection.
[0157] Step S602: Use structured information to determine the knowledge base filtering prompts corresponding to the query information, and use semantic model to obtain the knowledge base list corresponding to the knowledge base filtering prompts.
[0158] Based on the structured information constructed in step S601, knowledge base filtering prompts are generated. These prompts explicitly instruct the semantic model to select the most matching knowledge base from the overall knowledge base system according to the filtering conditions in the structured information. For example, the prompt might be: "Please filter knowledge bases based on the following conditions: 1. The topic contains 'AI project progress'; 2. The type is 'report'; 3. The associated department is 'R&D Department'; 4. It needs to be compatible with the permissions and requirements of AI engineers in the R&D Department. Return the name and matching degree of the knowledge base that meets the conditions."
[0159] Subsequently, a pre-defined semantic model (possessing logical matching and classification capabilities) is invoked. The model compares the filtering criteria in the structured information with the metadata of each knowledge base, calculating the matching degree (such as topic overlap, type consistency, departmental relevance, etc.), and then sorts the knowledge bases from highest to lowest matching degree to generate a list. The list not only includes the names of the knowledge bases that meet the criteria but also a matching degree score (e.g., "AI Project Progress Report Library, matching degree 92%; R&D Department Quarterly Report Summary Library, matching degree 85%)," ensuring the interpretability of the filtering results.
[0160] Step S603: Use the knowledge base list to obtain multiple sub-knowledge bases corresponding to the structured information from the knowledge base.
[0161] Finally, based on the knowledge base list generated in step S602, the corresponding specific knowledge bases are precisely located and extracted from the overall knowledge base system, i.e., multiple sub-knowledge bases corresponding to the structured information. For example, if the list contains "AI Project Progress Report Library" and "R&D Department Quarterly Report Summary Library", the complete data of these two libraries (including documents, indexes, metadata, etc.) can be directly retrieved.
[0162] These sub-knowledge bases are the most relevant local collections within the overall knowledge base to user needs. Their content is highly matched to the user's identity attributes and the current query topic (e.g., the "AI Project Progress Report Library" specifically stores progress reports for each stage of AI projects, perfectly meeting the user's need to "check AI project progress"). By extracting sub-knowledge bases, the search scope is narrowed from the vast overall knowledge base to focused local libraries, significantly reducing the computational load of subsequent searches and laying the foundation for improved efficiency and accuracy.
[0163] In practical scenarios, the recommendation control step, as the first stage of hierarchical retrieval, integrates various information and invokes a large model for intelligent decision-making, selecting the most relevant n knowledge bases (m>n) from all m knowledge bases. During information integration, three types of information need to be collected and structured: 1) the user's real-time query content; 2) the user's static and dynamic characteristics obtained from the user profile management step; and 3) metadata of all knowledge bases (name, description, tags, applicable roles, etc.). During the prompt word acquisition process, a dedicated prompt word template can be designed to integrate the above structured information into the large language model. This prompt word guides the large model to act as a "knowledge base recommendation expert," requiring it to reason and judge based on the input information. Based on its powerful semantic understanding and reasoning capabilities, the large model analyzes the matching degree between the user's intent and each knowledge base, ultimately outputting a list of knowledge bases sorted by relevance, and selecting the top n as the recommendation results.
[0164] Optionally, retrieval execution step S106 performs the final RAG retrieval within the recommended knowledge base and generates an answer, such as... Figure 7 As shown, it includes:
[0165] Step S701: Determine the RAG retrieval parameters corresponding to the query information based on the range parameters corresponding to multiple sub-knowledge bases.
[0166] First, the scope parameters of the multiple sub-knowledge bases selected in step S105 are analyzed. These parameters reflect the content characteristics of the sub-knowledge bases, such as: the topic focus of the sub-base (e.g., the "AI Project Progress Report Library" has a single topic and dense relevance), the granularity of document knowledge blocks (e.g., split by paragraph or by chapter), and the data update frequency (e.g., whether it includes documents from the latest quarter). Based on these scope parameters, the RAG retrieval parameters corresponding to the query information are dynamically adjusted and determined, including:
[0167] Similarity thresholds (for example, a higher threshold, such as ≥85%, can be set for sub-libraries with dense topics to avoid redundancy; for sub-libraries with broad topics, the threshold can be appropriately reduced to ≥80% to ensure coverage).
[0168] Search depth (e.g., for sub-databases with high timeliness requirements, prioritize searching documents from the last 3 months);
[0169] The maximum number of results returned (e.g., set based on the total number of documents in the sub-base to avoid returning too much fragmented information). These parameter settings directly affect the accuracy and efficiency of the search, ensuring adaptation to the characteristics of different sub-knowledge bases.
[0170] Step S702: After searching multiple sub-knowledge bases using RAG retrieval parameters, obtain the similarity between the RAG retrieval parameters and the vector index parameters corresponding to the multiple sub-knowledge bases.
[0171] Following the RAG retrieval parameters determined in step S701, retrieval operations are performed on multiple sub-knowledge bases: First, the user's query information is converted into semantic vectors (generated using the same embedding model as the document vectors in the sub-knowledge bases, ensuring vector space consistency). Simultaneously, pre-built vector index parameters in the sub-knowledge bases are invoked. These parameters are sets of semantic vectors converted from all document knowledge blocks (such as paragraphs and key sentences) within the sub-base, along with corresponding document location identifiers (e.g., which chapter of which document it belongs to). Then, by calculating the cosine similarity (measuring the consistency of vector direction; a value closer to 1 indicates greater semantic relevance) between the "query information vector" and each vector in the "sub-base vector index parameters," a similarity score is obtained. For example, the vector similarity between the query "AI project Q3 progress" and a document knowledge block "2024 Q3 AI R&D project progress node" might be 91%.
[0172] Step S703: Obtain the vector index corresponding to the similarity greater than the preset threshold, use the vector index to determine the corresponding document knowledge block in multiple sub-knowledge bases, and determine the document fragment corresponding to the query information based on the document knowledge block.
[0173] A preset similarity threshold is set (e.g., 85% as determined in step S701), and vector indices with similarity scores greater than this threshold are selected. The document knowledge blocks corresponding to these indices are determined to be highly relevant to the query information. Based on the selected vector indices, their associated document knowledge blocks (i.e., specific text fragments in the sub-knowledge base, such as paragraph 2 of the "Q3 Progress Summary" section of a report) are located. Finally, these document knowledge blocks undergo lightweight processing (e.g., removing redundant formatting and retaining core sentences) to form document fragments corresponding to the query information. For example, a fragment containing "Q3 model training completed, planned to enter the testing phase in October" is extracted from the "AI Project Progress Report Library," ensuring that the fragment fully carries the key information and is directly related to the query requirements.
[0174] The retrieval execution step, as the second stage of hierarchical retrieval, performs precise RAG retrieval within the n knowledge bases selected in the recommendation control step and generates the final answer. During vector retrieval, the user's query content is vectorized, and then a similarity search (e.g., using FAISS) is performed on the vector indexes of the recommended n knowledge bases to recall the most relevant document fragments or "knowledge blocks".
[0175] Optionally, the result generation step S107, such as Figure 8 As shown, it includes:
[0176] Step S801: Determine the document synthesis prompt words corresponding to the user based on the document fragment and its corresponding query information.
[0177] First, two core pieces of information are integrated: one is the document fragment obtained in step S106 (i.e., text content highly relevant to the query information, which may contain multiple scattered paragraphs or sentences, such as "AI project completed model training in Q3" or "planned to enter the testing phase in October"); the other is the user's original query information (such as "the progress report of the R&D department's AI project this quarter"). Based on these two parts of information, document-synthesized prompts corresponding to the user are constructed. The prompts need to clearly define the processing target of the semantic model and typically include the following elements:
[0178] The model should be centered on the user's query intent (e.g., "summarize the progress of AI projects this quarter").
[0179] Integration is based on the provided document fragments (avoiding fabricated information);
[0180] The output structure should be clear (e.g., bullet points explaining key progress and time nodes).
[0181] Retain key details (such as the specific task completion status and follow-up plans).
[0182] For example, the prompt might be: "Based on the following document fragment, summarize the core progress of the project around the query 'Progress Report of AI Projects in the R&D Department this Quarter,' and explain it in points according to 'Completed Work,' 'Incomplete Work,' and 'Subsequent Plans,' ensuring that the information comes entirely from the fragment and is logically coherent." Such prompts provide clear guidance for the semantic model synthesis process, ensuring that the output is both faithful to the original document fragment and accurately matches the user's needs.
[0183] Step S802: Use the semantic model to obtain the document synthesis result corresponding to the document synthesis prompt words, and determine the document retrieval result based on the document synthesis result.
[0184] The document synthesis prompt words constructed in step S801, along with the corresponding document fragments, are input into a preset semantic model (a large language model with text integration and logical organization capabilities). The model, understanding the requirements of the prompt words, processes the document fragments as follows:
[0185] Deduplication: Remove duplicate information from a fragment (e.g., when different document fragments mention the same progress node, keep only one instance);
[0186] Integration: Reorganizing scattered fragments according to logical relationships (such as integrating them according to time sequence or task type);
[0187] Extraction: Highlight the core content most relevant to the information being searched (e.g., if the user is interested in the progress of "this quarter", prioritize displaying the specific results of Q3).
[0188] Structured output: Output according to the format required by the prompt (such as bullet points, paragraphs, and clear headings).
[0189] The final generated document synthesis result is a refinement and reorganization of the original document fragments. For example, the progress of the AI project in the R&D department this quarter is as follows: 1. Completed work: Model training was completed in Q3 with an accuracy rate of 92%; 2. Subsequent plans: The testing phase will begin in October, and the first round of test reports is expected to be completed in November.
[0190] The result generation step can achieve context enhancement by combining the recalled knowledge blocks with the user's original query into a richer prompt. During answer generation, this enhanced prompt is input into a large language model, which generates an answer based on the provided context information and returns it to the user.
[0191] like Figure 9 The flowchart of another document retrieval control method is shown. The data access and preprocessing module corresponds to the document acquisition step; the intelligent analysis module corresponds to the document analysis step; and the automatic classification and knowledge base construction module corresponds to the knowledge base construction step.
[0192] Information integration corresponds to the profile management steps, the intelligent recommendation module corresponds to the recommendation control steps, the retrieval execution module corresponds to the retrieval execution steps, and answer generation corresponds to the result generation steps.
[0193] As can be seen from the above document retrieval control method, this method can combine semantic models to perform in-depth analysis of documents during the document analysis process, thereby solving the problems of low efficiency of manual classification and insufficient semantic understanding ability in traditional RAG systems. In addition, this method can fully understand the user's needs by combining semantic models and output the knowledge base most relevant to the query information, reducing the search scope and improving search efficiency and accuracy, thereby solving the problems of insufficient recommendation accuracy, low level of intelligence, poor search accuracy and long response time in traditional RAG systems.
[0194] Corresponding to the above-described document retrieval control method embodiments, this invention also provides a document retrieval control system, such as... Figure 10 As shown, the system includes:
[0195] The document acquisition module 1010 is used to acquire the original document uploaded by the user, determine the document parsing strategy using the type parameter of the original document, and parse the text data corresponding to the original document according to the document parsing strategy to obtain the document data corresponding to the original document.
[0196] The document analysis module 1020 is used to determine the semantic analysis results corresponding to the document data based on the file name corresponding to the original document, and to determine the content topic parameters and content type parameters of the document data based on the semantic analysis results.
[0197] The knowledge base construction module 1030 is used to construct a knowledge base corresponding to the document data using content topic parameters and content type parameters, and to determine the metadata corresponding to the knowledge base based on the document data.
[0198] The profile management module 1040 is used to determine the static attribute features and dynamic query features of a user based on the query information corresponding to the user, and to determine the user profile data corresponding to the user through the static attribute features and dynamic query features.
[0199] The recommendation control module 1050 is used to construct structured information corresponding to the query information through user profile data and metadata, and to obtain multiple sub-knowledge bases in the knowledge base that correspond to the structured information.
[0200] The retrieval execution module 1060 is used to determine the retrieval parameters corresponding to multiple sub-knowledge bases, and to perform vector retrieval on multiple sub-knowledge bases using the retrieval parameters to obtain the document fragments corresponding to the query information.
[0201] The result generation module 1070 is used to generate document retrieval results for the user based on document fragments and their corresponding query information.
[0202] As can be seen from the document retrieval control system described above, this system can combine semantic models to perform in-depth analysis of documents during the document analysis process, thereby solving the problems of low efficiency and insufficient semantic understanding ability of traditional RAG systems. In addition, the system can fully understand the user's needs by combining semantic models and output the knowledge base most relevant to the query information, reducing the search scope and improving search efficiency and accuracy, thereby solving the problems of insufficient recommendation accuracy, low level of intelligence, poor search accuracy and long response time of traditional RAG systems.
[0203] The document retrieval control system provided in this embodiment of the invention has the same implementation principle and technical effects as the aforementioned document retrieval control method embodiment. For the sake of brevity, any parts not mentioned in the system embodiment can be referred to the corresponding content in the aforementioned document retrieval control method embodiment.
[0204] This embodiment also provides a server, the structural diagram of which is shown below. Figure 11 As shown, the device includes a processor 101 and a memory 102; wherein, the memory 102 is used to store one or more computer instructions, which are executed by the processor to implement the steps of the document retrieval control method described above.
[0205] Figure 11 The server shown also includes a bus 103 and a communication interface 104. The processor 101, the communication interface 104, and the memory 102 are connected via the bus 103.
[0206] The memory 102 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device. The bus 103 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 11 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0207] The communication interface 104 is used to connect to at least one user terminal and other network units through a network interface, and to send encapsulated IPv4 packets or IPv4 packets to the user terminal through the network interface.
[0208] Processor 101 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 101 or by instructions in software form. The processor 101 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this disclosure. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this disclosure can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 102. The processor 101 reads the information in memory 102 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.
[0209] This invention also provides a storage medium storing a computer program, which, when run by a processor, executes the steps of the document retrieval control method described in the foregoing embodiments.
[0210] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, devices, and methods can be implemented in other ways. The system embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the coupling or direct coupling or communication connection shown or discussed may be through some communication interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0211] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0212] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0213] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0214] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A document search control method characterized by comprising: The method comprises: The document acquisition step: acquiring the original document uploaded by the user, determining the document parsing strategy by using the type parameter of the original document, and obtaining the document data corresponding to the original document by parsing the text data corresponding to the original document according to the document parsing strategy; The document analysis step: determining the semantic analysis result corresponding to the document data according to the file name corresponding to the original document, and determining the content theme parameter and the content type parameter of the document data based on the semantic analysis result; The knowledge base construction step: constructing the knowledge base corresponding to the document data by using the content theme parameter and the content type parameter, and determining the metadata corresponding to the knowledge base based on the document data; The portrait management step: determining the static attribute characteristics and dynamic query characteristics corresponding to the user based on the query information corresponding to the user, and determining the user portrait data corresponding to the user through the static attribute characteristics and the dynamic query characteristics; The recommendation control step: constructing the structured information corresponding to the query information through the user portrait data and the metadata, and acquiring a plurality of sub-knowledge bases corresponding to the structured information in the knowledge base; The retrieval execution step: determining the retrieval parameter corresponding to the plurality of sub-knowledge bases, and obtaining the document segment corresponding to the query information by performing vector retrieval on the plurality of sub-knowledge bases by using the retrieval parameter; The result generation step: generating the document retrieval result corresponding to the user based on the document segment and the query information corresponding thereto.
2. The document search control method according to claim 1, characterized by, The document acquisition step comprises: Acquire one or more of the original documents of technical documents, policy documents, business process documents, and training material documents uploaded by the user, and determine the type parameter by using the document format of the original document; Determine the document parsing library corresponding to the original document based on the type parameter, and determine the document parsing strategy corresponding to the original document through the document parsing library; Extract the text data contained in the original document by using the document parsing strategy, and calculate the MD5 hash value corresponding to the text data; After removing the text data by using the MD5 hash value, the document data corresponding to the original document is obtained.
3. The document search control method according to claim 1, characterized by, The document analysis step comprises: Acquire the file name corresponding to the original document, and obtain the attribute string corresponding to the original document by intercepting the file name based on a preset mark; Determine the semantic analysis prompt word corresponding to the document data by using the attribute string, and obtain the semantic analysis result and the content summary result corresponding to the semantic analysis prompt word by using a preset semantic model; Determine the business domain parameter and the professional direction parameter corresponding to the document data by using the semantic analysis result and the content summary, and determine the content theme parameter according to the business domain parameter and the professional direction parameter; Determine a writing style parameter, a keyword parameter and a structural feature parameter corresponding to the document data according to the semantic analysis result and the content summary, and determine the content type parameter according to the writing style parameter, the keyword parameter and the structural feature parameter.
4. The document search control method according to claim 3, characterized by, The knowledge base construction step comprises: Determine a document feature parameter corresponding to the document data according to the content theme parameter and the content type parameter; Determine a knowledge base allocation strategy and a knowledge base construction strategy corresponding to the document feature parameter by using the semantic model; Determine a target library corresponding to the knowledge base based on the knowledge base allocation strategy, and determine the metadata corresponding to the knowledge base according to the attribute parameter corresponding to the target library; Construct the knowledge base corresponding to the document data based on the knowledge base construction strategy, and determine the metadata according to the name parameter, the description parameter and the label parameter corresponding to the knowledge base.
5. The document search control method according to claim 1, characterized by, The portrait management step comprises: Determine a user information query instruction and a user behavior query instruction corresponding to the user according to the query information; Obtain role label data, department affiliation data, permission level data and professional field data corresponding to the user by using the user information query instruction, and determine the static attribute feature corresponding to the user through the role label data, the department affiliation data, the permission level data and the professional field data; Obtain theme type data, business scenario data and urgency level data corresponding to the user by using the user behavior query instruction, and determine the dynamic query feature corresponding to the user through the theme type data, the business scenario data and the urgency level data; Determine user portrait data corresponding to the user according to the static attribute feature and the dynamic query feature.
6. The document search control method according to claim 3, characterized by, The recommendation control step comprises: Construct the structured information by using the static attribute feature and the dynamic query feature corresponding to the user portrait data, the metadata corresponding to the knowledge base and the query information; Determine a knowledge base screening prompt word corresponding to the query information by using the structured information, and obtain a knowledge base list corresponding to the knowledge base screening prompt word by using the semantic model; Obtain a plurality of sub-knowledge bases corresponding to the structured information from the knowledge base by using the knowledge base list.
7. The document search control method according to claim 1, characterized by, The search execution step comprises: Determine a RAG search parameter corresponding to the query information based on the range parameter corresponding to the plurality of sub-knowledge bases; After searching the plurality of sub-knowledge bases by using the RAG search parameter, obtain a similarity between the RAG search parameter and a vector index parameter corresponding to the plurality of sub-knowledge bases; When the similarity is greater than a preset threshold, obtain a vector index corresponding to the similarity, determine a document knowledge block corresponding to the plurality of sub-knowledge bases by using the vector index, and determine the document segment corresponding to the query information based on the document knowledge block.
8. The document search control method according to claim 3, characterized by, The result generation step comprises: Determine a document synthesis prompt word corresponding to the user according to the document segment and the query information corresponding thereto; The semantic model is used to obtain a document synthesis result corresponding to the document synthesis prompt word, and the document retrieval result is determined based on the document synthesis result.
9. A document retrieval control system characterized by comprising: The system comprises: A document acquisition module is configured to acquire an original document uploaded by a user, determine a document analysis strategy based on a type parameter of the original document, and analyze text data corresponding to the original document based on the document analysis strategy to obtain document data corresponding to the original document. A document analysis module is configured to determine a semantic analysis result corresponding to the document data based on a file name of the original document, and determine a content theme parameter and a content type parameter of the document data based on the semantic analysis result. A knowledge base construction module is configured to construct a knowledge base corresponding to the document data based on the content theme parameter and the content type parameter, and determine metadata corresponding to the knowledge base based on the document data. A user portrait management module is configured to determine static attribute features and dynamic query features of the user based on query information corresponding to the user, and determine user portrait data corresponding to the user based on the static attribute features and the dynamic query features. A recommendation control module is configured to construct structured information corresponding to the query information based on the user portrait data and the metadata, and acquire a plurality of sub-knowledge bases corresponding to the structured information in the knowledge base. A retrieval execution module is configured to determine retrieval parameters corresponding to the plurality of sub-knowledge bases, and perform vector retrieval on the plurality of sub-knowledge bases based on the retrieval parameters to obtain document segments corresponding to the query information. A result generation module is configured to generate a document retrieval result corresponding to the user based on the document segments and the query information corresponding to the document segments.
10. A server, characterized by A processor and a memory are included, the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the steps of the document retrieval control method in any one of claims 1 to 8.
Citation Information
Patent Citations
Dynamic correlation enhancement retrieval generation system and method driven by intelligent knowledge graph
CN118839021A
Information retrieval-based answer generation method and device, equipment and medium
CN118897910A