An order intelligent identification method and system based on semantic similarity analysis

By using a multi-layer semantic fusion framework based on DeBERTa and an improved BigBird model, the problem of establishing logical dependencies in order text recognition is solved, achieving highly accurate and robust intelligent order recognition.

CN121960434BActive Publication Date: 2026-06-09SHALLBRIGHT HEALTHTECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHALLBRIGHT HEALTHTECH CO LTD
Filing Date
2026-03-31
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing order text recognition methods struggle to accurately establish logical dependencies between fields when processing diverse order texts, lack deep semantic modeling capabilities, resulting in insufficient accuracy and reliability of recognition results, and lack of effective automated error correction mechanisms.

Method used

The DeBERTa model is used for context-dependent embedding representation. Combined with the improved BigBird model's multi-layer semantic fusion framework, field label prediction is performed through local window connection, global anchor connection, and structural information enhancement modules. Semantic consistency verification and dynamic error correction mechanisms are also introduced.

Benefits of technology

It significantly improves the accuracy of order field recognition and the consistency of structured output, enhances the model's robustness to complex order text, and can handle scenarios with loose structure, diverse expressions, and intersecting fields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121960434B_ABST
    Figure CN121960434B_ABST
Patent Text Reader

Abstract

This invention discloses an intelligent order recognition method and system based on semantic similarity analysis, comprising the following steps: Step 1: Acquire order text data and perform context-sensitive embedding representation using the DeBERTa model; Step 2: Perform multi-layer semantic fusion processing to output a fused semantic representation vector sequence; Step 3: Input the fused semantic representation vector sequence into an improved BigBird model to generate a structure-aware semantic representation vector sequence; Step 4: Generate preliminary field recognition results based on a field recognition and classification module; Step 5: Perform semantic consistency verification and dynamic error correction on the preliminary field recognition results, and output the corrected field recognition results; Step 6: Output structured order field recognition results. This invention combines the DeBERTa model and the improved BigBird model to construct a multi-layer semantic processing framework, achieving intelligent recognition of order fields.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural language processing technology, and 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 recognition 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 fields in the text, but in practical applications, they generally suffer from the following problems:

[0003] Order texts come from diverse sources and have complex layouts, often containing redundant information and non-standardized descriptions. This leads to inconsistent performance in field localization and classification accuracy for traditional template-based or shallow semantic matching methods, making them ill-suited for order samples with varying formats. Existing models largely ignore structured features such as region labels, paragraph numbers, and line number indices in order texts, lacking the ability to deeply model the text structure and accurately establish logical dependencies between fields, thus affecting the consistency of global semantic modeling. In scenarios where field values ​​contain 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 structured outputs.

[0004] 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

[0005] 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.

[0006] An intelligent order recognition method based on semantic similarity analysis according to an embodiment of the present invention includes the following steps:

[0007] Step 1: Obtain order text data, and use the DeBERTa model to perform context-sensitive embedding representation on the order text data to generate an initial semantic representation vector sequence;

[0008] Step 2: Perform multi-layer semantic fusion processing on the initial semantic representation vector sequence, including the lexical layer, syntactic layer and context layer, and output the fused semantic representation vector sequence;

[0009] Step 3: Input the fused semantic representation vector sequence into the 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.

[0010] Step 4: Input the structure-aware semantic representation vector sequence into the field recognition and classification module, perform field label prediction on the structure-aware semantic representation vector corresponding to each structured text segment, and generate preliminary field recognition results;

[0011] Step 5: Perform semantic consistency verification on the preliminary field recognition results, perform dynamic error correction on the field recognition results with semantic conflicts, and output the corrected field recognition results;

[0012] Step 6: Based on the corrected field recognition results, output the structured order field recognition results.

[0013] Optionally, the order text data specifically includes a header area, a body area, and a remarks area.

[0014] Optionally, the step of using the DeBERTa model to perform context-sensitive embedding representation on the order text data to generate an initial semantic representation vector specifically involves:

[0015] Perform region partitioning on the order text data, and mark each line of text in the header area, body area and remarks area with paragraph number and line number index in the original order to generate a sequence of structured text fragments;

