Document multi-level label generation method and device, computer device and readable storage medium

By using a multi-level tag generation method, an initial document representation vector is generated using a multi-level tag codebook and a document content overview. This solves the problem of poor annotation standardization and consistency in the financial and medical fields, fulfills the need for detailed representation of document tags, and improves the representation ability and consistency of tags.

CN122153058APending Publication Date: 2026-06-05CHINA PING AN PROPERTY INSURANCE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA PING AN PROPERTY INSURANCE CO LTD
Filing Date
2026-03-05
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

In the financial and medical fields, document annotation suffers from poor standardization and consistency, making it difficult to generate detailed tags that represent documents.

Method used

A multi-level label generation method is adopted. An initial document representation vector is generated by obtaining a multi-level label codebook and a document content overview. The multi-level label codebook is then used for hierarchical iterative processing to determine the cluster centers and generate multi-level document labels.

Benefits of technology

It improves the standardization and consistency of label annotation, enhances the representational ability of labels, ensures the credibility of subsequent work, is applicable to multiple fields, and requires no model training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122153058A_ABST
    Figure CN122153058A_ABST
Patent Text Reader

Abstract

The application discloses a document multi-level label generation method and device, computer equipment and a readable storage medium, relates to the technical field of natural language processing, and can be specifically applied to the financial and medical fields. Through multi-level clustering marking processing, different granularity feature labels of the document can be accurately captured, and the demand of the financial and medical fields for generating document labels that can finely represent the document is better met. The method comprises the following steps: obtaining a target document to be generated with a document label, and obtaining a pre-generated multi-level label codebook; generating an initial document representation vector for the target document based on a document content summary and a document internal matching diagram of the target document; performing hierarchical iterative processing on the initial document representation vector by using the multi-level label codebook, determining the nearest clustering center for the initial document representation vector from a plurality of clustering centers included in each level, generating a multi-level document label corresponding to the target document, and outputting the multi-level document label.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural language processing technology, and can be specifically applied to the financial and medical fields. In particular, it relates to a method, apparatus, computer equipment, and readable storage medium for generating multi-level tags for documents. Background Technology

[0002] With the rapid development of information technology, the financial and healthcare sectors are experiencing a surge in documents covering a wide range of topics, including insurance product research, policy and system development, disease diagnosis and analysis, and medical cost assessment. These documents are not only numerous but also complex and diverse, encompassing multiple disciplines and areas of expertise. To effectively manage, retrieve, and recommend these documents for better service in practical applications such as financial investment decisions, insurance product design, and medical diagnostic support, accurate and detailed document tagging is crucial. Document tags, as a structured representation of document content, can quickly extract core information, providing strong support for subsequent data analysis, model training, and intelligent recommendations.

[0003] In related technologies, when generating document tags, a series of clear rules are pre-defined and a graph covering professional knowledge is constructed to match tags to documents; or, based on statistical and machine learning methods, a model is trained using a large amount of labeled data so that the model learns the mapping relationship between document features and tags; or, based on natural language processing and deep learning methods, the feature extraction and semantic understanding capabilities of deep neural networks are used to automatically identify key information in documents and generate tags.

[0004] However, the applicant recognizes that the relevant technology has at least the following technical problems in its implementation: In fields such as finance, insurance, and healthcare, there are documents that span multiple domains, have unique perspectives, or use ambiguous terminology. Different annotators may have different understandings of the rules, making it difficult to ensure annotation standards and consistency, which can easily affect the credibility of subsequent work. Moreover, the terminology, expressions, and text structures of different domains vary greatly. When switching domains, the model trained to generate tags needs to be readjusted for the new domain, which cannot meet the needs of the financial and healthcare fields for generating document tags that can accurately represent documents. Summary of the Invention

[0005] In view of this, the present invention provides a method, apparatus, computer device and readable storage medium for generating multi-level document tags. The main purpose is to solve the problem that it is currently difficult to guarantee the standardization and consistency of annotation, which can easily affect the credibility of subsequent work and fail to meet the needs of the financial and medical fields for generating document tags that can represent documents in detail.

[0006] According to a first aspect of the present invention, a method for generating multi-level tags for a document is provided, the method comprising: Obtain the target document for which document tags are to be generated, and obtain the pre-generated multi-level tag codebook, wherein the multi-level tag codebook includes multiple levels and each level includes multiple cluster centers; Based on the document content overview and in-document images of the target document, an initial document representation vector is generated for the target document; Using the multi-level tag codebook, the initial document representation vector is subjected to hierarchical iterative processing. The nearest cluster center for the initial document representation vector is determined from among the multiple cluster centers included in each level. Multi-level document tags corresponding to the target document are generated and output.

[0007] According to a second aspect of the present invention, a document multi-level tag generation apparatus is provided, the apparatus comprising: The acquisition module is used to acquire the target document for which document tags are to be generated, and to acquire a pre-generated multi-level tag codebook, wherein the multi-level tag codebook includes multiple levels and each level includes multiple cluster centers; The vector generation module is used to generate an initial document representation vector for the target document based on the document content overview and in-document illustrations. The tag generation module is used to perform hierarchical iterative processing on the initial document representation vector using the multi-level tag codebook, determine the nearest cluster center for the initial document representation vector among the multiple cluster centers included in each level, generate multi-level document tags corresponding to the target document, and output them.

