A settlement method and device for engineering contract data based on semantic analysis
By performing semantic analysis and structured processing on engineering contract documents, and utilizing hierarchical classification and entity extraction models, the problems of low efficiency and insufficient accuracy in traditional engineering cost management have been solved, realizing an automated engineering settlement process and standardized information traceability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NORTHWEST ENGINEERING CORPORATION LIMITED
- Filing Date
- 2026-03-09
- Publication Date
- 2026-05-19
AI Technical Summary
In traditional engineering cost management, the reading and understanding of massive amounts of unstructured contract texts and the extraction of key information rely on manual work, which is inefficient, has a long settlement cycle, and is difficult to guarantee in terms of accuracy. In addition, there are subjective biases and experience-based reliance in manual classification, and information traceability is cumbersome.
A semantic analysis-based approach is used to parse, clean, and segment engineering contract documents. A trained hierarchical classification model and entity extraction model are used to determine multi-level target classification labels, and a settlement report is generated through multi-dimensional aggregation calculation.
It has achieved automated end-to-end conversion of project settlement, improved processing efficiency and accuracy, eliminated subjective biases in manual classification, and ensured the standardization of cost management and information traceability.
Smart Images

Figure CN121808061B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of engineering cost management technology, and in particular to a method and apparatus for settling engineering contract data based on semantic analysis. Background Technology
[0002] Large and medium-sized hydropower projects are typically characterized by huge investment scale, long construction period, and complex technology. After the project is completed, the cost management department of the construction unit needs to sort out and extract relevant cost data from thousands of independent contracts and settlement documents involved in the project, and complete the final settlement report.
[0003] Traditionally, reading and understanding massive amounts of unstructured contract texts and extracting key information relies entirely on manual labor. This traditional approach is not only inefficient and time-consuming, but also makes it difficult to guarantee settlement accuracy. Due to differences in the professional backgrounds and experience of different personnel, there may be discrepancies in the understanding of the same contract terms or project categories, making it difficult to achieve standardized cost management. At the same time, when it is necessary to verify the source or basis of a specific item's expenses, information tracing is cumbersome and difficult, and errors in data input or formula links are often difficult to detect in a timely manner. Summary of the Invention
[0004] To overcome the problems existing in related technologies, this disclosure provides a method and apparatus for settling engineering contract data based on semantic analysis, which can improve the processing efficiency of massive unstructured contract texts, ensure the accuracy and standardization of engineering settlement data, and achieve precise information traceability.
[0005] According to a first aspect of the present disclosure, a settlement method for engineering contract data based on semantic analysis is provided, the method comprising:
[0006] The engineering contract documents to be processed are parsed, cleaned, and segmented to obtain the corresponding text sequence to be processed.
[0007] The text sequence to be processed is input into the trained hierarchical classification model, and the multi-level target classification label corresponding to the engineering contract document to be processed in the preset engineering cost hierarchical topology is determined according to the output result.
[0008] Obtain the trained entity extraction model corresponding to the multi-level target classification label, input the text sequence to be processed into the entity extraction model for entity annotation processing, and obtain structured entity data;
[0009] The structured entity data is aggregated and calculated in multiple dimensions based on the multi-level target classification labels, and the calculation results are mapped to the classification summary entries corresponding to the multi-level target classification labels in the preset template file to generate a target settlement report.
[0010] In one exemplary embodiment of this disclosure, the text parsing, cleaning, and word segmentation of the engineering contract document to be processed includes:
[0011] Identify the file format of the project contract file to be processed, and obtain the first text stream of the project contract file to be processed according to the parsing library corresponding to the file format;
[0012] The first text stream is cleaned to remove garbled characters, whitespace characters, special punctuation marks and duplicate content, resulting in a second text stream.
[0013] The second text stream is segmented into word sequences based on a pre-defined engineering cost lexicon.
[0014] The word sequence is encoded to obtain the text sequence to be processed.
[0015] In one exemplary embodiment of this disclosure, the engineering cost hierarchy topology includes four nested classification levels from top to bottom. These four levels include a first-level classification level, a second-level classification level, a third-level classification level, and a fourth-level classification level. The first-level classification level is the root node level of the engineering cost hierarchy topology. The second-level classification level is a sub-level of the first-level classification level, the third-level classification level is a sub-level of the second-level classification level, and the fourth-level classification level is a sub-level of the third-level classification level. Specifically, the first-level classification level includes a final completion settlement table category; the second-level classification level includes final completion settlement categories for each individual project; the third-level classification level includes various project cost categories; and the fourth-level classification level includes various sub-project categories.
[0016] In one exemplary embodiment of this disclosure, the hierarchical classification model includes a bidirectional semantic coding layer and a fully connected classification layer; determining the multi-level target classification label corresponding to the project contract document to be processed in the preset project cost hierarchical topology includes:
[0017] The text sequence to be processed is input into the bidirectional semantic coding layer, and a semantic vector representing the contextual dependencies of the whole text is output.
[0018] The semantic vector is input into the fully connected classification layer for feature space mapping to obtain the classification discriminant value vector corresponding to each category in the engineering cost hierarchical topology.
[0019] The classification discriminant value vectors are normalized to obtain the probability distribution values of each classification category, and the multi-level target classification label is determined according to the classification category corresponding to the maximum value in the probability distribution values.
[0020] In one exemplary embodiment of this disclosure, determining the multi-level target classification label based on the classification category corresponding to the maximum value in the probability distribution includes:
[0021] The classification category corresponding to the maximum value in the probability distribution is determined as the target fourth-level classification category in the fourth-level classification hierarchy of the engineering cost hierarchy topology.
[0022] Based on the index position corresponding to the target fourth-level classification category, a bottom-up path backtracking operation is performed on the engineering cost hierarchical topology to determine the target third-level classification category containing the target fourth-level classification category, the target second-level classification category containing the target third-level classification category, and the target first-level classification category containing the target second-level classification category in the engineering cost hierarchical topology.
[0023] The target primary category, target secondary category, target tertiary category, and target quaternary category are combined according to the hierarchical order from top to bottom in the engineering cost hierarchy topology to obtain the multi-level target classification label.
[0024] In one exemplary embodiment of this disclosure, the entity extraction model includes a sequence labeling feature layer and a conditional random field decoding layer; the step of inputting the text sequence to be processed into the entity extraction model for entity labeling processing to obtain structured entity data includes:
[0025] The text sequence to be processed is input into the sequence labeling feature layer to generate an emission score matrix corresponding to each word.
[0026] The emission score matrix is input into the conditional random field decoding layer, and the global label path is calculated based on the trained state transition matrix.
[0027] The global label path is parsed into a character position annotation sequence, and the start and end boundaries of the entity are identified based on the position indicator labels in the character position annotation sequence;
[0028] The continuous tokens within the start and end boundaries of the entity are concatenated into entity text fragments, and the entity text fragments are encapsulated into key-value pairs according to the corresponding entity type to obtain the structured entity data.
[0029] In one exemplary embodiment of this disclosure, the step of performing multi-dimensional aggregation calculations on the structured entity data based on the multi-level target classification labels, mapping the calculation results to classification summary entries corresponding to the multi-level target classification labels in a preset template file, and generating a target settlement report includes:
[0030] Based on the hierarchical nesting structure corresponding to the multi-level target classification labels, the structured entity data is divided into different hierarchical statistical groups;
[0031] Aggregation operations are performed on the entity fields within each of the aforementioned hierarchical statistical groups; specifically, summation operations are performed on the entity fields of monetary value type to obtain the corresponding summary numerical data; and text concatenation or deduplication processing is performed on the entity fields of string type to obtain the corresponding summary descriptive data.
[0032] Obtain the target row corresponding to the multi-level target category label in the template file, fill the summary numerical data and the summary description data into the target cell corresponding to the target row, and obtain the target settlement report;
[0033] A hash operation is performed on the project contract file to be processed to obtain the corresponding content fingerprint identifier, and the content fingerprint identifier is associated and stored in the metadata of the target settlement report to establish a traceability verification index between the target settlement report and the project contract file to be processed.
[0034] According to a second aspect of the present disclosure, a training method for an engineering contract data settlement model based on semantic analysis is provided, the method comprising:
[0035] Historical engineering contract documents are parsed, cleaned, and segmented to obtain a corresponding training sample set.
[0036] Construct a hierarchical topology for engineering cost, perform multi-level classification labeling on the training sample set according to the hierarchical topology for engineering cost, and obtain multi-level classification labels for each training sample; divide the training sample set into multiple category subsets according to the multi-level classification labels, and perform entity labeling on each category subset to obtain entity labeling data corresponding to each category.
[0037] Each category subset is input into a bidirectional semantic coding layer to obtain a semantic vector. The semantic vector is then input into a fully connected classification layer. Based on the classification loss value between the output predicted classification result and the multi-level classification label corresponding to each category subset, parameter update operations are performed on the bidirectional semantic coding layer and the fully connected classification layer to obtain a trained hierarchical classification model.
[0038] Entity extraction models corresponding to each category subset are constructed. Each category subset is input into the corresponding entity extraction model. The parameters of each entity extraction model are updated based on the sequence labeling loss value between the output predicted entity sequence and the corresponding entity labeling data to obtain the trained entity extraction model.
[0039] According to a third aspect of the present disclosure, an engineering contract data settlement apparatus based on semantic analysis is provided, the apparatus comprising:
[0040] The preprocessing module is used to perform text parsing, cleaning, and word segmentation on the engineering contract documents to be processed, so as to obtain the corresponding text sequence to be processed.
[0041] The classification module is used to input the text sequence to be processed into the trained hierarchical classification model, and determine the multi-level target classification label of the engineering contract document to be processed in the preset engineering cost hierarchical topology based on the output result;
[0042] The extraction module is used to obtain the trained entity extraction model corresponding to the multi-level target classification label, input the text sequence to be processed into the entity extraction model for entity annotation processing, and obtain structured entity data.
[0043] The settlement module is used to perform multi-dimensional aggregation calculations on the structured entity data based on the multi-level target classification labels, and map the calculation results to the classification summary entries corresponding to the multi-level target classification labels in a preset template file to generate a target settlement report.
[0044] According to a fourth aspect of the present disclosure, an engineering contract data settlement apparatus based on semantic analysis is provided, the apparatus comprising:
[0045] The sample module is used to perform text parsing, cleaning, and word segmentation on historical engineering contract documents to obtain the corresponding training sample set.
[0046] The annotation module is used to construct a hierarchical topology of engineering cost, perform multi-level classification annotation on the training sample set according to the hierarchical topology of engineering cost, and obtain multi-level classification labels for each training sample; divide the training sample set into multiple category subsets according to the multi-level classification labels, and perform entity annotation on each category subset to obtain entity annotation data corresponding to each category.
[0047] The first training module is used to input each category subset into a bidirectional semantic coding layer to obtain a semantic vector, input the semantic vector into a fully connected classification layer, and perform parameter update operations on the bidirectional semantic coding layer and the fully connected classification layer based on the classification loss value between the output predicted classification result and the multi-level classification label corresponding to each category subset, so as to obtain a trained hierarchical classification model.
[0048] The second training module is used to construct entity extraction models corresponding to each category subset. Each category subset is input into the corresponding entity extraction model. The module performs parameter update operations on each entity extraction model based on the sequence labeling loss value between the output predicted entity sequence and the corresponding entity labeling data to obtain the trained entity extraction model.
[0049] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects:
[0050] This disclosure provides a semantic analysis-based method for settling engineering contract data. By preprocessing unstructured contract documents and using a trained hierarchical classification model, it accurately maps them to a pre-defined engineering cost hierarchy topology, resulting in multi-level target classification labels with consistent business logic. This method eliminates the subjective bias and experience dependence of manual classification, providing a standardized logical benchmark for subsequent accurate extraction and ensuring the standardization of cost management processes.
[0051] Furthermore, based on the classification results, the matching entity extraction model is invoked for labeling, and multi-dimensional aggregation calculations and template mapping are performed on the structured entity data based on multi-level labels. This enables automated end-to-end transformation from bottom-level data to top-level summary reports under complex sub-project constraints. This method transforms project settlement from tedious manual calculation to automated closed-loop processing, improving the processing efficiency and summary accuracy of massive contract data, and enhancing the traceability and auditing capabilities of dynamic cost data.
[0052] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0053] The accompanying drawings, which are incorporated in and form part of this disclosure, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0054] Figure 1 This disclosure is a flowchart illustrating a method for settling engineering contract data based on semantic analysis, according to an exemplary embodiment.
[0055] Figure 2 This disclosure is a flowchart illustrating a training method for an engineering contract data settlement model based on semantic analysis, according to an exemplary embodiment.
[0056] Figure 3 This disclosure is a schematic diagram of the structure of a settlement device for engineering contract data based on semantic analysis, according to an exemplary embodiment.
[0057] Figure 4This is a schematic diagram of the structure of a training device for a semantic analysis-based engineering contract data settlement model, as illustrated in an exemplary embodiment of this disclosure.
[0058] Figure 5 This is a hardware structure diagram of a computer device shown in an embodiment of this disclosure. Detailed Implementation
[0059] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0060] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The singular forms “a,” “the,” and “the” as used in this disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
[0061] It should be understood that although the terms first, second, third, etc., may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are used only to distinguish information of the same type from one another. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0062] The embodiments of this disclosure will now be described in detail.
[0063] like Figure 1 As shown, Figure 1 This disclosure is a flowchart illustrating a method for settling engineering contract data based on semantic analysis according to an exemplary embodiment. The method may include the following steps 101 to 104:
[0064] Step 101: Perform text parsing, cleaning, and word segmentation on the engineering contract documents to be processed to obtain the corresponding text sequence to be processed.
[0065] Step 102: Input the text sequence to be processed into the trained hierarchical classification model, and determine the multi-level target classification label corresponding to the engineering contract document to be processed in the preset engineering cost hierarchical topology based on the output results.
[0066] Step 103: Obtain the trained entity extraction model corresponding to the multi-level target classification label, input the text sequence to be processed into the entity extraction model for entity annotation processing, and obtain structured entity data.
[0067] Step 104: Perform multi-dimensional aggregation calculations on the structured entity data based on the multi-level target classification labels, and map the calculation results to the classification summary entries corresponding to the multi-level target classification labels in the preset template file to generate a target settlement report.
[0068] The semantic analysis-based engineering contract data settlement method provided by the exemplary embodiments of this disclosure can quickly construct a standardized text sequence to be processed by performing in-depth analysis and preprocessing on unstructured engineering contract documents, providing a high-quality data base for accurate recognition by subsequent semantic models.
[0069] Based on this, the trained hierarchical classification model maps text sequences to a preset engineering cost hierarchical topology. It can automatically and quickly determine multi-level target classification labels based on contract semantic features without human intervention, thereby eliminating the bias in categorization caused by differences in human experience and improving the standardization of contract classification and the efficiency of the settlement preparation stage.
[0070] Furthermore, by acquiring entity extraction models that precisely match multi-level labels and performing annotation processing, and based on multi-dimensional aggregation calculations and template mapping guided by classification labels, an automated end-to-end conversion from scattered entity data to structured settlement reports was achieved. This classification-guided extraction mechanism effectively reduces the difficulty of model identification caused by the diversity of contract types, ensuring the calculation accuracy and logical consistency of cost data during multi-level aggregation. Thus, while ensuring the accuracy of settlement reports, it greatly enhances the processing capacity and business response speed for massive and complex contract data, and strengthens the traceability and auditing capabilities of dynamic cost data.
[0071] The following will provide a detailed description of a semantic analysis-based settlement method for engineering contract data in this example embodiment.
[0072] In step 101, the engineering contract documents to be processed are subjected to text parsing, cleaning and word segmentation to obtain the corresponding text sequence to be processed.
[0073] In the exemplary embodiments of this disclosure, the engineering contract document to be processed can be an electronically stored engineering contract text file, and its file format includes, but is not limited to, PDF (Portable Document Format), Word (Word Processing Document), plain text, or scanned contract document. The file format of the engineering contract document to be processed can be identified, and a first text stream of the engineering contract document to be processed can be obtained according to the parsing library corresponding to the file format. For example, when the engineering contract document to be processed is a PDF file, a PDF parsing library can be called to parse the file content; when the engineering contract document to be processed is a Word file, a document parsing library can be called to extract the main text; when the engineering contract document to be processed is a scanned document, the image content can first be converted into editable text through optical character recognition (OCR), and then the corresponding text content can be obtained. Through the above parsing process, a first text stream for subsequent processing is obtained, wherein the first text stream represents the original text content of the engineering contract document in the form of a character sequence or string.
[0074] In the exemplary implementation of this disclosure, after obtaining the first text stream, a cleaning process can be performed on the first text stream to remove garbled characters, whitespace, special punctuation marks, and duplicate content, resulting in a second text stream. Specifically, non-standard character encodings in the first text stream can be uniformly converted to remove garbled characters introduced by file format conversion or character recognition; consecutive spaces, newlines, or tabs can be merged or deleted; special punctuation marks that do not affect semantic understanding can be filtered; and repeated text paragraphs or sentences can be identified and deleted through string matching or sliding window comparison, thereby obtaining a second text stream with a more standardized structure and stronger semantic continuity. The second text stream, as a standardized contract text, provides a unified data foundation for subsequent word segmentation and encoding processing.
[0075] After obtaining the second text stream, a matching operation is performed on it according to a pre-set engineering cost terminology database, segmenting the second text stream into a sequence of terms. This pre-set database stores common professional terms, cost names, pricing units, quantity descriptions, and fixed expressions related to contractual agreements in the field of engineering contracts. By matching the second text stream with the pre-set database segment by segment or word by word, corresponding engineering cost-related terms in the text can be identified, and the second text stream is segmented according to the matching results, resulting in a sequence of terms composed of multiple terms. Each term can correspond to an engineering cost term, unit of measurement, numerical expression, or ordinary text fragment, thus transforming the original continuous character stream into a structured set of terms.
[0076] Furthermore, the word sequence can be encoded to obtain the text sequence to be processed. For example, each word in the word sequence can be assigned a unique word identifier, and the word identifier can be converted into a vector representation according to a preset encoding rule, or the word can be mapped to a corresponding index sequence. At the same time, in order to preserve contextual position information, position encoding can be injected into each word vector, and specific functional identifiers such as start symbol [CLS] and separator [SEP] can be added to the beginning and end of the sequence. The encoded tensor data is the text sequence to be processed.
[0077] Through the above implementation methods, this disclosure achieves the transformation from raw unstructured text to a standardized text sequence. The text sequence to be processed, after cleaning and correction using a specialized lexicon, improves the signal-to-noise ratio of semantic information, providing a high-purity logical input benchmark for subsequent hierarchical classification and entity extraction models. It effectively avoids semantic noise introduced by messy contract text formats and biased word segmentation of specialized terms, ensuring the accuracy of the input source.
[0078] In step 102, the text sequence to be processed is input into the trained hierarchical classification model, and the multi-level target classification label corresponding to the engineering contract document to be processed in the preset engineering cost hierarchical topology is determined according to the output result.
[0079] In the exemplary embodiments of this disclosure, a classification benchmark can be constructed based on a preset engineering cost hierarchy topology. This engineering cost hierarchy topology can be a tree structure with four nested classification levels from top to bottom, including a first-level classification level, a second-level classification level, a third-level classification level, and a fourth-level classification level. The first-level classification hierarchy is the root node of the engineering cost hierarchy topology, used to represent the categories of the final settlement table at the macro level, including but not limited to: final settlement table, final settlement estimate regression table, and final settlement and execution estimate investment comparison analysis table. The second-level classification hierarchy is a sub-level of the first-level classification hierarchy, corresponding to the specific final settlement categories of each individual project, including but not limited to: final settlement of key projects, final settlement of preliminary construction preparation projects, and final settlement of main building installation projects. The third-level classification hierarchy is a sub-level of the second-level classification hierarchy, further refined into various project cost categories, including but not limited to: preliminary construction preparation projects, main building installation projects, and equipment procurement projects. The fourth-level classification hierarchy is a sub-level of the third-level classification hierarchy, and also a leaf node of the engineering cost hierarchy topology, corresponding to the finest-grained categories of each sub-project, including but not limited to: dam projects, left bank seepage prevention curtain projects, water diversion and power generation system projects, and flood discharge structure projects. Within the hierarchical topology of engineering cost, each fourth-level classification category has a unique traceability path. As an example, a specific traceability path can be represented as: hub project (first-level classification) — dam project (second-level classification) — construction cost (third-level classification) — earthwork excavation project (fourth-level classification). This topology provides clear business logic constraints.
[0080] In the exemplary implementation of this disclosure, a trained hierarchical classification model can be used to extract semantic features and predict probabilities of the text sequence to be processed. This hierarchical classification model includes a bidirectional semantic coding layer and a fully connected classification layer.
[0081] As an example, the obtained text sequence to be processed can be input into the bidirectional semantic encoding layer in a hierarchical classification model. This bidirectional semantic encoding layer can use the BERT (Bidirectional Encoder Representations from Transformers) model to deeply model the contextual information of each word in the text sequence to be processed. The bidirectional semantic encoding layer can capture the bidirectional contextual dependencies between words through a self-attention mechanism, thereby outputting a semantic vector representing the contextual dependencies of the entire text. This semantic vector includes macroscopic semantic information of the entire contract text, such as the contract subject's intent, descriptions of engineering sub-items, and settlement boundary clauses.
[0082] Semantic vectors can be input into the fully connected classification layer of a hierarchical classification model for feature space mapping. As an example, the fully connected classification layer can learn the mapping rules from semantic vectors to the specific engineering cost business space, obtaining classification discriminant value vectors corresponding to each category in the engineering cost hierarchical topology. After obtaining the classification discriminant value vectors, each component value represents the discrimination score between the text to be processed and each category in the topology. Normalization can be performed on the discrimination scores to obtain the probability distribution values for each category. After obtaining the probability distribution values, multi-level target classification labels can be determined based on the category corresponding to the maximum value in the probability distribution values. By constructing a hierarchical classification model containing a bidirectional semantic encoding layer and a fully connected classification layer, and combining probability distribution values for hierarchical positioning, compared to traditional keyword matching methods, it can deeply understand the true business attributes of contract texts, achieve accurate classification of massive contract documents, provide a high-precision logical index for subsequent targeted data aggregation, and realize the automation and standardization of engineering settlement classification.
[0083] In the exemplary implementation of this disclosure, the classification category corresponding to the maximum value in the probability distribution can be determined as the target fourth-level classification category in the fourth-level classification hierarchy of the engineering cost hierarchy topology. As an example, the classification model generates a probability distribution corresponding to all predefined fourth-level classification categories in the engineering cost hierarchy topology at the output layer. By retrieving the maximum value component in the probability vector, the leaf node with the highest confidence in the lowest-level fourth-level classification hierarchy of the engineering cost hierarchy topology can be determined, and the fourth-level classification category corresponding to this leaf node can be determined as the target fourth-level classification category. After determining the target fourth-level classification category, this finest-grained business unit can be used as the starting point for subsequent path backtracking operations, thereby improving the certainty of classification and reducing the risk of hierarchy determination conflicts.
[0084] Based on the index position corresponding to the target fourth-level classification category, a bottom-up path backtracking operation can be performed on the hierarchical topology of the engineering cost. As an example, a hierarchical mapping table or tree diagram corresponding to the engineering cost hierarchical topology can be pre-stored, recording the unique correspondence between each fourth-level classification category and its parent node. Based on the index of the target fourth-level classification category, the target third-level classification category containing that fourth-level category can be retrieved level by level upwards, the target second-level classification category containing that third-level category can be retrieved at the third-level classification level, and the target first-level classification category containing that second-level category can be retrieved at the second-level classification level. For example, if the target fourth-level classification category is "left bank seepage prevention curtain project," then by backtracking upwards, its corresponding target third-level classification category can be determined as "main building installation engineering cost," further backtracking determines the target second-level classification category as "main building installation engineering completion settlement," and finally backtracking to the target first-level classification category as "completion settlement summary table." After obtaining the classification categories at each level, it can be ensured that there is a strict hierarchical logic between each level. By using bottom-up path backtracking operations, compared to independent prediction at each level, the strong constraints of the preset topology structure can be utilized to ensure the rationality of the generated classification chain in the engineering cost business logic, and improve the rigor of settlement data centralization.
[0085] The target primary, secondary, tertiary, and quaternary categories can be combined according to the top-down hierarchical order in the engineering cost hierarchy to obtain multi-level target category labels. As an example, preset separators, such as forward slashes or hyphens, can be used to cascade the names obtained from the backtracking process, forming a complete and standardized tag string for multi-level target category labels. By combining categories based on hierarchical order, precise positioning of unstructured data within a multi-dimensional cost system can be achieved, providing standardized index identifiers for subsequent automatic form filling and multi-level summarization, thus improving the efficiency of settlement data processing.
[0086] In the above implementation, by performing bottom-up path backtracking operations and hierarchical combination, the probability prediction results based on the deep learning model can be deeply integrated with the inherent logical structure of the engineering cost field, which can ensure that the final settlement report meets the industry audit requirements and improve the processing accuracy and traceability efficiency of settlement work for large-scale hydropower projects.
[0087] In step 103, the trained entity extraction model corresponding to the multi-level target classification label is obtained, and the text sequence to be processed is input into the entity extraction model for entity annotation processing to obtain structured entity data.
[0088] In the exemplary implementation of this disclosure, a trained entity extraction model corresponding to a multi-level target classification label can be obtained. As an example, dedicated entity extraction sub-models can be pre-trained for the same level of classification in the multi-level target classification, such as the third-level classification category. The specific training can be determined based on actual circumstances, and this disclosure does not impose limitations. Based on the determined multi-level target classification labels, a matching entity extraction model can be obtained from a pre-set model library. By calling the corresponding dedicated extraction model for different categories, compared to using a single general extraction model, it is possible to more accurately capture professional entity information within a specific industry context, effectively reducing the risk of misidentification due to terminological ambiguity and improving the accuracy of data extraction.
[0089] In the exemplary implementation of this disclosure, the text sequence to be processed can be input into an entity extraction model for entity annotation. This entity extraction model can employ a deep learning sequence annotation architecture, which may include a sequence annotation feature layer and a conditional random field decoding layer. As an example, the sequence annotation feature layer can employ a bidirectional long short-term memory network, etc., to learn the semantic association between each word in the text sequence and its context, generating an emission score matrix corresponding to each word. After obtaining the emission score matrix, this matrix records the initial probability score of each word belonging to different entity labels, such as project name, settlement price, unit of measurement, etc. By generating the emission score matrix, a basic semantic feature distribution can be provided for subsequent accurate decoding, achieving a preliminary transformation from the text sequence to a label probability space.
[0090] The emission score matrix can be input into the Conditional Random Field (CRF) decoding layer. As an example, the CRF decoding layer can utilize the state transition matrix obtained during training to apply logical constraints to the label selection at each position in the emission score matrix, calculating and outputting the global label path with the maximum likelihood score. This global label path indicates the annotation result that best conforms to grammatical logic and business common sense. By calculating the global label path based on the state transition matrix, compared to independent word-by-word classification, the logical contradiction problem in label prediction can be effectively solved, enhancing the continuity and logical rigor of entity recognition.
[0091] The global label path can be parsed into a sequence of character position labels. As an example, a point-to-point mapping relationship can be established between each status label in the globally optimal path and the character index in the original contract text, transforming the abstract logical label sequence into a character mask with physical location attributes. After obtaining the character position label sequence, each character is assigned a specific business attribute status, such as labeled "B-Project Name" or "I-Quantity of Work".
[0092] The start and end boundaries of entities can be identified based on position indicator labels in a character position tag sequence. As an example, a pre-defined labeling logic operator can be used to sequentially scan the sequence: when a position indicator label "B" (start) is encountered, the index position of that character is marked as the start boundary of the current entity; then, the scan continues downwards until a position indicator label "O" (outer) or the next "B" label is encountered, at which point the index position corresponding to the previous "I" (middle) label is marked as the end boundary of the entity. By identifying the start and end boundaries of entities, compared to fuzzy keyword retrieval or simple regular expression matching, this effectively solves the identification sticking problem caused by nested long and complex sentences and the continuous appearance of multiple entities in engineering contracts, improving the accuracy of entity extraction and ensuring the reliability of structured data sources. Transforming global logical paths into specific character position tags and locking boundaries based on position indicator labels can flexibly address the challenges of variable entity lengths and diverse expression methods in large engineering contracts.
[0093] Continuous words within the start and end boundaries of an entity can be concatenated into an entity text fragment. As an example, based on the previously identified start and end indices, corresponding word subsequences can be extracted from the original text sequence to be processed, and a string concatenation algorithm can be used to restore the discrete characters or words within that interval into a continuous text expression. By concatenating continuous words, compared to processing discrete characters individually, the original form of cost elements in contract terms can be restored, providing highly readable data for subsequent logical understanding.
[0094] Structured entity data can be obtained by encapsulating entity text fragments and their corresponding entity types into key-value pairs. As an example, the classification attributes assigned to each entity text fragment during the annotation process, such as project name, unit of measurement, and quantity of work, can be extracted. These classification attributes can then be used as keys, and the concatenated entity text fragments as values to construct one-to-one key-value pairs. All generated key-value pairs, along with pre-defined multi-level target classification labels, can be associated and encapsulated to obtain structured entity data. As an example, a unified data object containing business topology dimensions and core cost factors can be constructed, such as using JSON (JavaScript Object Notation) or XML (Extensible Markup Language) formats. As an example, structured entity data is shown below:
[0095] {
[0096] "classification": {
[0097] "Target Primary Category": "Completion Summary and Settlement Table",
[0098] "Target Secondary Category": "Summary Settlement of Main Building Installation Engineering Completion",
[0099] Target Category (Level 3): "Equipment Procurement Project"
[0100] Target Category (Level 4): "Installation Project of a Certain Generating Unit"
[0101] },
[0102] "entities": {
[0103] Project Name: Construction Power Supply Project
[0104] Unit: "item"
[0105] Quantity: "1",
[0106] Unit Price: 1,500,000.00 yuan
[0107] Total Amount: 1,500,000.00 yuan
[0108] }
[0109] }
[0110] Through the above implementation methods, encoding the lexical context through the sequence labeling feature layer can accurately ensure the high accuracy of the feature extraction source; by introducing a conditional random field decoding layer and combining it with a state transition matrix, the label conflict or illegal jump problem that may occur in the local prediction of deep learning models can be effectively solved, ensuring the reliability of the identified entities in business logic; by accurately identifying the start and end boundaries of entities and performing key-value pair encapsulation, the transcription error in the manual extraction process is reduced, and the subsequent business cycle from contract parsing to settlement report generation is shortened.
[0111] In this exemplary implementation, a contract cost classification and summary database can be constructed. As an example, a relational database management system can be used to create a structured data storage model, and dedicated data tables can be designed and constructed according to the business logic of project cost. During the construction of the data tables, a core structure including a unique identifier field, a classification information field, a key cost information field, and contract metadata fields can be set. The unique identifier field can be set as an auto-incrementing primary key to ensure the uniqueness of each settlement record globally; the classification information field is used to identify multi-level target classification labels; and the key cost information field is used to store extracted project names, unit prices, and total amounts.
[0112] After obtaining the constructed database structure, data insertion and related storage can be performed. As an example, the structured data generated for each contract text in the previous steps is parsed to extract the encapsulated category tags and entity key-value pairs. According to the preset field mapping rules, the parsed field data is entered one by one into the corresponding table entries in the contract cost classification summary database by calling the INSERT command in SQL (Structured Query Language).
[0113] Contract metadata can also be processed automatically. For example, contract numbers can be automatically generated based on the current date and preset serial number generation rules, or existing numbering information can be extracted from specific locations such as the header and footer of the contract text using information extraction technology and stored in the database as metadata fields. After data entry is complete, the classification result of each contract and its detailed cost item are linked in the database through a unique identifier field for the common contract.
[0114] By implementing automated data entry and associated storage, the risk of human intervention and transcription errors during the data entry process is reduced compared to manual data entry. This allows settlement data to flow in a structured form in real time, providing a high-confidence data source for multi-dimensional aggregation calculations in the final target settlement report.
[0115] In step 104, the structured entity data is aggregated in multiple dimensions according to the multi-level target classification labels, and the calculation results are mapped to the classification summary entries corresponding to the multi-level target classification labels in the preset template file to generate a target settlement report.
[0116] In the exemplary implementation of this disclosure, structured entity data can be divided into different hierarchical statistical groups based on the hierarchical nesting structure corresponding to multi-level target classification labels. As an example, based on a preset four-level nested topology, structured records with the same "Level 1 / Level 2 / Level 3 / Level 4" path can be grouped into the same logical statistical cluster. After obtaining the hierarchical statistical groups, all contract details under the same project part or cost item are aggregated together. By dividing according to the hierarchical nesting structure, compared to indiscriminate flat statistics, it is possible to ensure that the data's classification logic is strictly consistent with the work breakdown structure of the project cost, providing an ordered data set for subsequent classification and summarization.
[0117] In the exemplary implementation of this disclosure, aggregation operations can be performed on entity fields within each level of statistical group. For example, for numeric entity fields such as "total amount," "quantity of work," or "contract unit price," an accumulation operator can be called to perform accumulation operations on the numeric fields to obtain the corresponding summary numeric data. For string entity fields such as "description of work location" or "construction process description," text concatenation or deduplication processing can be performed to merge fragmented text descriptions into coherent summary description data. After obtaining the summary numeric data and summary description data, performing categorized aggregation operations can improve the accuracy of project settlement summaries and data processing efficiency.
[0118] In this exemplary implementation, the target rows corresponding to multi-level target category labels in the template file can be obtained. The summarized numerical data and summarized descriptive data are then filled into the target cells corresponding to the target rows to obtain the target settlement report. As an example, the template file can be preset as a spreadsheet containing specific row indexes and formula links. Multi-level labels can be used as search keywords to locate the corresponding hierarchical summary rows in the template. After obtaining the target settlement report, mapping the calculation results to the target rows of the preset template eliminates human input errors compared to manually filling out the report, ensuring the standardization and normalization of report generation.
[0119] In this exemplary implementation, a hash operation can be performed on the engineering contract document to be processed to obtain a corresponding content fingerprint identifier, which is then associated and stored in the metadata of the target settlement report. As an example, MD5 (Message Digest Algorithm 5) or SHA (Secure Hash Algorithm) algorithms can be used to calculate the binary data stream of the original contract, generating a unique string as the content fingerprint identifier. After obtaining the content fingerprint identifier and establishing the associated storage, each summary data item in the target settlement report is bound to the source file through this content fingerprint identifier. By establishing a traceability verification index, compared to traditional paper backups, auditors can be provided with a one-click source document traceability and anti-tampering verification method, significantly enhancing the security, reliability, and business transparency of the engineering settlement process.
[0120] Through the above implementation methods, the entire chain of automated management from reading unstructured contracts to generating structured compliant reports can be realized. This not only solves the technical problem of extremely complex multi-level aggregation logic in ultra-large-scale engineering projects, but also ensures the immutability of data during the data flow process through hash indexes, providing high-precision, high-efficiency and high-security technical guarantees for settlement work.
[0121] In the exemplary implementation of this disclosure, in response to a user's instruction to trace and verify any data in the target settlement report, the original engineering contract document can be retrieved by invoking a bidirectional mapping index. As an example, when a user clicks on any cost data, such as "Unit Price: 1,500,000.00 yuan," in the settlement report visualization interface, the method of this disclosure can retrieve the corresponding original contract scan or PDF page based on the bidirectional mapping index. After obtaining the engineering contract document image, based on the entity boundary coordinates output by the entity extraction model, a visually highlighted marker box, such as a rectangular red box, is generated on the image, and the page location of the highlighted marker box is automatically displayed. Through this text-image linkage verification method, compared to the problem that traditional OCR results can only display text and cannot verify the original document, a WYSIWYG settlement verification is achieved, greatly reducing the workload of manual review and improving the accuracy and credibility of financial audits for large-scale engineering projects.
[0122] like Figure 2 As shown, Figure 2 This disclosure is a flowchart illustrating a training method for a settlement model of engineering contract data based on semantic analysis, according to an exemplary embodiment. The method may include the following steps 201 to 204:
[0123] Step 201: Perform text parsing, cleaning, and word segmentation on the historical engineering contract documents to obtain the corresponding training sample set.
[0124] In this exemplary embodiment, a massive amount of historical engineering contract documents can be retrieved from a database or archive. As an example, a PDF parsing library, a Word parsing tool, and OCR technology for scanned documents are used to extract the original text content from the historical contracts. After obtaining the original text, noise reduction and cleaning operations can be performed to remove headers and footers irrelevant to cost estimation, garbled characters, and duplicate seal declarations, and a pre-defined engineering cost terminology library is introduced for accurate word segmentation. By standardizing and preprocessing historical contracts, compared to directly using the original text, the signal-to-noise ratio of the training data can be improved, providing a high-quality data foundation for the subsequent model to learn complex cost estimation logic.
[0125] Step 202: Construct a hierarchical topology of engineering cost, perform multi-level classification labeling on the training sample set according to the hierarchical topology of engineering cost, and obtain multi-level classification labels for each training sample; divide the training sample set into multiple category subsets according to the multi-level classification labels, and perform entity labeling on each category subset to obtain entity labeling data corresponding to each category.
[0126] In the exemplary implementation of this disclosure, a hierarchical topology of engineering cost can be constructed, comprising levels one to four. As an example, the topology can be divided into levels such as a final completion settlement table, individual projects, cost categories, and specific sub-projects, based on engineering practices. After obtaining the hierarchical topology of engineering cost, multi-level classification labeling can be performed on the training sample set to determine the multi-level classification label corresponding to each contract sample within the topology. Further, the training sample set can be divided into multiple category subsets based on the multi-level classification labels, such as a civil engineering subset, a mechanical and electrical engineering subset, etc., and fine-grained entity labeling can be performed on the samples within each category subset. During the labeling process, a BIO (Begin-Inside-Outside) system can be used to define the boundaries of entities such as project names, unit prices, and quantities, obtaining entity labeling data corresponding one-to-one with each category. By using a classification-then-labeling method, compared to full-scale mixed labeling, the training data can have stronger professional relevance, providing precise logical guidance for the subsequent construction of a dedicated extraction model.
[0127] Step 203: Input each category subset into the bidirectional semantic encoding layer to obtain semantic vectors, input the semantic vectors into the fully connected classification layer, and perform parameter update operations on the bidirectional semantic encoding layer and the fully connected classification layer based on the classification loss value between the output predicted classification result and the multi-level classification label corresponding to each category subset, to obtain the trained hierarchical classification model.
[0128] In the exemplary implementation of this disclosure, subsets of each category can be input into a bidirectional semantic encoding layer to obtain semantic vectors. As an example, the bidirectional semantic encoding layer can utilize a self-attention mechanism to capture long-range features in the contract text and input the extracted semantic vectors into a fully connected classification layer for feature mapping. After obtaining the predicted classification result, the classification loss value between this result and the true multi-level classification label corresponding to each subset of categories can be calculated. As an example, the cross-entropy loss function can be used to measure the difference between the predicted distribution and the true distribution. Based on the classification loss value, a backpropagation algorithm can be executed to update the weight parameters of the bidirectional semantic encoding layer and the fully connected classification layer. After iterative training reaches a preset accuracy target, a trained hierarchical classification model is obtained. By introducing semantic vectors and loss-driven parameter updates, compared to traditional rule-based classification schemes, the model can automatically learn the business logic in contract terms, improving the accuracy of classifying unknown contract documents.
[0129] Step 204: Construct entity extraction models corresponding to each category subset, input each category subset into the corresponding entity extraction model, and perform parameter update calculations on each entity extraction model based on the sequence labeling loss value between the output predicted entity sequence and the corresponding entity labeling data to obtain the trained entity extraction model.
[0130] In the exemplary implementation of this disclosure, entity extraction models corresponding one-to-one with each category subset can be constructed. As an example, model instances containing BiLSTM (Bidirectional Long Short-Term Memory) feature layers and CRF (Conditional Random Field) decoding layers can be constructed for the dam engineering category and the electromechanical installation category, respectively. After inputting each category subset into the corresponding entity extraction model, the parameters of each entity extraction model are updated based on the sequence labeling loss value between the output predicted entity sequence and the corresponding entity labeling data, such as negative log-likelihood loss. After obtaining the trained entity extraction models, each model for a specific category possesses a high sensitivity to the domain-specific expressions. By training entity extraction models independently for different categories, compared to using a single general model, the recognition accuracy for domain-specific proper nouns and numerical units can be significantly improved, ensuring high fidelity of structured entity data in complex business scenarios.
[0131] Corresponding to the embodiments of the foregoing methods, this disclosure also provides embodiments of the apparatus and the terminal to which it is applied.
[0132] like Figure 3 As shown, Figure 3 This disclosure is a schematic diagram illustrating the structure of an engineering contract data settlement device based on semantic analysis according to an exemplary embodiment. The device includes: a preprocessing module 310, a classification module 320, an extraction module 330, and a settlement module 340.
[0133] Preprocessing module 310 is used to perform text parsing, cleaning and word segmentation on the engineering contract documents to be processed, so as to obtain the corresponding text sequence to be processed;
[0134] The classification module 320 is used to input the text sequence to be processed into the trained hierarchical classification model, and determine the multi-level target classification label corresponding to the engineering contract document to be processed in the preset engineering cost hierarchical topology based on the output results.
[0135] The extraction module 330 is used to obtain the trained entity extraction model corresponding to the multi-level target classification label, input the text sequence to be processed into the entity extraction model for entity annotation processing, and obtain structured entity data.
[0136] The settlement module 340 is used to perform multi-dimensional aggregation calculations on structured entity data based on multi-level target classification labels, and map the calculation results to the classification summary entries corresponding to the multi-level target classification labels in the preset template file to generate a target settlement report.
[0137] It should be noted that the settlement device for engineering contract data based on semantic analysis in this embodiment is used to implement the corresponding settlement method for engineering contract data based on semantic analysis in the aforementioned method embodiment, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.
[0138] like Figure 4 As shown, Figure 4 This is a schematic diagram of a training device for a semantic analysis-based engineering contract data settlement model, according to an exemplary embodiment of this disclosure. The device includes: a sample module 410, a labeling module 420, a first training module 430, and a second training module 440.
[0139] Sample module 410 is used to perform text parsing, cleaning and word segmentation on historical engineering contract documents to obtain the corresponding training sample set;
[0140] The annotation module 420 is used to construct the hierarchical topology of engineering cost, perform multi-level classification annotation on the training sample set according to the hierarchical topology of engineering cost, and obtain multi-level classification labels for each training sample; divide the training sample set into multiple category subsets according to the multi-level classification labels, and perform entity annotation on each category subset to obtain entity annotation data corresponding to each category.
[0141] The first training module 430 is used to input each category subset into the bidirectional semantic coding layer to obtain semantic vectors, input the semantic vectors into the fully connected classification layer, and perform parameter update operations on the bidirectional semantic coding layer and the fully connected classification layer based on the classification loss value between the output predicted classification result and the multi-level classification label corresponding to each category subset, so as to obtain the trained hierarchical classification model.
[0142] The second training module 440 is used to construct entity extraction models corresponding to each category subset. Each category subset is input into the corresponding entity extraction model. The parameters of each entity extraction model are updated according to the sequence labeling loss value between the output predicted entity sequence and the corresponding entity labeling data, so as to obtain the trained entity extraction model.
[0143] It should be noted that the training device for the settlement model of engineering contract data based on semantic analysis in this embodiment is used to implement the corresponding training method for the settlement model of engineering contract data based on semantic analysis in the aforementioned method embodiment, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.
[0144] This disclosure discloses an embodiment of an engineering contract data settlement device based on semantic analysis or a training device for an engineering contract data settlement model based on semantic analysis, which can be applied to computer devices, such as servers or terminal devices. The device embodiment can be implemented through software, hardware, or a combination of both. Taking software implementation as an example, as a logical device, it is formed by the processor reading the corresponding computer program instructions from non-volatile memory into memory for execution. From a hardware perspective, such as... Figure 5 The diagram shown is a hardware structure diagram of a computer device containing a semantic analysis-based engineering contract data settlement device or a semantic analysis-based engineering contract data settlement model training device according to an embodiment of this disclosure. Except for... Figure 5 In addition to the processor 510, memory 530, network interface 520, and non-volatile memory 540 shown, the server or electronic device on which the semantic analysis-based engineering contract data settlement device or the semantic analysis-based engineering contract data settlement model training device is located in the embodiment may also include other hardware depending on the actual function of the computer device, which will not be described in detail here.
[0145] Accordingly, this disclosure also provides a semantic analysis-based engineering contract data settlement device or a semantic analysis-based engineering contract data settlement model training device, the device including a processor; a memory for storing processor-executable instructions; wherein the processor is configured for the above-mentioned semantic analysis-based engineering contract data settlement method.
[0146] The specific implementation process of the functions and roles of each module in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0147] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this disclosure according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0148] The foregoing has described specific embodiments of this disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0149] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention applied herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not claimed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0150] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
[0151] The above description is merely a preferred embodiment of this disclosure and is not intended to limit this disclosure. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A settlement method for engineering contract data based on semantic analysis, characterized in that, The method includes: The engineering contract documents to be processed are parsed, cleaned, and segmented to obtain the corresponding text sequence to be processed. The text sequence to be processed is input into the trained hierarchical classification model. Based on the output results, the multi-level target classification label corresponding to the engineering contract document to be processed in the preset engineering cost hierarchical topology is determined. The hierarchical classification model includes a bidirectional semantic coding layer and a fully connected classification layer. Obtain the trained entity extraction model corresponding to the multi-level target classification label, input the text sequence to be processed into the entity extraction model for entity annotation processing, and obtain structured entity data. The entity extraction model includes a sequence label feature layer and a conditional random field decoding layer. The structured entity data is aggregated and calculated in multiple dimensions based on the multi-level target classification labels, and the calculation results are mapped to the classification summary entries corresponding to the multi-level target classification labels in the preset template file to generate a target settlement report. The step of inputting the text sequence to be processed into the trained hierarchical classification model and determining the multi-level target classification label of the engineering contract document in the preset engineering cost hierarchical topology based on the output results includes: The text sequence to be processed is input into the bidirectional semantic coding layer to obtain a semantic vector, and the semantic vector is input into the fully connected classification layer to obtain a classification discriminant value vector corresponding to each category in the engineering cost hierarchical topology. The classification discriminant value vectors are normalized to obtain the probability distribution values of each classification category; The classification category corresponding to the maximum value in the probability distribution is determined as the target fourth-level classification category in the fourth-level classification hierarchy of the engineering cost hierarchy topology. Based on the index position corresponding to the target fourth-level classification category, a bottom-up path backtracking operation is performed on the engineering cost hierarchical topology to determine the target third-level classification category containing the target fourth-level classification category, the target second-level classification category containing the target third-level classification category, and the target first-level classification category containing the target second-level classification category in the engineering cost hierarchical topology. The target primary category, target secondary category, target tertiary category, and target quaternary category are combined according to the hierarchical order from top to bottom in the engineering cost hierarchy topology to obtain the multi-level target classification label; The step of inputting the text sequence to be processed into the entity extraction model for entity annotation processing to obtain structured entity data includes: The text sequence to be processed is input into the sequence labeling feature layer to generate an emission score matrix corresponding to each word. The emission score matrix is input into the conditional random field decoding layer, and the global label path is calculated based on the trained state transition matrix. The global label path is parsed into a character position label sequence, and the start and end boundaries of the entity are identified based on the position indicator labels in the character position label sequence. The continuous tokens within the start and end boundaries of the entity are concatenated into entity text fragments, and the entity text fragments are encapsulated into key-value pairs according to the corresponding entity type to obtain the structured entity data.
2. The method according to claim 1, characterized in that, The text parsing, cleaning, and word segmentation of the project contract documents to be processed include: Identify the file format of the project contract file to be processed, and obtain the first text stream of the project contract file to be processed according to the parsing library corresponding to the file format; The first text stream is cleaned to remove garbled characters, whitespace characters, special punctuation marks and duplicate content, resulting in a second text stream. The second text stream is segmented into word sequences based on a pre-defined engineering cost lexicon. The word sequence is encoded to obtain the text sequence to be processed.
3. The method according to claim 1, characterized in that, The engineering cost hierarchy topology comprises four nested classification levels from top to bottom: a first-level classification level, a second-level classification level, a third-level classification level, and a fourth-level classification level. The first-level classification level is the root node of the engineering cost hierarchy topology. The second-level classification level is a sub-level of the first-level classification level, the third-level classification level is a sub-level of the second-level classification level, and the fourth-level classification level is a sub-level of the third-level classification level. Specifically, the first-level classification level includes a final settlement summary table category; the second-level classification level includes final settlement summaries for each individual project category; the third-level classification level includes various project cost categories; and the fourth-level classification level includes various sub-project categories.
4. The method according to claim 1, characterized in that, The step of performing multi-dimensional aggregation calculations on the structured entity data based on the multi-level target classification labels, mapping the calculation results to the classification summary entries corresponding to the multi-level target classification labels in a preset template file, and generating a target settlement report includes: Based on the hierarchical nesting structure corresponding to the multi-level target classification labels, the structured entity data is divided into different hierarchical statistical groups; Aggregation operations are performed on the entity fields within each of the aforementioned hierarchical statistical groups; specifically, summation operations are performed on the entity fields of monetary value type to obtain the corresponding summary numerical data; and text concatenation or deduplication processing is performed on the entity fields of string type to obtain the corresponding summary descriptive data. Obtain the target row corresponding to the multi-level target category label in the template file, fill the summary numerical data and the summary description data into the target cell corresponding to the target row, and obtain the target settlement report; A hash operation is performed on the project contract file to be processed to obtain the corresponding content fingerprint identifier, and the content fingerprint identifier is associated and stored in the metadata of the target settlement report to establish a traceability verification index between the target settlement report and the project contract file to be processed.
5. A training method for an engineering contract data settlement model based on semantic analysis, characterized in that, The method includes: Historical engineering contract documents are parsed, cleaned, and segmented to obtain a corresponding training sample set. Construct a hierarchical topology for engineering cost, perform multi-level classification labeling on the training sample set according to the hierarchical topology for engineering cost, and obtain multi-level classification labels for each training sample; divide the training sample set into multiple category subsets according to the multi-level classification labels, and perform entity labeling on each category subset to obtain entity labeling data corresponding to each category. Each category subset is input into a bidirectional semantic encoding layer to obtain a semantic vector. The semantic vector is then input into a fully connected classification layer to obtain a predicted classification result. Based on the classification loss value between the predicted classification result and the multi-level classification label corresponding to each category subset, parameter update operations are performed on the bidirectional semantic encoding layer and the fully connected classification layer to obtain a trained hierarchical classification model. Construct an entity extraction model corresponding to each category subset, input each category subset into the corresponding entity extraction model, perform parameter update operation on each entity extraction model according to the sequence labeling loss value between the output predicted entity sequence and the corresponding entity labeling data, and obtain the trained entity extraction model. The entity extraction model includes a sequence labeling feature layer and a conditional random field decoding layer. The step of inputting the semantic vector into a fully connected classification layer to obtain the predicted classification result includes: The semantic vector is input into the fully connected classification layer to obtain the classification discriminant value vector corresponding to each category in the engineering cost hierarchical topology; The classification discriminant value vectors are normalized to obtain the probability distribution values of each classification category; The classification category corresponding to the maximum value in the probability distribution is determined as the target fourth-level classification category in the fourth-level classification hierarchy of the engineering cost hierarchy topology. Based on the index position corresponding to the target fourth-level classification category, a bottom-up path backtracking operation is performed on the engineering cost hierarchical topology to determine the target third-level classification category containing the target fourth-level classification category, the target second-level classification category containing the target third-level classification category, and the target first-level classification category containing the target second-level classification category in the engineering cost hierarchical topology. The step of inputting each category subset into the entity extraction model for entity annotation processing to obtain structured entity data includes: Each of the aforementioned category subsets is input into the sequence labeling feature layer to generate an emission score matrix corresponding to each word; The emission score matrix is input into the conditional random field decoding layer, and the global label path is calculated based on the trained state transition matrix. The global label path is parsed into a character position label sequence, and the start and end boundaries of the entity are identified based on the position indicator labels in the character position label sequence. The continuous tokens within the start and end boundaries of the entity are concatenated into entity text fragments, and the entity text fragments are encapsulated into key-value pairs according to the corresponding entity types to obtain the predicted entity sequences corresponding to each category subset.
6. A semantic analysis-based engineering contract data settlement device, characterized in that, include: The preprocessing module is used to perform text parsing, cleaning, and word segmentation on the engineering contract documents to be processed, so as to obtain the corresponding text sequence to be processed. The classification module is used to input the text sequence to be processed into the trained hierarchical classification model, and determine the multi-level target classification label of the engineering contract document to be processed in the preset engineering cost hierarchical topology based on the output result. The hierarchical classification model includes a bidirectional semantic coding layer and a fully connected classification layer. An extraction module is used to obtain a trained entity extraction model corresponding to the multi-level target classification label, input the text sequence to be processed into the entity extraction model for entity annotation processing, and obtain structured entity data. The entity extraction model includes a sequence labeling feature layer and a conditional random field decoding layer. The settlement module is used to perform multi-dimensional aggregation calculations on the structured entity data based on the multi-level target classification labels, and map the calculation results to the classification summary entries corresponding to the multi-level target classification labels in the preset template file to generate a target settlement report; Specifically, the classification module is used to: input the text sequence to be processed into the bidirectional semantic coding layer to obtain a semantic vector, and input the semantic vector into the fully connected classification layer to obtain a classification discriminant value vector corresponding to each category in the engineering cost hierarchical topology; Normalize the classification discriminant value vectors to obtain the probability distribution values of each classification category; determine the classification category corresponding to the maximum value in the probability distribution values as the target fourth-level classification category in the fourth-level classification hierarchy of the engineering cost hierarchy; based on the index position corresponding to the target fourth-level classification category, perform a bottom-up path backtracking operation on the engineering cost hierarchy topology to determine the target third-level classification category, the target second-level classification category, and the target first-level classification category in the third-level classification hierarchy of the engineering cost hierarchy topology; combine the target first-level classification category, the target second-level classification category, the target third-level classification category, and the target fourth-level classification category based on the top-down hierarchical order in the engineering cost hierarchy topology to obtain the multi-level target classification label; The extraction module is specifically used for: inputting the text sequence to be processed into the sequence labeling feature layer to generate an emission score matrix corresponding to each word; inputting the emission score matrix into the conditional random field decoding layer to calculate the global label path based on the trained state transition matrix; parsing the global label path into a character position label sequence, identifying the entity start and end boundaries of the entity according to the position indicator labels in the character position label sequence; concatenating consecutive words within the entity start and end boundaries into entity text fragments, and encapsulating the entity text fragments and their corresponding entity types into key-value pairs to obtain the structured entity data.
7. A training device for an engineering contract data settlement model based on semantic analysis, characterized in that, include: The sample module is used to perform text parsing, cleaning, and word segmentation on historical engineering contract documents to obtain the corresponding training sample set. The annotation module is used to construct a hierarchical topology of engineering cost, perform multi-level classification annotation on the training sample set according to the hierarchical topology of engineering cost, and obtain multi-level classification labels for each training sample; divide the training sample set into multiple category subsets according to the multi-level classification labels, and perform entity annotation on each category subset to obtain entity annotation data corresponding to each category. The first training module is used to input each category subset into a bidirectional semantic encoding layer to obtain a semantic vector, input the semantic vector into a fully connected classification layer to obtain a predicted classification result, and perform parameter update operations on the bidirectional semantic encoding layer and the fully connected classification layer based on the classification loss value between the predicted classification result and the multi-level classification label corresponding to each category subset, so as to obtain a trained hierarchical classification model. The second training module is used to construct entity extraction models corresponding to each category subset. Each category subset is input into the corresponding entity extraction model. The parameters of each entity extraction model are updated according to the sequence labeling loss value between the output predicted entity sequence and the corresponding entity labeling data to obtain the trained entity extraction model. The entity extraction model includes a sequence labeling feature layer and a conditional random field decoding layer. Specifically, the first training module is used to: input the semantic vector into the fully connected classification layer to obtain classification discriminant value vectors corresponding to each category in the engineering cost hierarchical topology; normalize each classification discriminant value vector to obtain the probability distribution value of each category; determine the category corresponding to the maximum value in the probability distribution value as the target fourth-level category in the fourth-level classification hierarchy of the engineering cost hierarchical topology; and perform a bottom-up path backtracking operation on the engineering cost hierarchical topology according to the index position corresponding to the target fourth-level category to determine the target third-level category, the target second-level category, and the target first-level category in the third-level classification hierarchy of the engineering cost hierarchical topology that contain the target fourth-level category. The second training module is specifically used for: inputting each of the category subsets into the sequence labeling feature layer to generate an emission score matrix corresponding to each word; inputting the emission score matrix into the conditional random field decoding layer to calculate the global label path based on the trained state transition matrix; parsing the global label path into a character position label sequence, and identifying the entity start and end boundaries of the entity according to the position indicator labels in the character position label sequence; concatenating consecutive words within the entity start and end boundaries into entity text fragments, and encapsulating the entity text fragments and their corresponding entity types into key-value pairs to obtain the predicted entity sequences corresponding to each of the category subsets.