[0016] For each structured text segment, 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 reaches the preset number of rounds, thus dividing the structured text segment into several sub-word units.

[0017] Each 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. The word vector is then generated by passing through multiple linear transformations and the ReLU activation function.

[0018] The DeBERTa model is used to model the positional information of each word unit, calculate the relative positional difference between each word unit and other word units, and process each relative positional difference through a linear transformation layer and a ReLU activation function in turn to obtain a relative positional vector consistent with the word vector dimension.

[0019] In the Transformer encoding layer of the DeBERTa model, for each word unit, a query vector, a key vector, and a 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.

[0020] 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;

[0021] The final attention matrix and the value vector are weighted and summed to generate a context-dependent representation vector.

[0022] 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, and the initial semantic representation vector is kept in correspondence with the region label, paragraph number and line number index of the original structured text segment;

[0023] The initial semantic representation vectors of all structured text fragments are arranged in ascending order according to the priority of region labels, the order of paragraph numbers, and the order of line number indices to form an initial semantic representation vector sequence.

[0024] Optionally, step two specifically involves:

[0025] The initial semantic representation vector sequence is input into the lexical layer processing unit. A sliding window of a set length slides on the initial semantic representation vector sequence in order of row number. In each sliding window, the mean operation is performed on the initial semantic representation vector in the dimensional direction to obtain the lexical layer output vector. Based on all the lexical layer output vectors of the corresponding structured text segment, a lexical layer output vector sequence is generated.

[0026] The lexical layer output vector sequence is input into the syntax layer processing unit, and part-of-speech tagging is performed for each structured text segment to identify words with noun and verb parts of speech in the structured text segment. Lexical layer output vectors corresponding to nouns and verbs are extracted for each structured text segment. The extracted lexical layer output vectors are concatenated in the dimensional direction to obtain the syntax layer output vector. Based on all the syntax layer output vectors of the corresponding structured text segment, a syntax layer output vector sequence is generated.

[0027] The sequence of output vectors of the syntactic layer is 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 the adjacent lines before and after the structured text segment are selected. The mean operation of the dimension direction is performed on the selected syntactic layer output vectors in line number order to obtain the context layer output vector. Based on all the context layer output vectors of the corresponding structured text segment, a sequence of context layer output vectors is generated.

[0028] The vectors of the corresponding structured text segments in the lexical layer output vector sequence, the syntactic layer output vector sequence, and the context layer output vector sequence are concatenated in the dimensional direction, and then fused by linear transformation and ReLU activation function to obtain a fused semantic representation vector sequence.

[0029] Optionally, step three specifically includes:

[0030] The fused semantic representation vector sequence is input into the local window connection module. The local window size k is set as a parameter, and the fused semantic representation vector sequence is traversed in the order of the line numbers of the structured text fragments. In each window, the current structured text fragment and the fused semantic representation vectors corresponding to the k lines before and after it are selected. The mean operation in the dimension direction is performed in the order of the line numbers to obtain the local association vector and construct the local association vector sequence.

[0031] The local association vector sequence is input into the global anchor connection module. The paragraph number is used as the grouping basis. The local association vector of the structured text segment in the first line of each paragraph is selected as the anchor vector. The dot product attention weight of the anchor vector and all local association vectors in the same paragraph is calculated to form a global attention connection matrix. The local association vector sequence and the global attention connection matrix are concatenated and merged according to the row number correspondence to output the anchor enhancement vector sequence.

[0032] 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 the dimensional direction and processed sequentially through linear transformation and ReLU activation function to output a structure enhancement vector sequence.

[0033] The structure-enhanced vector sequence is input into the field label interaction representation module to obtain a set of field labels, which includes order number, customer name, order date, product name, quantity, unit price, total amount, shipping date, and remarks, to cover the core structured fields in the order text. Based on a multi-head attention mechanism, attention interaction modeling is performed between each structure-enhanced vector and the embedding vector of each field label to generate a structure-aware semantic representation vector, and the structure-aware semantic representation vector sequence is output.