[0008] According to a third aspect of the present invention, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in any of the first aspects above.

[0009] According to a fourth aspect of the present invention, a readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any one of the first aspects above.

[0010] By employing the above technical solutions, this invention provides a method, apparatus, computer device, and readable storage medium for generating multi-level document tags. This invention targets documents in fields such as finance, insurance, and healthcare that span multiple domains, have unique perspectives, or employ multiple meanings of terminology. Through multi-level clustering and tagging processing, it can accurately capture feature tags at different granularities of the document. While enhancing the representational ability of the tags, it can also improve the standardization and consistency of tag annotation, ensuring the reliability of subsequent work. Moreover, since tag generation is performed at a multi-granular semantic level, no model training is required, making it applicable to various fields and better meeting the needs of the financial and medical fields for generating document tags that can meticulously represent documents.

[0011] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0012] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 This is a schematic diagram of an application environment for a document multi-level tag generation method according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating a method for generating multi-level tags for documents according to an embodiment of the present invention; Figure 3 This is a flowchart illustrating a specific implementation of step S20; Figure 4 This is a flowchart illustrating a specific implementation of step S30; Figure 5 This is a schematic diagram of a document multi-level tag generation device in one embodiment of the present invention; Figure 6 This is a schematic diagram of the structure of a computer device according to an embodiment of the present invention; Figure 7 This is another structural schematic diagram of a computer device according to one embodiment of the present invention. Detailed Implementation

[0013] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. 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.

[0014] The document multi-level tag generation method provided in this embodiment of the invention can be applied to, for example... Figure 1In this application environment, the client communicates with the server via a network. The server can obtain the target document for which document tags are to be generated, as well as a pre-generated multi-level tag codebook from the client. The multi-level tag codebook includes multiple levels, and each level includes multiple cluster centers. Based on the document content overview and in-document images of the target document, an initial document representation vector is generated for the target document. Using the multi-level tag codebook, the initial document representation vector is iteratively processed hierarchically. The nearest cluster center is determined from the multiple cluster centers included in each level, and the multi-level document tags corresponding to the target document are generated and output to the client.

[0015] In this invention, for documents spanning multiple fields, with unique perspectives, or multiple meanings of terminology in the fields of finance, insurance, and healthcare, multi-level clustering and labeling processing can accurately capture feature tags at different granularities of the documents. This enhances the representational power of the tags while improving the standardization and consistency of tag annotation, ensuring the reliability of subsequent work. Furthermore, because tag generation is performed at a multi-granular semantic level, no model training is required, making it applicable to various fields and better meeting the needs of the financial and healthcare sectors for generating document tags that can meticulously represent documents. The client can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster consisting of multiple servers. The invention will be described in detail below through specific embodiments.

[0016] Please see Figure 2 As shown, Figure 2 A flowchart illustrating a document multi-level tag generation method provided in an embodiment of the present invention includes the following steps: S10: Obtain the target document for generating document tags, and obtain the pre-generated multi-level tag codebook, which includes multiple levels and each level includes multiple cluster centers.

[0017] The document multi-level tag generation method provided by this invention can be applied to document annotation systems in various application scenarios. Document annotation systems are typically implemented through a server, which can acquire target documents for which tags are to be generated in real time. These target documents can come from fields such as finance and insurance, healthcare, or any other domain requiring document annotation. Simultaneously, the document annotation system also acquires a pre-generated multi-level tag codebook. This multi-level tag codebook is a structure containing multiple levels, each level containing multiple cluster centers. These cluster centers are obtained by clustering a large number of document features using a clustering algorithm, representing document features of different granularities.

[0018] In this way, by pre-generating a multi-level tag codebook, the document annotation system can quickly locate the corresponding cluster centers when processing new documents, thereby accelerating the document tag generation process. Furthermore, the multi-level tag codebook design enables the document annotation system to handle document features of different granularities, improving the representational power and flexibility of the tags. For example, in the financial field, assuming a document about "new investment insurance products" needs annotation, the document annotation system first obtains this document as the target document and then retrieves the pre-generated multi-level tag codebook. The multi-level tag codebook can contain cluster centers at multiple levels, such as "insurance type," "investment attribute," and "risk level." As another example, in the medical field, assuming a medical document about "rare disease treatment plans," the document annotation system similarly first obtains the document and then uses a multi-level tag codebook containing cluster centers at levels such as "disease type," "treatment plan," and "efficacy evaluation" for subsequent processing.

[0019] The process of generating a multi-level tag codebook includes the following steps one through three: Step 1: Obtain the training document set, which includes multiple training documents.

[0020] The document annotation system acquires a training document set, which includes multiple training documents from various fields such as finance and healthcare. These documents provide foundational data support for subsequent feature extraction and codebook construction. Its advantage lies in ensuring data diversity and richness, covering the characteristics of documents from different fields, and making the generated codebook more widely applicable. For example, in the financial field, training documents could be various financial product manuals, market analysis reports, etc.; in the medical field, they could be disease research papers, clinical treatment cases, etc.

[0021] Step 2: Extract multimodal features from each training document in multiple training documents to obtain multiple multimodal features, and use the multimodal features to construct a set of training representation vectors.

