Hotel order error correction verification method based on hotel order domain knowledge graph OCR technology
By using OCR technology based on a knowledge graph in the hotel order domain, the problem of low accuracy in order information recognition was solved, enabling efficient hotel order error correction, verification, and recommendation services, thus improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- QUANZHU INFORMATION TECHNOLOGY (CHONGQING) CO LTD
- Filing Date
- 2025-11-27
- Publication Date
- 2026-04-17
AI Technical Summary
Existing OCR technology suffers from low accuracy in hotel order recognition, and users need to manually take screenshots when querying across multiple platforms, resulting in incomplete information and low efficiency.
By employing OCR technology based on a knowledge graph in the hotel order domain, and through preprocessing, feature extraction, self-attention mechanism, layout parsing, and field clustering, combined with semantic verification of the knowledge graph, error correction and verification of order information can be achieved.
It improves the accuracy of order text recognition, simplifies user operations, reduces the time spent searching across multiple platforms, provides convenient hotel recommendation services, and avoids the phenomenon of price discrimination based on big data.
Smart Images

Figure CN121884367A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition, specifically a hotel order error correction and verification method based on OCR technology using a knowledge graph of hotel order domain. Background Technology
[0002] With the continuous evolution of artificial intelligence technology and the booming development of the online hotel booking industry, various hotel booking platforms are proliferating. However, complex pricing strategies and "price discrimination based on big data" are common occurrences among these platforms, often requiring users to search and compare prices on multiple platforms simultaneously to find affordable and cost-effective hotels. In this process, users commonly take screenshots of the order information pages displayed on their mobile phones or computers to capture and temporarily save real-time prices and room details from different platforms.
[0003] However, in practice, due to the limited screen size of mobile phones or the complex layout of web pages / app interfaces, the order images manually captured by users often have incomplete content and missing key information.
[0004] However, OCR (Optical Character Recognition) technology still suffers from low recognition accuracy. Summary of the Invention
[0005] The purpose of this invention is to provide a hotel order error correction and verification method based on OCR technology using a knowledge graph in the hotel order domain, comprising the following steps:
[0006] Step 1) Obtain a screenshot of the hotel order and preprocess it to extract the text boxes in the order screenshot;
[0007] Step 2) Use OCR recognition technology to recognize each text box and obtain the top-K candidate set;
[0008] Step 3) Construct a field candidate set based on the top-K candidate set. And calculate the matching score between each text box and the field candidate vector;
[0009] Step 4) Based on the matching score, map the OCR candidate strings to the entity candidate set of the knowledge graph to obtain the top-ranked candidate strings. Candidate vectors;
[0010] Step 5) For top- Each OCR candidate character in the candidate vector Each knowledge graph entity candidate Calculate the joint score The system selects the entity candidate with the highest score as the final entity, thereby filling in the missing field values.
[0011] Furthermore, in step 1), the preprocessing steps are as follows: grayscale and histogram processing of the order screenshot, extraction of text boxes in the order screenshot, and removal of redundant information other than text boxes.
[0012] Furthermore, in step 2), the steps of recognizing each text box using OCR recognition technology include:
[0013] Step 2.1) Crop the text box to get:
[0014] (1)
[0015] In the formula, , Images of the text box before and after cropping; For text boxes;
[0016] Step 2.2) Use a convolutional network to extract features from the cropped text boxes to obtain:
[0017] (2)
[0018] In the formula, , Here, m and n are the weights and biases; m and n are the indices inside the convolution kernel. , Indexes for input and output channels; Features extracted;
[0019] Step 2.3) Segment the order of the text in the extracted text boxes and use transform self-attention to extract features to obtain feature results at different time steps;
[0020] Among them, self-attention mechanism As shown below:
[0021] (3)
[0022] In the formula, Q, K, and V represent the query, key, and value matrices, respectively; The dimension of the key matrix;
[0023] Step 2.4) Calculate the probability of outputting a character at each time step, i.e.:
[0024] (4)
[0025] In the formula, , For weights and biases; The probability of outputting a character at each time step; The feature results of step 2.3);
[0026] Step 2.5) Use Beam search to determine the top- Candidate set ,Right now:
[0027] (5)
[0028] In the formula, For the k-th candidate text content, Representative to The confidence interval.
[0029] Furthermore, in step 3), the top-K candidate set is processed through layout parsing and field clustering to construct a field candidate set. .
[0030] Further, in step 3), the matching score is the keyword matching score between each text box and the field candidate vector, that is:
[0031] (6)
[0032] In the formula, The score is the matching score; b and f are the candidate vectors for the text box and the field, respectively. , The text content identified by the text box and the keywords belonging to the field candidate vector f.
[0033] Further, in step 3), the matching score is a BiLSTM-CRF score based on sequence labeling, i.e.:
[0034] (7)
[0035] in It is the first Each token belongs to a tag. The model score, Let be the transition matrix. A sequence of text blocks in the document in the order they are read; It is a label sequence. BiLSTM-CRF scoring.
[0036] Furthermore, in step 4), the step of mapping the OCR candidate strings to the entity candidate set of the knowledge graph includes:
[0037] Step 4.1) Calculate the similarity between strings and the semantic similarity between vectors;
[0038] Step 4.2) Obtain the candidate set using the Trigram index. and to The similarity of vectors is used for evaluation to obtain the top- Candidate vectors, i.e.:
[0039] (8)
[0040] In the formula, For top- Candidate vectors; s and c represent the recognition string and candidate entity, respectively.
[0041] Furthermore, string similarity As shown below:
[0042] (9)
[0043] In the formula, s and a represent different recognition strings; Indicates edit distance;
[0044] similarity of vector semantics As shown below:
[0045] (10)
[0046] In the formula, c represents the candidate entity; A vector representation of a candidate entity.
[0047] Furthermore, in step 5), the steps for completing missing field values include:
[0048] Step 5.1) Construct a context entity set, identify the high-confidence entity content in the document, and perform normalization processing, i.e.:
[0049] (11)
[0050] In the formula, , The original attention score and normalized attention weights are used for the context aggregation vector;
[0051] Step 5.2) Perform attention-weighted summation on the context-aggregated vectors to obtain:
[0052] (12)
[0053] In the formula, Attention score calculated using a weighted summation method; Let i be the vector representation of entity i;
[0054] Step 5.3) Calculate the semantic score of the knowledge graph, i.e.:
[0055] (13)
[0056] In the formula, The semantic score of the knowledge graph; A vector representation of a candidate entity;
[0057] Step 5.4) Calculate the joint score ,Right now:
[0058] (14)
[0059] in, It is a physical entity Its alternative name , , , As weight;
[0060] Step 5.5) If If the original text recognized by OCR is used as the final result, it is reverted to the original OCR text; otherwise, the optimal candidate is output.
[0061] (15)
[0062] In the formula, It is the optimal candidate.
[0063] Furthermore, after obtaining the top-K candidate set, manual sampling is also performed to re-validate the attention mechanism and ranking model;
[0064] The loss function used during re-validation is as follows:
[0065] (16)
[0066] (17)
[0067] In the formula, The loss function; , , These are the weighting coefficients; , , The losses are CTC loss, detection loss, and ranking loss. It is a positive candidate.
[0068] The technical effects of this invention are undeniable, and its beneficial effects are as follows:
[0069] Improve the accuracy of OCR technology in recognizing text in orders.
[0070] This invention primarily utilizes hotel order knowledge graph technology to calibrate and improve the accuracy of OCR (Optical Character Recognition) technology. It collects a large number of order interfaces, annotates the order content, constructs semantic associations of common words in the hotel industry, and ultimately forms a hotel order knowledge graph. This graph allows for semantic verification of the OCR results, identifying and correcting erroneous statements. Furthermore, manual verification enables feedback to the model, further improving OCR accuracy.
[0071] 2. Convenient operation: the first in the domestic market to use screenshots for hotel recommendations.
[0072] In the hotel industry, most customers need to use multiple apps to search for hotels of the same brand and room type, constantly comparing prices. This consumes a significant amount of user time and diminishes the stay experience. This invention uses OCR technology, allowing customers to quickly receive hotel recommendations simply by taking a screenshot of their hotel booking.
[0073] 3. Avoid price discrimination based on customer data and provide convenient services to customers.
[0074] After identifying hotel bookings, this invention can recommend cost-effective booking methods to customers through subsequent service offerings, allowing them to stay at their preferred hotels at lower prices. This effectively avoids price discrimination based on user data by major platforms, thus providing customers with a better stay experience. Attached Figure Description
[0075] Figure 1 This is a flowchart of the algorithm. Detailed Implementation
[0076] The present invention will be further described below with reference to embodiments, but it should not be construed that the scope of the present invention is limited to the following embodiments. Various substitutions and modifications made based on ordinary technical knowledge and common practices in the art without departing from the above-described technical concept of the present invention should be included within the scope of protection of the present invention.
[0077] Example 1:
[0078] See Figure 1 A hotel order error correction and verification method based on hotel order domain knowledge graph OCR technology includes the following steps:
[0079] Step 1) Obtain a screenshot of the hotel order and preprocess it to extract the text boxes in the order screenshot;
[0080] Step 2) Use OCR recognition technology to recognize each text box and obtain the top-K candidate set;
[0081] Step 3) Construct a field candidate set based on the top-K candidate set. And calculate the matching score between each text box and the field candidate vector;
[0082] Step 4) Based on the matching score, map the OCR candidate strings to the entity candidate set of the knowledge graph to obtain the top-ranked candidate strings. Candidate vectors;
[0083] Step 5) For top- Each OCR candidate character in the candidate vector Each knowledge graph entity candidate Calculate the joint score The system selects the entity candidate with the highest score as the final entity, thereby filling in the missing field values.
[0084] Example 2:
[0085] A hotel order error correction and verification method based on hotel order domain knowledge graph OCR technology, the technical content is the same as in embodiment 1, further, in step 1), the preprocessing step is: to perform grayscale and histogram processing on the order screenshot, extract the text boxes in the order screenshot, and remove redundant information that is not a text box.
[0086] Example 3:
[0087] A hotel order error correction and verification method based on OCR technology using a knowledge graph in the hotel order domain, the technical content of which is the same as any one of embodiments 1-2, further comprising, in step 2), the step of recognizing each text box using OCR recognition technology includes:
[0088] Step 2.1) Crop the text box to get:
[0089] (1)
[0090] In the formula, , Images of the text box before and after cropping; For text boxes;
[0091] Step 2.2) Use a convolutional network to extract features from the cropped text boxes to obtain:
[0092] (2)
[0093] In the formula, , Here, m and n are the weights and biases; m and n are the indices inside the convolution kernel. , Indexes for input and output channels; Features extracted;
[0094] Step 2.3) Segment the order of the text in the extracted text boxes and use transform self-attention to extract features to obtain feature results at different time steps;
[0095] Among them, self-attention mechanism As shown below:
[0096] (3)
[0097] In the formula, Q, K, and V represent the query, key, and value matrices, respectively; The dimension of the key matrix;
[0098] Step 2.4) Calculate the probability of outputting a character at each time step, i.e.:
[0099] (4)
[0100] In the formula, , For weights and biases; The probability of outputting a character at each time step; The feature results of step 2.3);
[0101] Step 2.5) Use Beam search to determine the top- Candidate set ,Right now:
[0102] (5)
[0103] In the formula, For the k-th candidate text content, Representative to The confidence interval.
[0104] Example 4:
[0105] A hotel order error correction and verification method based on hotel order domain knowledge graph OCR technology, with the same technical content as any one of embodiments 1-3, further wherein, in step 3), the top-K candidate set is processed by layout parsing and field clustering to construct a field candidate set. .
[0106] Example 5:
[0107] A hotel order error correction and verification method based on hotel order domain knowledge graph OCR technology, the technical content of which is the same as any one of embodiments 1-4, further, in step 3), the matching score is the keyword matching score between each text box and the field candidate vector, that is:
[0108] (6)
[0109] In the formula, The score is the matching score; b and f are the candidate vectors for the text box and the field, respectively. , The text content identified by the text box and the keywords belonging to the field candidate vector f.
[0110] Example 6:
[0111] A hotel order error correction and verification method based on hotel order domain knowledge graph OCR technology, the technical content of which is the same as any one of embodiments 1-5, further, in step 3), the matching score is a BiLSTM-CRF score according to sequence labeling, that is:
[0112] (7)
[0113] in It is the first Each token belongs to a tag. The model score, Let be the transition matrix. A sequence of text blocks in the document in the order they are read; It is a label sequence. BiLSTM-CRF scoring.
[0114] Example 7:
[0115] A hotel order error correction and verification method based on OCR technology using a knowledge graph in the hotel order domain, with technical content identical to any one of embodiments 1-6, further comprising, in step 4), mapping the OCR candidate string to the entity candidate set of the knowledge graph, including:
[0116] Step 4.1) Calculate the similarity between strings and the semantic similarity between vectors;
[0117] Step 4.2) Obtain the candidate set using the Trigram index. and to The similarity of vectors is used for evaluation to obtain the top- Candidate vectors, i.e.:
[0118] (8)
[0119] In the formula, For top- Candidate vectors; s and c represent the recognition string and candidate entity, respectively.
[0120] Example 8:
[0121] A hotel order error correction and verification method based on hotel order domain knowledge graph OCR technology, the technical content of which is the same as any one of embodiments 1-7, further including string similarity. As shown below:
[0122] (9)
[0123] In the formula, s and a represent different recognition strings; Indicates edit distance;
[0124] similarity of vector semantics As shown below:
[0125] (10)
[0126] In the formula, c represents the candidate entity; A vector representation of a candidate entity.
[0127] Example 9:
[0128] A hotel order error correction and verification method based on hotel order domain knowledge graph OCR technology, the technical content of which is the same as any one of embodiments 1-8, further comprising, in step 5), the step of filling in missing field values includes:
[0129] Step 5.1) Construct a context entity set, identify the high-confidence entity content in the document, and perform normalization processing, i.e.:
[0130] (11)
[0131] In the formula, , The original attention score and normalized attention weights are used for the context aggregation vector;
[0132] Step 5.2) Perform attention-weighted summation on the context-aggregated vectors to obtain:
[0133] (12)
[0134] In the formula, Attention score calculated using a weighted summation method; Let i be the vector representation of entity i;
[0135] Step 5.3) Calculate the semantic score of the knowledge graph, i.e.:
[0136] (13)
[0137] In the formula, The semantic score of the knowledge graph; A vector representation of a candidate entity;
[0138] Step 5.4) Calculate the joint score ,Right now:
[0139] (14)
[0140] in It is a physical entity An alias (used for character matching). As weight.
[0141] Step 5.5) If If the original text recognized by OCR is used as the final result, it is reverted to the original OCR text; otherwise, the optimal candidate is output.
[0142] (15)
[0143] In the formula, It is the optimal candidate.
[0144] Example 10:
[0145] A hotel order error correction and verification method based on hotel order domain knowledge graph OCR technology, the technical content is the same as any one of embodiments 1-9, further, after obtaining the top-K candidate set, manual sampling is also performed to re-verify the attention mechanism and ranking model;
[0146] The loss function used during re-validation is as follows:
[0147] (16)
[0148] (17)
[0149] In the formula, The loss function; , , These are the weighting coefficients; , , The losses are CTC loss, detection loss, and ranking loss. It is a positive candidate.
[0150] Example 11:
[0151] A hotel order error correction and verification method based on hotel order domain knowledge graph OCR technology, comprising the following steps:
[0152] 1) Image preprocessing: For the input order screenshot, grayscale and histogram conversion are first used to extract the text boxes in the image and remove redundant information other than text boxes to ensure accurate positioning of the recognized text boxes.
[0153] 2) For each text box, implement OCR recognition technology to obtain top-K candidates for each text box. This part of the algorithm mainly involves cropping each text box b and inputting it into the recognition model, outputting the character sequence and confidence score.
[0154] a. To crop a text box, the specific formula is as follows:
[0155]
[0156] b. Feature extraction using convolution
[0157]
[0158] c. Segment the text according to its order and extract features using transform self-attention to obtain the output feature results.
[0159]
[0160] d. Calculate the probability of outputting a character at each segmented time step:
[0161]
[0162] e. Obtain the top-level results via Beam search. Candidates:
[0163]
[0164] 3) Since many repetitions may occur during text content recognition in step 2, such as in an order form appearing as "King Room...King Room (Windowless Special Price)," the "King Room" appears repeatedly. However, the core of this field is "King Room," so it's necessary to cluster the repeated Chinese characters to display only the core keyword, "King Room." Therefore, layout parsing and field clustering techniques are used to identify candidate field groups. To prevent misidentification of characters as uncommon or incorrect font recognition during image recognition, keyword matching scores are calculated for each text box b and field module f. This embodiment employs deep learning-based methods (such as layout analysis models like YOLO and DETR, or specialized document layout analysis tools like LayoutParser) for layout parsing.
[0165]
[0166] 4) Map the OCR candidate strings to the entity candidate set of KG (including alias matching and vector retrieval) to ensure that the recognized fields can form a complete sentence.
[0167] First, calculate the similarity of the strings:
[0168]
[0169] Simultaneously calculate the semantic similarity of the vectors:
[0170]
[0171] In order to obtain entity candidates for KG, this invention uses a Trigram index to obtain a candidate set. Then to The similarity of vectors is used for evaluation, and the top-ranked vectors are obtained. :
[0172]
[0173] 5) To achieve accurate field completion, this invention combines OCR confidence and character similarity, while introducing an attention mechanism for knowledge graph (KG) semantic weighting, applying this to each OCR candidate. Each KG entity candidate Calculate the joint score The process involves selecting the highest value and ultimately filling in the missing field values. The specific steps are as follows:
[0174] a. Construct contextual entity combinations, find high-confidence entity content in the document, and use attention weights and softmax for normalization.
[0175]
[0176] b. For context-aggregated vectors, use attention-weighted summation.
[0177]
[0178] c. Calculate the semantic score of the knowledge graph.
[0179]
[0180] d. Final determination of combined score:
[0181]
[0182] in It is a physical entity An alias (used for character matching). As weight.
[0183] e. Select the best candidate
[0184]
[0185] like If the highest joint score S(c) of all knowledge graph candidate entities c is lower than a preset confidence threshold τ, the system will determine that the current error correction and completion is unreliable and abandon the use of any entity in the knowledge graph, and instead directly use the original text s recognized by the initial OCR as the final result.
[0186] For step (3), obtain the candidate groups of fields. Not only can scoring be performed using keywords, but scoring can also be performed using BiLSTM-CRF based on sequence labeling.
[0187] Sequence the text blocks of the document in reading order as follows The label sequence is Then the CRF probability is:
[0188]
[0189] in It is the first Each token belongs to a tag. The model score, Let be the transition matrix.
[0190] After introducing the attention mechanism, this invention adds a verification step to the recognition results. It relies on manual sampling to perform manual checks on the verified data samples, and simultaneously feeds this feedback back to the model to re-verify the attention mechanism and ranking model. The specific steps are as follows:
[0191] a. First, calculate the cross-entropy loss of the ranking model.
[0192]
[0193] b. Calculate the total loss during joint training.
[0194]
[0195] To accelerate training data, this invention generally fixes the OCR detection model and only trains it. (i.e., learning) , wait).
[0196] Example 12:
[0197] A hotel order error correction and verification method based on hotel order domain knowledge graph OCR technology, the technical content of which is the same as any one of embodiments 1-11. The present invention first constructs a hotel domain order knowledge graph using hotel order screenshots. The order screenshots include 10 platforms such as Ctrip, Meituan, Qunar, Tongcheng, Fliggy, Zhixing, eLong, Douyin, JD.com, and Tuniu.
[0198] The screenshots of the order mainly refer to the order details page and the payment details page.
[0199] OCR technology is used to identify textual information within orders to build a knowledge graph. The specific information includes, but is not limited to, 12 elements such as: hotel name, room type name, check-in time, whether breakfast is included, contact person for booking, hotel price, points program, mileage redemption, promotional activities, coupons / vouchers, and room policies.
[0200] This invention targets the above 12 elements to achieve OCR technology recognition. First, it is necessary to identify the position of the text in the image based on the keywords (12 elements) and realize text box segmentation to focus on key content areas.
[0201] Example 13:
[0202] A hotel order error correction and verification method based on OCR technology of knowledge graph in the hotel order domain, with the same technical content as any one of embodiments 1-12. On the basis of text box segmentation, this invention collects data samples from at least 10 hotel booking platforms across the country, extracts the text information after the 12 element keywords in embodiment 1, and constructs word association vectors based on the content of the text information.
[0203] Based on word association vectors, this invention constructs a knowledge graph, which is beneficial for comparing word vector associations and correcting the identified content in a timely manner when OCR technology makes mistakes or errors, thereby ensuring the accuracy of the recognition of this invention.
[0204] Example 14:
[0205] A hotel order error correction and verification method based on OCR technology using a knowledge graph in the hotel order domain is disclosed. The technical content is the same as any one of embodiments 1-13. In the knowledge graph-based autonomous error correction technology, the present invention arranges personnel to conduct spot checks on the identification situation in the database, mainly on the corrected situation, to determine whether the model has corrected correctly, and provides timely feedback to the model. Through the feedback, the model can perform a new verification on the weight of the attention mechanism and the ranking model, thereby ensuring that the recognition accuracy and precision are further improved during the application process.
Claims
1. A hotel order error correction and verification method based on hotel order domain knowledge graph OCR technology, characterized in that, Includes the following steps: Step 1) Obtain a screenshot of the hotel order and preprocess it to extract the text boxes in the order screenshot; Step 2) Use OCR recognition technology to recognize each text box and obtain the top-K candidate set; Step 3) Construct a field candidate set based on the top-K candidate set. And calculate the matching score between each text box and the field candidate vector; Step 4) Based on the matching score, map the OCR candidate strings to the entity candidate set of the knowledge graph to obtain the top-ranked candidate strings. Candidate vectors; Step 5) For top- Each OCR candidate character in the candidate vector Each knowledge graph entity candidate Calculate the joint score The system selects the entity candidate with the highest score as the final entity, thereby filling in the missing field values.
2. The hotel order error correction and verification method based on hotel order domain knowledge graph OCR technology according to claim 1, characterized in that, In step 1), the preprocessing steps are as follows: grayscale and histogram processing of the order screenshot, extraction of text boxes in the order screenshot, and removal of redundant information other than text boxes.
3. The hotel order error correction and verification method based on hotel order domain knowledge graph OCR technology according to claim 1, characterized in that, Step 2), the steps for recognizing each text box using OCR technology include: Step 2.1) Crop the text box to get: ;(1) In the formula, , Images of the text box before and after cropping; For text boxes; Step 2.2) Use a convolutional network to extract features from the cropped text boxes to obtain: ;(2) In the formula, , Here, m and n are the weights and biases; m and n are the indices inside the convolution kernel. , Indexes for input and output channels; Features extracted; Step 2.3) Segment the order of the text in the extracted text boxes and use transform self-attention to extract features to obtain feature results at different time steps; Among them, self-attention mechanism As shown below: ;(3) In the formula, Q, K, and V represent the query, key, and value matrices, respectively; The dimension of the key matrix; Step 2.4) Calculate the probability of outputting a character at each time step, i.e.: ;(4) In the formula, , For weights and biases; The probability of outputting a character at each time step; The feature results of step 2.3); Step 2.5) Use Beam search to determine the top- Candidate set ,Right now: ;(5) In the formula, For the k-th candidate text content, Representative to The confidence interval.
4. The hotel order error correction and verification method based on hotel order domain knowledge graph OCR technology according to claim 1, characterized in that, In step 3), the top-K candidate set is processed through layout parsing and field clustering to construct the field candidate set. .
5. The hotel order error correction and verification method based on hotel order domain knowledge graph OCR technology according to claim 1, characterized in that, In step 3), the matching score is the keyword matching score between each text box and the field candidate vector, that is: ;(6) In the formula, For matching scores; b and f are the text box and field candidate vectors, respectively; , The text content identified by the text box and the keywords belonging to the field candidate vector f.
6. The hotel order error correction and verification method based on hotel order domain knowledge graph OCR technology according to claim 1, characterized in that, In step 3), the matching score is a BiLSTM-CRF score based on sequence labeling, i.e.: ;(7) in, It is the first Each token belongs to a tag. The model score, Let be the transition matrix. A sequence of text blocks in the document in the order they are read; A sequence of labels; BiLSTM-CRF scoring.
7. The hotel order error correction and verification method based on hotel order domain knowledge graph OCR technology according to claim 1, characterized in that, Step 4), which maps OCR candidate strings to the entity candidate set of the knowledge graph, includes the following steps: Step 4.1) Calculate the similarity between strings and the semantic similarity between vectors; Step 4.2) Obtain the candidate set using the Trigram index. and to The similarity of vectors is used for evaluation to obtain the top- Candidate vectors, i.e.: ;(8) In the formula, For top- Candidate vectors; s and c represent the recognition string and candidate entity, respectively.
8. The hotel order error correction and verification method based on hotel order domain knowledge graph OCR technology according to claim 7, characterized in that, String similarity As shown below: ; (9) In the formula, s and a represent different recognition strings; Indicates edit distance; similarity of vector semantics As shown below: ;(10) In the formula, c represents the candidate entity; A vector representation of a candidate entity.
9. A hotel order error correction and verification method based on hotel order domain knowledge graph OCR technology according to claim 1, characterized in that, Step 5) involves completing the missing field values, including: Step 5.1) Construct a context entity set, identify the high-confidence entity content in the document, and perform normalization processing, i.e.: ;(11) In the formula, , The original attention score and normalized attention weights are used for the context aggregation vector; Step 5.2) Perform attention-weighted summation on the context-aggregated vectors to obtain: ;(12) In the formula, Attention score calculated using a weighted summation method; Let i be the vector representation of entity i; Step 5.3) Calculate the semantic score of the knowledge graph, i.e.: ;(13) In the formula, The semantic score of the knowledge graph; A vector representation of a candidate entity; Step 5.4) Calculate the joint score ,Right now: ;(14) in, It is a physical entity Its alternative name , , , As weight; Step 5.5) If If the original text recognized by OCR is used as the final result, it is backtracked to the original OCR text; otherwise, the optimal candidate is output, i.e.: ;(15) In the formula, It is the optimal candidate.
10. A hotel order error correction and verification method based on hotel order domain knowledge graph OCR technology according to claim 1, characterized in that, After obtaining the top-K candidate set, manual sampling is also performed to re-validate the attention mechanism and ranking model; The loss function used during re-validation is as follows: ;(16) ;(17) In the formula, The loss function; , , These are the weighting coefficients; , , The losses are CTC loss, detection loss, and ranking loss. It is a positive candidate.