Method and device for training classification model of ia combining rpa and ai

By obtaining the position coordinates of words on sample pages and using pre-trained document understanding models to obtain encoding vectors, the problems of large training data volume and long training time of document classification models are solved, and fast and accurate document classification is achieved.

CN115578739BActive Publication Date: 2026-02-13SHANGHAI LAIYEBOT NETWORK TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211125956.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-16
Publication Date
2026-02-13
Estimated Expiration
2042-09-16

AI Technical Summary

Technical Problem

Existing technologies for document classification require a large amount of training data and take a long time to train, making it difficult to achieve rapid training while ensuring accuracy.

Method used

By obtaining the position coordinates of words in the sample page and inputting them into a pre-trained document understanding model to obtain encoding vectors, and combining them with the category, the initial classification model is trained to obtain the target classification model for document classification.

Benefits of technology

It enables rapid training of classification models with limited training data, improving training speed and reducing data requirements while maintaining the accuracy of the classification model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115578739B_ABST
    Figure CN115578739B_ABST
Patent Text Reader

Abstract

The application relates to a training method and device of a classification model combining RPA and AI to realize IA, wherein the training method comprises the following steps: acquiring position coordinates of at least one word included in each sample page and a category to which each sample page belongs; inputting the position coordinates of each word into a pre-trained document understanding model to acquire corresponding encoding vectors; acquiring an encoding vector corresponding to each sample page based on the encoding vectors corresponding to each word in each sample page; and taking the encoding vector corresponding to each sample page and the category thereof as training data to train an initial classification model to obtain a target classification model used for document classification. The training speed of the classification model is improved, and the amount of data required in the training process is reduced. The application further provides a document classification method combining RPA and AI to realize IA, which classifies target documents sent by an RPA robot by using the target classification model, reduces the manual cost required for document classification, and improves the efficiency of document classification.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of robot process automation and artificial intelligence, in particular to a training method and device of a classification model combining RPA and AI to realize IA. BACKGROUND

[0002] Robotic Process Automation (RPA) is to simulate human operation on a computer through specific "robot software" and automatically execute process tasks according to rules.

[0003] Artificial Intelligence (AI) is a technical science studying and developing a theory, method, technology and application system for simulating, extending and expanding human intelligence.

[0004] Intelligent Automation (IA) is a general term of a series of technologies from RPA to AI, which combines RPA with Optical Character Recognition (OCR), Intelligent Character Recognition (ICR), Process Mining, Deep Learning (DL), Machine Learning (ML), Natural Language Processing (NLP), Automatic Speech Recognition (ASR), Text To Speech (TTS), Computer Vision (CV) and other AI technologies to create an end-to-end business process capable of thinking, learning and self-adapting, covering the whole process from process discovery, process automation to the management and optimization of business processes through automatic and continuous data collection, understanding the meaning of data and using data.

[0005] In a business scenario of intelligent document processing, a complex business process can involve processing several categories of documents, and different categories of documents need to call different information extraction models for information extraction, and then perform subsequent business processing based on the extracted key information, such as information input, bill reimbursement, etc. For example, when an RPA robot is used to automatically process an email sent by a customer A to a supplier B to order products, the email attachment can contain documents such as contracts and invoices, and the RPA robot needs to call a contract extraction model to extract information from the contract document, call a general multi-invoice model to extract information from the invoice document, and then perform subsequent processing based on the extracted information. This requires first using a classification model to classify the documents, then calling the information extraction model of the corresponding category to extract information from the documents, and then implementing further business processing. However, how to quickly train the classification model with less training data while ensuring the accuracy of the classification model has become a problem to be solved. SUMMARY

[0006] The present application provides a training method and device for a classification model combining RPA and AI to implement IA, to solve the technical problem of long training time of the classification model and the need to use a large amount of training data for training in the model training method for document classification in the related art.

[0007] The first aspect of the present application provides a training method for a classification model combining RPA and AI to implement IA, which comprises: obtaining the position coordinates of at least one word included in each sample page in a plurality of sample pages, and obtaining the category to which each sample page belongs; inputting the position coordinates of each word in each sample page into a pre-trained document understanding model to obtain the encoding vector corresponding to each word in each sample page; obtaining the encoding vector corresponding to each sample page based on the encoding vector corresponding to each word in each sample page; and taking the encoding vector corresponding to each sample page and the category to which it belongs as training data to train an initial classification model to obtain a target classification model for document classification.

[0008] In some embodiments, taking the encoding vector corresponding to each sample page and the category to which it belongs as training data to train an initial classification model to obtain a target classification model for document classification comprises: dividing the training data into a training set and a validation set, the training set including the encoding vectors corresponding to a plurality of first pages, and the validation set including the encoding vectors corresponding to a plurality of second pages, each first page and each second page being labeled with the category to which it belongs; performing multiple rounds of training on the initial classification model based on the encoding vectors corresponding to each first page and the category to which it belongs to obtain a candidate classification model after each round of training; and selecting a target classification model for document classification from the candidate classification models after each round of training based on the encoding vectors corresponding to each second page and the category to which it belongs.

[0009] In some embodiments, based on the encoding vectors corresponding to each second page and the category to which each second page belongs, a target classification model for document classification is selected from the candidate classification models after each round of training, including: for each candidate classification model after each round of training, inputting the encoding vectors corresponding to each second page into the candidate classification model to obtain the confidence of each second page belonging to the plurality of preset categories predicted by the candidate classification model, and based on the confidence of each second page belonging to the plurality of preset categories and the category to which each second page belongs, determining the loss value corresponding to the candidate classification model; based on the loss values corresponding to the candidate classification models after each round of training, selecting a target classification model for document classification from the candidate classification models after each round of training.

[0010] In some embodiments, obtaining the position coordinates of at least one word included in each sample page in the plurality of sample pages includes: obtaining a plurality of sample documents sent by an RPA robot; for each sample page, obtaining optical character recognition (OCR) recognition information of the sample page; based on the OCR recognition information of the sample page, obtaining text content of at least one text segment in the sample page; performing word segmentation on the text content of each text segment to obtain at least one word included in each text segment; obtaining position coordinates of a region occupied by each text segment; and based on the position coordinates of the region occupied by each text segment and the position of each word in the corresponding text segment, obtaining the position coordinates of each word.

[0011] The training method of the classification model for implementing IA by combining RPA and AI provided by the embodiments of the present application includes: obtaining the position coordinates of at least one word included in each sample page in the plurality of sample pages and the category to which each sample page belongs; inputting the position coordinates of each word in each sample page into a pre-trained document understanding model to obtain an encoding vector corresponding to each word in each sample page; based on the encoding vectors corresponding to each word in each sample page, obtaining an encoding vector corresponding to each sample page; and taking the encoding vector corresponding to each sample page and the category to which each sample page belongs as training data to train an initial classification model to obtain a target classification model for document classification. Thus, the training of the classification model for document classification is implemented, the training speed of the classification model is improved, and the amount of data required in the training process is reduced.

[0012] The second aspect embodiment of the application provides a document classification method combining RPA and AI to realize IA, which comprises the following steps: obtaining a target document sent by an RPA robot, the target document comprising at least one target page; obtaining the position coordinates of at least one word included in each target page; inputting the position coordinates of each word in each target page into a pre-trained document understanding model to obtain the encoding vectors corresponding to each word in each target page; obtaining the encoding vectors corresponding to each target page based on the encoding vectors corresponding to each word in each target page; inputting the encoding vectors corresponding to each target page into a target classification model to obtain the confidence of each target page belonging to a plurality of preset categories; wherein the target classification model is obtained by training the method of the first aspect embodiment; for each preset category, determining the average value of the confidence of each target page belonging to the preset category; and determining the category to which the target document belongs from the plurality of preset categories based on the average value corresponding to each preset category.

[0013] The document classification method combining RPA and AI to realize IA provided by the embodiments of the application comprises the following steps: obtaining a target document sent by an RPA robot, the target document comprising at least one target page; obtaining the position coordinates of at least one word included in each target page; inputting the position coordinates of each word in each target page into a pre-trained document understanding model to obtain the encoding vectors corresponding to each word in each target page; obtaining the encoding vectors corresponding to each target page based on the encoding vectors corresponding to each word in each target page; inputting the encoding vectors corresponding to each target page into a target classification model to obtain the confidence of each target page belonging to a plurality of preset categories; for each preset category, determining the average value of the confidence of each target page belonging to the preset category; and determining the category to which the target document belongs from the plurality of preset categories based on the average value corresponding to each preset category. In this way, the target classification model trained quickly by using a small amount of training data and the pre-trained document understanding model are combined to accurately classify the target document. Moreover, the target classification model is used to classify the target document sent by the RPA robot, thereby reducing the labor cost required for document classification and improving the efficiency of document classification.