[0022] The document annotation system extracts multimodal features from each training document. These multimodal features integrate various types of information in the document, such as text information and image information. For example, text descriptions and related charts in financial documents, and pathological descriptions and medical images in medical documents.

[0023] By extracting multimodal features and constructing a set of training representation vectors, document content can be represented more comprehensively and accurately, improving the effect of subsequent clustering analysis and helping to generate a more representative tag codebook.

[0024] Step 3: Set the target number of clusters With the total number of levels According to the target number of clusters Using the training representation vector set, multi-level residual clustering training is performed on each level to obtain a number of clusters that satisfy the total number of levels. Furthermore, multiple training levels are completed to construct a multi-level label codebook using these multiple levels.

[0025] The document annotation system first sets the target number of clusters. With the total number of levels According to the target number of clusters Using the training representation vector set, multi-level residual clustering training is performed on each level. The specific training process is as follows: First, the training representation vector set is input into the first layer, and a clustering algorithm is performed on the training representation vector set at the first layer to generate the first layer. Cluster centers are used to complete the clustering training for the first level. Taking this first level as an example, during clustering training, it is necessary to initialize the current level (i.e., the first level) for clustering training. Cluster centers, this Each cluster center can form a set of cluster centers as shown in Formula 1 below. Formula 1:

[0026] Among them, in Formula 1 Represents the set of cluster centers. to express Cluster centers, The value range is 1 to That is, when When the value is 1, it indicates that the cluster center set was generated for the first level.

[0027] Then, based on the distance between each input representation vector in the hierarchy and each initialized cluster center, the nearest subset of representation vectors is assigned to each initialized cluster center. Based on this assigned subset of representation vectors, each initialized cluster center is recalculated and updated. In practical applications, two variables can be initialized. ← ,Right now Initialize as feature set Calculate the expected allocation number for each cluster. ,in Represents the feature set Size, The proportion used for subsequent feature allocation calculations; for each cluster , According to the center distance to Sort the features in descending order, and then sort the first 0 to 100 features. Each feature is assigned to ,Right now ← ; Update Center afterwards The updated formula is Formula 2 below. Formula 2:

[0028] In Formula 2, Cluster The feature vectors in the cluster can be used to calculate the mean of the features within the cluster using Equation 2 to update the center; then update... , ← That is, from The assigned features are removed, thus completing the update of the cluster centers.

[0029] Finally, the operations of assigning the most recent subset of representation vectors and updating cluster centers are performed iteratively, that is, the feature assignment, center update, and cluster center updates are repeated. The update operation continues until each cluster center obtained satisfies the preset convergence condition, thus completing the hierarchical cluster training.

[0030] After completing the training for the first level through the above process, a set of residual vectors needs to be generated based on the distance between each multimodal feature and each cluster center included in the first level. The residual vectors reflect the differences between the vectors and the cluster centers. Next, the set of residual vectors is input into the second level, and a clustering algorithm is performed on the set of residual vectors at the second level to generate data for the second level. The cluster centers are used to complete the cluster training for the second level. The cluster training for the second level is consistent with the cluster training for the first level, and will not be repeated here.

[0031] Similarly, based on the distance between each residual vector included in the residual vector set and each cluster center included in the second level, the next residual vector set is generated, and the next residual vector set is input into the third level for cluster training, until the number of levels that have completed cluster training reaches the total number of levels, resulting in multiple levels that have completed training. Here, the second level is the next level after the first level, and the third level is the next level after the second level.

[0032] In practical applications, The value can be 3, meaning training at 3 levels to construct a multi-level label codebook. This progressively uncovers the differences in document features at different levels, allowing the generated codebook to represent document features more precisely and improving the accuracy and standardization of label annotation. For example, in the financial field, assuming the training document set contains various types of insurance product documents, such as life insurance and property insurance, after generating a multi-level label codebook through the above process, for a new life insurance product document, when generating labels using the codebook, it can generate multi-level labels such as "Insurance Type: Life Insurance," "Coverage: Death, Total Disability," and "Payment Method: Annual Payment" based on its clustering results at different levels. These labels can represent the document content more precisely, facilitating subsequent classification, management, and retrieval of insurance products. As another example, in the medical field, for a document about cancer treatment methods, the generated labels after processing could be "Disease Type: Cancer," "Treatment Methods: Chemotherapy, Radiotherapy," and "Efficacy Assessment: Partial Remission," helping medical personnel quickly understand the core content of the document and improving work efficiency.

[0033] S20: Based on the document content overview and in-document illustrations of the target document, generate an initial document representation vector for the target document.

[0034] In this embodiment of the invention, the document annotation system utilizes natural language processing and image processing techniques to process the document content overview and accompanying images of the target document to obtain an initial document representation vector. Specifically, the document annotation system can use a model such as Kimi K2 to summarize the target document and generate a detailed document content overview; simultaneously, it extracts accompanying images from the target document, for example, five images. Then, the document content overview and accompanying images are input into a multimodal model such as miniCPM-V-8B. The multimodal model can process multiple types of data (such as text and images) simultaneously, thereby generating a high-dimensional document representation vector that integrates information from both text and images. Finally, a Qformer model is used to compress this high-dimensional vector into a fixed-dimensional initial document representation vector for subsequent processing.

