Purchase receipt auditing method and device, storage medium and electronic equipment

By using pre-trained procurement document recognition model and text recognition technology, the problems of traditional manual verification methods are solved, and efficient and reliable audit of procurement documents are achieved.

CN119540968APending Publication Date: 2025-02-28AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411769871.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-02-28

Smart Images

  • Figure CN119540968A_ABST
    Figure CN119540968A_ABST
Patent Text Reader

Abstract

The invention provides a procurement receipt auditing method and device, a storage medium and electronic equipment, and the method comprises the steps: recognizing to-be-processed procurement receipt data through a procurement receipt recognition model, and obtaining a recognition result of the procurement receipt data; under the condition that the identification result of the purchase document data represents that the purchase document is not forged data, performing text identification on the purchase document data to obtain text identification information; performing word segmentation on the text recognition information to obtain a plurality of words; establishing a corresponding relationship between each keyword and the text identification information, and generating an index file; when a query keyword is received, obtaining a target word matched with the query keyword in the index file; determining text recognition information having a corresponding relationship with the target word; and outputting the text identification information having the corresponding relationship with the target word, so that the auditing object audits the text identification information corresponding to the target word, and the auditing efficiency and reliability of the purchase document can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a purchase document review method, device, storage medium, and electronic device. Background Art

[0002] Ensuring the authenticity of purchase document data queried on online platforms is crucial in current financial transactions and registration processes. However, traditional manual verification methods are not only time-consuming and labor-intensive, but also difficult to accurately determine the authenticity of data visually, resulting in high error rates and risks. As the number of registration documents continues to grow, the timeliness of manual review has significantly decreased, and the reliability of the results cannot be guaranteed. Summary of the Invention

[0003] The technical problem to be solved by this application is to provide a purchase document review method, device, storage medium and electronic device that can improve the efficiency and reliability of purchase document review. The specific solution is as follows:

[0004] A purchase document review method, comprising:

[0005] Get the purchase document data to be processed;

[0006] Using a pre-trained purchase document recognition model to recognize the purchase document data, obtaining a recognition result of the purchase document data; the recognition result indicates whether the purchase document data is forged data;

[0007] If the recognition result of the purchase document data indicates that the purchase document is not forged data, performing text recognition on the purchase document data to obtain text recognition information of the purchase document data;

[0008] Segmenting the text recognition information of the purchase document data to obtain a plurality of words;

[0009] Establishing a correspondence between each of the words and the text recognition information, and writing the correspondence between each of the words and the text recognition information into a preset index file;

[0010] When receiving a query keyword input by the audit subject, obtaining a target word matching the query keyword in the index file;

[0011] Determining text recognition information corresponding to the target word;

[0012] The text recognition information corresponding to the target word is output, so that the audit object audits the text recognition information corresponding to the target word.

[0013] In the above method, optionally, the purchase document recognition model includes a variational autoencoder (VAE) network and a classifier, the output end of the VAE network is connected to the classifier, and the use of the pre-trained purchase document recognition model to recognize the purchase document data to obtain the recognition result of the purchase document data includes:

[0014] The purchase document data is input into a pre-trained purchase document recognition model, so that the VAE network reconstructs the purchase document data to generate a reconstructed image. The classifier is used to classify and recognize the purchase document data and the reconstructed image output by the VAE network to obtain the recognition result of the purchase document data.

[0015] In the above method, optionally, the purchase document recognition model further includes a gradient-based class activation map (Grad-CAM) network, and the output end of the encoder in the VAE network is connected to the Grad-CAM network. After obtaining the recognition result of the purchase document data, the method further includes:

[0016] In the case where the recognition result indicates that the purchase document data is forged data, the abnormal area of ​​the purchase document data is determined based on the attention map of the reconstructed image; the attention map of the reconstructed image is generated by the gradient-based class activation map Grad-CAM network.

[0017] In the above method, optionally, performing text recognition on the purchase document data to obtain text recognition information of the purchase document data includes:

[0018] Preprocessing the purchase document data to obtain a binary image;

[0019] Classifying pixels in the binary image to obtain pixel classification results for each pixel in the binary image; the pixel classification results include one of a handwritten type and a printed type;

[0020] For each pixel corresponding to the pixel classification result in the binary image, using the PP-OCRv3 model corresponding to the pixel classification result, identifying the pixel corresponding to the pixel classification result in the binary image;

[0021] Obtain text recognition information output by the PP-OCRv3 model corresponding to each of the pixel classification results.

[0022] In the above method, optionally, classifying the binary image to obtain the classification result of the binary image includes:

[0023] The binarized image is input into a pre-trained SegNext model to obtain a classification result of the binarized image.

[0024] A purchase document review device, comprising:

[0025] An acquisition unit, used to acquire purchase document data to be processed;

[0026] a first recognition unit, configured to recognize the purchase document data using a pre-trained purchase document recognition model to obtain a recognition result of the purchase document data; the recognition result indicates whether the purchase document data is forged data;

[0027] a second recognition unit configured to, if the recognition result of the purchase document data indicates that the purchase document is not forged data, perform text recognition on the purchase document data to obtain text recognition information of the purchase document data;

[0028] A word segmentation unit, configured to segment the text recognition information of the purchase document data to obtain a plurality of words;

[0029] an execution unit, configured to establish a correspondence between each of the words and the text recognition information, and write the correspondence between each of the words and the text recognition information into a preset index file;

[0030] A receiving unit, configured to, when receiving a query keyword input by an audit subject, obtain a target word matching the query keyword from the index file;

[0031] A first determining unit, configured to determine text recognition information corresponding to the target word;

[0032] The output unit is configured to output the text recognition information corresponding to the target word, so that the audit subject audits the text recognition information corresponding to the target word.

[0033] In the above-mentioned device, optionally, the purchase document recognition model includes a variational autoencoder (VAE) network and a classifier, the output end of the VAE network is connected to the classifier, and the first recognition unit includes:

[0034] The first recognition subunit is used to input the purchase document data into a pre-trained purchase document recognition model, so that the VAE network reconstructs the purchase document data and generates a reconstructed image. The classifier is used to classify and recognize the purchase document data and the reconstructed image output by the VAE network to obtain the recognition result of the purchase document data.

[0035] In the above-mentioned device, optionally, the purchase document recognition model further includes a gradient-based class activation map Grad-CAM network, and the output end of the encoder in the VAE network is connected to the Grad-CAM network; the device further includes:

[0036] The second determination unit is used to determine the abnormal area of ​​the purchase document data according to the attention map of the reconstructed image when the recognition result indicates that the purchase document data is forged data; the attention map of the reconstructed image is generated by the gradient-based class activation map Grad-CAM network.

[0037] A storage medium includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the purchase document review method as described above.

[0038] An electronic device includes a memory and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by one or more processors to perform the above-mentioned purchase document review method.

[0039] Based on the above-mentioned implementation of the present application, a purchase document audit method, device, storage medium and electronic device are provided, the method comprising: obtaining purchase document data to be processed; using a pre-trained purchase document recognition model to identify the purchase document data to obtain a recognition result of the purchase document data; the recognition result indicates whether the purchase document data is forged data; if the recognition result of the purchase document data indicates that the purchase document is not forged data, performing text recognition on the purchase document data to obtain text recognition information of the purchase document data; performing word segmentation on the text recognition information of the purchase document data to obtain multiple words; establishing a corresponding relationship between each word and the text recognition information, and writing the corresponding relationship between each word and the text recognition information into a preset index file; when receiving a query keyword input by an audit object, obtaining a target word matching the query keyword in the index file; determining text recognition information that has a corresponding relationship with the target word; outputting text recognition information that has a corresponding relationship with the target word, so that the audit object audits the text recognition information that has a corresponding relationship with the target word. The method provided by the embodiment of the present application can improve the audit efficiency and reliability of purchase documents. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.

[0041] Figure 1 A flowchart of a purchase document review method provided for this application;

[0042] Figure 2 A schematic diagram of the structure of a purchase document recognition model provided for this application;

[0043] Figure 3 A flowchart of a process for obtaining text recognition information of purchase document data provided by this application;

[0044] Figure 4 A schematic diagram of the structure of a multi-scale convolutional attention mechanism provided for this application;

[0045] Figure 5 An example diagram of a data architecture provided for this application;

[0046] Figure 6 An example diagram of the architecture of a retrieval system provided in this application;

[0047] Figure 7 A schematic diagram of the structure of a purchase document review device provided in this application;

[0048] Figure 8 This is a schematic diagram of the structure of an electronic device provided in this application. DETAILED DESCRIPTION

[0049] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0050] In this application, the terms "comprises," "comprising," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.

[0051] The embodiment of the present application provides a method for reviewing purchase documents. The method can be applied to electronic devices, which may include one or more of a controller, a server, a personal computer, a tablet, a mobile phone, etc. The method flow chart of the method is as follows: Figure 1 As shown, specifically including:

[0052] S101: Obtain purchase document data to be processed.

[0053] In this embodiment, the purchase document data registered by the successful bidder during financing can be obtained from the network platform of the target organization, which can be a government organization.

[0054] Optionally, the purchase document data may include an electronic copy of the winning bid document, and the winning bid document may include at least one of a winning bid announcement and a winning bid contract.

[0055] Optionally, there can be multiple purchase document data.