[0014] The third aspect embodiment of the application provides a training device of a classification model combining RPA and AI to realize IA, which comprises the following steps: a first obtaining module is configured to obtain the position coordinates of at least one word included in each sample page in a plurality of sample pages and the category to which each sample page belongs; a first processing module is configured to input the position coordinates of each word in each sample page into a pre-trained document understanding model to obtain the encoding vectors corresponding to each word in each sample page; a second obtaining module is configured to obtain the encoding vectors corresponding to each sample page based on the encoding vectors corresponding to each word in each sample page; and a training module is configured to use the encoding vectors corresponding to each sample page and the category to which each sample page belongs as training data to train an initial classification model to obtain a target classification model used for document classification.

[0015] In some embodiments, the training module comprises: a division unit configured to divide the training data into a training set and a validation set, the training set comprising encoding vectors corresponding to a plurality of first pages, the validation set comprising encoding vectors corresponding to a plurality of second pages, each of the first pages and each of the second pages being labeled with a category; a training unit configured to perform multiple rounds of training on an initial classification model based on the encoding vectors corresponding to each of the first pages and the category to obtain a candidate classification model after each round of training; and a selection unit configured to select, from the candidate classification models after each round of training, a target classification model for document classification based on the encoding vectors corresponding to each of the second pages and the category.

[0016] In some embodiments, the selection unit comprises: a processing subunit configured to, for each of the candidate classification models after each round of training, input the encoding vectors corresponding to each of the second pages into the candidate classification model to obtain confidence levels of the candidate classification model in predicting that each of the second pages belongs to a plurality of preset categories, and determine a loss value corresponding to the candidate classification model based on the confidence levels of each of the second pages belonging to the plurality of preset categories and the category of each of the second pages; and a selection subunit configured to select, from the candidate classification models after each round of training, the target classification model for document classification based on the loss values corresponding to each of the candidate classification models after each round of training.

[0017] In some embodiments, the first obtaining module comprises: a first obtaining subunit configured to obtain a plurality of sample documents sent by an RPA robot; a second obtaining subunit configured to, for each sample page, obtain optical character recognition (OCR) recognition information of the sample page; a third obtaining subunit configured to obtain text content of at least one text segment in the sample page based on the OCR recognition information of the sample page; a word segmentation unit configured to perform word segmentation on the text content of each text segment to obtain at least one word included in each text segment; a fourth obtaining subunit configured to obtain position coordinates of a region occupied by each text segment; and a fifth obtaining subunit configured to obtain position coordinates of each word based on the position coordinates of the region occupied by each text segment and a position of each word in the corresponding text segment.

[0018] The training device for the classification model for realizing IA by combining RPA and AI provided in the embodiments of the present application obtains the position coordinates of at least one word included in each sample page in a plurality of sample pages, and obtains the category to which each sample page belongs; inputs the position coordinates of each word in each sample page into a pre-trained document understanding model to obtain the encoding vector corresponding to each word in each sample page; obtains the encoding vector corresponding to each sample page based on the encoding vector corresponding to each word in each sample page; and takes the encoding vector corresponding to each sample page and the category to which each sample page belongs as training data to train an initial classification model to obtain a target classification model for document classification. Thus, the training of the classification model for document classification is realized, the training speed of the classification model is improved, and the amount of data required in the training process is reduced.

[0019] The document classification device for realizing IA by combining RPA and AI provided in the fourth aspect of the present application includes: a third obtaining module configured to obtain a target document sent by an RPA robot, the target document including at least one target page; a fourth obtaining module configured to obtain the position coordinates of at least one word included in each target page; a second processing module configured to input the position coordinates of each word in each target page into a pre-trained document understanding model to obtain the encoding vector corresponding to each word in each target page; a fifth obtaining module configured to obtain the encoding vector corresponding to each target page based on the encoding vector corresponding to each word in each target page; a third processing module configured to input the encoding vector corresponding to each target page into a target classification model to obtain the confidence of each target page belonging to a plurality of preset categories; wherein the target classification model is obtained by training the method of the first aspect; a first determining module configured to determine, for each preset category, the average value of the confidence of each target page belonging to the preset category; and a second determining module configured to determine the category to which the target document belongs from the plurality of preset categories based on the average value corresponding to each preset category.

[0020] The document classification device provided by the embodiment of the application combines RPA and AI to realize IA. The target document sent by the RPA robot is obtained. The target document includes at least one target page. The position coordinates of at least one word included in each target page are obtained. The position coordinates of each word in each target page are input into a pre-trained document understanding model to obtain the encoding vectors corresponding to each word in each target page. The encoding vectors corresponding to each target page are obtained based on the encoding vectors corresponding to each word in each target page. The encoding vectors corresponding to each target page are input into a target classification model to obtain the confidence of each target page belonging to a plurality of preset categories. For each preset category, the average value of the confidence of each target page belonging to the preset category is determined. The category to which the target document belongs is determined from the preset categories based on the average values corresponding to the preset categories. In this way, the target classification model quickly trained using a small amount of training data and the pre-trained document understanding model are combined to accurately classify the target document. Moreover, the target classification model is used to classify the target document sent by the RPA robot, thereby reducing the labor cost required for document classification and improving the efficiency of document classification.

[0021] The fifth aspect of the application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method described in the first aspect of the application is implemented, or the method described in the second aspect of the application is implemented.

[0022] The sixth aspect of the application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method described in the first aspect of the application is implemented, or the method described in the second aspect of the application is implemented.

[0023] The seventh aspect of the application provides a computer program product including a computer program. When the computer program is executed by a processor, the method described in the first aspect of the application is implemented, or the method described in the second aspect of the application is implemented.

[0024] Additional aspects and advantages of the application will be in part apparent and in part pointed out hereinafter. BRIEF DESCRIPTION OF DRAWINGS

[0025] In the drawings, like reference numerals refer to same or similar functionalities throughout the several views. The drawings are not necessarily to scale. It should be understood that the drawings only depict some embodiments in accordance with the present disclosure and should not be considered to be limiting of the scope of the disclosure.

[0026] Figure 1 is a flowchart of a training method of a classification model for implementing IA by combining RPA and AI according to the first embodiment of the present application;

[0027] Figure 2 is a flowchart of a training method of a classification model for implementing IA by combining RPA and AI according to the second embodiment of the present application;

[0028] Figure 3 is a flowchart of a document classification method for implementing IA by combining RPA and AI according to the third embodiment of the present application;

[0029] Figure 4 is a structural diagram of a training device of a classification model for implementing IA by combining RPA and AI according to the fourth embodiment of the present application;

[0030] Figure 5 is a structural diagram of a document classification device for implementing IA by combining RPA and AI according to the fifth embodiment of the present application;

[0031] Figure 6 is a block diagram of an electronic device for implementing a training method of a classification model for implementing IA by combining RPA and AI or a document classification method for implementing IA by combining RPA and AI according to the embodiments of the present application. DETAILED DESCRIPTION

[0032] The embodiments of the present application / publication are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar notations represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the drawings are exemplary, only for explaining the present application / publication, and cannot be understood as limiting the present application / publication.

[0033] These and other aspects of the embodiments of the present application / publication will become apparent from the following description and accompanying drawings. In these descriptions and drawings, some specific implementations of the embodiments of the present application / publication are specifically disclosed to represent some ways of embodying the principles of the embodiments of the present application / publication, but it should be understood that the scope of the embodiments of the present application / publication is not limited thereto. On the contrary, the embodiments of the present application / publication include all changes, modifications and equivalents falling within the spirit and scope of the appended claims.

[0034] It should be noted that in the technical solutions of the present disclosure, the acquisition, storage and application of data involved in the technical solutions comply with relevant laws and regulations and do not violate public order and good customs.