[0035] In this way, by combining a document content overview and accompanying images to generate an initial document representation vector, the document annotation system can more comprehensively capture the document's features, improving the accuracy of subsequent tag generation. Furthermore, by integrating text and images, the document annotation system can process documents containing rich image information, broadening its application scope. For example, in the financial field, for a document on "new investment insurance products," the document annotation system might extract key information such as product features and investment risks as a content overview, and combine this with product promotional images to generate an initial document representation vector. As another example, in the medical field, for a document on "rare disease treatment plans," the document annotation system might extract key information such as disease symptoms and treatment effectiveness, and combine this with pathological images or before-and-after treatment comparison images to generate an initial document representation vector.

[0036] Among them, such as Figure 3 As shown, step S20, which involves generating an initial document representation vector for the target document based on its document content overview and in-document images, includes the following steps: S21: Using a pre-trained document processing model, summarize the text content of the target document and generate a document content overview.

[0037] In this embodiment of the invention, the document annotation system uses a pre-trained document processing model, such as the Kimi K2 model, to analyze and process the text content of the target document. The document processing model has been trained on a large amount of text data and has the ability to understand and summarize text. It can analyze every paragraph and every sentence in the target document, extract the key information, remove redundant content, and then generate a detailed and accurate document content overview that reflects the core content of the document.

[0038] For example, in the financial field, for a complex financial investment analysis report, the document processing model can quickly extract key points such as the analysis of market trends, the evaluation of various investment products, and investment recommendations, forming a clear and concise summary. Similarly, in the medical field, for a medical research paper, the model can extract important information such as the research objective, experimental methods, and main research findings, generating a summary of the paper's content. In this way, the summary generated by the model can condense the key information of the document, providing a textual foundation for subsequent steps and helping to improve overall processing efficiency and the accuracy of information utilization.

[0039] S22: Query at least one specified document tag currently associated with the target document, and extract a preset number of in-document images from the target document.

[0040] In this embodiment of the invention, the document annotation system queries at least one specified document tag currently associated with the target document. This specified document tag can be manually annotated previously or generated through other means, providing a preliminary classification or description of the document from different perspectives. Simultaneously, the document annotation system also extracts a preset number, such as a maximum of five, of in-document images from the target document. These images serve to visually display information within the document; for example, in financial documents, they could be product trend charts or screenshots of company financial statements; in medical documents, they could be pathology images or medical photographs.

[0041] Taking a fund product prospectus in the financial field as an example, the associated tags might include "equity fund" or "high risk, high return," and the accompanying images might include fund net asset value charts and portfolio distribution diagrams. Similarly, in disease information documents in the medical field, tags could be "rare disease" or "genetic disease," and the accompanying images might be disease symptom diagrams or gene maps. By fully utilizing existing tag information and in-document images, the subsequently generated representation vectors can more comprehensively reflect the document content.

[0042] S23: Input a summary of the document content, at least one specified document tag, and a preset number of in-document illustrations into a pre-trained multimodal large model to obtain a high-dimensional document representation vector.

[0043] In this embodiment of the invention, the document annotation system will combine the generated document content overview, at least one specified document tag found, and a preset number of extracted document annotations. Figure 1 The data is then input into a pre-trained multimodal large model, such as the miniCPM-V-8B model. This multimodal large model has the ability to process various types of data (text, images, etc.), analyze the relationships and features between these different modalities, and perform complex calculations and analyses on the input content to extract semantic and visual information, ultimately outputting a high-dimensional document representation vector of 1280×512 dimensions.

[0044] For example, in the financial field, after inputting the content summary, relevant tags, and charts of an investment analysis report into the model, the multimodal large model can comprehensively consider the analytical logic in the text, the category characteristics represented by the tags, and the data trends shown in the charts to generate a high-dimensional vector that fully represents the characteristics of the report. As another example, in the medical field, for medical research papers, the multimodal large model combines information such as the paper content, tags, and pathological images to generate a high-dimensional vector that accurately reflects the core content of the paper. In this way, the high-dimensional document representation vector generated by the multimodal large model integrates information from multiple modalities of the document, enabling a more accurate description of document features and providing a high-quality data foundation for subsequent dimensionality reduction and processing.

[0045] S24: Perform dimensionality reduction and compression on the high-dimensional document representation vector to obtain the initial document representation vector.

[0046] In this embodiment of the invention, the document annotation system performs dimensionality reduction and compression on the obtained high-dimensional document representation vector. Specifically, the Qformer model can be used to compress it into a 2048-dimensional document representation vector, i.e., the initial document representation vector. Although high-dimensional vectors contain rich information, they also suffer from data redundancy and high computational complexity. Dimensionality reduction can reduce the data dimensionality and lower the complexity of subsequent calculations while retaining the main feature information.

[0047] For example, in the financial and healthcare fields, the initial document representation vector after dimensionality reduction retains the key features of the document and is more convenient for subsequent processing operations such as clustering. Thus, through dimensionality reduction and compression, data processing efficiency is improved without affecting document feature representation, making the entire document tag generation process more efficient and feasible, and better meeting the needs of the financial and healthcare fields for generating detailed document tags.

