A document automatic cataloging method based on semantic understanding
By using multi-granular feature extraction and rule-based reasoning correction based on semantic understanding, the problem of keyword matching dependence in document cataloging is solved, realizing automated document cataloging, improving efficiency and accuracy, and applicable to document management in government affairs, scientific research, enterprises and other fields.
Patent Information
- Application Number
- CN202611363397.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-04
- Publication Date
- 2026-11-06
AI Technical Summary
In existing technologies, document cataloging mainly relies on manual or semi-automatic methods, which have problems such as being time-consuming and labor-intensive, having high labor costs, relying on keyword matching with poor flexibility, and not supporting multimodal recognition, making it difficult to meet the needs of rapid and accurate cataloging of massive amounts of professional documents.
A multi-format parsing engine is used to extract document information. Combined with multi-granular semantic feature extraction and rule-based reasoning correction, an automatic transcription method based on semantic understanding is constructed, including character-level, phrase-level, and document-level feature extraction. An improved cosine similarity algorithm and rule-based reasoning correction are used to generate and optimize the transcription content.
It automates the document cataloging process, reduces labor costs, and improves efficiency and accuracy. It is applicable to document management needs in multiple fields and promotes the digital and intelligent upgrade of document management.
Smart Images

Figure CN123050447A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of document management technology, specifically relating to a method for automatic document recording based on semantic understanding. Background Technology
[0002] In today's era of digital information explosion, documents, as the core carrier of information storage and dissemination, are widely used in various fields such as scientific research, enterprises, government affairs, and intellectual property. In the nuclear power industry, there are professional documents such as laws and regulations, institutional standards, management procedures, correspondence, production documents, and engineering documents, and their quantity is growing exponentially year by year. Document cataloging, as a fundamental prerequisite for document management, retrieval, and sharing, refers to the process of extracting, organizing, and standardizing the annotation of key metadata fields of documents (such as title, code, compiler, classification number, and compiling unit). Its accuracy and efficiency directly determine the usability of the document management system and the precision of information retrieval.
[0003] Currently, document cataloging mainly employs two methods: manual cataloging and semi-automatic cataloging. Manual cataloging requires professionals to meticulously screen, organize, and annotate the core information of each document, which is not only time-consuming and labor-intensive with high costs, but also susceptible to subjective judgment and differences in professional expertise, leading to cataloging errors, omissions, and non-standard practices, making it difficult to meet the needs of rapid cataloging of massive amounts of documents. Semi-automatic cataloging uses text matching methods such as regular expression matching to read relevant content from the document as metadata attributes for cataloging. While this method reduces manual workload to some extent, it still suffers from drawbacks such as reliance on keyword matching without semantic understanding, poor flexibility in field matching, poor quality of cataloged content, and lack of support for cross-modal recognition cataloging, failing to meet the accurate cataloging needs of professional documents. Summary of the Invention
[0004] The technical problem solved by this invention is to provide a document automatic recording method based on semantic understanding, which effectively solves the problems of poor flexibility in relying on keyword matching, poor recording quality, and lack of support for multimodal recognition recording in current automatic document recording, and realizes the automation of the document recording process.
[0005] The technical solution adopted in this invention is as follows: A method for automatic document transcription based on semantic understanding includes the following steps: S1. Employ a multi-format parsing engine to extract the original information from the document, standardize the format of non-text content, and uniformly organize all parsed information, including text, tables, formulas, and images, into JSON format for output. S2. Design cleaning logic for each parsed text information to remove noise information, correct format deviations, and integrate all cleaned data into a standardized dataset. S3. Semantic feature extraction based on multi-granularity feature fusion, including character-level semantic feature extraction, phrase-level semantic feature extraction, and document-level semantic feature extraction, and feature fusion of the extracted features; S4. Construct a bibliographic field ontology library, calculate weight-based semantic similarity, and perform rule-based reasoning correction; S5. Generation and optimization of bibliographic content.
[0006] For text cleaning, a three-step method of "regular expression matching + stop word filtering + syntactic correction" is adopted to achieve noise removal, word segmentation, stop word filtering and syntactic correction. For table cleaning, a "neighborhood mean + rule-based filling" scheme is adopted to handle missing values; outliers are identified through the 3σ principle to handle outliers; and merged cells in the table are split to standardize the format. For formula cleaning, redundant spaces and invalid symbols are removed from formulas, and the LaTeX format is standardized; the LaTeXMK formula syntax checker is used to verify the integrity of formulas and remove invalid formulas. For image cleaning, image preprocessing methods are adopted, specifically grayscale conversion of the images; edge enhancement is performed using the Canny edge detection algorithm; and noise is removed using Gaussian filtering.
[0007] The character-level semantic feature extraction specifically involves: using a pre-trained model as the basic architecture and performing domain-adaptive fine-tuning on the pre-trained model to output a 768-dimensional context vector for each character / word in the document; The phrase-level semantic feature extraction is specifically as follows: core phrases are identified using dependency parsing, and semantic filtering and importance scoring are performed on the identified phrases in conjunction with the domain ontology library. The BERT vectors of each character in the selected key phrases are averaged or weighted to obtain the semantic vector of the phrase. The vectors of all key phrases constitute a phrase-level semantic feature set. The document-level semantic feature extraction specifically involves: segmenting the document into sentences, representing each sentence with the mean of the BERT vectors of all its characters, using this as the initial feature for the semantic graph nodes, and calculating the edge weight between any two sentence nodes i and j. By using sentences as nodes and connecting them with edge weights, a semantic graph of the document's sentences is constructed.
[0008] The domain-specific adaptive fine-tuning involves: collecting a large-scale corpus of the target domain and constructing a domain-specific dictionary; and, based on the existing parameters of the pre-trained model, using masked language modeling as the training objective, further training the model parameters using the domain corpus. The importance score of the key phrase is calculated using the following formula: in, These are candidate phrases to be scored; The TD-IDF weight of phrase p; This indicates the semantic relevance of phrase p to core concepts in the domain ontology. This represents the positional weight of phrase p.
[0009] The The calculation formula is: Where i and 𝑗 represent the sentence's sequential number in the document. Indicates the semantic similarity between sentence i and sentence j; The position attenuation factor is calculated using the following formula: Where δ is the position decay factor (δ>0); The semantic graph of the sentence constructed above is input into a two-layer graph convolutional network.
[0010] The feature fusion process is as follows: the document-level semantic feature vector and the character-level aggregated vector are first concatenated along the feature dimension to form a global feature vector, which is then fed into the attention layer together with the phrase-level semantic feature vector set. The attention mechanism is used to obtain the contribution weight of each key phrase feature to the global feature. The phrase features and global features are weighted and summed according to this weight and the dimension is normalized to output a document semantic feature matrix with dimension D, thus completing the semantic feature fusion at the character-level, phrase-level, and document-level granularities.
[0011] The calculation is based on weighted semantic similarity, and an improved cosine similarity algorithm is used to calculate the document semantic feature matrix. semantic vectors of each bibliographic field The matching degree is calculated using the following formula: Where F is the document semantic feature vector, and V is the bibliographic field semantic vector. This represents the field importance weighting coefficient.
[0012] The rule-based reasoning correction specifically involves: constructing a rule-based reasoning engine to determine the domain to which a document belongs based on the document type recognition results; triggering corresponding rules by combining high-frequency field words in the document with similarity ranking; filtering, reordering, and supplementing fields according to the triggered rules for the preliminary matching results; and outputting the final list of bibliographic fields and the mapping relationship between each field and the document content.
[0013] The document semantic feature matrix obtained by feature fusion, together with the bibliographic field information and mapping relationship determined after rule reasoning correction, are input into the Seq2Seq generation model to generate the preliminary content of each bibliographic field. Construct a dual-verification model: one is semantic consistency verification, and the other is format and logic verification; A reinforcement learning agent is constructed to iteratively optimize the parameters of the generative model, and the optimized content is output as the final bibliographic result.
[0014] The beneficial effects of this invention are: (1) The present invention provides a document automatic recording method based on semantic understanding, which breaks through the limitations of traditional document recording that relies on keyword matching. It proposes a three-level semantic feature extraction model of “character level-phrase level-article level”. In view of the problem that the recording fields of different types of documents (such as laws and regulations, technical documents) are very different, a dynamic mapping algorithm based on semantic similarity and rule reasoning is designed. It innovatively proposes a four-stage recording content generation process of “semantic extraction-preliminary generation-semantic verification-optimized output”, which effectively solves the problems of poor flexibility of relying on keyword matching, poor recording quality and lack of support for multimodal recognition recording in current automatic document recording. It can realize the automation of the document recording process, without the need for professional personnel to manually annotate and correct the documents one by one, which greatly reduces the cost of human resources and greatly improves the efficiency and accuracy of automatic document recording.
[0015] (2) The document automatic recording method based on semantic understanding provided by the present invention can be adapted to the document recording needs of multiple fields such as government affairs, scientific research, and enterprises. It has a wide range of applications and can promote the digital and intelligent upgrading of document management, with significant economic and social benefits. Attached Figure Description
[0016] To more clearly illustrate the embodiments of the present invention, the accompanying drawings used in describing the embodiments of the present invention will be briefly described below. Obviously, the drawings described below are merely some embodiments recorded in the present invention. Those skilled in the art can derive other drawings from the following drawings without any creative effort.
[0017] Figure 1 The flowchart of an automatic document transcription method based on semantic understanding provided by the present invention is shown. Detailed Implementation
[0018] 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 embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of the present invention.
[0019] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., refer to the orientation or positional relationship shown in the accompanying drawings, and are used only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0020] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or a connection through an intermediate medium; and they can refer to the internal communication between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0021] like Figure 1 As shown, the present invention provides a method for automatic document transcription based on semantic understanding, comprising the following steps: S1. Document parsing and data cleaning S101, Document Format Analysis It employs a multi-format parsing engine (supporting common formats such as PDF, DOCX, TXT, and PPT) to extract original information from documents, including text content, tables, formula codes (LaTeX format), and image files. Non-text content (tables and images) undergoes format standardization processing (tables are converted into structured data, and images are converted into pixel matrices of uniform resolution).
[0022] For PDF documents, a dual-engine approach combining PyPDF2 and pdfplumber is used for parsing. PyPDF2 is responsible for extracting regular text content, while pdfplumber is responsible for extracting table, image coordinates, and formula location information. The specific parsing process is as follows: Read the PDF file stream to obtain the total number of pages and object information for each page (including text, tables, images, and formulas); extract the text line by line for each page, preserving the original paragraph structure; identify table areas, parse the tables into two-dimensional arrays (rows × columns), and retain the correspondence between table headers and cells; identify image areas, extract the pixel matrix and position coordinates of the images, and save them as temporary PNG files; extract formula areas and convert the formulas into LaTeX text using OCR recognition (using the Tesseract-OCR engine).
[0023] For DOCX documents, the python-docx library is used to parse paragraphs, tables, images and formulas in the documents. For formulas, the python-docx library is combined with the mathml2latex library to convert the formulas in the documents into LaTeX format, ensuring that the semantics of the formulas are recognizable.
[0024] Unified multi-format output: All parsed information is uniformly organized into JSON format, which is output in four parts: "text information", "table information", "formula information" and "image information", facilitating subsequent unified processing.
[0025] Parameter setting: During parsing, the text encoding is uniformly set to UTF-8, and the image resolution is uniformly set to 300dpi.
[0026] S102. Data cleaning Cleaning logic is designed respectively for the parsed text, tables, formulas and images to remove noise information and correct format deviations, so as to ensure data quality and prepare for subsequent semantic extraction.
[0027] For text cleaning, a three-step method of "regular matching + stop word filtering + syntactic correction" is adopted, which is specifically as follows: Regular expressions are used to remove special characters, garbled characters and punctuation marks (retaining Chinese and English periods and question marks). Through the judgment of page coordinate threshold, headers, footers, page numbers and watermarks are removed (the coordinates of the header and footer areas are ≤ 10% of the page height) to realize noise removal. Jieba word segmentation (precise mode) is adopted for Chinese, and nltk.word_tokenize is adopted for English, with a word segmentation accuracy rate of ≥98%. Custom dictionaries are supplemented for professional terms (such as "IPC classification number" and "semantic feature extraction") to ensure accurate word segmentation and realize word segmentation processing. Load the Chinese stop word list (containing more than 1000 common stop words, such as "de", "le", "shi") and the English stop word list (nltk.stopwords) to remove words with no semantic value, and filter out characters with a length of ≤1 (except for professional abbreviations) to realize stop word filtering. The hanlp syntactic analysis tool is used to correct grammatical errors in the text (such as reversed word order and typos) with a correction accuracy rate of ≥90%, and splice and repair broken sentences (such as half sentences caused by parsing omissions) to realize syntactic correction.
[0028] For table cleaning, the details are as follows: The system employs a "domain mean + rule-based filling" scheme. Missing values in numerical cells are filled with the mean of the column (deviation ≤ 5%), while missing values in text cells are filled with "unclear". When the "IPC classification number" is missing in the patent document, it is marked as "to be supplemented", thus handling missing values. Outliers (values exceeding the mean ± 3 times the standard deviation) are identified using the 3σ principle, marked as "outliers", and their original values are retained to avoid accidental deletion of valid data, thus handling outliers. Merged cells in the table are split, and cell formats are standardized (text centered, values retained to 2 decimal places), and table header naming is standardized (e.g., "Author Name" is standardized to "Author"), thus achieving format standardization.
[0029] For formula cleaning, the specific steps are as follows: Remove redundant spaces and invalid symbols from formulas, and standardize the LaTeX format (e.g., unify "x^2" to "x"). 2 The formula integrity is verified using the LaTeXMK formula syntax checker, and invalid formulas are removed (marked as "to be manually checked").
[0030] For image cleaning, an image preprocessing method is adopted, specifically grayscale processing of the image, followed by edge enhancement using the Canny edge detection algorithm (with a threshold set to 100-200), and noise removal using Gaussian filtering with a filter kernel size of 5×5. Finally, the unified image size is 800×600 pixels to facilitate subsequent image-text semantic alignment.
[0031] Post-cleaning output: All cleaned data are integrated into a standardized dataset, with text saved as TXT format, tables as CSV format, formulas as LaTeX format, and images as PNG format of uniform size for subsequent semantic feature extraction.
[0032] S2: Semantic Feature Extraction Based on Multi-Granularity Feature Fusion Specifically, this includes character-level semantic feature extraction, phrase-level semantic feature extraction, and document-level semantic feature extraction, followed by feature fusion of the extracted features. S201, Character-level semantic feature extraction Using pre-trained models such as BERT-base or RoBERTa as the basic architecture, and performing domain-adaptive fine-tuning on the pre-trained models, the output is a 768-dimensional context vector for each character / word in the document; The domain-specific adaptive fine-tuning involves: collecting a large-scale corpus of the target domain (such as institutional standards or production documents); constructing a domain-specific dictionary using high-frequency words and professional terms from the corpus; employing a continued pre-training strategy during the fine-tuning phase, i.e., training the model parameters using Masked Language Modeling (MLM) as the training objective, based on the existing parameters of the pre-trained model; and training the model parameters using the domain corpus while retaining general semantic understanding capabilities. The trained model retains general semantic understanding capabilities while learning the vocabulary distribution and expression habits of domain texts. The domain-specific dictionary is used to map and normalize the document segmentation results during the model input phase, unifying synonymous or near-synonymous professional terms into standardized word forms. Simultaneously, the semantic vectors corresponding to words in the dictionary can serve as supervisory signals to assist the model output, thereby improving the accuracy of semantic feature extraction from domain texts.
[0033] S202, Phrase-level semantic feature extraction Key phrase identification: First, dependency parsing (such as spaCy's parser) is used to identify core phrases such as noun phrases and verb phrases. Then, combined with a domain ontology (for example, in the information technology domain, ontologies may include concepts and hierarchical relationships such as "algorithm," "model," "system," and "interface"), the identified phrases are semantically filtered and their importance is scored. The importance score of key phrases is calculated using the following formula: in, These are candidate phrases to be scored. is the TD-IDF (Term Frequency-Inverse Document Frequency) weight of phrase p, used to measure the significance of the phrase's term frequency-inverse document frequency in the document, with a value range of [0,+∞). Indicates phrase The semantic relevance of p to the core concepts in the domain ontology is calculated by the cosine similarity between the phrase vector and the ontology concept vector, and the value is normalized to [0,1]. The positional weight of phrase p is represented by a value that assigns higher values to phrases appearing in key positions such as titles, abstracts, and the first sentence of chapters, with a range of [1, 3]. The importance score of the phrase is obtained by multiplying the three weights together. The higher the score, the greater the contribution of the phrase to the document's semantics, and the more it should be included as a key phrase in the subsequent construction of semantic feature vectors.
[0034] Feature vector generation: The BERT vectors of each character in the selected key phrases are averaged or weighted to obtain the semantic vector of the phrase. The vectors of all key phrases constitute a phrase-level semantic feature set.
[0035] S203, Document-level Semantic Feature Extraction The document is segmented into sentences, and each sentence is represented by the mean of the BERT vectors of all its characters. This is used as the initial feature of the semantic graph nodes. The edge weight between any two sentence nodes i and j is calculated. Using sentences as nodes and connecting them with edge weights, we construct a sentence semantic graph of the document. The calculation formula is: Where i and 𝑗 represent the sentence's sequential number in the document. The semantic similarity between sentence i and sentence j is calculated by the cosine similarity of the vectors of the two sentences. The value ranges from [0,1]. The closer the value is to 1, the more similar the two sentences are semantically. The position attenuation factor is calculated using the following formula: Where δ is the positional attenuation factor (δ>0), used to control the range of influence of sentence position on edge weight. The larger φ is, the more gradual the attenuation of edge weight by sentence spacing, and the less the correlation between two sentences is affected by position. In this embodiment, φ is set to 5, that is, when the spacing between two sentences |ij|=5, the positional attenuation factor is approximately e. -1 ≈0.37.
[0036] The semantic graph of the sentence constructed above is input into a two-layer graph convolutional network. Each layer is updated according to the following formula: in, It is the first The node feature matrix of the layer, with each row corresponding to the feature vector of a sentence node; It is the first Layer trainable weight matrix; The normalized adjacency matrix is derived from the adjacency matrix of the sentence semantic graph. Add self-connection (unit matrix) Then, it is obtained by diagonally normalizing the degree matrix, i.e. D is the degree matrix; It is the ReLU activation function.
[0037] After two convolutional layers, global average pooling is performed on the node features of the entire graph to obtain a fixed-dimensional (e.g., 1024-dimensional) chapter-level semantic feature vector.
[0038] S204, Feature Fusion The document-level semantic feature vector obtained in S203 and the character-level semantic feature vector obtained in S201 are aggregated and statistically analyzed (taking the maximum value and average value) to obtain a character-level aggregated vector. Then, it is fused with the phrase-level feature vector set constructed in S202. The specific method is as follows: the document-level semantic feature vector and the character-level aggregated vector are first concatenated in the feature dimension to form a global feature vector, and then fed into the attention layer together with the phrase-level semantic feature vector set. The contribution weight of each key phrase feature to the global feature is obtained by the attention mechanism. The phrase features and global features are weighted and summed according to this weight and the dimension is normalized to output a document semantic feature matrix with dimension D, thus completing the fusion of semantic features at three granularities: character-level, phrase-level, and document-level. In this embodiment, D is 1024 dimensions.
[0039] S3. Cataloging Mapping Based on Dynamic Field Matching S301. Construction of the Bibliographic Field Ontology Library The ontology library contains basic bibliographic fields (such as "file code", "file title", "file category", "version", etc.) and domain-extended bibliographic fields (such as "unit number", "system code", "sub-item code", etc., which are typically included in the production domain). Each field contains a field name, field type, and standard semantic description text. A general pre-trained model is used to encode the semantic description text of all fields into semantic vectors. Store it in a vector database.
[0040] S302, Weight-based semantic similarity calculation An improved cosine similarity algorithm is used to calculate the document semantic feature matrix. semantic vectors of each bibliographic field The matching degree is calculated using the following formula: Where F is the document semantic feature vector, and V is the bibliographic field semantic vector. This is the field importance weighting coefficient. It's not a fixed value, but a parameter that is dynamically adjusted based on a preliminary judgment of the document type and the inherent importance of the fields. For example, if the preprocessing stage detects that a document contains sections such as "Tools, Spare Parts and Materials," "Prerequisites for Conducting Work," and "Acceptance Criteria," it is initially determined to be a production document. In this case, fields such as "Unit Number" and "System Code" will be more relevant. The value is automatically adjusted upwards (e.g., from 1.0 to 1.2). Common fields such as "Title" and "Version Number" are also adjusted accordingly. The value remains at 1.0.
[0041] S303, Rule-based Reasoning Correction A rule-based reasoning engine is constructed to correct the preliminary semantic matching results obtained from S302. Rules are organized in a "premise-conclusion" structure: the premise is extracted from the statistical information of the document content features and matching results; the conclusion is used to confirm field mappings or adjust the field set. The reasoning correction involves three steps: first, determining the document's domain based on the document type identification results; then, triggering corresponding rules by combining the high-frequency words in the document with the similarity ranking in S302. For example, if "system coding" appears frequently in the document and its similarity ranking is in the top 3, the mapping to the "system coding" field is confirmed, and the "production" domain field package is activated; finally, filtering, reordering, and supplementing the preliminary matching results according to the triggered rules, outputting the final list of bibliographic fields and the mapping relationship between each field and the document content (the mapping relationship refers to the field value and its name in the document's semantic feature matrix that match each bibliographic field).
[0042] S4. Generation and Optimization of Bibliographic Content S401, Preliminary Content Generation The document semantic feature matrix obtained by fusing the aforementioned S204 features, together with the bibliographic field information and mapping relationship determined after S303 rule reasoning correction, are input into the Seq2Seq generation model (the encoder adopts an LSTM architecture and the decoder adopts a Transformer architecture). Combined with the attention mechanism, the model focuses on the semantic features related to each field to generate the preliminary content of each bibliographic field (e.g., the "Abstract" field generates a text summary of no more than 200 words, and the "Keywords" field generates 3-5 core words).
[0043] S402, Semantic Validation A dual-verification model is constructed: First, semantic consistency verification, which calculates the similarity between the generated preliminary content and the semantic features of the original text. If the similarity is lower than a preset threshold (e.g., 0.7), the generated model is returned for re-optimization. Second, format and logic verification, which removes content with format errors and logical contradictions based on the format specifications of each field (e.g., "classification number" must conform to the IPC classification standard) and logical rules (e.g., "author name and affiliation must correspond one-to-one").
[0044] S403, Reinforcement Learning Optimization A reinforcement learning agent is constructed to iteratively optimize the parameters of the generative model, and the optimized content is output as the final cataloging result. This reinforcement learning process uses the current cataloging content and its semantic features output by the generative model as the state, adjustments to the decoding strategy and the generation methods of each field as actions, and a comprehensive score as the reward signal; the agent updates the model parameters accordingly, gradually increasing the overall reward. The comprehensive score R is calculated using the formula: R1 is the validation pass rate, which refers to the proportion of fields that pass the double validation out of the total number of fields; For the sake of brevity in the bibliographical information, , To determine the length of the generated content, This corresponds to the length of the original text and is used to encourage concise content. To simulate human scoring, a pre-trained judge model is used, which is trained on high-quality human-annotated (document, bibliographic result, score) triples. The weighting coefficients for each reward item satisfy the following conditions: In this embodiment, the values are 0.5, 0.2, and 0.3, respectively.
[0045] S5, Output and Update The final cataloging results are output in structured data formats (such as XML and JSON), which can be directly imported into the document management system. At the same time, a cataloging report is generated, which includes a list of cataloging fields, the confidence score of each field (0-1 interval), and information on unmatched fields. User feedback on the cataloging results is collected regularly (such as field matching errors, inaccurate content, etc.). The corrected samples are added to the training set to fine-tune the semantic extraction model and the generation model, and continuously improve the accuracy of cataloging.
[0046] 1. A three-level semantic feature extraction model of "character-phrase-document" is proposed. To address the problem of large differences in the citation fields of different types of documents (such as laws and regulations, technical documents), a dynamic mapping algorithm based on the combination of semantic similarity and rule reasoning is designed. 2. A four-stage bibliographic content generation process of "semantic extraction - preliminary generation - semantic verification - optimized output" is proposed, which effectively solves the problems of poor flexibility in relying on keyword matching, poor bibliographic quality, and lack of support for multimodal recognition bibliographication in current automatic document bibliographication. While those skilled in the art will recognize that the present invention is not limited to the details of the exemplary embodiments described above, and that it can be implemented in other specific forms without departing from the spirit or essential characteristics of the invention, the embodiments should be considered illustrative and non-limiting in all respects. The scope of the invention is defined by the appended claims rather than the foregoing description, and therefore all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
[0047] Furthermore, it should be understood that although the present invention is described according to embodiments, not every embodiment contains only one independent technical solution. This way of describing the specification is only for clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.
Claims
1. A method for automatic document transcription based on semantic understanding, characterized in that, Includes the following steps: S1. Employ a multi-format parsing engine to extract the original information from the document, standardize the format of non-text content, and uniformly organize all parsed information, including text, tables, formulas, and images, into JSON format for output. S2. Design cleaning logic for each parsed text information to remove noise information, correct format deviations, and integrate all cleaned data into a standardized dataset. S3. Semantic feature extraction based on multi-granularity feature fusion, including character-level semantic feature extraction, phrase-level semantic feature extraction, and document-level semantic feature extraction, and feature fusion of the extracted features; S4. Construct a bibliographic field ontology library, calculate weight-based semantic similarity, and perform rule-based reasoning correction; S5. Generation and optimization of bibliographic content.
2. The automatic document transcription method based on semantic understanding according to claim 1, characterized in that, For text cleaning, a three-step method of "regular expression matching + stop word filtering + syntactic correction" is adopted to achieve noise removal, word segmentation, stop word filtering and syntactic correction. For table cleaning, a "neighborhood mean + rule-based filling" scheme is adopted to handle missing values; outliers are identified through the 3σ principle to handle outliers; and merged cells in the table are split to standardize the format. For formula cleaning, redundant spaces and invalid symbols are removed from formulas, and the LaTeX format is standardized; the LaTeXMK formula syntax checker is used to verify the integrity of formulas and remove invalid formulas. For image cleaning, image preprocessing methods are adopted, specifically grayscale conversion of the images; edge enhancement is performed using the Canny edge detection algorithm; and noise is removed using Gaussian filtering.
3. The automatic document transcription method based on semantic understanding according to claim 2, characterized in that, The character-level semantic feature extraction specifically involves: using a pre-trained model as the basic architecture and performing domain-adaptive fine-tuning on the pre-trained model to output a 768-dimensional context vector for each character / word in the document; The phrase-level semantic feature extraction is specifically as follows: core phrases are identified using dependency parsing, and semantic filtering and importance scoring are performed on the identified phrases in conjunction with the domain ontology library. The BERT vectors of each character in the selected key phrases are averaged or weighted to obtain the semantic vector of the phrase. The vectors of all key phrases constitute a phrase-level semantic feature set. The document-level semantic feature extraction specifically involves: segmenting the document into sentences, representing each sentence with the mean of the BERT vectors of all its characters, using this as the initial feature for the semantic graph nodes, and calculating the edge weight between any two sentence nodes i and j. By using sentences as nodes and connecting them with edge weights, a semantic graph of the document's sentences is constructed.
4. The automatic document transcription method based on semantic understanding according to claim 3, characterized in that, The domain-specific adaptive fine-tuning involves: collecting a large-scale corpus of the target domain and constructing a domain-specific dictionary; and, based on the existing parameters of the pre-trained model, using masked language modeling as the training objective, further training the model parameters using the domain corpus.
5. The automatic document transcription method based on semantic understanding according to claim 4, characterized in that, The importance score of the key phrase is calculated using the following formula: in, These are candidate phrases to be scored; The TD-IDF weight of phrase p; This indicates the semantic relevance of phrase p to core concepts in the domain ontology. This represents the positional weight of phrase p.
6. The automatic document transcription method based on semantic understanding according to claim 5, characterized in that, The The calculation formula is: Where i and 𝑗 represent the sentence's sequential number in the document. Indicates the semantic similarity between sentence i and sentence j; The position attenuation factor is calculated using the following formula: Where δ is the position decay factor (δ>0); The semantic graph of the sentence constructed above is input into a two-layer graph convolutional network.
7. The automatic document transcription method based on semantic understanding according to claim 6, characterized in that, The feature fusion process is as follows: the document-level semantic feature vector and the character-level aggregated vector are first concatenated along the feature dimension to form a global feature vector, which is then fed into the attention layer together with the phrase-level semantic feature vector set. The attention mechanism is used to obtain the contribution weight of each key phrase feature to the global feature. The phrase features and global features are weighted and summed according to this weight and the dimension is normalized to output a document semantic feature matrix with dimension D, thus completing the semantic feature fusion at the character-level, phrase-level, and document-level granularities.
8. The automatic document transcription method based on semantic understanding according to claim 7, characterized in that, The calculation is based on weighted semantic similarity, and an improved cosine similarity algorithm is used to calculate the document semantic feature matrix. semantic vectors of each bibliographic field The matching degree is calculated using the following formula: Where F is the document semantic feature vector, and V is the bibliographic field semantic vector. This represents the field importance weighting coefficient.
9. The automatic document transcription method based on semantic understanding according to claim 8, characterized in that, The rule-based reasoning correction specifically involves: constructing a rule-based reasoning engine to determine the domain to which a document belongs based on the document type recognition results; triggering corresponding rules by combining high-frequency field words in the document with similarity ranking; filtering, reordering, and supplementing fields according to the triggered rules for the preliminary matching results; and outputting the final list of bibliographic fields and the mapping relationship between each field and the document content.
10. The automatic document transcription method based on semantic understanding according to claim 9, characterized in that, The document semantic feature matrix obtained by feature fusion, together with the bibliographic field information and mapping relationship determined after rule reasoning correction, are input into the Seq2Seq generation model to generate the preliminary content of each bibliographic field. Construct a dual-verification model: one is semantic consistency verification, and the other is format and logic verification; A reinforcement learning agent is constructed to iteratively optimize the parameters of the generative model, and the optimized content is output as the final bibliographic result.