[0035] In the related art, a pre-trained document understanding model such as a LayoutLM model is usually used to understand a document, and then a classification model is used to classify the document based on the understanding result. In order to implement document classification in different business scenarios, the pre-trained document understanding model and the classification model are usually jointly trained based on training data related to the business scenario. That is, in order to implement document classification in a certain business scenario, not only the classification model needs to be trained, but also the entire pre-trained document understanding model needs to be fine-tuned. The pre-trained document understanding model has a complex structure, and a large amount of training data is required to fine-tune the pre-trained document understanding model, and the entire training process is time-consuming.

[0036] The present application provides a training method of a classification model combining RPA and AI to implement IA, which does not need to fine-tune the pre-trained document understanding model to obtain a classification model for document classification. The method includes: obtaining the position coordinates of at least one word included in each sample page in a plurality of sample pages, and obtaining the category to which each sample page belongs; inputting the position coordinates of each word in each sample page into a pre-trained document understanding model to obtain an encoding vector corresponding to each word in each sample page; obtaining an encoding vector corresponding to each sample page based on the encoding vector corresponding to each word in each sample page; and taking the encoding vector corresponding to each sample page and the category to which each sample page belongs as training data to train an initial classification model to obtain a target classification model for document classification. Thus, the training of the classification model for document classification is implemented, the training speed of the classification model is improved, and the amount of data required in the training process is reduced.

[0037] In order to clearly illustrate the embodiments of the present application, first, the technical terms involved in the embodiments of the present application are explained.

[0038] In the description of the present application / publication, the term "a plurality of" refers to two or more.

[0039] In the description of the present application, "RPA robot" refers to a software robot that can automatically process business by combining AI technology and RPA technology. The RPA robot has two characteristics of "connector" and "non-intrusion", and uses a non-intrusive way to extract, integrate and connect data of different systems without changing the information system by simulating human operation methods.

[0040] In the description of the present application, a "document" is an electronic document, which can be a PDF (Portable Document Format) format document scanned from a paper document, or a document edited in a computer, a mobile phone or other smart device, which is not limited in the present application. A "target document" is a document to be classified. A "page" is a page included in a document. For example, an electronic contract document can have one or more pages. A "sample page" is a page included in a sample document used for model training. A "first page" is a page included in a training set after the training data is divided into a training set and a validation set. A "second page" is a page included in a validation set after the training data is divided into a training set and a validation set. A "target page" is a page included in a target document to be classified.

[0041] In the description of the present application, a "text segment" is a segment composed of part of the content in a page, wherein the text segment can be a row or less than a row of text arranged horizontally, or a column or less than a column of text arranged vertically, which is not limited in the present application.

[0042] In the description of the present application, an "encoding vector corresponding to a word" is a vector used to represent the feature information of the word, wherein the feature information of the word includes, for example, the position of the word in the page. An "encoding vector corresponding to a sample page" is a vector used to represent the feature information of the sample page, wherein the feature information of the sample page includes, for example, the positions of all the words included in the sample page in the page. An "encoding vector corresponding to a target page" is a vector used to represent the feature information of the target page, wherein the feature information of the target page includes, for example, the positions of all the words included in the target page in the page.

[0043] In the description of the present application, a "pre-trained document understanding model" is a pre-trained model used to understand a document, such as a LayoutLM model (a pre-trained model processing multi-modal information (text and layout information)), a LayoutLM2.0 model, etc., which is not limited in the present application, as long as it can be used to encode a page in a document to obtain an encoding vector corresponding to each word in the page.

[0044] In the description of the present application, a "preset category" is a category to which a document can belong, which is created in advance as needed, such as a bill category, a contract category, etc. A "category to which a target document belongs" is a category to which a target document to be classified belongs, which is predicted by using a target classification model trained. A "category to which a sample page belongs" is a category to which a sample page actually belongs, such as a bill category, a contract category, etc.

[0045] In the description of the present application, the "classification model" is an AI neural network model used for document classification, the structure of which can be set as needed. The input of the classification model is the encoding vector corresponding to the page in the document, and the output of the classification model is the predicted category of the corresponding page, which can be the confidence of the page belonging to one or more preset categories.

[0046] In the description of the present application, "confidence" can represent the possibility of a certain page belonging to a certain preset category. For example, the confidence of the target page belonging to the preset category A represents the possibility of the target page belonging to the preset category A.

[0047] In the description of the present application, "the average value of the confidence of each target page belonging to a preset category" is the value obtained by averaging the confidence of each target page belonging to the preset category.

[0048] In the description of the present application, "document processing platform" is an intelligent automation platform used for intelligent processing of documents. Intelligent document processing (IDP) is one of the core capabilities of the intelligent automation platform. Intelligent document processing (Intelligent Document Processing, IDP) is a new generation of automation technology based on AI technologies such as optical character recognition (Optical Character Recognition, OCR), computer vision (Computer Vision, CV), natural language processing (Natural Language Processing, NLP), knowledge graph (Knowledge Graph, KG), etc. It can recognize, classify, extract elements, check, compare, correct and process various documents, and help enterprises realize the intelligentization and automation of document processing work.

[0049] In the description of the present application, "OCR (Optical Character Recognition)" specifically refers to the process in which an electronic device checks characters printed on paper, determines their shape by detecting light and dark patterns, and then translates the shape into computer text using character recognition methods; that is, for printed characters, an optical method is used to convert the text in a paper document into a black and white dot matrix image file, and the text in the image is converted into a text format through recognition software, which is further edited and processed by word processing software.

[0050] The training method of the classification model combining RPA and AI to realize IA, the document classification method combining RPA and AI to realize IA, the device, the electronic equipment and the storage medium according to the embodiments of the present application / publication are described below in combination with the drawings.

[0051] Firstly, the training method of the classification model combining RPA and AI to implement IA in the embodiment of the application is described with reference to the drawings.

[0052] Figure 1 is the flowchart of the training method of the classification model combining RPA and AI to implement IA in the first embodiment of the application. As shown in the figure, the method can include the following steps: Figure 1

[0053] Step 101, obtaining the position coordinates of at least one word included in each sample page in a plurality of sample pages, and obtaining the category to which each sample page belongs.

[0054] It should be noted that the training method of the classification model combining RPA and AI to implement IA in the embodiment of the application can be executed by a training device of the classification model combining RPA and AI to implement IA. Hereinafter, the training device of the classification model combining RPA and AI to implement IA is simply referred to as the training device. The training device can be realized by software and / or hardware, and the training device can be an electronic device or can be configured in an electronic device to realize the training of the classification model for document classification. The electronic device can include but is not limited to terminal devices, servers, etc., and the embodiment does not make specific limitations on the electronic device.

[0055] Among them, the word included in the sample page is the word (i.e. token) obtained by segmenting the text segment of the sample page. The text segment can be segmented based on a preset word table and rules. For example, for Chinese, it can be cut by word, for example, for the text segment "123", the segmented words are "1" and "23", and for the text segment "Zhang San", the segmented words are "Zhang San" and "of"; for English, it can be cut into sub-words (sub-words) of stems and affixes, for example, for the text segment "working", the segmented words are "work" and "ing".

[0056] Among them, the position coordinates of the word are used to represent the position of the word in the page (in this embodiment, the sample page). For example, the position coordinates of the word can include the x-axis coordinate and y-axis coordinate of the word in the coordinate system with the top left corner of the sample page as the origin.

[0057] Among them, for each sample page, in the case where the sample page includes a plurality of words, in order to reduce the amount of calculation, only a limited number of position coordinates of the words can be obtained for subsequent model training. For example, assuming that the number of words is set to 128, then for each sample page, at most 128 position coordinates of the words can be obtained.

[0058] ​In step 102, the position coordinates of each word in each sample page are input into the pre-trained document understanding model to obtain the encoding vector corresponding to each word in each sample page.

[0059] In some embodiments, for each word in each sample page, the position coordinates of the word can be input into the pre-trained document understanding model, and the pre-trained document understanding model can output the encoding vector of the word, so that the training device can obtain the encoding vector corresponding to the word.

[0060] In step 103, the encoding vector corresponding to each sample page is obtained based on the encoding vector corresponding to each word in each sample page.

[0061] In some embodiments, for each sample page, if the sample page includes one word, the encoding vector corresponding to the word can be determined as the encoding vector corresponding to the sample page; if the sample page includes multiple words, the average of the encoding vectors corresponding to the multiple words can be determined, and the average is taken as the encoding vector corresponding to the sample page.