[0048] S30: Using a multi-level tag codebook, perform hierarchical iterative processing on the initial document representation vector, determine the nearest cluster center among the multiple cluster centers included in each level as the initial document representation vector, generate multi-level document tags corresponding to the target document and output them.

[0049] In this embodiment of the invention, the document annotation system utilizes a multi-level tag codebook to perform hierarchical iterative processing on the generated initial document representation vector. Specifically, starting from the first level of the codebook, the document annotation system finds the nearest cluster center for the initial document representation vector and uses the label corresponding to that cluster center as the first-level label of the document. Then, it calculates the residual between the initial document representation vector and the cluster center and uses the residual as the input for the next level of processing. This process is repeated at each level of the codebook until all levels are processed, ultimately generating and outputting the multi-level document labels corresponding to the target document.

[0050] In this way, through multi-level iterative processing, the document annotation system can accurately capture feature tags of documents at different granularities, improving the representational ability and standardization of tags. Simultaneously, since this process does not require model training, it can be applied to various different fields, meeting the needs of the financial and medical sectors for generating detailed document tags. For example, in the financial field, for a document on "new investment insurance products," the document annotation system ultimately generates multi-level document tags such as "Insurance Type: Investment-linked Insurance," "Investment Attribute: High Risk, High Return," and "Risk Level: Medium." As another example, in the medical field, for a document on "rare disease treatment plans," the document annotation system generates multi-level document tags such as "Disease Type: Rare Disease," "Treatment Plan: Comprehensive Treatment," and "Efficacy Assessment: Significant Improvement."

[0051] Among them, such as Figure 4 As shown, in step S30, which involves using a multi-level tag codebook to perform hierarchical iterative processing on the initial document representation vector, determining the nearest cluster center among the multiple cluster centers included in each level as the initial document representation vector, generating and outputting the multi-level document tags corresponding to the target document, includes the following steps: S31: Input the initial document representation vector into the first level of the multi-level label codebook. Among the multiple cluster centers included in the first level, determine the cluster center that is closest to the initial document representation vector as the first matching center.

[0052] In this embodiment of the invention, the document annotation system inputs the generated initial document representation vector into the first level of the multi-level tag codebook. As mentioned earlier, the multi-level tag codebook contains multiple levels, each with multiple cluster centers. These cluster centers are pre-determined through cluster analysis of a large number of document features, and each cluster center represents a set of documents with similar features. Therefore, the document annotation system uses a preset distance metric, such as Euclidean distance, to calculate the distance between the initial document representation vector and each cluster center in the first level. Assuming the initial document representation vector is a multi-dimensional vector and the first level has multiple cluster center vectors, the distance is obtained by calculating the square root of the sum of the squares of the differences between their corresponding elements. After calculating all distances, the closest cluster center is selected as the first matching center.

[0053] For example, in the financial field, for a document about stock investment strategies, its initial document representation vector is input into the first level of the codebook. The distance to the cluster centers representing different investment styles (such as value investing, growth investing, etc.) at that level is calculated, and the cluster center with the closest distance is ultimately determined as the first matching center. Similarly, in the medical field, for a disease diagnosis report document, the distance to the cluster centers representing different disease categories (such as infectious diseases, chronic diseases, etc.) at the first level of the codebook is calculated to find the first matching center. In this way, by accurately calculating distances and determining the first matching center, the category closest to the target document's features can be initially screened from the first level of the codebook, laying the foundation for generating accurate hierarchical labels subsequently.

[0054] S32: Query the first identifier corresponding to the first matching center, and use the first identifier as the first level tag of the target document in the first level.

[0055] After determining the first matching center, the document annotation system queries the first identifier corresponding to that first matching center. Each cluster center corresponds to an identifier, which is used to uniquely identify the category represented by the corresponding cluster center. The document annotation system uses the retrieved first identifier as the first-level label of the target document at the first level. For example, in the financial field, if the first matching center represents a value investment style, then the corresponding first identifier "value" becomes the first-level label of the target document; similarly, in the medical field, if the first matching center represents the infectious disease category, then the corresponding first identifier "infectious disease" becomes the first-level label of the target document.

[0056] In this way, through the above process, the category to which the target document belongs in the first level of the codebook can be clearly identified, giving the document a clear label at the first level, which helps to classify and annotate the document in more detail later.

[0057] S33: Calculate the difference between the initial document representation vector and the first matching center, and use the calculated difference as the first residual vector of the first level.

[0058] In this embodiment of the invention, the document annotation system calculates the difference between the initial document representation vector and the first matching center, and uses this difference as the first residual vector of the first level. Specifically, during the calculation, each element of the initial document representation vector needs to be subtracted from the element corresponding to the first matching center. The residual vector reflects the difference information between the initial document representation vector and the first matching center.

[0059] For example, in financial documents, if the initial document representation vector reflects multiple characteristics of a stock, and the first matching center represents a typical investment style, the residual vector contains the differences between the stock's characteristics and this typical investment style. Similarly, in medical documents, if the first matching center represents typical characteristics of a disease, the residual vector reflects the differences between the disease characteristics described in the target document and these typical characteristics. Thus, by calculating the residual vector, subtle differences between document features and the current matching center can be captured, providing more detailed information for further precise classification at the next level and helping to improve the accuracy of label generation.