[0034] Optionally, the field recognition and classification module is based on a multilayer perceptron structure, receives the structure-aware semantic representation vector as input, and sequentially 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;

[0035] Perform a Softmax normalization operation on the intermediate vector representation and calculate the normalized probability distribution of the structure-aware semantic representation vector on each field label;

[0036] The field label corresponding to the highest probability is determined as the predicted field label of the current structured text fragment, and then bound to the original text content of the structured text fragment.

[0037] The predicted field labels of all structured text fragments are merged with the corresponding order text in order of region label priority, paragraph number increment, and line number index ascending to generate preliminary field recognition results.

[0038] Optionally, the semantic consistency verification specifically includes:

[0039] Based on the field dependency rules of the order text, extract field values ​​related to amount calculation, date sequence, and uniqueness of number from the preliminary field recognition results, including quantity, unit price, total amount, order date, shipping date, and order number;

[0040] 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 identification 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.

[0041] Perform a 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.

[0042] Perform duplicate detection on the order number field, compare the order number list in the preliminary identification results one by one, and if there is no duplicate order number, the consistency of the order number field is determined to be valid;

[0043] The consistency judgment results of the amount field, the date sequence judgment result, and the order number field are jointly judged. If all the judgment results are valid, the current field recognition result is considered to have passed the semantic consistency verification. If any judgment result is invalid, it is considered to have failed the semantic consistency verification, there is a semantic conflict, and dynamic error correction is performed.

[0044] Optionally, the dynamic error correction operation performed on the identification results of fields with semantic conflicts specifically includes:

[0045] When the initial field recognition result fails the semantic consistency verification, the structure-aware semantic representation vector of the corresponding structured text fragment is extracted;

[0046] Calculate the cosine similarity between the structure-aware semantic representation vector and the embedding vector of all field labels;

[0047] Remove field labels from the field label set that have semantic conflicts with the current recognition result, select the field label with the highest cosine similarity to replace the original recognition result, and generate the updated field label as the corrected field recognition result.

[0048] Optionally, step six specifically includes:

[0049] Based on the corrected field recognition results, the field labels of each structured text fragment are bound to the original order text content, and then summarized and organized according to the priority of the area label, the ascending order of the paragraph number, and the ascending order of the line number index.

[0050] The structured text content belonging to the same field label is categorized and grouped into a list of field values.

[0051] Construct key-value pairs from the list of field labels and field values, and output the structured order field recognition results.

[0052] An intelligent order recognition system based on semantic similarity analysis according to an embodiment of the present invention includes the following modules:

[0053] The text acquisition module is used to obtain order text data;

[0054] The semantic representation generation module is used to perform context-related embedding representation on the order text data based on the DeBERTa model, and generate an initial semantic representation vector sequence.

[0055] The multi-layer semantic fusion module is used to perform multi-layer semantic fusion processing on the initial semantic representation vector sequence at the lexical, syntactic and contextual levels, and output the fused semantic representation vector sequence.

[0056] The structure-aware modeling module is used to input the fused semantic representation vector sequence into the improved BigBird model, and generate the structure-aware semantic representation vector sequence through the local window connection module, the global anchor connection module, the structural information enhancement module and the field label interaction representation module.

[0057] The field recognition and classification module receives the structure-aware semantic representation vector sequence, performs field label prediction based on the multilayer perceptron structure, and outputs preliminary field recognition results.

[0058] The consistency verification and error correction module is used to perform semantic consistency verification on the preliminary field identification results, perform dynamic error correction operation on the field identification results with semantic conflicts, and output the corrected field identification results.

[0059] 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.

[0060] The beneficial effects of this invention are:

[0061] This invention addresses the challenges of complex order text data structures, non-standard expressions, and frequent semantic conflicts between fields by introducing a multi-layer semantic processing framework built from the DeBERTa model and an improved BigBird model. It employs a context-sensitive embedding representation and multi-layer semantic fusion strategy to extract deep features from 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. The structural information enhancement module introduces region labels, paragraph numbers, line number indices, and text length structural features to achieve comprehensive modeling of structure-aware semantic representation vectors. In the field label interaction representation module, the embedding vectors from the field label set are combined with multi-head annotation... The intentional mechanism constructs the alignment relationship between field labels and text, significantly improving the semantic alignment accuracy of the field recognition and classification module in the field label prediction process. Addressing semantic conflicts in field recognition, it combines semantic consistency verification and dynamic error correction, logically verifying the consistency of the amount field, the chronological order of dates, and the uniqueness of the order number based on the field dependency rules of the order text. It then outputs corrected field recognition results by removing conflicting field labels and using a cosine similarity replacement mechanism. Finally, it aggregates field values ​​according to region, paragraph, and line number order and constructs them 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

[0062] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0063] Figure 1 This is an overall flowchart of an intelligent order recognition method based on semantic similarity analysis proposed in this invention;

[0064] Figure 2 This is a schematic diagram of the structure of an intelligent order recognition system based on semantic similarity analysis proposed in this invention. Detailed Implementation

[0065] 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.

[0066] refer to Figure 1 A method for intelligent order recognition based on semantic similarity analysis includes the following steps:

[0067] Step 1: Obtain order text data, and use the DeBERTa model to perform context-sensitive embedding representation on the order text data to generate an initial semantic representation vector sequence;

[0068] Step 2: Perform multi-layer semantic fusion processing on the initial semantic representation vector sequence, including the lexical layer, syntactic layer and context layer, and output the fused semantic representation vector sequence;

[0069] Step 3: Input the fused semantic representation vector sequence into the 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.

[0070] Step 4: Input the structure-aware semantic representation vector sequence into the field recognition and classification module, perform field label prediction on the structure-aware semantic representation vector corresponding to each structured text segment, and generate preliminary field recognition results;

[0071] Step 5: Perform semantic consistency verification on the preliminary field recognition results, perform dynamic error correction on the field recognition results with semantic conflicts, and output the corrected field recognition results;

[0072] Step 6: Based on the corrected field recognition results, output the structured order field recognition results.

[0073] In this embodiment, the order text data specifically includes a header area, a body area, and a remarks area.

[0074] In this embodiment, the step of using the DeBERTa model to perform context-sensitive embedding representation on the order text data and generating an initial semantic representation vector specifically involves:

[0075] Perform region partitioning on the order text data, and mark each line of text in the header area, body area and remarks area with paragraph number and line number index in the original order to generate a sequence of structured text fragments;

[0076] For each structured text segment, 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 reaches the preset number of rounds, thus dividing the structured text segment into several sub-word units.

[0077] Specifically, during the initialization 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, and a frequency table is generated.

[0078] Select the character pair that appears most frequently from the frequency table, perform a character pair merging operation, replace the character pair with a new compound symbol, and add the new symbol to the current vocabulary;

[0079] After each character pair merging operation, update all regions in the original text that match the character pair and recount the frequency of the character pair occurrences.

[0080] Repeat the character pair merging and vocabulary expansion process until the preset number of merging rounds is reached, then end the iteration.

[0081] Based on the final vocabulary, the structured text fragments are scanned and matched in a forward direction, with long words being matched first as sub-word units, and the entire text is segmented into an ordered sequence of sub-words in turn;

[0082] Each 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. The word vector is then generated by passing through multiple linear transformations and the ReLU activation function.

[0083] The DeBERTa model is used to model the positional information of each word unit, calculate the relative positional difference between each word unit and other word units, enumerate all differences within the set offset range, and process each relative positional difference through a linear transformation layer and a ReLU activation function in sequence to obtain a relative positional vector consistent with the word vector dimension.

[0084] In the Transformer encoding layer of the DeBERTa model, for each word unit, a query vector, a key vector, and a 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 set scaling factor is the square root of the vocabulary vector dimension.

[0085] 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;

[0086] The final attention matrix and the value vector are weighted and summed to generate a context-dependent representation vector.

[0087] 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, and the initial semantic representation vector is kept in correspondence with the region label, paragraph number and line number index of the original structured text segment;