[0056] S102: Using a pre-trained purchase document recognition model to recognize the purchase document data, and obtaining a recognition result of the purchase document data; the recognition result indicates whether the purchase document data is forged data.

[0057] In this embodiment, the purchase document recognition model may include a CAVGA model.

[0058] Optionally, when the identification result indicates that the purchase document data is forged data, a first warning message may be output.

[0059] S103: When the recognition result of the purchase document data indicates that the purchase document is not forged data, perform text recognition on the purchase document data to obtain text recognition information of the purchase document data.

[0060] In this embodiment, the PP-OCRv3 model may be used to perform text recognition on the purchase document data to obtain text recognition information of the purchase document data.

[0061] Optionally, after obtaining the text recognition information of the purchase document data, the text recognition information of the purchase document may be stored in a preset database, which may be a MongoDB database.

[0062] S104: Segment the text recognition information of the purchase document data to obtain a plurality of words.

[0063] In this embodiment, the text recognition information stored in the database can be synchronized to the Elasticsearch engine, so that the text recognition information of the purchase document data can be segmented by the Elasticsearch engine to obtain multiple words.

[0064] S105: establishing a correspondence between each of the words and the text recognition information, and writing the correspondence between each of the words and the text recognition information into a preset index file.

[0065] In this embodiment, the text recognition information can be treated as a document and a document identifier generated, where a document is a basic unit of information that can be indexed. A correspondence is established between each word and the document identifier of the document to which the text recognition information belongs, i.e., a postings list is created to record the document ID and location information of each word. The postings list is then written into an index file to generate an index structure readable by search engines.

[0066] S106: When receiving a query keyword input by the audit subject, obtaining a target word matching the query keyword from the index file.

[0067] In this embodiment, the query keywords may include the winning bid announcement number, the winning bid contract number, the government procurement document number, the company name, etc.

[0068] Optionally, the length of the query keyword does not exceed a preset word segmentation granularity. For example, the length of the query keyword may be 2 to 50 characters.

[0069] S107: Determine text recognition information corresponding to the target word.

[0070] In this embodiment, the text recognition information corresponding to the target word may include one or more pieces of text recognition information.

[0071] S108: Outputting text recognition information corresponding to the target word, so that the audit subject audits the text recognition information corresponding to the target word.

[0072] In some embodiments, query keywords are obtained, such as the winning contract number, the names of Party A and Party B of the winning contract, etc., and the query keywords are input into the Elasticsearch index library for query. Elasticsearch returns matching results, and the proportion of documents matching the query keywords is determined based on the matching results. When the document proportion is greater than a preset proportion threshold, a second warning message is output to indicate the existence of duplicate purchase document data.

[0073] The application of the method provided in the embodiments of the present application can improve the efficiency and reliability of the review of purchase documents.

[0074] In one embodiment provided in the present application, based on the above solution, optionally, the purchase document recognition model includes a variational autoencoder (VAE) network and a classifier, and the output end of the VAE network is connected to the classifier. The use of the pre-trained purchase document recognition model to recognize the purchase document data to obtain the recognition result of the purchase document data includes:

[0075] The purchase document data is input into a pre-trained purchase document recognition model, so that the VAE network reconstructs the purchase document data to generate a reconstructed image. The classifier is used to classify and recognize the purchase document data and the reconstructed image output by the VAE network to obtain the recognition result of the purchase document data.

[0076] In one embodiment provided in the present application, based on the above solution, optionally, the purchase document recognition model further includes a gradient-based class activation map Grad-CAM network, and the output end of the encoder in the VAE network is connected to the Grad-CAM network; after obtaining the recognition result of the purchase document data, the following is further included:

[0077] In the case where the recognition result indicates that the purchase document data is forged data, the abnormal area of ​​the purchase document data is determined based on the attention map of the reconstructed image; the attention map of the reconstructed image is generated by the gradient-based class activation map Grad-CAM network.

[0078] In this embodiment, the structural diagram of the purchase document recognition model is as follows: Figure 2 As shown, the VAE network includes an encoder and a decoder.

[0079] In this embodiment, a purchase document data sample set is obtained; wherein, the purchase document data sample set includes multiple purchase document data samples; a pre-built machine learning model is trained based on the purchase document data sample set to generate a purchase document recognition model; wherein, the pre-built machine learning model includes a VAE network and a classifier, and the output end of the VAE network is connected to the classifier.

[0080] Optionally, the VAE network includes an encoder and a decoder, and the pre-built machine learning model also includes a Grad-CAM network, and the input end of the decoder in the VAE network is connected to the Grad-CAM network; the pre-built machine learning model is trained based on the purchase document data sample set to generate a purchase document recognition model, including: iteratively training the pre-built machine learning model based on the purchase document data sample set through a target loss function until the pre-built machine learning model converges to generate a purchase document recognition model.