[0060] S34: Input the first residual vector into the second level of the multi-level tag codebook. Among the multiple cluster centers included in the second level, determine the cluster center closest to the first residual vector as the second matching center. Query the second identifier corresponding to the second matching center and use the second identifier as the second-level label of the target document in the second level. Calculate the difference between the first residual vector and the second matching center as the second residual vector of the second level. Input the second residual vector into the third level of the multi-level tag codebook to determine the matching center and calculate the residual vector. Continue this process until each level in the multi-level tag codebook is traversed to obtain multiple level labels. The second level is the next level after the first level, and the third level is the next level after the second level.

[0061] In this embodiment of the invention, the document annotation system inputs the first residual vector into the second level of the multi-level tag codebook. Using the distance calculation method in step S31, it determines the cluster center closest to the first residual vector among the multiple cluster centers included in the second level as the second matching center. Then, it queries the second identifier corresponding to the second matching center and uses it as the second-level tag of the target document in the second level. Next, it calculates the difference between the first residual vector and the second matching center using the method in step S33, using it as the second residual vector for the second level. The second residual vector is then input into the third level of the multi-level tag codebook for the same matching center determination and residual vector calculation operations, until every level in the multi-level tag codebook is traversed.

[0062] For example, in the financial field, the second level might represent different industries (such as finance, manufacturing, etc.). By calculating the distance between the first residual vector and the cluster center of that level, the second matching center is determined, and the corresponding industry identifier is obtained as the second-level label. Similarly, in the medical field, the second level might represent a specific subtype of a disease; a similar operation yields the subtype identifier as the second-level label. In this way, through progressively deeper analysis and matching, continuously refining the document's tags, we can accurately capture the document's feature tags at different granularities, making the generated tags more comprehensive and accurate in reflecting the document's content.

[0063] S35: Integrate multiple level tags to obtain multi-level document tags, and output the multi-level document tags.

[0064] After traversing each level in the multilevel tag codebook, multiple level tags are obtained. The document annotation system integrates these multiple level tags, for example, by arranging and combining them according to the hierarchical order, to obtain the final multilevel document tags, and then outputs them.

[0065] For example, in the financial sector, the final multi-level document tags might be "Value-based - Financial Industry - A Specific Sub-sector"; in the medical field, they might be "Infectious Disease - Viral Infectious Disease - A Specific Viral Disease". In this way, the integrated multi-level document tags can provide detailed descriptions of documents from different levels and perspectives, enhancing the tag's representational power, improving the standardization and consistency of tag annotation, ensuring the reliability of subsequent work such as document retrieval and classification, and better meeting the needs of the financial and medical fields for generating detailed document tags.

[0066] The method provided in this invention addresses documents in the fields of finance, insurance, and healthcare that span multiple domains, have unique perspectives, or employ multiple meanings of terminology. Through multi-level clustering and labeling, it can accurately capture feature tags at different granularities of the documents. This enhances the representational power of the tags while improving the standardization and consistency of tag annotation, ensuring the credibility of subsequent work. Moreover, since the tags are generated at a multi-granularity semantic level, no model training is required, making it applicable to various fields and better meeting the needs of the financial and healthcare sectors for generating document tags that can meticulously represent documents.

[0067] Furthermore, as Figure 1 To specifically implement the method, this embodiment of the invention provides a document multi-level tag generation device, such as... Figure 5 As shown, the device includes: an acquisition module 501, a vector generation module 502, and a tag generation module 503.

[0068] The acquisition module 501 is used to acquire the target document for which document tags are to be generated, and to acquire a pre-generated multi-level tag codebook, wherein the multi-level tag codebook includes multiple levels and each level includes multiple cluster centers; The vector generation module 502 is used to generate an initial document representation vector for the target document based on the document content overview and in-document illustrations of the target document; The tag generation module 503 is used to perform hierarchical iterative processing on the initial document representation vector using the multi-level tag codebook, determine the nearest cluster center for the initial document representation vector among the multiple cluster centers included in each level, generate multi-level document tags corresponding to the target document, and output them.

[0069] In specific application scenarios, the device further includes: The module is used to acquire a training document set, which includes multiple training documents; extract multimodal features from each of the multiple training documents to obtain multiple multimodal features; and construct a training representation vector set using the multimodal features; and set the target number of clusters. With the total number of levels According to the target number of clusters Using the training representation vector set, multi-level residual clustering training is performed on each level to obtain a number of clusters that satisfy the total number of levels. The training of the multiple levels is completed to construct the multi-level label codebook using the multiple levels.

[0070] In a specific application scenario, the construction module is used to input the training representation vector set into the first level, and perform a clustering algorithm on the training representation vector set at the first level to generate a clustering algorithm for the first level. Clustering is performed on the first level using cluster centers; a set of residual vectors is generated based on the distance between each multimodal feature and each cluster center in the first level; the set of residual vectors is input to the second level, and the clustering algorithm is executed on the set of residual vectors at the second level to generate clusters for the second level. The system generates a set of cluster centers to complete cluster training for the second level, and generates a next set of residual vectors based on the distance between each residual vector in the residual vector set and each cluster center in the second level. The next set of residual vectors is then input into the third level for cluster training, until the number of levels that have completed cluster training reaches the total number of levels, resulting in the multiple levels that have completed training. The second level is the next level after the first level, and the third level is the next level after the second level.