[0062] In step 104, the encoding vector corresponding to each sample page and the category to which the sample page belongs are taken as training data to train the initial classification model to obtain a target classification model for document classification.

[0063] In some embodiments, the initial classification model can be constructed in advance. Assuming that the encoding length of the encoding vector corresponding to each sample page is L, and the number of preset categories is M, the initial classification model can be an L*M dimensional matrix. L is an integer greater than 1, and M is an integer greater than 0. By inputting the 1*L dimensional encoding vector corresponding to a sample page into the classification model, a 1*M dimensional vector can be obtained, and each element in the 1*M dimensional vector represents the confidence of the sample page belonging to M preset categories.

[0064] Further, the encoding vector corresponding to each sample page can be taken as the input of the classification model, and the category to which each sample page belongs can be taken as the label to supervise the training of the initial classification model to obtain the target classification model.

[0065] The target classification model can be used to implement the classification of documents. Therefore, in actual business scenarios, the target classification model can be used to classify documents first, and then the information extraction model corresponding to the category is called to extract information from the documents, and further business processing is implemented based on the extracted information.

[0066] It can be understood that in the embodiments of the present application, the pre-trained document understanding model is used as a general encoder in different business scenarios and is used alone to obtain the encoding vector corresponding to the sample page. In the training process, the pre-trained document understanding model is not trained, and only the classification model is trained. Since the classification model, which does not need to be used to generate the encoding vector corresponding to each sample page, has a simple structure, only a small amount of training data needs to be used for training, so that a classification model capable of accurately classifying documents can be obtained, and the training process is time-consuming. Therefore, the training speed of the classification model can be improved without affecting the accuracy of document classification, and the amount of data required in the training process is reduced. In addition, the classification model has a simple structure and occupies less space, thereby facilitating deployment.

[0067] In summary, the training method of the classification model combining RPA and AI to implement IA provided in the embodiments of the present application obtains the position coordinates of at least one word included in each sample page in a plurality of sample pages, and obtains the category to which each sample page belongs; inputs the position coordinates of each word in each sample page into a pre-trained document understanding model to obtain the encoding vector corresponding to each word in each sample page; obtains the encoding vector corresponding to each sample page based on the encoding vector corresponding to each word in each sample page; and uses the encoding vector corresponding to each sample page and the category thereof as training data to train an initial classification model to obtain a target classification model for document classification. Thus, the training of the classification model for document classification is realized, the training speed of the classification model is improved, and the amount of data required in the training process is reduced.

[0068] The following will be described in combination with Figure 2 The training method of the classification model combining RPA and AI to implement IA provided in the embodiments of the present application will be further described.

[0069] Figure 2 is a flowchart of the training method of the classification model combining RPA and AI to implement IA according to the second embodiment of the present application, as Figure 2 shown, the method comprises:

[0070] Step 201, obtaining the position coordinates of at least one word included in each sample page in a plurality of sample pages, and obtaining the category to which each sample page belongs.

[0071] Among them, for each sample page, in the case where the sample page includes a plurality of words, in order to reduce the amount of calculation, only the position coordinates of a limited number of words can be obtained for subsequent model training. For example, assuming that the number of words is set to 128, then for each sample page, at most 128 position coordinates of words can be obtained.

[0072] In some embodiments, the position coordinates of the at least one word included in each of the plurality of sample pages can be obtained by: obtaining, for each sample page, optical character recognition (OCR) recognition information of the sample page; obtaining, based on the OCR recognition information of the sample page, text content of at least one text segment in the sample page; performing word segmentation on the text content of each text segment to obtain at least one word included in each text segment; obtaining position coordinates of a region occupied by each text segment; and obtaining, based on the position coordinates of the region occupied by each text segment and positions of each word in the corresponding text segment, position coordinates of each word.

[0073] In some embodiments, the position coordinates of the at least one word included in each of the plurality of sample pages can be obtained by: obtaining, for each sample page, optical character recognition (OCR) recognition information of the sample page; obtaining, based on the OCR recognition information of the sample page, text content of at least one text segment in the sample page; performing word segmentation on the text content of each text segment to obtain at least one word included in each text segment; obtaining position coordinates of a region occupied by each text segment; and obtaining, based on the position coordinates of the region occupied by each text segment and positions of each word in the corresponding text segment, position coordinates of each word.

[0074] In some embodiments, the position coordinates of the at least one word included in each of the plurality of sample pages can be obtained by: obtaining, for each sample page, optical character recognition (OCR) recognition information of the sample page; obtaining, based on the OCR recognition information of the sample page, text content of at least one text segment in the sample page; performing word segmentation on the text content of each text segment to obtain at least one word included in each text segment; obtaining position coordinates of a region occupied by each text segment; and obtaining, based on the position coordinates of the region occupied by each text segment and positions of each word in the corresponding text segment, position coordinates of each word.

[0075] In some embodiments, the position coordinates of the at least one word included in each of the plurality of sample pages can be obtained by: obtaining, for each sample page, optical character recognition (OCR) recognition information of the sample page; obtaining, based on the OCR recognition information of the sample page, text content of at least one text segment in the sample page; performing word segmentation on the text content of each text segment to obtain at least one word included in each text segment; obtaining position coordinates of a region occupied by each text segment; and obtaining, based on the position coordinates of the region occupied by each text segment and positions of each word in the corresponding text segment, position coordinates of each word.

[0076] In some embodiments, the position coordinates of the at least one word included in each of the plurality of sample pages can be obtained by: obtaining, for each sample page, optical character recognition (OCR) recognition information of the sample page; obtaining, based on the OCR recognition information of the sample page, text content of at least one text segment in the sample page; performing word segmentation on the text content of each text segment to obtain at least one word included in each text segment; obtaining position coordinates of a region occupied by each text segment; and obtaining, based on the position coordinates of the region occupied by each text segment and positions of each word in the corresponding text segment, position coordinates of each word.

[0077] The process of obtaining the position coordinates of each word in the text segment based on the position coordinates of the area occupied by the text segment in a certain sample page and the position of each word in the text segment is described below. It is assumed that the upper left corner of the sample page is the origin of the coordinate system, the position coordinates of the area occupied by the text segment include the x-axis and y-axis coordinates of the upper left corner (x1, y1) and the x-axis and y-axis coordinates of the lower right corner (x2, y2). The position coordinates of the word include the x-axis and y-axis coordinates of the upper left corner (x3, y3) and the x-axis and y-axis coordinates of the lower right corner (x4, y4) of the area occupied by the word.

[0078] Since the text segment can be a row or less than a row of horizontally arranged text, or a column or less than a column of vertically arranged text, it can be determined whether the text segment is horizontally arranged or vertically arranged. It can be determined whether y2-y1 of the text segment is less than A(x2-x1), where A can be set as needed, such as 1.5. In the case where y2-y1 is less than A(x2-x1), it can be determined that the text segment is horizontally arranged; in the case where y2-y1 is not less than A(x2-x1), it can be determined that the text segment is vertically arranged.

[0079] For a horizontally arranged text segment, the width of each word in the text segment can be obtained based on the length proportion of each word in the text segment and the value of x2-x1. Further, for the first word on the left in the text segment, x1 is taken as the x-axis coordinate x3 of the upper left corner of the word, and x3+the width of the first word is taken as the x-axis coordinate x4 of the lower right corner of the first word. For other words in the text segment, x1 is added to the cumulative width of all words to the left of the word to obtain the x-axis coordinate x3 of the upper left corner of the word, and x3+the width of the word is taken as the x-axis coordinate x4 of the lower right corner of the word. In addition, for each word in the text segment, y1 is taken as the y-axis coordinate y3 of the upper left corner of each word, and y2 is taken as the y-axis coordinate y4 of the lower right corner of each word.

[0080] For a vertically arranged text segment, the height of each word in the text segment can be obtained based on the length proportion of each word in the text segment and the value of y2-y1. Further, for the first word on the top in the text segment, y1 is taken as the y-axis coordinate y3 of the upper left corner of the word, and y3+the height of the first word is taken as the y-axis coordinate y4 of the lower right corner of the first word. For other words in the text segment, y1 is added to the cumulative height of all words above the word to obtain the y-axis coordinate y3 of the upper left corner of the word, and y3+the height of the word is taken as the y-axis coordinate y4 of the lower right corner of the word. In addition, for each word in the text segment, x1 is taken as the x-axis coordinate x3 of the upper left corner of each word, and x2 is taken as the x-axis coordinate x4 of the lower right corner of each word.