[0088] The initial semantic representation vectors of all structured text fragments are arranged in ascending order according to the priority of region labels, the order of paragraph numbers, and the order of line number indexes to form an initial semantic representation vector sequence. The priority of the region labels is as follows: header region, body region, and notes region.

[0089] The context-sensitive embedding representation method based on the DeBERTa model described in this invention possesses fine-grained sub-word segmentation, dynamic relative position modeling, and decoupled attention weight construction capabilities, specifically optimized for scenarios with loosely structured, diverse expressions, and interleaved fields in order text. Through region partitioning, the order text is segmented into header, body, and remarks regions, and combined with paragraph numbering and line number indexing to achieve structured text organization. During sub-word segmentation, rules based on statistical word frequency and byte pair merging are adopted to automatically identify high-frequency character pairs and perform iterative merging operations, ensuring that the segmentation granularity adapts to the text content. The generated sub-word units are mapped to Unicode encoding, processed through multi-layer linear transformation and ReLU activation function, 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 function 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 respectively, and context-sensitive representation vectors are further generated to improve semantic understanding accuracy and provide a high-quality representation foundation for field recognition.

[0090] In this embodiment, step two specifically includes:

[0091] The initial semantic representation vector sequence is input into the lexical layer processing unit. A sliding window of a set length slides on the initial semantic representation vector sequence in order of row number. In each sliding window, the mean operation is performed on the initial semantic representation vector in the dimensional direction to obtain the lexical layer output vector. Based on all the lexical layer output vectors of the corresponding structured text segment, a lexical layer output vector sequence is generated.

[0092] The lexical layer output vector sequence is input into the syntax layer processing unit, and part-of-speech tagging is performed for each structured text segment to identify words with noun and verb parts of speech in the structured text segment. Lexical layer output vectors corresponding to nouns and verbs are extracted for each structured text segment. The extracted lexical layer output vectors are concatenated in the dimensional direction to obtain the syntax layer output vector. Based on all the syntax layer output vectors of the corresponding structured text segment, a syntax layer output vector sequence is generated.

[0093] The sequence of output vectors of the syntactic layer is 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 the adjacent lines before and after the structured text segment are selected. The mean operation of the dimension direction is performed on the selected syntactic layer output vectors in line number order to obtain the context layer output vector. Based on all the context layer output vectors of the corresponding structured text segment, a sequence of context layer output vectors is generated.

[0094] The vectors of the corresponding structured text segments in the lexical layer output vector sequence, the syntactic layer output vector sequence, and the context layer output vector sequence are concatenated in the dimensional direction, and then fused by linear transformation and ReLU activation function to obtain a fused semantic representation vector sequence.

[0095] In this embodiment, step three specifically includes:

[0096] The fused semantic representation vector sequence is input into the local window connection module. The local window size k is set as a parameter, and the fused semantic representation vector sequence is traversed in the order of the line numbers of the structured text fragments. In each window, the current structured text fragment and the fused semantic representation vectors corresponding to the k lines before and after it are selected. The mean operation in the dimension direction is performed in the order of the line numbers to obtain the local association vector and construct the local association vector sequence.

[0097] The local association vector sequence is input into the global anchor connection module. The paragraph number is used as the grouping basis. The local association vector of the structured text segment in the first line of each paragraph is selected as the anchor vector. The dot product attention weight of the anchor vector and all local association vectors in the same paragraph is calculated to form a global attention connection matrix. The local association vector sequence and the global attention connection matrix are concatenated and merged according to the row number correspondence to output the anchor enhancement vector sequence.

[0098] 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 the dimensional direction and processed sequentially through linear transformation and ReLU activation function to output a structure enhancement vector sequence.

[0099] The structure-enhanced vector sequence is input into the field label interaction representation module to obtain a set of field labels, which 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 a multi-head attention mechanism, attention interaction modeling is performed between each structure-enhanced vector and the embedding vectors of each field label to generate structure-aware semantic representation vectors, and a sequence of structure-aware semantic representation vectors is output. Specifically, the structure-enhanced vectors are used as query vectors, and the field label embedding vectors are used as key and value vectors. Multiple sets of query vectors, key vectors, and value vectors are generated through linear transformation to construct h attention heads. In each attention head, the query vector is multiplied by the key vectors of all field labels and divided by a set scaling factor to obtain an attention score. The attention score is then normalized by Softmax 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 in the dimensional direction and transformed through linear transformation to obtain structure-aware semantic representation vectors, which are then combined into a sequence of structure-aware semantic representation vectors and output.