[0081] In an embodiment provided by the present application, based on the above solution, optionally, the process of performing text recognition on the purchase document data to obtain text recognition information of the purchase document data is as follows: Figure 3 As shown, specifically including:

[0082] S301: Preprocess the purchase document data to obtain a binary image.

[0083] In this embodiment, the government procurement document data can be subjected to image brightness equalization. If the image of the government procurement document data is tilted, the image can be corrected. The corrected government procurement document data is then binarized to form a binary image. After the binarization of the government procurement document data, the binarized image can also be subjected to denoising to reduce the reduction in recognition accuracy caused by image quality issues.

[0084] S302: Classify the pixels in the binary image to obtain a pixel classification result of each pixel in the binary image; the pixel classification result includes one of a handwritten type and a printed type.

[0085] In this example, the government procurement document data obtained from the online platform contains not only standard printed text but also some handwritten text, such as information about the parties A and B in the trade contract and the contract signing date. In images containing both printed and handwritten text, OCR recognition of handwritten text is not as effective as that of printed text in practice. To address this issue, this solution proposes to separately recognize handwritten and non-handwritten text within the document, processing the handwritten and non-handwritten portions separately.

[0086] In an embodiment provided in the present application, based on the above solution, optionally, classifying the binary image to obtain a classification result of the binary image includes:

[0087] The binarized image is input into a pre-trained SegNext model to obtain a classification result of the binarized image.

[0088] Optionally, the binarized image is used as an input sample, and handwriting, printed text, and background are classified at the pixel level. The resulting image is used as the output sample of the deep learning model.

[0089] In this embodiment, the SegNext model is used for semantic segmentation. The SegNext model designs a simple multi-scale convolutional attention mechanism (MSCA). Figure 4 The schematic diagram of the MSCA architecture is shown. MSCA utilizes large convolution kernel decomposition, a multi-branch parallel architecture, and an attention mechanism to achieve beneficial properties such as a large receptive field, multi-scale information, and adaptability, which are beneficial for handwritten and printed text segmentation.

[0090] S303: For each pixel corresponding to the pixel classification result in the binary image, the pixel corresponding to the pixel classification result in the binary image is identified using the PP-OCRv3 model corresponding to the pixel classification result.

[0091] In this embodiment, the PP-OCRv3 model corresponding to the handwriting type can be used to identify the pixel portion of the handwriting type in the binary image to obtain first text recognition information; the PP-OCRv3 model corresponding to the printed type can be used to identify the pixel portion of the printed type in the binary image to obtain second text recognition information; the first text recognition information and the second text recognition information constitute the text recognition information of the purchase document data.

[0092] In this example, PP-OCRv3 uses a large receptive field PAN module, LK-PAN, which makes it easier to detect text in large fonts and text with special fonts. The DML distillation strategy, in which two models with the same structure learn from each other, effectively improves the accuracy of the text detection model.

[0093] S304: Obtain text recognition information output by the PP-OCRv3 model corresponding to each of the pixel classification results.

[0094] In this example, the PP-OCRv3 model is used to identify all text within the image after separating printed and handwritten text. The recognized text is stored to prepare for Elasticsearch to process the file. Elasticsearch has certain restrictions on the data schema when storing data; once the data schema is set, it cannot be easily changed. Therefore, this article uses MongoDB to store the parsed text. As a database based on distributed file storage, MongoDB's schema lies between relational databases and non-relational data, making it suitable for storing file data.

[0095] The following is an example of the government procurement document verification process:

[0096] Step 1: Obtain government procurement document registration data. In this embodiment, the movable property financing registration data query interface of the preset network platform can be called to obtain the electronic copy of the winning announcement or winning contract registered by the winning enterprise when financing.

[0097] Optionally, obtain all of the client's registration documents from the online platform, including multiple registration certification documents and associated files attached to each registration certification document. The obtained online platform certification registration document format can be a PDF file, and the associated files can be PDF files or images.

[0098] Step 2: Verify the authenticity of government procurement document data. In this embodiment, the CAVGA model can be used to verify the authenticity of government procurement document data obtained from the network platform query interface, and issue an early warning for problematic government procurement document data.

[0099] Step 3: Perform text recognition on government procurement document data. In this embodiment, after the authenticity of the government procurement document data is verified, the text in the winning bid document is extracted using improved OCR recognition technology (PP-OCRv3 model) and persistently stored in an auxiliary duplicate checking database (hereinafter referred to as the auxiliary database).