[0081] For example, assuming A is 1.5, the text segment is "1 23", and the words obtained by cutting the text content of the text segment are "1" and "23". The position coordinates of the area occupied by the text segment "1 23" include: (x1, y1) = (2, 2) and (x2, y2) = (8, 4), since y2-y1 is less than 1.5(x2-x1), it can be determined that the text segment "1 23" is horizontally arranged. Since the length ratio of "1" and "23" is 1:2, the width of "1" can be obtained as (8-2)*1 / 3 = 2, and the width of "23" is (8-2)*2 / 3 = 4. In the above manner, the position coordinates of "1" can be determined as: (x3, y3) = (2, 2), (x4, y4) = (4, 4), and the position coordinates of "23" can be determined as: (x3, y3) = (4, 2), (x4, y4) = (8, 4).

[0082] In some embodiments, the plurality of sample documents obtained by the training device can be sent by an RPA robot. That is, before obtaining the optical character recognition (OCR) recognition information of each sample page, the method can further include: obtaining the plurality of sample documents sent by the RPA robot.

[0083] For example, the training device can be configured in a document processing platform, and the document processing platform can provide an upload interface, so that when a user needs to train a target classification model, each sample document can be uploaded through the upload interface based on an RPA robot, so that the training device in the document processing platform can obtain the plurality of sample documents uploaded by the RPA robot. Thus, by uploading the plurality of sample pages to the document processing platform using the RPA robot, the training device can automatically obtain the sample pages in combination with the RPA robot, thereby reducing the labor cost of training the classification model.

[0084] Step 202: inputting the position coordinates of each word in each sample page into the pre-trained document understanding model to obtain the encoding vectors corresponding to each word in each sample page.

[0085] Step 203: obtaining the encoding vectors corresponding to each sample page based on the encoding vectors corresponding to each word in each sample page.

[0086] The specific implementation process and principles of steps 202-203 can be referred to the description of the above embodiments, which will not be repeated here.

[0087] Step 204: dividing the training data into a training set and a validation set, the training set including the encoding vectors corresponding to a plurality of first pages, and the validation set including the encoding vectors corresponding to a plurality of second pages, each first page and each second page being labeled with a category.

[0088] The ratio of the number of the first pages included in the training set and the number of the second pages included in the verification set can be set as needed, such as 4:1, which is not limited in the present application.

[0089] In step 205, the initial classification model is trained based on the encoding vectors corresponding to the first pages and the categories to which the first pages belong, to obtain a candidate classification model after each round of training.

[0090] The number of rounds of training of the initial classification model can be set as needed, which is not limited in the present application.

[0091] In some embodiments, taking the number of training rounds as N, where N is an integer greater than 1, the training set can be divided into N sub-training sets, and the initial classification model is iteratively trained based on the first sub-training set to obtain a candidate classification model after the first round of training, the candidate classification model after the first round of training is iteratively trained based on the next sub-training set to obtain a candidate classification model after the second round of training, and the candidate classification model after the second round of training is iteratively trained based on the next sub-training set to obtain a candidate classification model after the third round of training, and so on, so that N candidate classification models after N rounds of training are obtained based on the N sub-training sets.

[0092] In some embodiments, taking the number of training rounds as N, where N is an integer greater than 1, the initial classification model can also be iteratively trained based on the training set to obtain a candidate classification model after the first round of training, the candidate classification model after the first round of training is iteratively trained based on the training set to obtain a candidate classification model after the second round of training, and the candidate classification model after the second round of training is iteratively trained based on the training set to obtain a candidate classification model after the third round of training, and so on, so that N candidate classification models after N rounds of training are obtained based on the training set.

[0093] In step 206, the target classification model for document classification is selected from the candidate classification models after each round of training based on the encoding vectors corresponding to the second pages and the categories to which the second pages belong.

[0094] In some embodiments, step 206 can be implemented in the following way: for each candidate classification model after each round of training, the encoding vectors corresponding to the second pages are input into the candidate classification model to obtain the confidence of the candidate classification model in predicting that each second page belongs to a plurality of preset categories, and the loss value corresponding to the candidate classification model is determined based on the confidence of each second page belonging to a plurality of preset categories and the category to which each second page belongs; the target classification model for document classification is selected from the candidate classification models after each round of training based on the loss values corresponding to the candidate classification models after each round of training.

[0095] In some embodiments, the confidence of each second page belonging to each preset category predicted by a certain candidate classification model and the category to which each second page belongs can be substituted into a cross-entropy loss function to determine the loss value corresponding to the candidate classification model.

[0096] The cross-entropy loss function can be formula (1).

[0097]

[0098] wherein L ce represents the loss value. N represents the number of second pages included in the verification set. C represents the number of preset categories, also referred to as the number of categories. is a symbolic function, when the category to which the i-th second page belongs is c, is 1, otherwise is 0. represents the confidence (also referred to as the predicted probability) of the i-th second page belonging to the preset category c.

[0099] In some embodiments, the candidate classification model with the lowest loss value among the candidate classification models after each round of training can be determined as the target classification model. Thus, the model with the highest prediction accuracy among the candidate classification models after each round of training can be determined as the target classification model.

[0100] In summary, the training method of the classification model for realizing IA by combining RPA and AI provided in the embodiments of the present application obtains the position coordinates of at least one word included in each sample page in a plurality of sample pages and the category to which each sample page belongs, inputs the position coordinates of each word in each sample page into a pre-trained document understanding model to obtain the encoding vector corresponding to each word in each sample page, obtains the encoding vector corresponding to each sample page based on the encoding vector corresponding to each word in each sample page, divides the training data into a training set and a verification set, the training set includes the encoding vectors corresponding to a plurality of first pages, the verification set includes the encoding vectors corresponding to a plurality of second pages, each first page and each second page is labeled with a category, performs multiple rounds of training on an initial classification model based on the encoding vectors corresponding to each first page and the category to obtain candidate classification models after each round of training, and selects a target classification model for document classification from the candidate classification models after each round of training based on the encoding vectors corresponding to each second page and the category. Thus, the training of the classification model for document classification is realized, the training speed of the classification model is improved, and the amount of data required in the training process is reduced.

[0101] Based on the above embodiments, the present application further provides a document classification method for realizing IA by combining RPA and AI. The following will be described in combination with Figure 3The document classification method combining RPA and AI to realize IA provided by the embodiment of the application is described.

[0102] Figure 3 is a flowchart of the document classification method combining RPA and AI to realize IA according to the third embodiment of the application, as shown in the figure, the method comprises: Figure 3

[0103] Step 301, obtaining the target document sent by the RPA robot, the target document comprising at least one target page.

[0104] It should be noted that the document classification method combining RPA and AI to realize IA in the embodiment of the application can be executed by a document classification device combining RPA and AI to realize IA. The document classification device combining RPA and AI to realize IA can be realized by software and / or hardware, and the document classification device combining RPA and AI to realize IA can be an electronic device or can be configured in an electronic device to realize the classification of the document. The electronic device can include but is not limited to terminal equipment, servers, etc., and the embodiment does not make specific limitation to the electronic device.

[0105] In some embodiments, the document classification device combining RPA and AI to realize IA can be configured in a document processing platform, and the document processing platform can provide an upload interface. Therefore, when a user needs to classify a target document, the target document can be uploaded through the upload interface based on the RPA robot, so that the document classification device combining RPA and AI to realize IA in the document processing platform can obtain the target document uploaded by the RPA robot.

[0106] Step 302, obtaining the position coordinates of at least one word included in each target page.

[0107] Among them, the word included in the target page is the word (i.e. token) obtained by segmenting the text segment of the target page. The text segment can be segmented based on a preset word table and rules.

[0108] The position coordinates of the word are used to represent the position of the word in the page (in this embodiment, the target page). For example, the position coordinates of the word can include the x-axis coordinate and y-axis coordinate of the word in the coordinate system with the top-left corner of the target page as the origin.