[0071] In specific application scenarios, the construction module is used to initialize the level currently undergoing clustering training. Each initial cluster center is assigned a subset of its own representation vectors. Based on the distance between each input representation vector in the level and each initialized cluster center, the nearest subset of representation vectors is assigned to each initialized cluster center. Then, based on the nearest subset of representation vectors assigned to each initialized cluster center, each initialized cluster center is recalculated and updated. The operations of assigning the nearest subset of representation vectors and updating the cluster centers are iteratively performed until each currently obtained cluster center satisfies a preset convergence condition, thus completing the clustering training for the level.

[0072] In a specific application scenario, the vector generation module 502 is used to summarize the text content of the target document using a pre-trained document processing model to generate a document content overview; query at least one specified document tag currently associated with the target document, and extract a preset number of in-document images from the target document; input the document content overview, the at least one specified document tag, and the preset number of in-document images into a pre-trained multimodal large model to obtain a high-dimensional document representation vector; and perform dimensionality reduction and compression processing on the high-dimensional document representation vector to obtain the initial document representation vector.

[0073] In a specific application scenario, the tag generation module 503 is used to input the initial document representation vector into the first level of the multi-level tag codebook, determine the cluster center closest to the initial document representation vector among the multiple cluster centers included in the first level as the first matching center; query the first identifier corresponding to the first matching center, and use the first identifier as the first level tag of the target document in the first level; calculate the difference between the initial document representation vector and the first matching center, and use the calculated difference as the first residual vector of the first level; input the first residual vector into the second level of the multi-level tag codebook, and determine the cluster center closest to the initial document representation vector among the multiple cluster centers included in the second level as the first residual vector. The nearest cluster center is used as the second matching center, and the second identifier corresponding to the second matching center is queried. The second identifier is used as the second-level label of the target document at the second level. The difference between the first residual vector and the second matching center is calculated as the second residual vector of the second level. The second residual vector is input into the third level of the multi-level label codebook to determine the matching center and calculate the residual vector. This process is repeated until each level in the multi-level label codebook is traversed to obtain multiple level labels. The second level is the next level after the first level, and the third level is the next level after the second level. The multiple level labels are integrated to obtain the multi-level document label, and the multi-level document label is output.

[0074] In a specific application scenario, the label generation module 503 is used to determine the input representation vector input to the level for each level, and to obtain the matching center determined for the level; subtract the vector corresponding to the matching center from the input representation vector, and use the subtracted input representation vector as the residual vector of the level.

[0075] The apparatus provided in this invention targets documents in the fields of finance, insurance, and healthcare that span multiple domains, have unique perspectives, or contain multiple meanings of terminology. Through multi-level clustering and labeling processing, it can accurately capture feature tags at different granularities of the documents. While enhancing the representational ability of the tags, it can also improve the standardization and consistency of tag annotation, ensuring the credibility of subsequent work. Moreover, since the tags are generated at a multi-granularity semantic level, no model training is required, so it can be applied to a variety of different fields and better meet the needs of the financial and medical fields for generating document tags that can represent documents in detail.

[0076] Specific limitations regarding the document multi-level tag generation device can be found in the limitations of the document multi-level tag generation method described above, and will not be repeated here. Each module in the aforementioned document multi-level tag generation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0077] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When the computer program is executed by the processor, it implements the functions or steps of a document multi-level tag generation method on the server side.

[0078] In one embodiment, a computer device is provided, which may be a client, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with an external server via a network connection. When executed by the processor, the computer program implements the client-side functions or steps of a document multi-level tag generation method.

[0079] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps: Obtain the target document for which document tags are to be generated, and obtain the pre-generated multi-level tag codebook, wherein the multi-level tag codebook includes multiple levels and each level includes multiple cluster centers; Based on the document content overview and in-document images of the target document, an initial document representation vector is generated for the target document; Using the multi-level tag codebook, the initial document representation vector is subjected to hierarchical iterative processing. The nearest cluster center for the initial document representation vector is determined from among the multiple cluster centers included in each level. Multi-level document tags corresponding to the target document are generated and output.

[0080] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor: Obtain the target document for which document tags are to be generated, and obtain the pre-generated multi-level tag codebook, wherein the multi-level tag codebook includes multiple levels and each level includes multiple cluster centers; Based on the document content overview and in-document images of the target document, an initial document representation vector is generated for the target document; Using the multi-level tag codebook, the initial document representation vector is subjected to hierarchical iterative processing. The nearest cluster center for the initial document representation vector is determined from among the multiple cluster centers included in each level. Multi-level document tags corresponding to the target document are generated and output.

[0081] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.

[0082] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this invention are all information and data authorized by the user or fully authorized by all parties.

[0083] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0084] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0085] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications 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 included within the protection scope of the present invention.

Claims

1. A method for generating multi-level tags in a document, characterized in that, include: Obtain the target document for which document tags are to be generated, and obtain the pre-generated multi-level tag codebook, wherein the multi-level tag codebook includes multiple levels and each level includes multiple cluster centers; Based on the document content overview and in-document images of the target document, an initial document representation vector is generated for the target document; Using the multi-level tag codebook, the initial document representation vector is subjected to hierarchical iterative processing. The nearest cluster center for the initial document representation vector is determined from among the multiple cluster centers included in each level. Multi-level document tags corresponding to the target document are generated and output.

