Document type recommendation method based on large model
By constructing a vector knowledge base and hierarchical search technology, the problem of inefficient selection of document types in the intelligent reimbursement system is solved, and the intelligent, real-time and accurate recommendation of document types is realized, improving the automation and accuracy of the system.
Patent Information
- Application Number
- CN202511063072.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-31
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2045-07-31
AI Technical Summary
The existing intelligent reimbursement system is inefficient when users choose reimbursement documents types and is susceptible to manual subjective deviations, resulting in chain errors in the subsequent audit process, incomplete coverage of the traditional rule base and low retrieval efficiency.
By building a vector knowledge base, combining pre-trained rule mining models and BERT models, vectorized storage and hierarchical retrieval of document processing rules are carried out, and efficient similarity search is used to achieve intelligent recommendation of document types.
It improves the real-time and accuracy of document type recommendations, reduces the cost of manual intervention, realizes the intelligence, real-time and precision of document type recommendations, and improves the processing speed and the degree of automation of the system.
Smart Images

Figure CN120561382A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of financial data processing, and specifically relates to a document type recommendation method based on a large model. Background Art
[0002] With the acceleration of enterprise digital transformation, the demand for intelligent financial reimbursement processes is becoming increasingly urgent. Currently, intelligent reimbursement systems on the market primarily focus on optimizing the review process, with technological evolution focused on enhancing automated review processes. This involves leveraging technologies like optical character recognition (OCR) and rule engines to improve the automation of document field extraction, amount verification, and compliance verification. Currently, intelligent reimbursement systems have entered the "audit-driven" technology iteration phase, with widespread adoption of OCR text recognition, structured rule engines, and natural language processing (NLP) field extraction technologies.
[0003] However, the reimbursement scenarios of modern enterprises involve multiple types of documents such as invoices, consumption records, application forms, loan forms, etc., and the document processing rule files are often dynamically adjusted according to the region, department, and business type. At the current stage, when users use the reimbursement system to initiate reimbursement, they often manually understand the document processing rule files and then manually select the reimbursement document type and associate relevant bills. However, in this process, users need to repeatedly consult the document processing rule files or historical records to determine the document type. Especially when the rule processing files are frequently adjusted, the selection time increases significantly, resulting in inefficiency. In addition, manual selection is easily affected by subjective cognitive bias. If the document type is incorrectly selected, it will lead to chain errors in the subsequent review process.
[0004] Therefore, there is an urgent need to develop a document type recommendation method based on a large model that integrates data processing and intelligent document type recommendation. Summary of the Invention
[0005] In order to solve at least one technical problem existing in the background technology, the present application provides a document type recommendation method based on a large model. By constructing a vector knowledge base, the document recommendation type corresponding to the bill data is determined based on the vector knowledge base, thereby realizing intelligent recommendation of document types.
[0006] The technical solutions adopted in this application are: A first embodiment of the present application provides a document type recommendation method based on a large model, comprising: extracting text content of a document processing rule file, and segmenting the text content to obtain static processing rules of the document processing rule file; Obtain dynamic processing rules through pre-trained rule mining models and historical review document type recommendation results; Vectorizing and storing the static processing rules and the dynamic processing rules to construct a vector knowledge base; Receive the bill data uploaded by the user, and determine the document recommendation type corresponding to the bill data based on the vector knowledge base.
[0007] According to one embodiment of the present application, segmenting the text content to obtain the static processing rules of the document processing rule file specifically includes: Preliminarily segmenting the text content using a character window of a preset length to obtain a first text paragraph set; Detecting paragraph boundaries of the first text paragraph set by using a TextTiling algorithm, and correcting the paragraph boundaries of the first text paragraph set to obtain a second text paragraph set; Determining the inter-paragraph differences of each text paragraph in the second text paragraph set based on the bag-of-words model; Modifying paragraph boundaries in the second text paragraph set based on the inter-paragraph differences to obtain a third text paragraph set; Based on the third text paragraph set, a static processing rule is determined.
[0008] According to one embodiment of the present application, vectorizing and storing the static processing rules and the dynamic processing rules to construct a vector knowledge base specifically includes: The static processing rules and the dynamic processing rules are segmented using the BERT model to obtain corresponding CLS vectors. The CLS vector is stored to obtain the vector knowledge base.
[0009] According to one embodiment of the present application, receiving the bill data uploaded by the user and determining the recommended document type corresponding to the bill data based on the vector knowledge base specifically includes: performing standardization processing on the bill data to obtain standardized data; Extracting characteristic fields of the standardized data; Based on the feature fields, a hierarchical search is performed in the vector knowledge base to determine a recommended document type corresponding to the bill data; The characteristic fields include at least any one of the document number, date, amount, and consumption type.
[0010] According to an embodiment of the present application, performing a hierarchical search in the vector knowledge base based on the feature field to determine the document recommendation type corresponding to the bill data specifically includes: A multi-layer graph structure of a vector knowledge base is constructed based on the HNSW algorithm. Each layer of the multi-layer graph structure contains multiple CLS vectors. The node degree of each layer of the graph structure decays exponentially. The node degree is the number of adjacent vectors of each CLS vector. Performing a neighbor search on each layer of the graph structure based on the feature field to obtain the most similar CLS vector; Determining the static processing rule and / or the dynamic processing rule corresponding to the bill data based on the most similar CLS vector; Based on the static processing rule and / or the dynamic processing rule, a document recommendation type corresponding to the bill data is determined.
[0011] According to one embodiment of the present application, the multi-layer graph structure of the vector knowledge base constructed based on the HNSW algorithm specifically further includes: Clustering the CLS vectors to obtain multiple cluster centers, each of the cluster centers corresponds to an inverted list, and the multiple cluster centers form a similarity search library; Dynamically partition the newly added CLS vectors using the Faiss retrieval algorithm and update the similarity search library; A hierarchical search is performed based on the similarity search library.
[0012] According to an embodiment of the present application, performing a hierarchical search in the vector knowledge base based on the feature field to determine the document recommendation type corresponding to the bill data specifically includes: Generate a query vector based on the feature field, and calculate the similarity between the query vector and multiple cluster centers using the IVF algorithm; Based on the similarity sorting, a plurality of cluster centers with higher similarity are selected to obtain a candidate set; Constructing a multi-layer graph structure for the plurality of cluster centers in the candidate set by using the HNSW algorithm; Based on the query vector, a nearest neighbor search is performed on each layer of the graph structure to obtain the most similar CLS vector; Determining the static processing rule and / or the dynamic processing rule corresponding to the bill data based on the most similar CLS vector; Based on the static processing rule and / or the dynamic processing rule, a document recommendation type corresponding to the bill data is determined.
[0013] According to one embodiment of the present application, the method further includes: Pre-build large model service interfaces of various preset types; The data acquisition interface is configured to obtain the bill data uploaded by the user and the standardized processing process of the bill data; The data acquisition interface and multiple preset types of large model service interfaces are arranged in the interactive interface of the intelligent body.
[0014] A second aspect of the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the document type recommendation method based on a large model as described in any embodiment of the first aspect are implemented.
[0015] The third aspect of the present application provides a non-volatile computer storage medium having computer executable instructions stored thereon. When the computer executable instructions are executed by a processor, the document type recommendation method based on a large model as described in any embodiment of the first aspect is implemented.
[0016] Beneficial effects: The document type recommendation method based on a large model disclosed in the present application obtains implicit processing rules by segmenting the document processing rule file, and mines and analyzes dynamic processing rules. By uniformly vectorizing and storing static processing rules and the dynamic processing rules, the problem of incomplete coverage of the traditional rule library is solved. Through layered vectorization, data standardization and collaboration with the rule engine, the vector knowledge base storing the document processing rule file and implicit related information involved in bill filling is deeply integrated with the user's real-time unreimbursed data (invoices, application forms, loan forms, etc.), and reimbursement document type recommendations are generated through semantic reasoning, and a one-click jump interaction of "recommendation-filling form" is realized, which solves the pain point of the traditional reimbursement system relying on manual decision-making, realizes the intelligent, real-time and precise recommendation of document type, and improves the processing speed of documents. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings: Figure 1 A flowchart of a document type recommendation method based on a large model provided in an embodiment of the present application; Figure 2 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0018] Reference numerals: 810 , processor; 820 , communication interface; 830 , memory; 840 , communication bus. DETAILED DESCRIPTION
[0019] In order to more clearly illustrate the overall concept of the present application, a detailed description is given below in an illustrative manner in conjunction with the accompanying drawings.
[0020] The following description sets forth many specific details to facilitate a thorough understanding of the present application. However, the present application may also be implemented in other ways than those described herein, and therefore, the scope of protection of the present application is not limited by the specific embodiments disclosed below. It should be noted that the embodiments of the present application and the features of each embodiment may be combined with each other unless there is a conflict.
[0021] In this application, unless otherwise expressly specified and limited, a first feature "above" or "below" a second feature may be that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in an appropriate manner in any one or more embodiments or examples.
[0022] like Figure 1 As shown, the first embodiment of the present application provides a document type recommendation method based on a large model, comprising: Step 100: extract the text content of the document processing rule file and segment the text content to obtain the static processing rules of the document processing rule file.
[0023] Step 200: Obtain dynamic processing rules through the pre-trained rule mining model and the historical review document type recommendation results.
[0024] Step 300: vectorize and store the static processing rules and the dynamic processing rules to construct a vector knowledge base.
[0025] Step 400: Receive bill data uploaded by the user, and determine the recommended document type corresponding to the bill data based on the vector knowledge base.
[0026] A document type recommendation method based on a large model in this application can be applied to type recommendations when filling out various types of documents. Specifically, the document type recommendation method in this application can be applied to reimbursement document type recommendations. The following content of this application is detailed based on the scheme for recommending the filling-in types of reimbursement documents. When constructing a rule vector knowledge base for document type recommendation, traditional rule base methods usually directly perform full-text matching on reimbursement rule documents. However, this method has several significant problems: document processing rule files are often long and contain complex terms and details, and direct full-text matching may cause semantic breaks or loss of key information; in addition, due to the integrity of the context of the document processing rule file, if the document is not properly segmented, the contextual relationship of certain paragraphs may be destroyed, affecting subsequent semantic understanding and retrieval accuracy.
[0027] In step 100, the system first extracts the rule text related to document rule filling and processing from the document processing rule file and performs structured segmentation on the extracted relevant rule text to obtain the static processing rules for the document processing rule file. The resulting static processing rules are more easily vectorized, thereby improving subsequent retrieval accuracy and resolving the semantic gap caused by text fragmentation when processing document processing rule files.
[0028] In step 200, within the reimbursement system, static processing rules (such as "travel expenses must be linked to a requisition form") are typically explicitly defined by the enterprise and recorded in the relevant document processing rules file. However, in the actual reporting process, many implicit associations exist. These rules cannot be directly obtained from the explicit document processing rules file, but can be mined from historical audit data. For example, "catering invoice + transportation invoice" means "travel expenses." To automatically identify these implicit associations, the system requires a mechanism to learn and extract useful information from large amounts of historical data, and then derive dynamic processing rules based on these implicit associations.
[0029] First, a lightweight machine learning model (such as a random forest) is trained on historical audit data to identify implicit associations (e.g., combining restaurant and transportation invoices to generate travel expenses). The model's output rule paths are then converted into textual descriptions to ensure readability and operability. Specifically, historical audit data, including but not limited to invoices, consumption records, application forms, and historical reporting documents, is collected and organized. The raw data is cleaned and standardized, and useful features (such as amount, date, location, and invoice type) are extracted. The machine learning model then learns from this raw data to derive dynamic processing rules, such as the fact that the combination of "restaurant and transportation invoices" often corresponds to "travel expenses."
[0030] By using a pre-trained rule mining model to identify implicit associations from historical audit data and converting these rules into easy-to-understand and actionable text descriptions, the resulting dynamic processing rules significantly improve the accuracy of recommendations and the level of automation within the intelligent reimbursement system. This approach not only reduces the cost of manual intervention but also allows for rapid adaptation to business changes, providing enterprises with more flexible and efficient reimbursement solutions.
[0031] In step 300, the obtained static processing rules and dynamic processing rules are uniformly vectorized and stored, a vector knowledge base is constructed, and combined with an efficient index structure, millisecond-level retrieval of billions of vectors is achieved. The core of this step is to integrate different types of rules into a unified knowledge representation framework for subsequent rapid retrieval and application. Static processing rules are usually based on fixed business logic or document processing rule file provisions, such as "catering invoices are classified as entertainment expenses by default." Dynamic processing rules are implicit association information mined from historical data through machine learning, such as the aforementioned "catering invoices + transportation invoices → travel expenses." Through vectorized storage, these rules are converted into mathematical vector representations, which not only retains the core information of the rules, but also facilitates efficient computer processing.
[0032] The construction of a vector knowledge base not only improves rule storage efficiency but also makes similarity calculation and matching between rules more intuitive and rapid. Combined with efficient indexing structures such as inverted indexes or approximate nearest neighbor search algorithms, the system can retrieve the processing rule that best matches the current document from a vast pool of rules within milliseconds. This significantly improves the real-time and accuracy of document type recommendations, effectively resolving the technical issues of traditional rule bases, which rely on linear search, are unable to cope with massive document processing rule files, and suffer from low retrieval efficiency.
[0033] In step 400, the system matches user invoice data against the vector knowledge base to intelligently recommend document types, reducing manual intervention costs. Specifically, the ERP system builds a real-time, unified data pool for unreimbursed items to support subsequent intelligent recommendations. Through SQL dynamic queries and Java backend service calls, it extracts multi-source data, including user invoices, requisitions, loan forms, and spending records, in real time. Java code then performs data type identification, field alignment (e.g., converting timestamps to ISO8601 format), and null value filtering to ensure uniform formatting, ultimately outputting standardized JSON data. Furthermore, structured fields (e.g., amount, date) and unstructured fields (e.g., consumption location keywords) are extracted from the standardized JSON data. High-performance static processing rules (e.g., the company's document processing rules file) are prioritized for matching. If this fails, dynamic processing rules (e.g., historical implicit rules) are retrieved. A rule engine validation is then performed to verify whether the matching results comply with explicit rules (e.g., "travel expenses must be associated with a requisition"). In the event of a conflict, the explicit rule prevails.
[0034] The document type recommendation method based on a large model disclosed in this application obtains implicit processing rules by segmenting the document processing rule file, and mines and analyzes dynamic processing rules. By uniformly vectorizing and storing static processing rules and the dynamic processing rules, the problem of incomplete coverage of the traditional rule library is solved. Through the layered vectorization of the rule file, data standardization and collaboration with the rule engine, the vector knowledge base storing the document processing rule file and the implicit associated information involved in bill filling is deeply integrated with the user's real-time unreimbursed data (invoices, application forms, loan forms, etc.), and reimbursement document type recommendations are generated through semantic reasoning, and a one-click jump interaction of "recommendation-form filling" is realized. This solves the pain point of the traditional reimbursement system's reliance on manual decision-making, realizes the intelligent, real-time and precise recommendation of document type, and improves the processing speed of documents.
[0035] According to one embodiment of the present application, segmenting the text content to obtain the static processing rules of the document processing rule file specifically includes: Preliminarily segmenting the text content using a character window of a preset length to obtain a first text paragraph set; Detecting paragraph boundaries of the first text paragraph set by using a TextTiling algorithm, and correcting the paragraph boundaries of the first text paragraph set to obtain a second text paragraph set; Determining the inter-paragraph differences of each text paragraph in the second text paragraph set based on the bag-of-words model; Modifying paragraph boundaries in the second text paragraph set based on the inter-paragraph differences to obtain a third text paragraph set; Based on the third text paragraph set, a static processing rule is determined.
[0036] By performing reasonable text segmentation on the document processing rule file, we ensure that each paragraph contains complete semantic information and avoid truncation of key information or contextual fragmentation. Ultimately, we generate high-quality static processing rules, providing accurate basic data for subsequent document type recommendations.
[0037] Specifically, the long text content is initially segmented into multiple smaller paragraphs to facilitate subsequent finer boundary adjustments and semantic analysis. The text content is segmented using a pre-set window step size to generate a first set of text paragraphs, ensuring a certain degree of overlap between adjacent paragraphs and preserving contextual coherence. The paragraph boundaries of the first set of text paragraphs are then detected using the TextTiling algorithm, and the paragraph boundaries of the first set of text paragraphs are corrected to obtain a second set of text paragraphs. The difference between adjacent second sets of text paragraphs is calculated based on the bag-of-words model, and the segmentation point determination formula is: .
[0038] in, is the difference, represents a set of all possible words (i.e., the vocabulary in the bag-of-words model), is the frequency of word w in the previous text, for The frequency of words in the following text. When it is judged as a paragraph boundary ( is the threshold, the threshold experience value (This can be set to 1.2). Perform paragraph segmentation to obtain a third set of text paragraphs. Extract explicit static processing rules from this final set of third text paragraphs for subsequent document type recommendation. Convert the extracted rules into a structured format (such as JSON) for easy storage and query.
[0039] Through steps such as initial segmentation using a preset character window, boundary correction using the TextTiling algorithm, calculation of inter-paragraph differences using the bag-of-words model, and final paragraph boundary correction, long texts can be effectively segmented into semantically complete and coherent paragraphs. This allows for better capture of complex semantic patterns, extraction of high-quality static processing rules, and improved accuracy of subsequent vectorization and retrieval. This approach not only addresses the difficulty of traditional rule bases in processing long texts, which can lead to semantic fragmentation or loss of key information, but also significantly improves the accuracy and automation of recommendations in the intelligent reimbursement system.
[0040] According to one embodiment of the present application, vectorizing and storing the static processing rules and the dynamic processing rules to construct a vector knowledge base specifically includes: The static processing rules and the dynamic processing rules are segmented using the BERT model to obtain corresponding CLS vectors. The CLS vector is stored to obtain the vector knowledge base.
[0041] By using a pre-trained language model (such as BERT), static and dynamic processing rules are converted into vector representations, building a highly efficient vector knowledge base. This enables the system to quickly and accurately recommend appropriate document types based on user-uploaded invoice data, reducing manual intervention and improving work efficiency. Specifically, all static and dynamic processing rules are collected and formatted according to the BERT model's requirements (e.g., adding special tags like CLS and SEP). Each rule is tokenized using BERT's built-in tokenizer, breaking the original text into individual lexical units. The tokenized input is fed into the pre-trained BERT model, and the hidden state output of each layer is obtained. The vector corresponding to the CLS tag position in all hidden states is selected as the semantic representation of the entire sentence. The vector corresponding to the CLS tag of each sentence is extracted from the output of the BERT model's final layer as the semantic representation of the sentence, which is then used for subsequent similarity calculations and matching operations. The extracted CLS vectors for all static and dynamic processing rules are stored in a specially designed vector database, forming a knowledge base that supports efficient querying.
[0042] The BERT model performs word segmentation on static and dynamic processing rules and extracts CLS vectors to construct a vector knowledge base. This captures deeper semantic information, allowing vector-based similarity searches to achieve faster responses on large datasets. Because CLS vectors contain the semantic information of entire sentence rules, similarity calculations based on these vectors can more accurately identify the rules that best match user invoices, reducing false positives, improving matching accuracy, and meeting the needs of real-time recommendations. Furthermore, as corporate reimbursement rules evolve, new document processing rule files are constantly generated. The vector knowledge base can flexibly store and update these rules, maintaining the system's timeliness and adaptability.
[0043] According to one embodiment of the present application, receiving the bill data uploaded by the user and determining the recommended document type corresponding to the bill data based on the vector knowledge base specifically includes: performing standardization processing on the bill data to obtain standardized data; Extracting characteristic fields of the standardized data; Based on the feature fields, a hierarchical search is performed in the vector knowledge base to determine a recommended document type corresponding to the bill data; The characteristic fields include at least any one of the document number, date, amount, and consumption type.
[0044] By standardizing and extracting features from user-uploaded invoice data and leveraging a pre-built vector knowledge base, the system intelligently identifies the recommended document types corresponding to the invoice data. This process aims to reduce manual intervention and improve the automation and accuracy of the reimbursement process. Specifically, invoice data from various sources (such as ERP systems or user uploads) undergoes data cleansing to remove noise and correct erroneous or incomplete fields. All data fields are then standardized to pre-defined standard formats, such as ISO 8601 format for date fields and two decimal places for amount fields. This ensures that each invoice contains the necessary information and is output in JSON or other easily parsable formats. Key information is extracted from the standardized invoice data as feature fields for search and matching within the vector knowledge base. This involves selecting appropriate feature fields based on business requirements, including but not limited to document number, date, amount, and consumption type. The extracted feature fields are converted into numerical or categorical vector representations. Using these feature fields, efficient similarity searches are performed within the pre-built vector knowledge base. The search results are ranked by similarity score to identify the recommended document type that best matches the current invoice.
[0045] Standardizing invoice data ensures that all data is processed and analyzed within the same framework. Feature field extraction and vector similarity search enable more accurate identification of the document type that best matches the invoice content. Furthermore, through user feedback, the system continuously learns and improves its vector knowledge base to better serve actual business needs. Automated invoice processing and type recommendations significantly reduce the time and cost of manual review. Intelligent matching algorithms also reduce errors caused by human judgment, improve the accuracy and consistency of recommendation results, and enhance the efficiency of the overall reimbursement process.
[0046] According to an embodiment of the present application, performing a hierarchical search in the vector knowledge base based on the feature field to determine the document recommendation type corresponding to the bill data specifically includes: A multi-layer graph structure of a vector knowledge base is constructed based on the HNSW algorithm. Each layer of the multi-layer graph structure contains multiple CLS vectors. The node degree of each layer of the graph structure decays exponentially. The node degree is the number of adjacent vectors of each CLS vector. Performing a neighbor search on each layer of the graph structure based on the feature field to obtain the most similar CLS vector; Determining the static processing rule and / or the dynamic processing rule corresponding to the bill data based on the most similar CLS vector; Based on the static processing rule and / or the dynamic processing rule, a document recommendation type corresponding to the bill data is determined.
[0047] The system uses the multi-layer graph structure vector knowledge base built by the HNSW algorithm to perform efficient and accurate similarity searches on the bill data uploaded by users, thereby determining the most matching static processing rules and / or dynamic processing rules, and recommending the most suitable document type based on them. Specifically, the vector knowledge base is created as a multi-layer graph structure, with each layer containing a different number of nodes, namely CLS vectors. The node degree of each layer of the graph is set to decay exponentially. , that is, from the top layer to the bottom layer, the number of adjacent nodes of each node gradually increases, so that the top layer graph has fewer but more extensive connections, and the bottom layer graph is more dense. The adjacency relationship between nodes in each layer is calculated and established based on the similarity between vectors.
[0048] in: Refers to The node degree of the layer graph, Refers to the basic node degree (such as 16), refers to the attenuation factor (such as 1.2), Refers to the maximum number of layers in the graph, Refers to the current layer number.
[0049] The key feature fields in the bill data are converted into numerical or categorical vector representations. The initial search begins at the top graph, looking for the nodes closest to the query vector. The search progresses step by step down the graph layer, each time selecting the node closest to the query vector in the current layer as the starting point. The search continues downward until the bottom graph is reached. The nearest neighbor nodes found at all layers are summarized, sorted by similarity, and the top-K CLS vectors are selected as the final candidate set.
[0050] The CLS vector is mapped back to its original text form, and the static and / or dynamic processing rules corresponding to the invoice data are determined. The content and applicable conditions of these rules are analyzed to determine which rules apply to the current invoice data. Comprehensive reimbursement guidance is generated by comprehensively considering both static and dynamic processing rules. Furthermore, after determining the best-matching document type, the front-end component displays the recommended document type and related information, allowing users to jump to the corresponding reimbursement form with a single click. A feedback mechanism is also implemented to allow users to raise objections or suggestions to the recommended results, helping the system continuously learn and improve.
[0051] The HNSW algorithm builds a vector knowledge base with a multi-layered graph structure. This layered graph structure significantly reduces search time while maintaining a high recall rate, significantly improving search efficiency and making it particularly suitable for applications with large datasets. Furthermore, through feature field extraction and vector similarity search, it can more accurately identify the reimbursement rules corresponding to invoice data, reducing the possibility of misjudgment and improving overall system reliability.
[0052] According to one embodiment of the present application, the multi-layer graph structure of the vector knowledge base constructed based on the HNSW algorithm specifically includes: Clustering the CLS vectors to obtain multiple cluster centers, each of the cluster centers corresponds to an inverted list, and the multiple cluster centers form a similarity search library; Dynamically partition the newly added CLS vectors using the Faiss retrieval algorithm and update the similarity search library; A hierarchical search is performed based on the similarity search library.
[0053] By dividing all CLS vectors into clusters, each represented by a cluster center, we form a basic structure for efficient querying. Specifically, we use a clustering algorithm such as K-means to cluster all CLS vectors. We determine the appropriate number of clusters based on business needs and data size to balance query efficiency and recall. We calculate the mean of all vectors in each cluster as the cluster center, and create an inverted list for each cluster center, recording the IDs of all CLS vectors belonging to that cluster and their related information.
[0054] When a new CLS vector is added, the similarity between it and the existing cluster center is first calculated. Based on the similarity result, the new vector is assigned to the cluster corresponding to the cluster center closest to it, and the inverted list of the cluster is updated. If the data volume of a cluster exceeds the set threshold, the repartitioning operation is triggered, the cluster division is readjusted, and re-clustering is performed if necessary. The IVF mechanism provided by Faiss is used to dynamically maintain and optimize the index structure to ensure that query efficiency is not affected.
[0055] According to another embodiment of the present application, performing a hierarchical search in the vector knowledge base based on the feature field to determine the document recommendation type corresponding to the bill data specifically further includes: Generate a query vector based on the feature field, and calculate the similarity between the query vector and multiple cluster centers using the IVF algorithm; Based on the similarity sorting, a plurality of cluster centers with higher similarity are selected to obtain a candidate set; Constructing a multi-layer graph structure for the plurality of cluster centers in the candidate set by using the HNSW algorithm; Based on the query vector, a nearest neighbor search is performed on each layer of the graph structure to obtain the most similar CLS vector; Determining the static processing rule and / or the dynamic processing rule corresponding to the bill data based on the most similar CLS vector; Based on the static processing rule and / or the dynamic processing rule, a document recommendation type corresponding to the bill data is determined.
[0056] By combining the IVF and HNSW algorithms, we conduct efficient and accurate similarity searches on the recommended invoice data, identifying the most suitable static and / or dynamic processing rules and recommending the most suitable document type accordingly. This process aims to increase the automation level of the reimbursement process, reduce manual intervention, and improve system efficiency and accuracy.
[0057] Specifically, key information is extracted from the standardized invoice data to form feature fields. These feature fields are then converted into fixed-length vector representations using a pre-trained model to form a query vector. Furthermore, the IVF algorithm is used to calculate the similarity between the query vector and all cluster centers. All cluster centers are ranked according to the similarity score, and the top N cluster centers with the highest similarity are selected as the candidate set. Furthermore, a multi-level graph structure is created for the cluster centers in each candidate set. An efficient similarity search is performed on this constructed multi-level graph structure to find the CLS vectors closest to the query vector. These are then ranked by similarity, and the top-K CLS vectors are selected as the final candidate set. Based on the retrieved most similar CLS vectors, the associated reimbursement rules (static processing rules and / or dynamic processing rules) are identified. Based on the reimbursement rules determined in the above steps, the document type that best suits the current invoice data is recommended and fed back to the front-end interface for user confirmation or further action.
[0058] According to one embodiment of the present application, the method further includes: Pre-build large model service interfaces of various preset types; The data acquisition interface is configured to obtain the bill data uploaded by the user and the standardized processing process of the bill data; The data acquisition interface and multiple preset types of large model service interfaces are arranged in the interactive interface of the intelligent body.
[0059] By pre-building various pre-defined big model service interfaces and configuring the acquisition and standardized processing of user-uploaded invoice data as data retrieval interfaces, these interfaces are ultimately integrated into the agent's interactive interface, enabling efficient data processing and intelligent recommendations. This setup aims to enhance the system's flexibility, scalability, and user experience, ensuring the system can adapt to diverse data processing needs and simplifying user operations. Specifically, the different types of service interfaces to be supported are determined based on business requirements. Based on the needs of each service, appropriate big models are selected and corresponding API interfaces are developed. Each selected big model is encapsulated to conform to unified service specifications, including input and output formats and call methods. The acquired data is cleaned, formatted, and structured to generate a standard data format that meets system requirements. The API paths are dynamically configured in the agent's tool library, enabling the big model to call the interfaces on demand to obtain real-time business data. Furthermore, an intuitive and easy-to-use front-end interface is created, allowing users to easily upload invoice data and view processing results. The call logic for the data retrieval interface is embedded in the front-end interface, ensuring that user-uploaded invoice data is automatically acquired and standardized. The integration of various pre-defined big model service interfaces into the interactive interface allows users to select different services for processing as needed. By creating a front-end interface, the user's operation process is simplified and the user experience is improved.
[0060] In addition, to ensure the reliability of the RPC interface, it is possible to obtain user unreimbursed data in real time and implement interface data standardization, that is, to define constraints based on JSON Schema and adopt an exponential backoff retry strategy. .
[0061] in: is the retry interval, Refers to the initial retry delay time, It refers to the current number of retries.
[0062] This document type recommendation method encapsulates multi-source, heterogeneous business data (such as invoices and loan notes) into standardized API services and enables on-demand access to a large model through dynamic configuration. This creates a unified data service middleware layer, supporting interface-level permission control and ensuring data real-time availability. Furthermore, users can define the model's "identity" and answer rules during use, constraining its behavior (e.g., requiring formal expression and contextual dependencies). System prompts serve as implicit input, guiding the large model to generate consistent responses. This method addresses the difficulties of large models in directly processing multi-source, heterogeneous data and the inefficiency of traditional manual rule mapping, enabling automatic alignment of disparate data sources and strategic integration. Based on large model technology, an intelligent document type prediction agent is constructed. This agent, combined with the company's document processing rules and the user's real-time unreimbursed data, dynamically recommends appropriate document types to users. Through front-end design, users can directly navigate to the card page for submission by clicking on a recommended document type, achieving a one-click "recommendation-to-form submission" interaction on the front end.
[0063] The document type recommendation method based on a large model provided by this application combines the document processing rule file with vectorized storage for the first time to build a hierarchical vector knowledge base; in addition, the dynamic update mechanism supports real-time synchronization of new document processing rule files, solving the problem of delayed dynamic updates of traditional rule bases, and real-time linkage of multi-source document data with the dynamic rule base through standardized interfaces, thus realizing the coupling of document data and rule files; it promotes the transformation of document filling from "post-review" to "pre-recommendation", and realizes the paradigm upgrade from "manual decision-making" to "intelligent recommendation", filling the gap in the initiation stage of the intelligent document filling system. The technical solution of this application solves the pain points of the traditional reimbursement system's reliance on manual decision-making and the problems of low efficiency of document type recommendation and high cost of manual intervention due to data isolation and policy lag through the hierarchical vectorization, data standardization and rule engine collaboration of the document processing rule file, thus realizing the intelligent, real-time and precise recommendation of document type.
[0064] The second aspect of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the steps of the document type recommendation method based on a large model in any embodiment of the first aspect are implemented.
[0065] Figure 2 An example of a physical structure diagram of an electronic device is shown below. Figure 2As shown, the electronic device may include: a processor 810, a communications interface 820, a memory 830, and a communication bus 840, wherein the processor 810, the communications interface 820, and the memory 830 communicate with each other via the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to execute the document type recommendation method based on the large model in any embodiment of the first aspect described above, the method including: Step 100: extract the text content of the document processing rule file and segment the text content to obtain the static processing rules of the document processing rule file.
[0066] Step 200: Obtain dynamic processing rules through the pre-trained rule mining model and the historical review document type recommendation results.
[0067] Step 300: vectorize and store the static processing rules and the dynamic processing rules to construct a vector knowledge base.
[0068] Step 400: Receive bill data uploaded by the user, and determine the recommended document type corresponding to the bill data based on the vector knowledge base.
[0069] Furthermore, the logic instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion 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, stored in a storage medium, includes instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, mobile hard drives, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical disks.
[0070] In another aspect, the present invention further provides a computer program product, comprising a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer-readable storage medium is executed by a processor, the computer can execute the document type recommendation method based on a large model provided by each of the above methods, the method comprising: Step 100: extract the text content of the document processing rule file and segment the text content to obtain the static processing rules of the document processing rule file.
[0071] Step 200: Obtain dynamic processing rules through the pre-trained rule mining model and the historical review document type recommendation results.
[0072] Step 300: vectorize and store the static processing rules and the dynamic processing rules to construct a vector knowledge base.
[0073] Step 400: Receive bill data uploaded by the user, and determine the recommended document type corresponding to the bill data based on the vector knowledge base.
[0074] Finally, the present invention further provides a non-volatile computer storage medium having computer executable instructions stored thereon. When the computer executable instructions are executed by a processor, the document type recommendation method based on the large model provided by the above methods is implemented. The method includes: Step 100: extract the text content of the document processing rule file and segment the text content to obtain the static processing rules of the document processing rule file.
[0075] Step 200: Obtain dynamic processing rules through the pre-trained rule mining model and the historical review document type recommendation results.
[0076] Step 300: vectorize and store the static processing rules and the dynamic processing rules to construct a vector knowledge base.
[0077] Step 400: Receive bill data uploaded by the user, and determine the recommended document type corresponding to the bill data based on the vector knowledge base.
[0078] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.
[0079] The foregoing is merely an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included in the protection scope of the present application.
Claims
1. A document type recommendation method based on a large model, characterized in that: include: Extracting text content of the document processing rule file and segmenting the text content to obtain static processing rules of the document processing rule file; Obtain dynamic processing rules through pre-trained rule mining models and historical review document type recommendation results; Vectorizing and storing the static processing rules and the dynamic processing rules to construct a vector knowledge base; Receive the bill data uploaded by the user, and determine the document recommendation type corresponding to the bill data based on the vector knowledge base.
2. The document type recommendation method based on a large model according to claim 1 is characterized in that: The segmentation of the text content to obtain the static processing rules of the document processing rule file specifically includes: Preliminarily segmenting the text content using a character window of a preset length to obtain a first text paragraph set; Detecting paragraph boundaries of the first text paragraph set by using a TextTiling algorithm, and correcting the paragraph boundaries of the first text paragraph set to obtain a second text paragraph set; Determining the inter-paragraph differences of each text paragraph in the second text paragraph set based on the bag-of-words model; Modifying paragraph boundaries in the second text paragraph set based on the inter-paragraph differences to obtain a third text paragraph set; Based on the third text paragraph set, a static processing rule is determined.
3. The document type recommendation method based on a large model according to claim 2 is characterized in that: The vectorized storage of the static processing rules and the dynamic processing rules to construct a vector knowledge base specifically includes: Perform word segmentation processing on the static processing rules and the dynamic processing rules through the BERT model to obtain corresponding CLS vectors; The CLS vector is stored to obtain the vector knowledge base.
4. The document type recommendation method based on a large model according to claim 1 is characterized in that: The receiving of the bill data uploaded by the user and determining the recommended document type corresponding to the bill data based on the vector knowledge base specifically includes: performing standardization processing on the bill data to obtain standardized data; Extracting characteristic fields of the standardized data; Based on the feature fields, a hierarchical search is performed in the vector knowledge base to determine a recommended document type corresponding to the bill data; The characteristic fields include at least any one of the document number, date, amount, and consumption type.
5. The document type recommendation method based on a large model according to claim 4 is characterized in that: The step of performing a hierarchical search in the vector knowledge base based on the feature field to determine the document recommendation type corresponding to the bill data specifically includes: A multi-layer graph structure of a vector knowledge base is constructed based on the HNSW algorithm. Each layer of the multi-layer graph structure contains multiple CLS vectors. The node degree of each layer of the graph structure decays exponentially. The node degree is the number of adjacent vectors of each CLS vector. Performing a neighbor search on each layer of the graph structure based on the feature field to obtain the most similar CLS vector; Determining the static processing rule and / or the dynamic processing rule corresponding to the bill data based on the most similar CLS vector; Based on the static processing rule and / or the dynamic processing rule, a document recommendation type corresponding to the bill data is determined.
6. The document type recommendation method based on a large model according to claim 5 is characterized in that: The multi-layer graph structure of the vector knowledge base constructed based on the HNSW algorithm specifically includes: Clustering the CLS vectors to obtain multiple cluster centers, each of the cluster centers corresponds to an inverted list, and the multiple cluster centers form a similarity search library; Dynamically partition the newly added CLS vectors using the Faiss retrieval algorithm and update the similarity search library; A hierarchical search is performed based on the similarity search library.
7. The document type recommendation method based on a large model according to claim 6 is characterized in that: The step of performing a hierarchical search in the vector knowledge base based on the feature field to determine the document recommendation type corresponding to the bill data specifically includes: Generate a query vector based on the feature field, and calculate the similarity between the query vector and multiple cluster centers using the IVF algorithm; Based on the similarity sorting, a plurality of cluster centers with higher similarity are selected to obtain a candidate set; Constructing a multi-layer graph structure for the plurality of cluster centers in the candidate set by using the HNSW algorithm; Based on the query vector, a nearest neighbor search is performed on each layer of the graph structure to obtain the most similar CLS vector; Determining the static processing rule and / or the dynamic processing rule corresponding to the bill data based on the most similar CLS vector; Based on the static processing rule and / or the dynamic processing rule, a document recommendation type corresponding to the bill data is determined.
8. The document type recommendation method based on a large model according to claim 1 is characterized in that: The method further comprises: Pre-build large model service interfaces of various preset types; The data acquisition interface is configured to obtain the bill data uploaded by the user and the standardized processing process of the bill data; The data acquisition interface and multiple preset types of large model service interfaces are arranged in the interactive interface of the intelligent body.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the document type recommendation method based on a large model as described in any one of claims 1 to 8 are implemented.
10. A non-volatile computer storage medium having computer executable instructions stored thereon, characterized in that: When the computer executable instructions are executed by a processor, the document type recommendation method based on a large model as described in any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Self-updating legal case recommendation system based on large model and rule reasoning
CN118193716A
Vector database retrieval method and device based on large model, terminal and medium
CN118312594A
Intelligent order checking method, system and device based on artificial intelligence and medium
CN119850354A
Dynamic vector knowledge base construction and retrieval method based on multi-modal large model
CN120277223A
OCR and Transform decoder-based reimbursement method and apparatus, and electronic device
CN120317999A
Cited By
Intelligent box type recommendation method based on multi-modal retrieval
CN121071003A