[0100] 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 fused semantic representation vector sequence is slide-processed according to a set window size. The mean fused 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.

[0101] 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.

[0102] 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.

[0103] 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, thereby outputting a sequence of structure-aware semantic representation vectors, improving the accuracy of field recognition and context consistency.

[0104] 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.

[0105] In this embodiment, 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 the first linear transformation layer, the ReLU activation function layer, and the second linear transformation layer in sequence to obtain an intermediate vector representation with the same dimension as the field label set.

[0106] Perform a Softmax normalization operation on the intermediate vector representation and calculate the normalized probability distribution of the structure-aware semantic representation vector on each field label;

[0107] The field label corresponding to the highest probability is determined as the predicted field label of the current structured text fragment, and then bound to the original text content of the structured text fragment.

[0108] The predicted field labels of all structured text fragments are merged with the corresponding order text in order of region label priority, paragraph number increment, and line number index ascending to generate preliminary field recognition results.

[0109] In this embodiment, the semantic consistency verification specifically includes:

[0110] Based on the field dependency rules of the order text, extract field values ​​related to amount calculation, date sequence, and uniqueness of number from the preliminary field recognition results, including quantity, unit price, total amount, order date, shipping date, and order number;

[0111] 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 identification 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.

[0112] Perform a 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.

[0113] Perform duplicate detection on the order number field, compare the order number list in the preliminary identification results one by one, and if there is no duplicate order number, the consistency of the order number field is determined to be valid;

[0114] The consistency judgment results of the amount field, the date sequence judgment result, and the order number field are jointly judged. If all the judgment results are valid, the current field recognition result is considered to have passed the semantic consistency verification. If any judgment result is invalid, it is considered to have failed the semantic consistency verification, there is a semantic conflict, and dynamic error correction is performed.

[0115] In this embodiment, the dynamic error correction operation performed on the field identification results with semantic conflicts specifically includes:

[0116] When the initial field recognition result fails the semantic consistency verification, the structure-aware semantic representation vector of the corresponding structured text fragment is extracted;

[0117] Calculate the cosine similarity between the structure-aware semantic representation vector and the embedding vector of all field labels;

[0118] Remove field labels that semantically conflict with the current recognition result from the field label set, select the field label with the highest cosine similarity to replace the original recognition result, and generate the updated field label as the corrected field recognition result;

[0119] This invention introduces a dynamic error correction mechanism to intelligently correct semantic conflicts in the initial field recognition results, improving overall recognition accuracy and robustness. Based on the semantic consistency verification results, it identifies structured text fragments with field conflicts and extracts their structure-aware semantic representation vectors as the basis for semantic error correction. Using the vector representation of field labels in the embedding space, it calculates the cosine similarity between the structure-aware semantic vector and each field label, quantifying their semantic relevance. Furthermore, according to domain logic rules, it filters the set of field labels, removing labels with semantically inconsistent relationships 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 shipping date, and the repetition of order numbers. From the remaining candidate labels, it selects the field label with the closest semantics to replace the original conflicting label, achieving precise error correction and field label correction, balancing semantic matching and business rules, avoiding the propagation of errors due to misjudgment, and significantly improving the field recognition accuracy and system usability of structured text.

[0120] In this embodiment, step six specifically includes:

[0121] Based on the corrected field recognition results, the field labels of each structured text fragment are bound to the original order text content, and then summarized and organized according to the priority of the area label, the ascending order of the paragraph number, and the ascending order of the line number index.

[0122] The structured text content belonging to the same field label is categorized and grouped into a list of field values.

[0123] Construct key-value pairs from the list of field labels and field values, and output the structured order field recognition results.