2. The method according to claim 1, characterized in that, Before obtaining the target document for generating document tags and the pre-generated multi-level tag codebook, the method further includes: Obtain a training document set, which includes multiple training documents; Extract the multimodal features of each of the multiple training documents to obtain multiple multimodal features, and use the multimodal features to construct a training representation vector set; Set the target number of clusters With the total number of levels According to the target number of clusters Using the training representation vector set, multi-level residual clustering training is performed on each level to obtain a number of clusters that satisfy the total number of levels. The training of the multiple levels is completed to construct the multi-level label codebook using the multiple levels.

3. The method according to claim 2, characterized in that, The set target number of clusters With the total number of levels According to the target number of clusters Using the training representation vector set, multi-level residual clustering training is performed on each level to obtain a number of clusters that satisfy the total number of levels. And the multiple levels that have been trained include: The training representation vector set is input into the first level, and a clustering algorithm is performed on the training representation vector set at the first level to generate [data for the first level]. A number of cluster centers are used to complete the clustering training for the first level; A set of residual vectors is generated based on the distance between each of the multimodal features and each of the cluster centers included in the first level; The residual vector set is input to the second level, and the clustering algorithm is executed on the residual vector set at the second level to generate the second level. The system generates a set of cluster centers to complete cluster training for the second level, and generates a next set of residual vectors based on the distance between each residual vector in the residual vector set and each cluster center in the second level. The next set of residual vectors is then input into the third level for cluster training, until the number of levels that have completed cluster training reaches the total number of levels, resulting in the multiple levels that have completed training. The second level is the next level after the first level, and the third level is the next level after the second level.

4. The method according to claim 3, characterized in that, Clustering training performed for each of the aforementioned levels includes: Initialize the level for the current clustering training. Cluster centers; Based on the distance between each input representation vector in the hierarchy and each initialized cluster center, assign the nearest subset of representation vectors to each initialized cluster center; Based on the assignment of the nearest subset of representation vectors to each initialized cluster center, each initialized cluster center is recalculated and updated, and the operations of assigning the nearest subset of representation vectors and updating cluster centers are iteratively performed until each currently obtained cluster center satisfies the preset convergence condition, thus completing the clustering training for the level.

5. The method according to claim 1, characterized in that, The process of generating an initial document representation vector for the target document based on the document content overview and in-document images includes: Using a pre-trained document processing model, the text content of the target document is summarized to generate a summary of the document content; Query at least one specified document tag currently associated with the target document, and extract a preset number of in-document images from the target document; The document content overview, the at least one specified document tag, and a preset number of in-document images are input into a pre-trained multimodal large model to obtain a high-dimensional document representation vector; The high-dimensional document representation vector is subjected to dimensionality reduction and compression to obtain the initial document representation vector.

6. The method according to claim 1, characterized in that, The step of using the multi-level tag codebook to perform hierarchical iterative processing on the initial document representation vector, determining the nearest cluster center for the initial document representation vector among multiple cluster centers included in each level, generating and outputting multi-level document tags corresponding to the target document, includes: The initial document representation vector is input into the first level of the multi-level tag codebook. Among the multiple cluster centers included in the first level, the cluster center that is closest to the initial document representation vector is determined as the first matching center. Query the first identifier corresponding to the first matching center, and use the first identifier as the first level tag of the target document at the first level; Calculate the difference between the initial document representation vector and the first matching center, and use the calculated difference as the first residual vector of the first level; The first residual vector is input to the second level of the multi-level tag codebook. Among the multiple cluster centers included in the second level, the cluster center closest to the first residual vector is determined as the second matching center. The second identifier corresponding to the second matching center is queried, and the second identifier is used as the second level tag of the target document in the second level. The difference between the first residual vector and the second matching center is calculated as the second residual vector of the second level. The second residual vector is input to the third level of the multi-level tag codebook to determine the matching center and calculate the residual vector. This process is repeated until each level in the multi-level tag codebook is traversed to obtain multiple level tags. The second level is the next level after the first level, and the third level is the next level after the second level. The multiple hierarchical tags are integrated to obtain the multi-level document tags, and the multi-level document tags are output.

7. The method according to claim 6, characterized in that, Calculating the residual vector in each of the aforementioned levels includes: For each level, determine the input representation vector input to the level, and obtain the matching center determined for the level; The vector corresponding to the matching center is subtracted from the input representation vector, and the resulting input representation vector after subtraction is used as the residual vector of the level.

8. A document multi-level tag generation device, characterized in that, include: The acquisition module is used to acquire the target document for which document tags are to be generated, and to acquire a pre-generated multi-level tag codebook, wherein the multi-level tag codebook includes multiple levels and each level includes multiple cluster centers; The vector generation module is used to generate an initial document representation vector for the target document based on the document content overview and in-document illustrations. The tag generation module is used to perform hierarchical iterative processing on the initial document representation vector using the multi-level tag codebook, determine the nearest cluster center for the initial document representation vector among the multiple cluster centers included in each level, generate multi-level document tags corresponding to the target document, and output them.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

10. A readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.