Intelligent order identification method and system based on semantic similarity analysis
By using a multi-layer semantic processing framework based on DeBERTa and an improved BigBird model, the problem of establishing logical dependencies in order text recognition was solved, achieving high-precision field label prediction and dynamic error correction, thus improving the recognition accuracy and robustness of order text.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHALLBRIGHT HEALTHTECH CO LTD
- Filing Date
- 2026-03-31
- Publication Date
- 2026-05-01
AI Technical Summary
Existing order text recognition methods struggle to accurately establish logical dependencies between fields when dealing with diverse and structurally complex order texts. They also lack deep semantic modeling capabilities, resulting in insufficient accuracy and reliability of recognition results, and a lack of effective automated error correction mechanisms.
A multi-layer semantic processing framework, built using the DeBERTa model and an improved BigBird model, achieves accurate prediction of field labels and correction of recognition results through context-dependent embedding representation, multi-layer semantic fusion and structure-aware modeling, combined with semantic consistency verification and dynamic error correction mechanisms.
It significantly improves the accuracy of order field recognition and the consistency of structured output, can handle semantic conflicts in complex structured text, and improves the robustness and recognition accuracy of the model.
Smart Images

Figure CN121960434A_ABST
Abstract
Description
A method and system for intelligent order recognition based on semantic similarity analysis Technical Field
[0001] This invention relates to the field of natural language processing technology, and in particular to an intelligent order recognition method and system based on semantic similarity analysis. Background Technology
[0002] With the continuous improvement of enterprises' digital management level, the demand for automated identification and structured processing of order data is increasing. Semantic understanding-based intelligent order identification technology is gradually becoming an important research direction in the field of information extraction. Existing order text recognition methods mainly rely on fixed template rules or traditional sequence labeling models to identify text fields. However, in practical applications, the following problems are common: order text content comes from diverse sources, has complex layout structures, and often contains redundant information and non-standardized descriptions. This leads to unstable performance in field location and classification accuracy of traditional methods based on templates or shallow semantic matching, making it difficult to adapt to order samples with varying formats. Most existing models ignore structured features such as region labels, paragraph numbers, and line number indices in order text, lacking the ability to deeply model the text structure and accurately establish logical dependencies between fields, affecting the consistency of global semantic modeling. In scenarios where field values have semantic conflicts or logical errors, existing methods lack effective automated error correction mechanisms and cannot dynamically correct the recognition results, resulting in insufficient accuracy and reliability of the structured output.
[0003] Therefore, how to provide an intelligent order recognition method and system based on semantic similarity analysis is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0004] One objective of this invention is to propose an intelligent order recognition method and system based on semantic similarity analysis. This invention combines the DeBERTa model and the improved BigBird model to construct a multi-layer semantic processing framework. Through context-related embedding representation, multi-layer semantic fusion and structure-aware modeling, it comprehensively extracts semantic and structural information from order text, achieves accurate prediction of field labels, and integrates semantic consistency verification and dynamic error correction mechanisms to improve recognition robustness. Finally, it outputs structured order field recognition results.
[0005] According to an embodiment of the present invention, an intelligent order recognition method based on semantic similarity analysis includes the following steps: Step 1: Acquire order text data, and use a DeBERTa model to perform context-related embedding representation on the order text data to generate an initial semantic representation vector sequence; Step 2: Perform multi-layer semantic fusion processing on the initial semantic representation vector sequence, including a lexical layer, a syntactic layer, and a context layer, and output a fused semantic representation vector sequence; Step 3: Input the fused semantic representation vector sequence into an improved BigBird model, wherein the improved BigBird model includes a local window connection module, a global anchor connection module, a structural information enhancement module, and a field label interaction representation module, to generate a structure-aware semantic representation vector sequence; Step 4: Input the structure-aware semantic representation vector sequence into a field recognition and classification module, and perform field label prediction on the structure-aware semantic representation vector corresponding to each structured text fragment to generate a preliminary field recognition result; Step 5: Perform semantic consistency verification on the preliminary field recognition result, perform dynamic error correction operation on the field recognition result with semantic conflicts, and output a corrected field recognition result; Step 6: Based on the corrected field recognition result, output a structured order field recognition result.
[0006] Optionally, the order text data specifically includes a header area, a body area, and a remarks area.
[0007] Optionally, the step of using the DeBERTa model to perform context-sensitive embedding representation on the order text data and generate an initial semantic representation vector specifically involves: performing a region partitioning operation on the order text data; marking each line of text in the header region, body region, and remarks region with paragraph numbers and line indices in the original order to generate a structured text fragment sequence; performing sub-word segmentation on each structured text fragment using a sub-word encoding algorithm based on statistical word frequency and byte pair merging rules; traversing the character pairs appearing in the text and selecting merging operations from high to low frequency until the number of merging rounds reaches a preset number, dividing the structured text fragment into several sub-word units; converting each sub-word unit into a Unicode encoding sequence of the constituent characters, and inputting it as an initial input vector into the DeBERTa model embedding structure; sequentially passing through multiple layers of linear transformation and ReLU activation function to generate a vocabulary vector; using the DeBERTa model to model the positional information of each sub-word unit, calculating the relative positional difference between each sub-word unit and other sub-word units, and processing each relative positional difference sequentially through a linear transformation layer and ReLU activation function to obtain the vocabulary vector dimension. The DeBERTa model generates a relative position vector with consistent degree. In the Transformer encoding layer, for each word unit, a query vector, key vector, and value vector are calculated using the vocabulary vector. The query vector is multiplied by the transpose of the key vector and divided by a set scaling factor to obtain the content attention weight matrix. The query vector is multiplied by the transpose of the relative position vector and divided by a set scaling factor to obtain the position attention weight matrix. The content attention weight matrix and the position attention weight matrix are Softmax normalized and added according to a set weighting ratio to form the final attention matrix. The final attention matrix is weighted and summed with the value vector to generate a context-related representation vector. The context-related representation vectors of all word units in each structured text segment are fused by mean along the dimension to generate an initial semantic representation vector. The initial semantic representation vector is then associated with the region label, paragraph number, and line number index of the original structured text segment. The initial semantic representation vectors of all structured text segments are arranged in ascending order according to the region label priority, paragraph number, and line number index to form an initial semantic representation vector sequence.
[0008] Optionally, step two specifically involves: inputting the initial semantic representation vector sequence into the lexical layer processing unit; sliding a window of a set length along the initial semantic representation vector sequence in row number order; performing a mean operation on the initial semantic representation vector along the dimensional direction within each sliding window to obtain the lexical layer output vector; generating a lexical layer output vector sequence based on all lexical layer output vectors of the corresponding structured text segment; inputting the lexical layer output vector sequence into the syntactic layer processing unit; performing part-of-speech tagging on each structured text segment to identify words with noun and verb parts of speech in the structured text segment; extracting the lexical layer output vectors corresponding to nouns and verbs for each structured text segment; concatenating the extracted lexical layer output vectors along the dimensional direction to obtain the syntactic layer output vector; and generating a syntactic layer output vector sequence based on the corresponding structured text segment. All syntactic layer output vectors of the text fragment are used to generate a syntactic layer output vector sequence. This sequence is then input into the context layer processing unit. Based on the region label, paragraph number, and line number index of each structured text fragment, the syntactic layer output vectors corresponding to adjacent lines of the structured text fragment are selected. The mean operation in the dimensional direction is performed on the selected syntactic layer output vectors in line number order to obtain the context layer output vector. Based on all context layer output vectors of the corresponding structured text fragment, a context layer output vector sequence is generated. The vectors of the corresponding structured text fragments in the lexical layer output vector sequence, syntactic layer output vector sequence, and context layer output vector sequence are concatenated in the dimensional direction and then fused using linear transformation and the ReLU activation function to obtain a fused semantic representation vector sequence.
[0009] Optionally, step three specifically involves: inputting the fused semantic representation vector sequence into the local window connection module, setting the local window size k as a parameter, traversing the fused semantic representation vector sequence according to the line number order of the structured text fragment; selecting the current structured text fragment and the corresponding fused semantic representation vectors of the k lines before and after it in each window, performing mean operation in the dimension direction according to the line number order to obtain local association vectors, and constructing a local association vector sequence; inputting the local association vector sequence into the global anchor connection module, using the paragraph number as the grouping basis, selecting the local association vector of the structured text fragment in the first line of each paragraph as the anchor vector, calculating the dot product attention weight of the anchor vector and all local association vectors in the same paragraph to form a global attention connection matrix, and concatenating and fusing the local association vector sequence and the global attention connection matrix according to the line number correspondence, outputting the anchor enhancement vector sequence. The anchor point enhancement vector sequence is input into the structure information enhancement module to extract four structural features for each structured text segment: region label, paragraph number, line number index, and text length, to construct a structure information vector. The structure information vector is then concatenated with the corresponding anchor point enhancement vector along its dimension, and processed sequentially through linear transformation and ReLU activation function to output a structure enhancement vector sequence. This sequence is then input into the field label interaction representation module to obtain a set of field labels, including order number, customer name, order date, product name, quantity, unit price, total amount, shipping date, and remarks, covering the core structured fields in the order text. Based on a multi-head attention mechanism, attention interaction modeling is performed between each structure enhancement vector and the embedding vectors of each field label to generate a structure-aware semantic representation vector, outputting a structure-aware semantic representation vector sequence.
[0010] Optionally, the field recognition and classification module is based on a multilayer perceptron structure. It receives a structure-aware semantic representation vector as input and passes it sequentially through a first linear transformation layer, a ReLU activation function layer, and a second linear transformation layer to obtain an intermediate vector representation. A Softmax normalization operation is performed on the intermediate vector representation to calculate the normalized probability distribution of the structure-aware semantic representation vector on each field label. The field label with the highest probability is determined as the predicted field label for the current structured text segment and bound to the original text content of the structured text segment. The predicted field labels of all structured text segments are merged with the corresponding order text in ascending order of region label priority, paragraph number, and line number index to generate preliminary field recognition results.
[0011] Optionally, the semantic consistency verification specifically involves: based on the field dependency rules of the order text, extracting field values related to amount calculation, date sequence, and uniqueness of the order number from the preliminary field recognition results, including quantity, unit price, total amount, order date, shipping date, and order number; performing a numerical multiplication operation on the quantity field and the unit price field to obtain the calculated amount; calculating the difference between the calculated amount and the total amount field value in the preliminary field recognition results to obtain the amount consistency difference; if the amount consistency difference is less than a set error threshold, the consistency of the amount field is determined to be valid; performing a time difference calculation on the order date field and the shipping date field to determine the time difference... If the time difference is greater than zero, a positive value indicates that the date sequence conforms to the order specifications, and the date sequence is deemed valid. A duplicate check is performed on the order number field, comparing each order number in the preliminary identification result. If no duplicate order numbers are found, the order number field is deemed consistent. The consistency results of the amount field, the date sequence, and the order number field are jointly evaluated. If all results are valid, the current field identification result is considered to have passed semantic consistency verification. If any result is invalid, the semantic consistency verification is deemed to have failed, indicating a semantic conflict, and dynamic error correction is performed.
[0012] Optionally, the dynamic error correction operation for the field recognition results with semantic conflicts is performed as follows: when the preliminary field recognition result fails the semantic consistency verification, the structure-aware semantic representation vector of the corresponding structured text fragment is extracted; the cosine similarity between the structure-aware semantic representation vector and the embedding vector of all field labels is calculated; field labels that have semantic conflicts with the current recognition result are removed from the field label set, and the field label with the highest cosine similarity is selected to replace the original recognition result, generating the updated field label as the corrected field recognition result.
[0013] Optionally, step six specifically involves: binding the field tags of each structured text fragment to the original order text content based on the corrected field recognition results, and summarizing and organizing them according to the priority of the region tags, the ascending order of the paragraph numbers, and the ascending order of the line number index; classifying and grouping them according to the field tags, and aggregating the structured text content belonging to the same field tags into a list of field values; constructing the field tags and the list of field values into key-value pairs, and outputting the structured order field recognition results.
[0014] An intelligent order recognition system based on semantic similarity analysis according to an embodiment of the present invention includes the following modules: a text acquisition module for acquiring order text data; a semantic representation generation module for performing context-related embedding representation on the order text data based on the DeBERTa model to generate an initial semantic representation vector sequence; a multi-layer semantic fusion module for performing multi-layer semantic fusion processing on the initial semantic representation vector sequence at the lexical, syntactic, and context layers to output a fused semantic representation vector sequence; and a structure-aware modeling module for inputting the fused semantic representation vector sequence into an improved BigBird model, and connecting it through a local window connection module and a global anchor point connection module. The system comprises a receiving module, a structure information enhancement module, and a field label interaction module to generate a sequence of structure-aware semantic representation vectors; a field recognition and classification module to receive the sequence of structure-aware semantic representation vectors, perform field label prediction based on a multilayer perceptron structure, and output preliminary field recognition results; a consistency verification and error correction module to perform semantic consistency verification on the preliminary field recognition results, perform dynamic error correction on field recognition results with semantic conflicts, and output corrected field recognition results; and a structured output module to summarize the corrected field recognition results in the order of region, paragraph, and line number and construct them into key-value pairs, outputting structured order field recognition results.
[0015] The beneficial effects of this invention are as follows: This invention, by introducing the DeBERTa model and an improved BigBird model to construct a multi-layer semantic processing framework, addresses the problems of complex order text data structure, non-standard expression, and frequent semantic conflicts between fields. It employs a context-dependent embedding representation and multi-layer semantic fusion strategy to perform deep feature extraction on structured text fragments at the lexical, syntactic, and contextual levels. Local and global associations between text fragments are established through a local window connection module and a global anchor connection module. In the structural information enhancement module, region labels, paragraph numbers, line number indices, and text length structural features are introduced to achieve comprehensive modeling of structure-aware semantic representation vectors. In the field label interaction representation module, the embedded vectors in the field label set are combined... By constructing the alignment relationship between field labels and text based on a multi-head attention mechanism, the semantic alignment accuracy of the field recognition and classification module in the field label prediction process is significantly improved. Addressing the semantic conflict issue in field recognition, semantic consistency verification and dynamic error correction are combined. Logical verification of the consistency of the amount field, the chronological order of dates, and the uniqueness of the order number are completed based on the field dependency rules of the order text. Conflicting field labels are removed, and a cosine similarity replacement mechanism is used to output the corrected field recognition results. Finally, field values are aggregated according to region, paragraph, and line number order and constructed into key-value pairs, outputting structured order field recognition results. This effectively improves the accuracy of field recognition under non-template-based order text, the consistency of structured output, and overall robustness. Attached Figure Description
[0016] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 is an overall flowchart of an order intelligent recognition method based on semantic similarity analysis proposed in this invention; Figure 2 is a schematic diagram of the structure of an order intelligent recognition system based on semantic similarity analysis proposed in this invention. Detailed Implementation
[0017] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0018] Referring to Figure 1, an intelligent order recognition method based on semantic similarity analysis includes the following steps: Step 1: Acquire order text data, and use the DeBERTa model to perform context-related embedding representation on the order text data to generate an initial semantic representation vector sequence; Step 2: Perform multi-layer semantic fusion processing on the initial semantic representation vector sequence, including a lexical layer, a syntactic layer, and a context layer, and output a fused semantic representation vector sequence; Step 3: Input the fused semantic representation vector sequence into an improved BigBird model, which includes a local window connection module, a global anchor connection module, a structural information enhancement module, and a field label interaction representation module to generate a structure-aware semantic representation vector sequence; Step 4: Input the structure-aware semantic representation vector sequence into a field recognition and classification module, and perform field label prediction on the structure-aware semantic representation vector corresponding to each structured text segment to generate preliminary field recognition results; Step 5: Perform semantic consistency verification on the preliminary field recognition results, perform dynamic error correction on field recognition results with semantic conflicts, and output corrected field recognition results; Step 6: Based on the corrected field recognition results, output structured order field recognition results.
[0019] In this embodiment, the order text data specifically includes a header area, a body area, and a remarks area.
[0020] In this embodiment, the step of using the DeBERTa model to perform context-sensitive embedding representation on the order text data and generate an initial semantic representation vector specifically involves: performing a region partitioning operation on the order text data; marking each line of text in the header region, body region, and remarks region with paragraph numbers and line indexes in their original order to generate a structured text fragment sequence; performing sub-word segmentation on each structured text fragment using a sub-word encoding algorithm based on statistical word frequency and byte pair merging rules; traversing the character pairs appearing in the text; selecting merging operations according to the frequency of occurrence from high to low until the number of merging rounds reaches a preset number; and dividing the structured text fragment into several sub-word units. Specifically, the initial... In the vocabulary expansion phase, all consecutive single character pairs are extracted from the input structured text fragment. The frequency of each character pair in the text is counted to generate a frequency table. The character pair with the highest frequency is selected from the frequency table, and a character pair merging operation is performed to replace the character pair with a new composite symbol, which is then added to the current vocabulary. After each character pair merging, all regions in the original text that match the character pair are updated, and the frequency of the character pair is counted again. The character pair merging and vocabulary expansion process is repeated until the number of merging rounds reaches a preset number, at which point the iteration ends. Based on the final vocabulary, the structured text fragment is forward scanned and matched, prioritizing long words as sub-word units, and then segmented sequentially. The entire text is a sequence of ordered sub-words. Each sub-word unit is converted into a Unicode encoding sequence of its constituent characters, which is used as the initial input vector into the DeBERTa model embedding structure. It then passes through multiple layers of linear transformations and ReLU activation functions to generate vocabulary vectors. The DeBERTa model is used to model the positional information of each sub-word unit, calculating the relative positional difference between each sub-word unit and other sub-word units. All differences are enumerated within a set offset range, and each relative positional difference is processed sequentially through linear transformation layers and ReLU activation functions to obtain a relative position vector with the same dimension as the vocabulary vector. In the DeBERTa model's Trans... In the former encoding layer, for each sub-word unit, a query vector, key vector, and value vector are calculated using the vocabulary vector. The query vector is multiplied by the transpose of the key vector and divided by a set scaling factor to obtain the content attention weight matrix. The query vector is multiplied by the transpose of the relative position vector and divided by a set scaling factor to obtain the position attention weight matrix, where the set scaling factor is the square root of the vocabulary vector dimension. The content attention weight matrix and the position attention weight matrix are Softmax normalized and added according to a set weighting ratio (1:1) to form the final attention matrix. The final attention matrix is then weighted and summed with the value vector to generate a context-dependent representation vector.The context-related representation vectors of all sub-word units in each structured text segment are fused by mean along the dimensional direction to generate an initial semantic representation vector. The initial semantic representation vector is then associated with the region labels, paragraph numbers, and line number indices of the original structured text segment. The initial semantic representation vectors of all structured text segments are arranged in ascending order according to the region label priority, paragraph number, and line number index to form an initial semantic representation vector sequence. The priority order of the region labels is as follows: header region, body region, and remarks region. The context-related embedding representation method based on the DeBERTa model described in this invention has the ability to perform fine-grained sub-word segmentation, dynamic relative position modeling, and decoupled attention weight construction. It is specifically optimized for scenarios with loose structure, diverse expressions, and interleaved fields in order text. Order text is segmented into header, body, and remarks sections using region partitioning, and structured organization is achieved by combining paragraph numbering and line number indexing. During sub-word segmentation, rules based on statistical word frequency and byte pair merging are employed to automatically identify high-frequency character pairs and perform iterative merging operations, ensuring the segmentation granularity adapts to the text content. The generated sub-word units are mapped to Unicode encoding and processed through multi-layer linear transformation and ReLU activation functions to obtain vocabulary vectors with semantic distribution characteristics. For positional dependencies in the sequence structure, the relative position difference between each pair of sub-word units is calculated and sequentially input into linear transformation and ReLU activation functions to obtain a relative position offset vector consistent with the vocabulary vector dimension. In the DeBERTa model, content attention weight matrices and position attention weight matrices are constructed separately, and context-related representation vectors are further generated to improve semantic understanding accuracy and provide a high-quality representation foundation for field recognition.
[0021] In this embodiment, step two specifically involves: inputting the initial semantic representation vector sequence into the lexical layer processing unit; sliding a window of a set length along the initial semantic representation vector sequence in row number order; performing a mean operation on the initial semantic representation vector along the dimensional direction within each sliding window to obtain a lexical layer output vector; and generating a lexical layer output vector sequence based on all lexical layer output vectors of the corresponding structured text segment; inputting the lexical layer output vector sequence into the syntactic layer processing unit; performing part-of-speech tagging on each structured text segment to identify words with noun and verb parts of speech in the structured text segment; extracting the lexical layer output vectors corresponding to nouns and verbs for each structured text segment; and concatenating the extracted lexical layer output vectors along the dimensional direction to obtain a syntactic layer output vector; and generating a lexical layer output vector sequence based on all lexical layer output vectors of the corresponding structured text segment. All syntactic layer output vectors of the text fragment are used to generate a syntactic layer output vector sequence. This sequence is then input into the context layer processing unit. Based on the region label, paragraph number, and line number index of each structured text fragment, the syntactic layer output vectors corresponding to adjacent lines of the structured text fragment are selected. The mean operation in the dimensional direction is performed on the selected syntactic layer output vectors in line number order to obtain the context layer output vector. Based on all context layer output vectors of the corresponding structured text fragment, a context layer output vector sequence is generated. The vectors of the corresponding structured text fragments in the lexical layer output vector sequence, syntactic layer output vector sequence, and context layer output vector sequence are concatenated in the dimensional direction and then fused using linear transformation and the ReLU activation function to obtain a fused semantic representation vector sequence.
[0022] In this embodiment, step three specifically involves: inputting the fused semantic representation vector sequence into the local window connection module, using the local window size k as a parameter, traversing the fused semantic representation vector sequence according to the line number order of the structured text fragment; selecting the current structured text fragment and the corresponding fused semantic representation vectors of the k lines before and after it in each window, performing mean operation in the dimension direction according to the line number order to obtain local association vectors, and constructing a local association vector sequence; inputting the local association vector sequence into the global anchor connection module, using the paragraph number as the grouping basis, selecting the local association vector of the structured text fragment in the first line of each paragraph as the anchor vector. The system calculates the attention weights of the dot product between the anchor vector and all local related vectors in the same paragraph to form a global attention connection matrix. The local related vector sequence is then concatenated with the global attention connection matrix according to row number correspondence, outputting an anchor-enhanced vector sequence. This anchor-enhanced vector sequence is input into a structure information enhancement module, which extracts four structural features from each structured text segment: region label, paragraph number, row number index, and text length, constructing a structure information vector. This structure information vector is then concatenated with the corresponding anchor-enhanced vector along its dimension and processed sequentially through linear transformation and ReLU activation function, outputting a structure-enhanced vector sequence. The resulting sequence is then... The structure-aware semantic representation (SMR) module is used to construct an input field label interaction representation module to obtain a set of field labels, including order number, customer name, order date, product name, quantity, unit price, total amount, shipping date, and remarks, covering the core structured fields in the order text. Based on a multi-head attention mechanism, attention interaction modeling is performed between each structure-aware vector and the embedding vectors of each field label to generate structure-aware semantic representation vectors, and outputting a sequence of structure-aware semantic representation vectors. Specifically, the structure-aware vectors are used as query vectors, and the field label embedding vectors are used as key and value vectors, respectively. Multiple sets of queries are generated through linear transformation. This invention constructs h attention heads using vectors, key vectors, and value vectors. Within each attention head, the query vector is multiplied by the key vectors of all field labels, and the result is divided by a set scaling factor to obtain an attention score. This score is then Softmax normalized and multiplied by the corresponding field label value vector to obtain the interaction representation of that attention head. The interaction representations of all attention heads are concatenated along their dimensional axes and transformed linearly to obtain a structure-aware semantic representation vector. This vector is then combined into a sequence of structure-aware semantic representation vectors and output. This invention structurally optimizes the traditional BigBird model, proposing a semantic modeling method for structured text scenarios. In terms of local modeling, a local window connection module is introduced. Based on the line number order of the structured text fragments, the sequence of fused semantic representation vectors is slid-processed according to a set window size. The mean fusion representation within the local context is calculated, forming a local association vector sequence with continuous semantic smoothness, effectively enhancing the model's ability to model semantic relationships between adjacent fields.
[0023] To address global relationships within paragraphs, a global anchor connection module is introduced. The structured text is divided into multiple semantic blocks by paragraph numbering. The first line of structured fragments in each paragraph is extracted as anchors. Attention connections are built between the anchors and other fragments in the same paragraph. Combined with the global attention connection matrix, the efficient propagation of contextual information within paragraphs is achieved, which helps the model accurately identify long-distance dependencies between fields.
[0024] To further enhance the model's understanding of structural information in order text, a structural information enhancement module is proposed. By extracting structural features such as region labels, paragraph numbers, line number indices, and text length, a structural information vector is generated and fused with the anchor point enhancement vector. This enhances the model's sensitivity to format and position features and improves its representation ability in complex structural text.
[0025] In the semantic alignment modeling stage, a field label interaction representation module is introduced to construct a set of labels covering common core fields in orders. Through a multi-head attention mechanism, the structure enhancement vector and the field label embedding representation are interactively modeled, enabling the model to have field-level semantic alignment capabilities. This results in the output of a structure-aware semantic representation vector sequence, improving the accuracy and contextual consistency of field recognition. The improved BigBird model not only retains the original long text modeling capabilities but also achieves a deep integration between the order text structure and field semantics, significantly improving the accuracy and robustness of field recognition in actual order parsing tasks.
[0026] In this embodiment, the field recognition and classification module is based on a multilayer perceptron structure. It receives a structure-aware semantic representation vector as input and passes it sequentially through a first linear transformation layer, a ReLU activation function layer, and a second linear transformation layer to obtain an intermediate vector representation with the same dimension as the field label set. A Softmax normalization operation is performed on the intermediate vector representation to calculate the normalized probability distribution of the structure-aware semantic representation vector on each field label. The field label with the highest probability is determined as the predicted field label for the current structured text segment and bound to the original text content of the structured text segment. The predicted field labels of all structured text segments are merged with the corresponding order text in ascending order of region label priority, paragraph number, and line number index to generate preliminary field recognition results.
[0027] In this embodiment, the semantic consistency verification specifically involves: extracting field values related to amount calculation, date sequence, and uniqueness of the order number from the preliminary field recognition results based on the field dependency rules of the order text, including quantity, unit price, total amount, order date, shipping date, and order number; performing a numerical multiplication operation on the quantity field and the unit price field to obtain the calculated amount; calculating the difference between the calculated amount and the total amount field value in the preliminary field recognition results to obtain the amount consistency difference; if the amount consistency difference is less than a set error threshold, the amount field consistency is determined to be valid; performing a time difference calculation on the order date field and the shipping date field to determine the time difference... The system checks whether the value is greater than zero. If the time difference is positive, it indicates that the date sequence conforms to the order specifications, and the date sequence is deemed valid. A duplicate check is performed on the order number field, comparing each order number in the preliminary identification result. If no duplicate order numbers are found, the order number field is deemed consistent. The consistency results of the amount field, the date sequence, and the order number field are jointly evaluated. If all results are valid, the current field identification result is considered to have passed semantic consistency verification. If any result is invalid, the semantic consistency verification is deemed to have failed, indicating a semantic conflict, and dynamic error correction is performed.
[0028] In this embodiment, the dynamic error correction operation for the field identification results with semantic conflicts specifically involves: when the preliminary field identification result fails the semantic consistency verification, extracting the structure-aware semantic representation vector of the corresponding structured text fragment; calculating the cosine similarity between the structure-aware semantic representation vector and the embedding vectors of all field labels; removing field labels that have semantic conflicts with the current identification result from the field label set, selecting the field label with the highest cosine similarity to replace the original identification result, and generating updated field labels as the corrected field identification result; this invention introduces a dynamic error correction mechanism to intelligently correct semantic conflicts in the preliminary field identification result, thereby improving the overall recognition accuracy and robustness; based on the semantic consistency verification result, identifying the structured text fragments with field conflicts and extracting their structure-aware semantic representation vectors as the basis for semantic error correction; using the vector representation of the field labels in the embedding space, calculating the cosine similarity between the structure-aware semantic vector and each field label to quantify their semantic relevance. Based on this, according to domain logic rules, the set of field tags is filtered to remove tags that have semantic inconsistencies with the currently identified conflicting fields, such as the calculation constraints between unit price, quantity, and total amount, or the temporal relationship between order date and delivery date, as well as the problem of duplicate order numbers. From the remaining candidate tags, the field tag that is closest to the current semantics is selected to replace the original conflicting tag, realizing accurate error correction and field tag correction, taking into account semantic matching and business rules, avoiding the propagation of errors caused by misjudgment, and significantly improving the field recognition accuracy and system practicality of structured text.
[0029] In this embodiment, step six specifically involves: binding the field tags of each structured text fragment to the original order text content based on the corrected field recognition results, and summarizing and organizing them according to the priority of the region tags, the ascending order of the paragraph numbers, and the ascending order of the line number index; classifying and grouping them according to the field tags, and aggregating the structured text content belonging to the same field tags into a list of field values; constructing the field tags and the list of field values into key-value pairs, and outputting the structured order field recognition results.
[0030] Referring to Figure 2, an intelligent order recognition system based on semantic similarity analysis includes the following modules: a text acquisition module for acquiring order text data; a semantic representation generation module for performing context-related embedding representation on the order text data based on the DeBERTa model to generate an initial semantic representation vector sequence; a multi-layer semantic fusion module for performing multi-layer semantic fusion processing on the initial semantic representation vector sequence at the lexical, syntactic, and context layers to output a fused semantic representation vector sequence; and a structure-aware modeling module for inputting the fused semantic representation vector sequence into an improved BigBird model, and then connecting it through a local window connection module and a global anchor connection module. The block and structure information enhancement module and the field label interaction representation module generate a sequence of structure-aware semantic representation vectors; the field recognition and classification module receives the sequence of structure-aware semantic representation vectors, performs field label prediction based on a multilayer perceptron structure, and outputs preliminary field recognition results; the consistency verification and error correction module performs semantic consistency verification on the preliminary field recognition results, performs dynamic error correction on field recognition results with semantic conflicts, and outputs corrected field recognition results; the structured output module summarizes the corrected field recognition results according to region, paragraph, and line number order and constructs them into key-value pairs, outputting structured order field recognition results. Example 1:
[0031] To verify the feasibility of this invention in practice, it was applied to an enterprise's order processing system, and a structured intelligent recognition experiment was conducted on the enterprise's historically accumulated electronic order text data. This enterprise has long faced problems such as diverse order formats, non-standard field expressions, and low accuracy of automatically extracted fields, which seriously affects the efficiency and accuracy of the automatic data entry into the order system.
[0032] In this embodiment, the text acquisition module is used to obtain order text data containing headers, body text, and remarks areas from the enterprise's order management system. The formats cover various text types such as PDF scanned OCR results, Excel exported text, and ERP system logs. The semantic representation generation module performs context-related embedding representation on the order text data based on the DeBERTa model, generates an initial semantic representation vector sequence, and retains structured information such as area labels, paragraph numbers, and line number indexes.
[0033] The multi-layer semantic fusion module processes the initial semantic representation vector sequence at the lexical, syntactic, and contextual levels to fully capture contextual and syntactic dependencies. Then, by improving the BigBird model's local window connection module, global anchor connection module, structural information enhancement module, and field label interaction representation module, it extracts the structure-aware semantic representation vector sequence. In the field recognition and classification module, a multi-layer perceptron structure is used for field label prediction, outputting preliminary field recognition results.
[0034] The preliminary results are input into the consistency verification and error correction module to perform semantic consistency verification, such as whether the amount field satisfies the rule that quantity multiplied by unit price equals total amount, whether the time field satisfies the logic that order date is earlier than shipping date, and whether order number is duplicated. If semantic conflicts are found, dynamic error correction is triggered, and the fields are re-identified based on the semantic similarity of the field label embedding vectors. Finally, the structured output module generates the corrected structured order field recognition results.
[0035] To verify the effectiveness of the method, we conducted a statistical analysis of the system's performance in real business scenarios, and the results are as follows.
[0036] Table 1. Order Field Recognition Accuracy Evaluation Table As can be seen from the data in Table 1 above, the overall performance of this invention in the intelligent recognition task of order fields is significantly better than that of the original system. Accuracy improvements were achieved to varying degrees for all core fields, especially for fields such as total amount, unit price, quantity, shipping date, and order date, which rely on semantic logical consistency and numerical correlation. For example, the accuracy of the total amount field increased from 84.1% to 93.5%, an improvement of 9.4%; the unit price field increased from 85.4% to 94.2%, an improvement of 8.8%; and the quantity field increased from 87.3% to 95.6%, an improvement of 8.3%. These results demonstrate that the semantic consistency verification and dynamic error correction mechanism introduced in this invention can effectively handle the logical relationships and numerical coupling between complex fields, improving the robustness of the model to scenarios containing numerical logical conflicts. In comparison, the accuracy improvement for fields such as order number, customer name, product name, and remarks, which rely on contextual semantics but do not involve numerical calculations, was relatively moderate, but still maintained an improvement of over 4%, reflecting the universal effect of structure-aware semantic modeling in improving overall recognition accuracy.
[0037] This embodiment fully demonstrates that the present invention can achieve high-precision field extraction in the processing of complex and non-standard order texts, possesses strong semantic understanding and error correction capabilities, significantly improves the accuracy of automatic order identification and system processing efficiency, and provides stable and reliable intelligent support for enterprises in automating large-scale order processing. At the same time, the present invention exhibits good adaptability in handling common problems such as formatting errors, missing fields, and semantic conflicts. Relying on structure-aware semantic modeling and semantic consistency verification mechanisms, it can effectively reduce the frequency of manual intervention and reduce business losses caused by incorrect identification.
[0038] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A method for intelligent order recognition based on semantic similarity analysis, characterized in that, The process includes the following steps: Step 1: Obtain order text data and use the DeBERTa model to perform context-related embedding representation on the order text data to generate an initial semantic representation vector sequence; Step 2: Perform multi-layer semantic fusion processing on the initial semantic representation vector sequence, including a lexical layer, a syntactic layer, and a context layer, and output a fused semantic representation vector sequence; Step 3: Input the fused semantic representation vector sequence into an improved BigBird model, which includes a local window connection module, a global anchor connection module, a structural information enhancement module, and a field label interaction representation module, to generate a structure-aware semantic representation vector sequence; Step 4: Input the structure-aware semantic representation vector sequence into a field recognition and classification module, and perform field label prediction on the structure-aware semantic representation vector corresponding to each structured text fragment to generate preliminary field recognition results; Step 5: Perform semantic consistency verification on the preliminary field recognition results, perform dynamic error correction on field recognition results with semantic conflicts, and output corrected field recognition results; Step 6: Based on the corrected field recognition results, output structured order field recognition results.
2. The intelligent order recognition method based on semantic similarity analysis according to claim 1, characterized in that, The order text data specifically includes a header area, a body area, and a remarks area.
3. The intelligent order recognition method based on semantic similarity analysis according to claim 1, characterized in that, The DeBERTa model is used to perform context-sensitive embedding representation on the order text data to generate an initial semantic representation vector. Specifically, the order text data is divided into regions. Each line of text in the header region, body region, and remarks region is labeled with paragraph number and line number index in the original order to generate a structured text fragment sequence. For each structured text fragment, a sub-word encoding algorithm based on statistical word frequency and byte pair merging rules is used to segment the sub-words. The character pairs appearing in the text are traversed, and the merging operation is selected from high to low frequency until the number of merging rounds reaches a preset number, dividing the structured text fragment into several sub-word units. Each sub-word unit is converted into a Unicode encoding sequence of the constituent characters and used as the initial input vector into the DeBERTa model embedding structure. It is then passed through multiple linear transformations and the ReLU activation function to generate a vocabulary vector. The DeBERTa model is used to model the positional information of each word unit. The relative positional difference between each word unit and other word units is calculated, and each relative positional difference is processed sequentially through a linear transformation layer and a ReLU activation function to obtain a relative positional vector with the same dimension as the vocabulary vector. In the Transformer encoding layer of the DeBERTa model, a query vector, key vector, and value vector are calculated for each word unit using the vocabulary vector. The query vector is multiplied by the transpose of the key vector and divided by a set scaling factor to obtain the content attention weight matrix. The query vector is multiplied by the transpose of the relative positional vector and divided by a set scaling factor to obtain the positional attention weight matrix. The content attention weight matrix and the positional attention weight matrix are Softmax normalized and added according to a set weighting ratio to form the final attention matrix. The final attention matrix and the value vector are weighted and summed to generate a context-dependent representation vector. The context-related representation vectors of all sub-word units in each structured text segment are fused by mean along the dimensional direction to generate an initial semantic representation vector. The initial semantic representation vector is then associated with the region label, paragraph number, and line number index of the original structured text segment. The initial semantic representation vectors of all structured text segments are arranged in ascending order according to the region label priority, the paragraph number, and the line number index to form an initial semantic representation vector sequence.
4. The intelligent order recognition method based on semantic similarity analysis according to claim 1, characterized in that, Step two specifically involves: inputting the initial semantic representation vector sequence into the lexical layer processing unit; sliding a window of a set length along the initial semantic representation vector sequence in row number order; performing a mean operation on the initial semantic representation vector along the dimensional direction within each sliding window to obtain the lexical layer output vector; generating a lexical layer output vector sequence based on all lexical layer output vectors of the corresponding structured text segment; inputting the lexical layer output vector sequence into the syntactic layer processing unit; performing part-of-speech tagging on each structured text segment to identify words with noun and verb parts of speech in the structured text segment; extracting the lexical layer output vectors corresponding to nouns and verbs for each structured text segment; concatenating the extracted lexical layer output vectors along the dimensional direction to obtain the syntactic layer output vector; and generating a syntactic layer output vector based on the corresponding structured text segment. All syntactic layer output vectors are used to generate a syntactic layer output vector sequence. This sequence is then input into the context layer processing unit. Based on the region label, paragraph number, and line number index of each structured text segment, the syntactic layer output vectors corresponding to adjacent lines of the structured text segment are selected. The mean operation in the dimensional direction is performed on the selected syntactic layer output vectors in line number order to obtain the context layer output vector. Based on all context layer output vectors of the corresponding structured text segment, a context layer output vector sequence is generated. The vectors of the corresponding structured text segments in the lexical layer output vector sequence, syntactic layer output vector sequence, and context layer output vector sequence are concatenated in the dimensional direction and then fused using linear transformation and the ReLU activation function to obtain a fused semantic representation vector sequence.
5. The intelligent order recognition method based on semantic similarity analysis according to claim 1, characterized in that, Step three specifically involves: inputting the fused semantic representation vector sequence into the local window connection module, setting the local window size k as a parameter, and traversing the fused semantic representation vector sequence according to the line number order of the structured text fragments; selecting the current structured text fragment and the corresponding fused semantic representation vectors of the k lines before and after it in each window, performing mean operation in the dimension direction according to the line number order to obtain local association vectors, and constructing a local association vector sequence; inputting the local association vector sequence into the global anchor connection module, using the paragraph number as the grouping basis, selecting the local association vector of the first line of the structured text fragment in each paragraph as the anchor vector, calculating the dot product attention weight of the anchor vector and all local association vectors in the same paragraph to form a global attention connection matrix, and then sequencing the local association vectors. The column and global attention connection matrices are concatenated and fused according to row number correspondence to output an anchor point enhancement vector sequence. This anchor point enhancement vector sequence is then input into the structure information enhancement module to extract four structural features from each structured text segment: region label, paragraph number, row number index, and text length, constructing a structure information vector. This structure information vector is then concatenated with the corresponding anchor point enhancement vector along its dimension and processed sequentially through linear transformation and ReLU activation function to output a structure enhancement vector sequence. Finally, this structure enhancement vector sequence is input into the field label interaction representation module to obtain a set of field labels. This set includes order number, customer name, order date, product name, quantity, unit price, total amount, shipping date, and remarks, covering the core structured fields in the order text. Based on the multi-head attention mechanism, attention interaction modeling is performed between each structure enhancement vector and the embedding vector of each field label to generate structure-aware semantic representation vectors and output a sequence of structure-aware semantic representation vectors.
6. The intelligent order recognition method based on semantic similarity analysis according to claim 1, characterized in that, The field recognition and classification module is based on a multilayer perceptron structure. It receives the structure-aware semantic representation vector as input and passes it through a first linear transformation layer, a ReLU activation function layer, and a second linear transformation layer to obtain an intermediate vector representation. The module then performs a Softmax normalization operation on the intermediate vector representation and calculates the normalized probability distribution of the structure-aware semantic representation vector on each field label. The field label with the highest probability is determined as the predicted field label of the current structured text fragment, and bound to the original text content of the structured text fragment; the predicted field labels of all structured text fragments and the corresponding order text are merged in order of region label priority, paragraph number increment and line number index ascending to generate preliminary field recognition results.
7. The intelligent order recognition method based on semantic similarity analysis according to claim 1, characterized in that, The semantic consistency verification specifically involves: based on the field dependency rules of the order text, extracting field values related to amount calculation, date sequence, and uniqueness of the number from the preliminary field recognition results, including quantity, unit price, total amount, order date, shipping date, and order number; Perform a numerical multiplication operation on the quantity field and the unit price field to obtain the calculated amount. Calculate the difference between the calculated amount and the total amount field value in the preliminary field recognition result to obtain the amount consistency difference. If the amount consistency difference is less than a set error threshold, the amount field consistency is determined to be valid. Perform time difference calculation on the order date field and the shipping date field, and determine whether the time difference is greater than zero. If the time difference is positive, it means that the date sequence conforms to the order specifications, and the date sequence is determined to be valid. A duplicate check is performed on the order number field. The list of order numbers in the preliminary identification results is compared one by one. If no duplicate order numbers are found, the consistency of the order number field is considered valid. The consistency results of the amount field, the date sequence, and the order number field are jointly evaluated. If all the evaluation results are valid, the current field identification result is considered to have passed the semantic consistency verification. If any evaluation result is invalid, the semantic consistency verification is considered to have failed, indicating a semantic conflict, and dynamic error correction is performed.
8. The intelligent order recognition method based on semantic similarity analysis according to claim 1, characterized in that, The dynamic error correction operation for the field recognition results with semantic conflicts is as follows: when the preliminary field recognition result fails the semantic consistency verification, the structure-aware semantic representation vector of the corresponding structured text fragment is extracted; the cosine similarity between the structure-aware semantic representation vector and the embedding vector of all field labels is calculated; field labels that have semantic conflicts with the current recognition result are removed from the field label set, and the field label with the highest cosine similarity is selected to replace the original recognition result, generating the updated field label as the corrected field recognition result.
9. The intelligent order recognition method based on semantic similarity analysis according to claim 1, characterized in that, Step six specifically involves: based on the corrected field recognition results, binding the field tags of each structured text fragment with the original order text content, and summarizing and organizing them according to the priority of the region tag, the ascending order of the paragraph number, and the ascending order of the line number index; classifying and grouping them according to the field tags, and aggregating the structured text content belonging to the same field tag into a list of field values; Construct a list of field labels and field values into key-value pairs, and output the structured order field recognition results.
10. An intelligent order recognition system based on semantic similarity analysis, comprising executing the intelligent order recognition method based on semantic similarity analysis as described in any one of claims 1 to 9, characterized in that, The system includes the following modules: a text acquisition module for acquiring order text data; a semantic representation generation module for performing context-dependent embedding representation on the order text data based on the DeBERTa model to generate an initial semantic representation vector sequence; a multi-layer semantic fusion module for performing multi-layer semantic fusion processing on the initial semantic representation vector sequence at the lexical, syntactic, and contextual levels to output a fused semantic representation vector sequence; a structure-aware modeling module for inputting the fused semantic representation vector sequence into an improved BigBird model, generating a structure-aware semantic representation vector sequence through a local window connection module, a global anchor connection module, a structural information enhancement module, and a field label interaction representation module; a field recognition and classification module for receiving the structure-aware semantic representation vector sequence, performing field label prediction based on a multi-layer perceptron structure, and outputting preliminary field recognition results; and a consistency verification and error correction module for performing semantic consistency verification on the preliminary field recognition results, performing dynamic error correction operations on field recognition results with semantic conflicts, and outputting corrected field recognition results. The structured output module is used to summarize the corrected field recognition results by region, paragraph and line number and build them into key-value pairs, outputting the structured order field recognition results.
Citation Information
Patent Citations
Colorectal tumor pathological text named entity recognition method and system
CN117114000A
Electronic medical record named entity identification method and system based on deep learning
CN118095285A
Open source news data-oriented small sample chapter-level event extraction method and system
CN121144490A
Heterogeneous document structured data extraction system and method based on multi-modal fusion
CN121658894A
Text information extraction
WO2024189326A1