[0100] Step 4: Create an Elasticsearch index. In this embodiment, in order to speed up query efficiency, this solution uses Elasticsearch to create an index library, and processes the identified winning bid information into a file that can be directly indexed, so that similar text can be quickly located when checking for duplicates.

[0101] (5) Checking and verifying the duplicate data of government procurement documents. In this embodiment, the key elements for checking duplicate data of government procurement documents defined by the system, such as the winning contract number, the names of the parties A and B of the winning contract, etc., can be obtained. The key elements are input into the Elasticsearch index library for query. Elasticsearch returns the matching results, and the system is warned based on the matching key element ratio.

[0102] In this embodiment, the process of training the CAVGA model can be as follows:

[0103] 1) Dataset Preparation: In this embodiment, files obtained from the network platform can be collected into an image sample library.

[0104] 2) Use the encoder part of VAE to extract and process the high-dimensional features of the image, then send the extracted high-dimensional features to the decoder part of VAE to regenerate the two-dimensional image, and use the classifier to classify and identify the input samples and the reconstructed samples.

[0105] 3) The intermediate feature vectors in the VAE network (the high-dimensional features mentioned above) are used as input to Grad-CAM to obtain the attention map of the image to mark the abnormal areas of the image.

[0106] In this embodiment, CAVGA uses the network platform registration file as the original image sample x, inputs x into the encoder, obtains the code z, and reconstructs the code into sample x^ through the decoder. The function used by the VAE model is as follows:

[0107]

[0108] Where x is the input image, KL is the relative entropy, It can represent the approximate probability distribution of z given x conditions, represents the approximate probability distribution of z given x, where z represents the hidden variable, is the cross loss entropy. In order to enhance the clarity of the images generated by the VAE decoder, the model sets a classifier (Discriminator). When training the entire classifier, the loss function used is as follows:

[0109]

[0110] Where N is the total number of samples, It can represent the classifier's response to the input image Given the probability estimate, ) can represent the data samples generated by the classifier Probability estimates are given.

[0111] In addition to detecting anomalies in images, this paper also focuses on spatially localizing anomalies within them. Most models use a thresholded pixel-by-pixel difference between the reconstructed and original images to locate anomalies. This threshold is determined by using anomalous training images. However, in real-world sample libraries, truly anomaly data is often rare, making this threshold-based anomaly location approach impractical. The CAVGA model, on the other hand, localizes anomalies using an attention map generated through an end-to-end training process, without requiring any anomalous images for model training.

[0112] By passing the intermediate features of the trained VAE model through Grad-CAM, the system obtains the attention map A. In order to better distinguish the pixel values ​​in the attention map during training, this solution uses the sigmoid function to map each pixel value in the attention map to between 0 and 1.

[0113] Since Grad-CAM relies on the activation function characteristics of neural networks, it focuses more on local image distribution. However, the scenario studied in this paper focuses on unsupervised learning. Therefore, a loss function is added to spread the attention map to the entire image. The attention expansion loss formula for each image is as follows:

[0114]

[0115] Among them, A can be the attention matrix, It can represent the degree of attention the model pays to the relationship between the i-th position and the j-th position in the input data.

[0116] Final attention expansion loss It is N images The average value of . We form the final target loss function below :

[0117]

[0118] in, represents the target loss function, L represents the loss function of the VAE network, represents the loss function of the classifier, represents the loss function of the Grad-CAM network, 、 and These are all preset constants.

[0119] At this point, the model for document authenticity warning has been completed. The classifier is used to detect and determine the winning documents that may have been registered repeatedly. If there is a possibility of tampering, an early warning is issued, and the attention map is used to identify the parts that may have been tampered with, prompting the user to deal with it, otherwise proceed to the next step.

[0120] MongoDB generally uses the JSON data format to store data. This solution uses the key values ​​in the JSON format string to include the winning contract name, winning contract number, winning company name, government, document body after OCR recognition, and signing date. The JSON format example is as follows:

[0121] {

[0122] "Winning Contract Name": "XXX",

[0123] "Successful Bid Contract Number": "XXX",

[0124] "Name of the winning company": "XXX",

[0125] "Government": "XXX",

[0126] "Full text of contract": "XXX",

[0127] "Signing Date": "XXX"

[0128] }

[0129] In this embodiment, data can be synchronized to Elasticsearch, and then indexes are created and query optimization is performed. The specific process is as follows:

[0130] (1) Data synchronization.

[0131] In this embodiment, Elasticsearch is a Lucene-based search server. After MongoDB stores the text recognition information obtained by OCR, the system needs to synchronize the data with Elasticsearch to create an index for the data. This embodiment implements the MongoDB and Elasticsearch data synchronization function by installing the prenatal examination mongo-connector tool.

[0132] (2) Index creation.