[0124] refer to Figure 2 An intelligent order recognition system based on semantic similarity analysis includes the following modules:

[0125] The text acquisition module is used to obtain order text data;

[0126] The semantic representation generation module is used to perform context-related embedding representation on the order text data based on the DeBERTa model, and generate an initial semantic representation vector sequence.

[0127] The multi-layer semantic fusion module is used to perform multi-layer semantic fusion processing on the initial semantic representation vector sequence at the lexical, syntactic and contextual levels, and output the fused semantic representation vector sequence.

[0128] The structure-aware modeling module is used to input the fused semantic representation vector sequence into the improved BigBird model, and generate the structure-aware semantic representation vector sequence through the local window connection module, the global anchor connection module, the structural information enhancement module and the field label interaction representation module.

[0129] The field recognition and classification module receives the structure-aware semantic representation vector sequence, performs field label prediction based on the multilayer perceptron structure, and outputs preliminary field recognition results.

[0130] The consistency verification and error correction module is used to perform semantic consistency verification on the preliminary field identification results, perform dynamic error correction operation on the field identification results with semantic conflicts, and output the corrected field identification results.

[0131] 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.

[0132] Example 1:

[0133] 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.

[0134] 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.

[0135] 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.

[0136] 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.

[0137] 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.

[0138] Table 1. Order Field Recognition Accuracy Evaluation Table

[0139]

[0140] 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.

[0141] 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.