[0109] Among them, for each target page, in the case that the target page includes multiple words, in order to reduce the amount of calculation, only a limited number of position coordinates of the words can be obtained for subsequent document classification. For example, assuming that the number of words is set to 128, then for each target page, at most 128 position coordinates of the words can be obtained.

[0110] ​The manner of obtaining the position coordinates of the at least one word included in each target page can refer to the manner of obtaining the position coordinates of the at least one word included in the sample page in the above embodiments, and details are not repeated here.

[0111] In step 303, the position coordinates of each word in each target page are input into the pre-trained document understanding model to obtain the encoding vector corresponding to each word in each target page.

[0112] In some embodiments, for each word in each target page, the position coordinates of the word can be input into the pre-trained document understanding model, and the pre-trained document understanding model can output the encoding vector of the word, so that the document classification device combining RPA and AI to implement IA can obtain the encoding vector corresponding to the word.

[0113] In step 304, the encoding vector corresponding to each target page is obtained based on the encoding vector corresponding to each word in each target page.

[0114] In some embodiments, for each target page, in the case that the target page includes one word, the encoding vector corresponding to the word can be determined as the encoding vector corresponding to the target page; in the case that the target page includes a plurality of words, the average of the encoding vectors corresponding to the plurality of words can be determined, and the average is taken as the encoding vector corresponding to the target page.

[0115] In step 305, the encoding vector corresponding to each target page is input into the target classification model to obtain the confidence of each target page belonging to a plurality of preset categories.

[0116] The target classification model is trained by the training method of the classification model combining RPA and AI to implement IA shown in any of the above embodiments.

[0117] For any target page, the confidence of the target page belonging to a plurality of preset categories can represent the possibility of the target page belonging to each preset category.

[0118] In some embodiments, the target classification model trained by the training method of the classification model combining RPA and AI to implement IA shown in any of the above embodiments can be deployed in a document processing platform, so that the document classification device combining RPA and AI to implement IA can input the encoding vector corresponding to each target page into the target classification model deployed in the document processing platform to obtain the confidence of each target page belonging to a plurality of preset categories.

[0119] In step 306, for each preset category, the average of the confidence of each target page belonging to the preset category is determined.

[0120] In some embodiments, the confidence levels of the target pages belonging to the same preset category can be summed and averaged to obtain an average value of the confidence levels of the target pages belonging to the same preset category.

[0121] In step 307, the category to which the target document belongs is determined from the preset categories based on the average values corresponding to the preset categories.

[0122] In some embodiments, the preset category with the largest average value among the preset categories can be determined as the category to which the target document belongs.

[0123] For example, it is assumed that the preset categories include category 1 and category 2. The target document includes 10 target pages. Through step 305 and the previous steps, the confidence levels of the 10 target pages belonging to category 1 and the confidence levels of the 10 target pages belonging to category 2 can be obtained. Then, the confidence levels of the 10 target pages belonging to category 1 can be summed and averaged to obtain an average value of the confidence levels of the 10 target pages belonging to category 1, and the confidence levels of the 10 target pages belonging to category 2 can be summed and averaged to obtain an average value of the confidence levels of the 10 target pages belonging to category 2. It is assumed that the average value of the confidence levels of the 10 target pages belonging to category 1 is greater than the average value of the confidence levels of the 10 target pages belonging to category 2. Then, the category to which the target document belongs can be determined as category 1.

[0124] The pre-trained document understanding model in the embodiments of the present application is universal for each business scenario and does not need to be trained. It can be used as a universal encoder in different business scenarios to obtain the encoding vectors corresponding to the target pages. The target classification model does not need to be used to generate the encoding vectors corresponding to the target pages. The structure of the target classification model is simple. In the training process, only a small amount of training data needs to be used for training. The training process is time-consuming and short. The prediction effect of the target classification model obtained by training is not affected. The target classification model can still achieve accurate classification of the document.

[0125] In summary, the document classification method combining RPA and AI to achieve IA (Information Awareness) provided in this application embodiment obtains a target document sent by an RPA robot. The target document includes at least one target page. The location coordinates of at least one word in each target page are obtained. The location coordinates of each word in each target page are input into a pre-trained document understanding model to obtain the encoding vector corresponding to each word in each target page. Based on the encoding vectors corresponding to each word in each target page, the encoding vector corresponding to each target page is obtained. The encoding vector corresponding to each target page is input into a target classification model to obtain the confidence score of each target page belonging to multiple preset categories. For each preset category, the average confidence score of each target page belonging to the preset category is determined. Based on the average value corresponding to each preset category, the category to which the target document belongs is determined from each preset category. Thus, it achieves accurate classification of target documents by combining a target classification model quickly trained using a small amount of training data and a pre-trained document understanding model. Furthermore, by using a target classification model to perform IA classification on target documents sent by an RPA robot, the manual cost required for document classification is reduced, and the efficiency of document classification is improved.

[0126] To implement the above embodiments, this application also proposes a training device for a classification model of IA that combines RPA and AI. Figure 4 This is a schematic diagram of the structure of a training device for a classification model of IA that combines RPA and AI according to the fourth embodiment of this application.

[0127] like Figure 4 As shown, the training device 400 for the classification model of IA that combines RPA and AI includes: a first acquisition module 401, a first processing module 402, a second acquisition module 403, and a training module 404.

[0128] The first acquisition module 401 is used to acquire the position coordinates of at least one word included in each of the multiple sample pages, and to acquire the category to which each sample page belongs.

[0129] The first processing module 402 is used to input the position coordinates of each word in each sample page into the pre-trained document understanding model in order to obtain the encoding vector corresponding to each word in each sample page.

[0130] The second acquisition module 403 is used to acquire the encoding vector corresponding to each sample page based on the encoding vector corresponding to each word in each sample page;

[0131] The training module 404 is used to train the initial classification model by using the encoding vector and category corresponding to each sample page as training data to obtain the target classification model for document classification.

[0132] It should be noted that the training apparatus 400 of the classification model combining RPA and AI to implement IA according to the embodiments of the present application can perform the training method of the classification model combining RPA and AI to implement IA provided in the above embodiments. The training apparatus 400 of the classification model combining RPA and AI to implement IA can be implemented by software and / or hardware, and can be an electronic device or can be configured in an electronic device to implement training of the classification model for document classification. The electronic device can include, but is not limited to, a terminal device, a server, etc., and the embodiments do not specifically limit the electronic device.

[0133] In an embodiment of the present application, the training module 404 includes:

[0134] The division unit is configured to divide the training data into a training set and a validation set, the training set including the encoding vectors corresponding to the plurality of first pages, and the validation set including the encoding vectors corresponding to the plurality of second pages, each of the first pages and each of the second pages being labeled with the belonging category;

[0135] The training unit is configured to perform multi-round training on the initial classification model based on the encoding vectors corresponding to the first pages and the belonging categories, to obtain candidate classification models after each round of training;

[0136] The selection unit is configured to select, from the candidate classification models after each round of training, a target classification model for document classification based on the encoding vectors corresponding to the second pages and the belonging categories.

[0137] In an embodiment of the present application, the selection unit includes:

[0138] The processing sub-unit is configured to, for each candidate classification model after each round of training, input the encoding vectors corresponding to the second pages into the candidate classification model, to obtain confidence degrees of the candidate classification model predicting that each of the second pages belongs to the plurality of preset categories, and determine a loss value corresponding to the candidate classification model based on the confidence degrees of each of the second pages belonging to the plurality of preset categories and the belonging category of each of the second pages;

[0139] The selection sub-unit is configured to select, from the candidate classification models after each round of training, a target classification model for document classification based on the loss values corresponding to the candidate classification models after each round of training.

[0140] In an embodiment of the present application, the first obtaining module 401 includes:

[0141] The first obtaining sub-unit is configured to obtain the plurality of sample documents sent by the RPA robot;

[0142] The second obtaining subunit is configured to obtain, for each sample page, optical character recognition (OCR) recognition information of the sample page.

[0143] The third obtaining subunit is configured to obtain, based on the OCR recognition information of the sample page, text content of at least one text segment in the sample page.

[0144] The word segmentation unit is configured to perform word segmentation on the text content of each text segment to obtain at least one word included in each text segment.

[0145] The fourth obtaining subunit is configured to obtain position coordinates of a region occupied by each text segment.

[0146] The fifth obtaining subunit is configured to obtain, based on the position coordinates of the region occupied by each text segment and the position of each word in the corresponding text segment, position coordinates of each word.