[0133] In this embodiment, an Elasticsearch index can refer to a collection of interrelated documents. A document is a basic unit of information that can be indexed. Elasticsearch uses an inverted index, which uses words in the document content as the index and the document ID containing the word as the record. The document ID can be automatically generated by Elasticsearch.

[0134] The process of creating an index is as follows:

[0135] 1. Segment all data into words.

[0136] 2. Establish the corresponding relationship between words and corresponding documents, as follows:

[0137] PUT xxEnterprise{

[0138] "mappings":{

[0139] "properties":{

[0140] "Pledgeid":{

[0141] “type”:“text”

[0142] },

[0143] "invoiceid":{

[0144] “type”:“text”

[0145] }, ...

[0147] }

[0148] }

[0149] }

[0150] In some embodiments, the word segmentation granularity can be controlled. Specifically, a Length Token Filter can be used to configure an Analyzer when building an index to limit the search term length to 2 to 50 (the maximum length allowed for company names) to provide a better search experience. The implementation method for controlling the word segmentation strength is as follows:

[0151] PUT length_control

[0152] {

[0153] "settings":{

[0154] "analysis":{

[0155] "analyzer":{

[0156] "whitespace_length_2_to_50_char":{

[0157] "tokenizer":"whitespace",

[0158] "filter":"length_2_to_50_char"

[0159] }

[0160] },

[0161] "filter":{

[0162] "length_2_to_50_char":{

[0163] “type”:”length”,

[0164] "min":2,

[0165] "max":10

[0166] }

[0167] }

[0168] }

[0169] }

[0170] In some embodiments, homophones can be added. Specifically, homophone configuration can be added during index design to avoid the problem of misspelling Chinese pinyin. For example, when checking for duplicates on an online platform, the most frequently used keyword is the customer's company name. The search term is usually: a certain company. If "gongsi" is entered, it will not match. In the TokenFilters module, the index segmentation of the full spelling corresponding to the Chinese character can be added to better hit the user's search content. The specific implementation is as follows:

[0171] PUT quanpin_control

[0172] {

[0173] "settings":{

[0174] "analysis":{

[0175] "analyzer":{

[0176] "chinese_full_name_analyzer":{

[0177] "tokenizer":"whitespace",

[0178] "filter":"full_pinyin_filter"

[0179] }

[0180] },

[0181] "filter":{

[0182] "full_pinyin_filter":{

[0183] “type”:”pinyin”,

[0184] “keep_full_pinyin”:true

[0185] }

[0186] }

[0187] }

[0188] }

[0189] In some embodiments, the query can be optimized; in this embodiment, the relevance scoring rule is used for sorting. The calculation formula is as follows:

[0190]

[0191] Among them, qi refers to the search term, IDF( ) is the inverse document frequency, fieldlen / avgfieldlen is the quotient of the search term field length and the average document length, b controls the impact of this quotient on the score, and f( ,D) Count the number of times a word appears in a document. The more times a word appears, the higher the score. To set parameters.

[0192] In this embodiment, when users use company names to check for duplicates, they can first return data with the company name as the index name, and then return data for each document in the index that contains the company name. This is achieved by adjusting the parameters fieldlen / avgfieldlen in the formula, which better meets user expectations.

[0193] This solution creates an index for each company based on the characteristics of the registration materials on the online platform, further narrowing the search scope. Each document included in the index is a JSON data item retrieved from the MongoDB database based on the company name. Figure 5 The data architecture of Elasticsearch full-text retrieval is given, and all full-text retrieval-related business data is deployed on the full-text retrieval application server.

[0194] This embodiment uses the end-of-day batch procedure, and the system automatically processes, such as Figure 6 As shown, the retrieval system automatically completes pre-processing operations such as document acquisition, OCR recognition, and Elasticsearch processing. In actual business operations, the system only needs to pre-process newly added certification documents on the network platform. This pre-processing of batches and real-time processing of newly added registration certification documents reduces system resource consumption while ensuring business accuracy and timeliness.

[0195] In this embodiment, the purchase document data can be checked for duplicates. Specifically, the auditor can input the query conditions, and the system can automatically complete the debt verification in real time through the search function. The system first obtains the file from the network platform registration file acquisition interface, and then compares the obtained file with the data currently stored in MongoDB to determine whether the data has been updated. If there is an update, the file that needs to be updated will be identified and stored, and synchronized to Elasticsearch to update the index. If the data has not been updated, directly call Elasticsearch for retrieval. Elasticsearch obtains the input query conditions, and performs word segmentation on the query conditions. With the help of the inverted index, it quickly queries whether there is file content that meets the query conditions and returns it.

[0196] and Figure 1 Corresponding to the method described above, the embodiment of the present application also provides a purchase document review device for Figure 1 The specific implementation of the method is shown in the following diagram: Figure 7 As shown, specifically including:

[0197] An acquisition unit 701 is used to acquire purchase document data to be processed;

[0198] The first recognition unit 702 is configured to recognize the purchase document data using a pre-trained purchase document recognition model to obtain a recognition result of the purchase document data; the recognition result indicates whether the purchase document data is forged data;

[0199] The second recognition unit 703 is configured to perform text recognition on the purchase document data to obtain text recognition information of the purchase document data if the recognition result of the purchase document data indicates that the purchase document is not forged data;

[0200] A word segmentation unit 704 is used to segment the text recognition information of the purchase document data to obtain multiple words;

[0201] An execution unit 705 is configured to establish a correspondence between each keyword and the text recognition information, and write the correspondence between each keyword and the text recognition information into a preset index file;

[0202] The receiving unit 706 is configured to, when receiving a query keyword input by the audit subject, obtain a target word matching the query keyword in the index file;

[0203] A first determining unit 707 is configured to determine text recognition information corresponding to the target word;

[0204] The output unit 708 is configured to output the text recognition information corresponding to the target word, so that the audit subject can audit the text recognition information corresponding to the target word.

[0205] In one embodiment provided in the present application, based on the above solution, optionally, the purchase document recognition model includes a variational autoencoder (VAE) network and a classifier, the output end of the VAE network is connected to the classifier, and the first recognition unit includes:

[0206] The first recognition subunit is used to input the purchase document data into a pre-trained purchase document recognition model, so that the VAE network reconstructs the purchase document data and generates a reconstructed image. The classifier is used to classify and recognize the purchase document data and the reconstructed image output by the VAE network to obtain the recognition result of the purchase document data.

[0207] In one embodiment provided in the present application, based on the above solution, optionally, the purchase document recognition model further includes a gradient-based class activation map Grad-CAM network, and the output end of the encoder in the VAE network is connected to the Grad-CAM network; the apparatus further includes:

[0208] The second determination unit is used to determine the abnormal area of ​​the purchase document data based on the attention map of the reconstructed image when the recognition result indicates that the purchase document data is forged data; the attention map of the reconstructed image is generated by the gradient-based class activation map Grad-CAM network.

[0209] The specific principles and execution processes of each unit and module in the procurement document review device disclosed in the above-mentioned embodiment of the present application are the same as the procurement document review method disclosed in the above-mentioned embodiment of the present application. Please refer to the corresponding parts of the procurement document review method provided in the above-mentioned embodiment of the present application, and no further details will be given here.

[0210] An embodiment of the present application further provides a storage medium, which includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the above-mentioned purchase document review method.

[0211] The present application also provides an electronic device, the structure of which is shown in FIG. Figure 8 As shown, the system specifically includes a memory 801 and one or more instructions 802, wherein the one or more instructions 802 are stored in the memory 801 and are configured to be executed by one or more processors 803 to perform the following operations:

[0212] Get the purchase document data to be processed;

[0213] Using a pre-trained purchase document recognition model to recognize the purchase document data, obtaining a recognition result of the purchase document data; the recognition result indicates whether the purchase document data is forged data;

[0214] If the recognition result of the purchase document data indicates that the purchase document is not forged data, performing text recognition on the purchase document data to obtain text recognition information of the purchase document data;

[0215] Segmenting the text recognition information of the purchase document data to obtain a plurality of words;

[0216] Establishing a correspondence between each of the words and the text recognition information, and writing the correspondence between each of the words and the text recognition information into a preset index file;

[0217] When receiving a query keyword input by the audit subject, obtaining a target word matching the query keyword in the index file;

[0218] Determining text recognition information corresponding to the target word;

[0219] The text recognition information corresponding to the target word is output, so that the audit object audits the text recognition information corresponding to the target word.

[0220] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similarities between the various embodiments can be referred to in conjunction with each other. For device embodiments, since they are generally similar to method embodiments, their description is relatively simple, and for relevant details, reference can be made to the description of the method embodiments.

[0221] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations.

[0222] For the convenience of description, the above devices are described as being divided into various units according to their functions. Of course, when implementing this application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0223] Through the description of the above embodiments, it can be seen that those skilled in the art can clearly understand that the present application can be implemented by means of software plus the necessary general hardware platform. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments of the present application or certain parts of the embodiments.

[0224] The above is a detailed introduction to a procurement document review method provided by this application. Specific examples are used in this article to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method of this application and its core idea; at the same time, for general technical personnel in this field, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on this application.

Claims

1. A purchasing document review method, characterized in that: include: Get the purchase document data to be processed; Using a pre-trained purchase document recognition model to recognize the purchase document data, and obtaining a recognition result of the purchase document data; The identification result indicates whether the purchase document data is forged data; If the recognition result of the purchase document data indicates that the purchase document is not forged data, performing text recognition on the purchase document data to obtain text recognition information of the purchase document data; Segmenting the text recognition information of the purchase document data to obtain a plurality of words; Establishing a correspondence between each of the words and the text recognition information, and writing the correspondence between each of the words and the text recognition information into a preset index file; When receiving a query keyword input by the audit object, obtaining a target word matching the query keyword in the index file; Determining text recognition information that corresponds to the target word; The text recognition information corresponding to the target word is outputted, so that the audit object audits the text recognition information corresponding to the target word.

2. The method according to claim 1, characterized in that The purchase document recognition model includes a variational autoencoder VAE network and a classifier, the output end of the VAE network is connected to the classifier, and the purchase document data is recognized by using the pre-trained purchase document recognition model to obtain the recognition result of the purchase document data, including: The purchase document data is input into a pre-trained purchase document recognition model so that the VAE network reconstructs the purchase document data to generate a reconstructed image. The classifier is used to classify and recognize the purchase document data and the reconstructed image output by the VAE network to obtain the recognition result of the purchase document data.

3. The method according to claim 2, characterized in that The purchase document recognition model also includes a gradient-based class activation map Grad-CAM network, and the output end of the encoder in the VAE network is connected to the Grad-CAM network; After obtaining the identification result of the purchase document data, the method further includes: In the case where the recognition result indicates that the purchase document data is forged data, the abnormal area of ​​the purchase document data is determined according to the attention map of the reconstructed image; the attention map of the reconstructed image is generated by the gradient-based class activation map Grad-CAM network.

4. The method according to claim 1, characterized in that: The performing text recognition on the purchase document data to obtain text recognition information of the purchase document data includes: Preprocessing the purchase document data to obtain a binary image; Classifying pixels in the binary image to obtain pixel classification results of each pixel of the binary image; the pixel classification results include one of a handwritten type and a printed type; For each pixel corresponding to the pixel classification result in the binary image, using the PP-OCRv3 model corresponding to the pixel classification result, identifying the pixel corresponding to the pixel classification result in the binary image; The text recognition information output by the PP-OCRv3 model corresponding to each of the pixel classification results is obtained.

5. The method according to claim 4, characterized in that The step of classifying the binary image to obtain a classification result of the binary image includes: The binary image is input into a pre-trained SegNext model to obtain a classification result of the binary image.

6. A purchasing document review device, characterized in that: include: An acquisition unit, used to acquire purchase document data to be processed; A first recognition unit, configured to recognize the purchase document data using a pre-trained purchase document recognition model to obtain a recognition result of the purchase document data; The identification result indicates whether the purchase document data is forged data; A second recognition unit is used to perform text recognition on the purchase document data to obtain text recognition information of the purchase document data when the recognition result of the purchase document data indicates that the purchase document is not forged data; A word segmentation unit, used to segment the text recognition information of the purchase document data to obtain a plurality of words; An execution unit, used for establishing a correspondence between each of the words and the text recognition information, and writing the correspondence between each of the words and the text recognition information into a preset index file; A receiving unit, configured to, when receiving a query keyword input by the audit object, obtain a target word matching the query keyword in the index file; A first determining unit, configured to determine text recognition information corresponding to the target word; The output unit is used to output the text recognition information corresponding to the target word, so that the audit object audits the text recognition information corresponding to the target word.

7. The device according to claim 6, characterized in that The purchase document recognition model includes a variational autoencoder VAE network and a classifier, the output end of the VAE network is connected to the classifier, and the first recognition unit includes: The first recognition subunit is used to input the purchase document data into a pre-trained purchase document recognition model so that the VAE network reconstructs the purchase document data and generates a reconstructed image. The classifier is used to classify and recognize the purchase document data and the reconstructed image output by the VAE network to obtain a recognition result of the purchase document data.

8. The device according to claim 7, characterized in that The purchase document recognition model also includes a gradient-based class activation map Grad-CAM network, and the output end of the encoder in the VAE network is connected to the Grad-CAM network; the device also includes: A second determination unit is used to determine the abnormal area of ​​the purchase document data according to the attention map of the reconstructed image when the recognition result indicates that the purchase document data is forged data; the attention map of the reconstructed image is generated by the gradient-based class activation map Grad-CAM network.

9. A storage medium, characterized in that: The storage medium includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the purchase document review method according to any one of claims 1 to 5.

10. An electronic device, characterized in that: It comprises a memory and one or more instructions, wherein the one or more instructions are stored in the memory and are configured to be executed by one or more processors to perform the procurement document review method as described in any one of claims 1 to 5.