[0142] 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, Includes the following steps: Step 1: Obtain order text data, and use the DeBERTa model to perform context-sensitive 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 the lexical layer, syntactic layer and context layer, and output the fused semantic representation vector sequence; Step 3: Input the fused semantic representation vector sequence into the 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 the field recognition and classification module, perform field label prediction on the structure-aware semantic representation vector corresponding to each structured text segment, and generate preliminary field recognition results; Step 5: Perform semantic consistency verification on the preliminary field recognition results, perform dynamic error correction on the field recognition results with semantic conflicts, and output the corrected field recognition results; Step 6: Based on the corrected field recognition results, output the 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 as follows: Perform region partitioning on the order text data, and mark each line of text in the header area, body area and remarks area with paragraph number and line number index in the original order to generate a sequence of structured text fragments; For each structured text segment, 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 reaches the preset number of rounds, thus dividing the structured text segment into several sub-word units. Each 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. The word vector is then generated by passing through multiple linear transformations and the ReLU activation function. The DeBERTa model is used to model the positional information of each word unit, calculate the relative positional difference between each word unit and other word units, and process each relative positional difference through a linear transformation layer and a ReLU activation function in turn to obtain a relative positional vector consistent with the word vector dimension. In the Transformer encoding layer of the DeBERTa model, for each word unit, a query vector, a key vector, and a 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 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, and the initial semantic representation vector is kept in correspondence 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 fragments are arranged in ascending order according to the priority of region labels, the order of paragraph numbers, and the order of line number indices 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: The initial semantic representation vector sequence is input into the lexical layer processing unit. A sliding window of a set length slides on the initial semantic representation vector sequence in order of row number. In each sliding window, the mean operation is performed on the initial semantic representation vector in the dimensional direction to obtain the lexical layer output vector. Based on all the lexical layer output vectors of the corresponding structured text segment, a lexical layer output vector sequence is generated. The lexical layer output vector sequence is input into the syntax layer processing unit, and part-of-speech tagging is performed for each structured text segment to identify words with noun and verb parts of speech in the structured text segment. Lexical layer output vectors corresponding to nouns and verbs are extracted for each structured text segment. The extracted lexical layer output vectors are concatenated in the dimensional direction to obtain the syntax layer output vector. Based on all the syntax layer output vectors of the corresponding structured text segment, a syntax layer output vector sequence is generated. The sequence of output vectors of the syntactic layer is 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 the adjacent lines before and after the structured text segment are selected. The mean operation of the dimension direction is performed on the selected syntactic layer output vectors in line number order to obtain the context layer output vector. Based on all the context layer output vectors of the corresponding structured text segment, a sequence of context layer output vectors is generated. The vectors of the corresponding structured text segments in the lexical layer output vector sequence, the syntactic layer output vector sequence, and the context layer output vector sequence are concatenated in the dimensional direction, and then fused by linear transformation and 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: The fused semantic representation vector sequence is input into the local window connection module. The local window size k is set as a parameter, and the fused semantic representation vector sequence is traversed in the order of the line numbers of the structured text fragments. In each window, the current structured text fragment and the fused semantic representation vectors corresponding to the k lines before and after it are selected. The mean operation in the dimension direction is performed in the order of the line numbers to obtain the local association vector and construct the local association vector sequence. The local association vector sequence is input into the global anchor connection module. The paragraph number is used as the grouping basis. The local association vector of the structured text segment in the first line of each paragraph is selected as the anchor vector. The dot product attention weight of the anchor vector and all local association vectors in the same paragraph is calculated to form a global attention connection matrix. The local association vector sequence and the global attention connection matrix are concatenated and merged according to the row number correspondence to output 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 the dimensional direction and processed sequentially through linear transformation and ReLU activation function to output a structure enhancement vector sequence. The structure-enhanced vector sequence is input into the field label interaction representation module to obtain a set of field labels. The set of field labels includes order number, customer name, order date, product name, quantity, unit price, total amount, shipping date, and remarks, which are used to cover 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 the first linear transformation layer, the ReLU activation function layer, and the second linear transformation layer in sequence to obtain the intermediate vector representation. Perform a Softmax normalization operation on the intermediate vector representation and calculate the normalized probability distribution of the structure-aware semantic representation vector on each field label; The field label corresponding to the highest probability is determined as the predicted field label of the current structured text fragment, and then bound to the original text content of the structured text fragment. The predicted field labels of all structured text fragments are merged with the corresponding order text 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 refers to: Based on the field dependency rules of the order text, extract field values ​​related to amount calculation, date sequence, and uniqueness of 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 identification 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 a 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. Perform duplicate detection on the order number field, compare the order number list in the preliminary identification results one by one, and if there is no duplicate order number, the consistency of the order number field is determined to be valid; The consistency judgment results of the amount field, the date sequence judgment result, and the order number field are jointly judged. If all the judgment results are valid, the current field recognition result is considered to have passed the semantic consistency verification. If any judgment result is invalid, it is considered to have failed the semantic consistency verification, there is 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 performed on the identification results of fields with semantic conflicts specifically involves: When the initial field recognition result fails the semantic consistency verification, the structure-aware semantic representation vector of the corresponding structured text fragment is extracted; Calculate the cosine similarity between the structure-aware semantic representation vector and the embedding vector of all field labels; Remove field labels from the field label set that have semantic conflicts with the current recognition result, select the field label with the highest cosine similarity to replace the original recognition result, and generate 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, the field labels of each structured text fragment are bound to the original order text content, and then summarized and organized according to the priority of the area label, the ascending order of the paragraph number, and the ascending order of the line number index. The structured text content belonging to the same field label is categorized and grouped into a list of field values. Construct key-value pairs from the list of field labels and field values, 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, Includes the following modules: The text acquisition module is used to obtain order text data; The semantic representation generation module is used to perform context-related embedding representation on the order text data based on the DeBERTa model, and generate an initial semantic representation vector sequence. The multi-layer semantic fusion module is used to perform multi-layer semantic fusion processing on the initial semantic representation vector sequence at the lexical, syntactic and contextual levels, and output the fused semantic representation vector sequence. The structure-aware modeling module is used to input the fused semantic representation vector sequence into the improved BigBird model, and generate the structure-aware semantic representation vector sequence through the local window connection module, the global anchor connection module, the structural information enhancement module and the field label interaction representation module. The field recognition and classification module receives the structure-aware semantic representation vector sequence, performs field label prediction based on the multilayer perceptron structure, and outputs preliminary field recognition results. The consistency verification and error correction module is used to perform semantic consistency verification on the preliminary field identification results, perform dynamic error correction operation on the field identification results with semantic conflicts, and output the corrected field identification 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.