[0147] It should be noted that the foregoing description of the training method of the classification model for implementing IA in combination with RPA and AI is also applicable to the training device of the classification model for implementing IA in combination with RPA and AI, and the details not disclosed in the training device of the classification model for implementing IA in combination with RPA and AI in the present application will not be described here.

[0148] To sum up, the training device of the classification model for implementing IA in combination with RPA and AI according to the embodiments of the present application obtains the position coordinates of at least one word included in each sample page in the plurality of sample pages and the category to which each sample page belongs; inputs the position coordinates of each word in each sample page into a pre-trained document understanding model to obtain an encoding vector corresponding to each word in each sample page; obtains an encoding vector corresponding to each sample page based on the encoding vector corresponding to each word in each sample page; and uses the encoding vector corresponding to each sample page and the category to which each sample page belongs as training data to train an initial classification model to obtain a target classification model for document classification. In this way, the training of the classification model for document classification is realized, the training speed of the classification model is improved, and the amount of data required in the training process is reduced.

[0149] To implement the above embodiments, the present application further provides a document classification device for implementing IA in combination with RPA and AI. Figure 5 FIG. 5 is a structural schematic diagram of a document classification device for implementing IA in combination with RPA and AI according to the fifth embodiment of the present application.

[0150] As shown in FIG. 5, the document classification device 500 for implementing IA in combination with RPA and AI includes a third obtaining module 501, a fourth obtaining module 502, a second processing module 503, a fifth obtaining module 504, a third processing module 505, a first determining module 506, and a second determining module 507. Figure 5 As shown in FIG. 5, the document classification device 500 for implementing IA in combination with RPA and AI includes a third obtaining module 501, a fourth obtaining module 502, a second processing module 503, a fifth obtaining module 504, a third processing module 505, a first determining module 506, and a second determining module 507.

[0151] The third obtaining module 501 is configured to obtain a target document sent by an RPA robot, the target document including at least one target page;

[0152] The fourth obtaining module 502 is configured to obtain position coordinates of at least one word included in each target page;

[0153] The second processing module 503 is configured to input the position coordinates of each word in each target page into a pre-trained document understanding model to obtain an encoding vector corresponding to each word in each target page;

[0154] The fifth obtaining module 504 is configured to obtain an encoding vector corresponding to each target page based on the encoding vector corresponding to each word in each target page;

[0155] The third processing module 505 is configured to input the encoding vector corresponding to each target page into a target classification model to obtain a confidence degree of each target page belonging to a plurality of preset categories; the target classification model is trained by the method of the first aspect.

[0156] The first determining module 506 is configured to determine, for each preset category, an average value of the confidence degrees of each target page belonging to the preset category;

[0157] The second determining module 507 is configured to determine, based on the average values corresponding to the preset categories, a category to which the target document belongs from the preset categories.

[0158] In summary, the document classification device combining RPA and AI to implement IA according to the embodiments of the present application obtains a target document sent by an RPA robot, the target document including at least one target page, obtains position coordinates of at least one word included in each target page, inputs the position coordinates of each word in each target page into a pre-trained document understanding model to obtain an encoding vector corresponding to each word in each target page, obtains an encoding vector corresponding to each target page based on the encoding vector corresponding to each word in each target page, inputs the encoding vector corresponding to each target page into a target classification model to obtain a confidence degree of each target page belonging to a plurality of preset categories, determines, for each preset category, an average value of the confidence degrees of each target page belonging to the preset category, and determines, based on the average values corresponding to the preset categories, a category to which the target document belongs from the preset categories. Thus, the target classification model trained quickly by using a small amount of training data and the pre-trained document understanding model are combined to accurately classify a target document. Moreover, the target classification model is used to classify the target document sent by the RPA robot, thereby reducing the labor cost required for document classification and improving the efficiency of document classification.

[0159] To achieve the above-mentioned embodiments, the embodiments of the present application further provide an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the training method of the classification model combining RPA and AI to implement IA, or the document classification method combining RPA and AI to implement IA according to any one of the preceding method embodiments.

[0160] To achieve the above-mentioned embodiments, the embodiments of the present application further provide a computer readable storage medium, which stores a computer program, wherein the computer program is executed by a processor to implement the training method of the classification model combining RPA and AI to implement IA, or the document classification method combining RPA and AI to implement IA according to any one of the preceding method embodiments.

[0161] To achieve the above-mentioned embodiments, the embodiments of the present application further provide a computer program product, wherein the instructions in the computer program product are executed by a processor to implement the training method of the classification model combining RPA and AI to implement IA, or the document classification method combining RPA and AI to implement IA according to any one of the preceding method embodiments.

[0162] Figure 6 A block diagram of an exemplary electronic device suitable for use in implementing embodiments of the present application is shown. Figure 6 The electronic device 10 shown is merely one example and should not be taken as limiting the scope of the functionality or use of the embodiments of the present application.

[0163] As shown in Figure 6 The electronic device 10 is in the form of a general computing device. Components of the electronic device 10 can include, but are not limited to, one or more processors or processing units 16, system memory 28, and a bus 18 that connects the various system components, including the memory 28 and the processing unit 16.

[0164] Bus 18 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. Examples of these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.

[0165] Electronic device 10 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by electronic device 10, including volatile and non-volatile media, removable and non-removable media.

[0166] Memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Electronic device 10 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (… Figure 6 Not shown; usually referred to as a "hard drive"). Although Figure 6 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disc drive for reading and writing to a removable non-volatile optical disc (e.g., a compact disc read-only memory (CD-ROM), a digital video disc read-only memory (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of this application.

[0167] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 42 typically perform the functions and / or methods described in the embodiments of this application.

[0168] Electronic device 10 can also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), and with one or more devices that enable a user to interact with the electronic device 10, and / or with any device that enables the electronic device 10 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed through input / output (I / O) interface 22. Furthermore, electronic device 10 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 20. Figure 6 As shown, network adapter 20 communicates with other modules of electronic device 10 via bus 18. It should be understood that, although... Figure 6 As not shown, other hardware and / or software modules may be used in conjunction with electronic device 10, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0169] The processing unit 16 executes various functional applications and data processing by running programs stored in the memory 28, such as implementing the methods mentioned in the foregoing embodiments.

[0170] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0171] Moreover, the terms "first", "second", "third", etc. are used herein only to describe different steps or categories of steps in a claim for patent purposes, and are not to be construed as implying or implying relative importance or a number of indicated technical features. Thus, features defined with "first", "second" can explicitly or implicitly include at least one of the features. In the description of the present application, the meaning of "a plurality of" is at least two, for example, two, three, etc., unless otherwise explicitly specified.

[0172] Any process or method descriptions or descriptions of the flow diagrams described herein or otherwise described herein can be understood as representing modules, segments, or portions of code that include one or more executable instructions for implementing specific logical functions or steps in the process, and the preferred embodiments of the present application include additional implementations that can not be described in detail in the description of the preferred embodiments, and the skilled person in the art should understand that the preferred embodiments of the present application can be implemented in other ways, including in an order other than that shown or discussed, including in a substantially simultaneous manner or in reverse order, according to the functions involved.

[0173] The logic and / or steps represented in the flow diagrams or otherwise described herein, for example, can be considered as a list of executable instructions for implementing the logic function, which can be specifically embodied in any computer-readable medium for use by or in conjunction with an instruction execution system, device or apparatus, such as a computer-based system, a system including a processor, or other system that can take instructions from an instruction execution system, device or apparatus and execute them. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate or transport a program for use by or in conjunction with an instruction execution system, device or apparatus. More specific examples (non-exhaustive list) of computer-readable media include the following: electrical connections having one or more wires (electronic devices), portable computer disks (magnetic devices), random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memories), fiber optic devices, and portable compact disc read-only memories (CD ROMs). In addition, a computer-readable medium can even be paper or other suitable medium on which the program can be printed, as the program can be electronically obtained, for example, by optical scanning of the paper or other medium, followed by electronic editing, interpretation or processing, if necessary, in other suitable manner, and then stored in a computer memory.

[0174] It should be understood that parts of the present application can be realized in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be realized as software or firmware stored in a memory and executed by a suitable instruction execution system. As such, if realized in hardware, and in another embodiment, any one or a combination of the following technologies known in the art can be used: discrete logic circuitry having logic gates for implementing logic functions on data signals, application specific integrated circuits having appropriate combinational logic gates, programmable gate arrays (PGA), field programmable gate arrays (FPGA), and the like.

[0175] Those skilled in the art of the present technology can understand that all or part of the steps carried out by the above-mentioned embodiment methods can be completed by a program instructing the relevant hardware, and the program can be stored in a computer readable storage medium. When the program is executed, it includes one of the steps of the method embodiment or a combination thereof.

[0176] In addition, each functional unit in each embodiment of the present application can be integrated in one processing module, or each unit can be physically present separately, or two or more units can be integrated in one module. The above-mentioned integrated module can be realized in the form of hardware or in the form of a software functional module. The integrated module, if realized in the form of a software functional module and sold or used as an independent product, can also be stored in a computer readable storage medium.

[0177] The above-mentioned storage medium can be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it should be understood that the above-mentioned embodiments are exemplary and cannot be understood as limiting the present application, and those skilled in the art can make changes, modifications, replacements and variations to the above-mentioned embodiments within the scope of the present application.

Claims

1. A training method for a classification model that combines Robotic Process Automation (RPA) and Artificial Intelligence (AI) to achieve intelligent automation (IA), characterized in that, The method includes: Obtain the position coordinates of at least one word included in each of the multiple sample pages, and obtain the category to which each of the sample pages belongs; Input the position coordinates of each word in each of the sample pages into the pre-trained document understanding model to obtain the encoding vector corresponding to each word in each of the sample pages; Based on the encoding vectors corresponding to each word in each of the sample pages, obtain the encoding vectors corresponding to each of the sample pages; The encoding vectors and categories corresponding to each sample page are used as training data to train the initial classification model, thereby obtaining the target classification model for document classification.

2. The method according to claim 1, characterized in that, The step of using the encoding vector and category corresponding to each sample page as training data to train the initial classification model to obtain the target classification model for document classification includes: The training data is divided into a training set and a validation set. The training set includes encoding vectors corresponding to multiple first pages, and the validation set includes encoding vectors corresponding to multiple second pages. Each first page and each second page is labeled according to its category. Based on the encoding vector and category corresponding to each of the first pages, the initial classification model is trained in multiple rounds to obtain candidate classification models after each round of training. Based on the encoding vector and category corresponding to each second page, the target classification model for document classification is selected from the candidate classification models trained in each round.

3. The method according to claim 2, characterized in that, The step of selecting the target classification model for document classification from the candidate classification models trained in each round, based on the encoding vector and category corresponding to each second page, includes: For each round of training, the encoding vector corresponding to each second page is input into the candidate classification model to obtain the confidence level of each second page belonging to multiple preset categories predicted by the candidate classification model. Based on the confidence level of each second page belonging to multiple preset categories and the category to which each second page belongs, the loss value corresponding to the candidate classification model is determined. Based on the loss values ​​corresponding to the candidate classification models after each round of training, the target classification model for document classification is selected from the candidate classification models after each round of training.

4. The method according to claim 1, characterized in that, The step of obtaining the position coordinates of at least one word included in each of the multiple sample pages includes: Obtain the multiple sample documents sent by the RPA robot; For each of the sample pages, obtain the optical character recognition (OCR) information of the sample page; Based on the OCR recognition information of the sample page, obtain the text content of at least one text fragment in the sample page; The text content of each of the aforementioned text segments is segmented into words to obtain at least one word included in each of the aforementioned text segments; Obtain the position coordinates of the area occupied by each of the text fragments; Based on the position coordinates of the area occupied by each text segment and the position of each word in the corresponding text segment, the position coordinates of each word are obtained.

5. A document classification method combining RPA and AI to achieve IA, characterized in that, The method includes: Obtain the target document sent by the RPA robot, wherein the target document includes at least one target page; Obtain the position coordinates of at least one word included in each of the target pages; Input the position coordinates of each word in each target page into the pre-trained document understanding model to obtain the encoding vector corresponding to each word in each target page; Based on the encoding vectors corresponding to each word in each target page, obtain the encoding vectors corresponding to each target page; The encoding vector corresponding to each target page is input into the target classification model to obtain the confidence level of each target page belonging to multiple preset categories; wherein, the target classification model is trained by the method of any one of claims 1-4; For each of the preset categories, determine the average confidence level of each target page belonging to the preset category; Based on the average value corresponding to each preset category, the category to which the target document belongs is determined from each preset category.

6. A training device for a classification model of IA that combines RPA and AI, characterized in that, The device includes: The first acquisition module is used to acquire the position coordinates of at least one word included in each of the multiple sample pages, and to acquire the category to which each of the sample pages belongs; The first processing module is used to input the position coordinates of each word in each of the sample pages into the pre-trained document understanding model in order to obtain the encoding vector corresponding to each word in each of the sample pages; The second acquisition module is used to acquire the encoding vector corresponding to each of the sample pages based on the encoding vector corresponding to each of the words in each of the sample pages; The training module is used to train the initial classification model by using the encoding vector and category corresponding to each sample page as training data, so as to obtain the target classification model for document classification.

7. The apparatus according to claim 6, characterized in that, The training module includes: A partitioning unit is used to divide the training data into a training set and a validation set. The training set includes multiple encoding vectors corresponding to multiple first pages, and the validation set includes multiple encoding vectors corresponding to multiple second pages. Each first page and each second page is labeled with its respective category. The training unit is used to train the initial classification model in multiple rounds based on the encoding vector and category corresponding to each of the first pages, so as to obtain the candidate classification model after each round of training. The selection unit is used to select the target classification model for document classification from the candidate classification models trained in each round, based on the encoding vector corresponding to each second page and its category.

8. The apparatus according to claim 7, characterized in that, The selection unit includes: The processing subunit is used to input the encoding vector corresponding to each second page into the candidate classification model after each round of training, so as to obtain the confidence of each second page belonging to multiple preset categories predicted by the candidate classification model, and determine the loss value corresponding to the candidate classification model based on the confidence of each second page belonging to multiple preset categories and the category to which each second page belongs. A sub-unit is selected to select the target classification model for document classification from the candidate classification models after each round of training, based on the loss value corresponding to the candidate classification models after each round of training.

9. The apparatus according to claim 6, characterized in that, The first acquisition module includes: The first acquisition subunit is used to acquire the multiple sample documents sent by the RPA robot; The second acquisition subunit is used to acquire optical character recognition (OCR) information of each sample page for each sample page. The third acquisition subunit is used to acquire the text content of at least one text fragment in the sample page based on the OCR recognition information of the sample page. A word segmentation unit is used to segment the text content of each text segment to obtain at least one word included in each text segment; The fourth acquisition subunit is used to acquire the position coordinates of the area occupied by each of the text fragments; The fifth acquisition subunit is used to acquire the position coordinates of each word based on the position coordinates of the area occupied by each text segment and the position of each word in the corresponding text segment.

10. A document classification device that combines RPA and AI to achieve IA, characterized in that, The device includes: The third acquisition module is used to acquire the target document sent by the RPA robot, wherein the target document includes at least one target page; The fourth acquisition module is used to acquire the position coordinates of at least one word included in each of the target pages; The second processing module is used to input the position coordinates of each word in each target page into the pre-trained document understanding model to obtain the encoding vector corresponding to each word in each target page; The fifth acquisition module is used to acquire the encoding vector corresponding to each of the target pages based on the encoding vector corresponding to each of the words in each of the target pages; The third processing module is used to input the encoding vector corresponding to each target page into the target classification model to obtain the confidence level of each target page belonging to multiple preset categories; wherein, the target classification model is trained by the method of any one of claims 1-4; The first determining module is used to determine, for each of the preset categories, the average confidence level of each target page belonging to the preset category; The second determining module is used to determine the category to which the target document belongs from each of the preset categories based on the average value corresponding to each preset category.

11. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements the method as described in any one of claims 1-4, or implements the method as described in claim 5.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the method as described in any one of claims 1-4, or implements the method as described in claim 5.

13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-4, or implements the method as described in claim 5.

Citation Information

Patent Citations

  • Text classification method and device combining RPA and AI, equipment and medium

    CN111813941A

  • Intelligent government affair text multi-classification method and system based on BERT

    CN111930937A