WO2023024614A1 - Document classification method and apparatus, electronic device and storage medium - Google Patents

Document classification method and apparatus, electronic device and storage medium Download PDF

Info

Publication number
WO2023024614A1
WO2023024614A1 PCT/CN2022/094788 CN2022094788W WO2023024614A1 WO 2023024614 A1 WO2023024614 A1 WO 2023024614A1 CN 2022094788 W CN2022094788 W CN 2022094788W WO 2023024614 A1 WO2023024614 A1 WO 2023024614A1
Authority
WO
WIPO (PCT)
Prior art keywords
text
feature
document
line
fusion
Prior art date
Application number
PCT/CN2022/094788
Other languages
French (fr)
Chinese (zh)
Inventor
李煜林
庾悦晨
钦夏孟
章成全
姚锟
韩钧宇
刘经拓
Original Assignee
北京百度网讯科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京百度网讯科技有限公司 filed Critical 北京百度网讯科技有限公司
Publication of WO2023024614A1 publication Critical patent/WO2023024614A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • G06F18/253Fusion techniques of extracted features

Definitions

  • the present disclosure relates to the technical field of artificial intelligence, in particular to the technical fields of computer vision and deep learning.
  • Documents are an important information carrier and are widely used in various business and office scenarios. In an automated office or input system, classifying different documents is one of the most critical processes.
  • the present disclosure provides a method, device, electronic equipment and storage medium for document classification.
  • a method for document classification including:
  • the category of the document to be processed is determined.
  • the text includes at least one line of text content; acquiring text information of the text included in the document to be processed includes: acquiring at least one line of text content and location information of the at least one line of text content.
  • performing fusion based on text information and image information to obtain fusion features includes: adding image information to position information of at least one line of text content, and then concatenating with at least one line of text content to obtain fusion features.
  • obtaining the feature sequence of the text according to the fusion feature includes: performing arithmetic averaging on the first character feature in at least one line of text content in the fusion feature, and combining the arithmetic mean result with the first word feature in at least one line of text content A position feature is multiplied to obtain the feature sequence of the text.
  • obtaining the feature sequence of the text according to the fusion feature includes: inputting the fusion feature into a stacked self-attention network to obtain an enhanced fusion feature; the initial weight of the self-attention network is the fusion feature.
  • the self-attention network is represented as follows:
  • W l* represents the learnable parameter matrix of the fully connected layer that multiple learning parameters do not share, * is a positive integer; d represents the feature dimension; H l represents the output of the l-layer self-attention network; V represents the fusion feature; ⁇ represents the normalization function.
  • obtaining the feature sequence of the text includes: arithmetically averaging the second single-character feature in at least one line of text content composed of the feature H1 output by the self-attention network, and combining the result of the arithmetic mean with a line of text The second position feature in the content is multiplied to obtain the feature sequence of the text.
  • the fused features are represented as follows:
  • T is the vector of the encoded single word in at least one line of text content
  • F is the vector of using the region of interest pooling algorithm to extract the image information of at least one line of text content on the entire image
  • S is the position code of at least one line of text content The vector after ; the vector dimensions of T, F, and S are the same.
  • acquiring the text information and image information of the text contained in the document to be processed includes: using a neural network to extract the image information of the document to be processed.
  • determining the category of the document to be processed includes:
  • Predefined document categories use the classifier function to obtain the probability of the feature sequence of the text on the predefined document categories;
  • the predefined document category with the highest probability value in the probability is taken as the category of the document.
  • a document classification device including:
  • An acquisition module configured to: acquire text information and image information of the text included in the document to be processed
  • the fusion feature module is used for: performing fusion based on text information and image information to obtain fusion features;
  • the feature sequence acquisition module is used to: acquire the feature sequence of the text according to the fusion feature;
  • the classification module is configured to: determine the category of the document to be processed based on the predefined document category and feature sequence.
  • a method for training a document classification model including:
  • the parameters of the document classification model are adjusted based on the correct probability value and the predicted probability distribution value, and a target document classification model is obtained in response to preset conditions.
  • an electronic device including:
  • the memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor, so that at least one processor can execute the method in any one of the above method technical solutions.
  • a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to make a computer execute the method in any one of the above-mentioned method technical solutions.
  • a computer program product including a computer program, and when the computer program is executed by a processor, the method in any one of the above method technical solutions is implemented.
  • the technical solution provided in the present disclosure proposes a document classification method for multimodal feature fusion. This method takes text content, text image blocks and text coordinates as input information to enhance the semantic expression of document features.
  • FIG. 1 shows a schematic flowchart of a method for classifying documents provided by an embodiment of the present disclosure
  • FIG. 2 shows a schematic flowchart of an optical character recognition method provided by an embodiment of the present disclosure
  • FIG. 3 shows a schematic flowchart of determining a document category according to a text feature sequence and a predefined document category provided by an embodiment of the present disclosure
  • Fig. 4 shows a schematic diagram of a document classification device provided by an embodiment of the present disclosure
  • FIG. 5 shows a schematic flowchart of a method for training a document classification model provided by an embodiment of the present disclosure
  • Fig. 6 is a block diagram of an electronic device used to implement the document classification method of the embodiment of the present disclosure.
  • Region of interest pooling algorithm ROI Pooling (RegionOFInterest); the pooling layer is sandwiched between consecutive convolutional layers to compress the amount of data and parameters and reduce overfitting; if the input is an image, then the pooling layer The main function of is to compress the image.
  • OCR Optical Character Recognition, Optical Character Recognition.
  • the methods for processing document classification include: manual approach: this approach is to fill in the report by the uploader or manual classification by the auditor, which is time-consuming, laborious and inefficient; image classification: classify the image through the visual information of the document; text classification: Based on the acquired document text content, use text to classify; classification based on image and text content: obtain classification results based on images and text respectively, and give the final result based on voting or predefined rules.
  • Fig. 1 shows a schematic flowchart of a method for document classification provided by an embodiment of the present disclosure. As shown in Fig. 1, the method may mainly include the following steps:
  • S101 Obtain the text information and image information of the text included in the document to be processed; use a camera to obtain the image of the document to be classified, which can be obtained by a mobile phone, camera, tablet computer, scanner, etc.
  • the image must contain text information, otherwise, it does not belong to the document classified in this disclosure.
  • the text and text information in the image is obtained through the text recognition algorithm, which is one of the basis for document classification; the image information includes the color feature, texture feature, shape feature and spatial relationship feature of the image.
  • S104 Determine the category of the document to be processed based on the predefined document category and feature sequence.
  • text information and image information are processed, and what is obtained through fusion may be a line text, a feature sequence of column text, or text in other arrangements.
  • the feature sequence of the text is processed, and the category of the document is determined in combination with the predefined document category.
  • Pre-defined document categories for example: VAT invoices in invoices, taxi tickets, tolls, train tickets, itinerary and other documents.
  • VAT invoices in invoices for example: VAT invoices in invoices, taxi tickets, tolls, train tickets, itinerary and other documents.
  • To classify invoices of the same type the technical solution of the present disclosure can be adopted. It can also be other types of documents, such as case sheets, prescription lists, medical record pages, inspection reports and other documents in hospital scenarios.
  • the text includes at least one line of text content; acquiring text information of the text included in the document to be processed includes: acquiring at least one line of text content and position information of at least one line of text content.
  • Acquiring at least one line of text content and location information of at least one line of text content includes: acquiring at least one line of text by using an optical character recognition method.
  • optical character recognition OCR
  • OCR can be used to obtain at least one line of text.
  • Fig. 2 shows a schematic flowchart of an optical character recognition method provided by an embodiment of the present disclosure. As shown in Fig. 2, the method may mainly include the following steps:
  • S201 Text detection algorithm: used to obtain position information of at least one line of text content in the document to be processed.
  • S202 Text recognition algorithm: used to obtain at least one line of text content.
  • the so-called text includes the position of the text content, the content of the text, and the horizontal and vertical arrangement, oblique arrangement or other arrangements of the text.
  • the technical solution can recognize row texts, column texts, or texts arranged in other ways, so that the application scope of the present disclosure is wider.
  • the text detection algorithm includes: EAST algorithm, which is a prior art, and will not be described in detail here.
  • the character recognition algorithm includes: CTC algorithm, which is also a prior art, and will not be described in detail here.
  • the OCR recognizes the position and content of a line of text, it means that the text information of the text in the document to be processed has been obtained.
  • Fusion based on text information and image information to obtain fusion features including: adding image information and position information of at least one line of text content, and then concatenating with at least one line of text content to obtain fusion features.
  • Acquiring the feature sequence of the text according to the fusion feature including: performing arithmetic mean of the first single character feature in at least one line of text content in the fusion feature, and multiplying the result of the arithmetic mean with the first position feature in at least one line of text to obtain A sequence of features for the text.
  • the first word feature in at least one line of text content is to encode each word t i in at least one line of text content into a 768-dimensional vector
  • the dimension can also be other numbers.
  • the first position feature in the position information of at least one line of text content is the 768-dimensional image information of a line of text in the document extracted by using a pooling algorithm (pooling) in the entire document This dimension can also be other numbers, but it must be consistent with the vector dimension encoded by the single word t i ; the first position feature also includes: for the 4-dimensional space coordinates of at least one line of text, it is also encoded as a 768-dimensional vector This dimension can also be other dimensions, but it must be consistent with the dimension of the vector encoded by the word t i .
  • the 4-dimensional space coordinates of at least one line of text are the upper left, upper right, lower left, and lower right coordinates of each text.
  • the document can be classified, and the category of the document can be determined according to the feature sequence of the text and the predefined document category.
  • Acquiring the feature sequence of the text according to the fusion feature including: inputting the fusion feature into the stacked self-attention network to obtain the enhanced fusion feature; the initial weight of the self-attention network is the fusion feature.
  • the representation of the self-attention network is as follows:
  • W l* represents the learnable parameter matrix of the fully connected layer that multiple learning parameters do not share, and * is a positive integer
  • d represents the feature dimension, which is 768 dimensions in the above technical solution
  • H l represents the self-attention of the l layer
  • the output of the network V represents the fusion feature
  • represents the normalization function, and in this embodiment, the normalization function adopts the sigmoid function. Taking the fused features as initial weights, stack H l step by step.
  • the self-attention network first uses two fully connected layers (W l1 and W l2 ) to calculate the input feature H l-1 , uses matrix multiplication for the calculated features, and normalizes it by the sigmoid function ⁇ to obtain the weight Matrix, the weight matrix is then multiplied by H l-1 to get a new feature H l and output as the lth layer.
  • Obtaining the feature sequence of the text including: performing arithmetic averaging on the second character feature in at least one line of text content composed of the feature H l output by the self-attention network, and comparing the result of the arithmetic mean with the second position in the line of text content
  • the features are multiplied to obtain the feature sequence of the text.
  • the second word feature is to encode each word t i in at least one line of text content into a 768-dimensional vector
  • the encoded features output by the above deep self-attention network are denoted by x.
  • the second position feature is the 768-dimensional image information of at least one line of text in the document extracted by pooling algorithm (pooling)
  • the encoded features output by the above-mentioned deep self-attention network are denoted by y, and y corresponds to the encoded features of the image information F and the position s of a line of text content.
  • the 768 dimension is an implementation in the embodiment, and may also be other dimensions. However, dimensions must be consistent before and after encoding.
  • the encoded H is expressed as:
  • H (x 1,1 ,x 1,2 ,...,x 1,k1 ,x 2,1 ,x 2,2 ,...,x 2,k2 ,...,x n,1 ,...,x n,kn ,y 1 ,...,y n )
  • the specific implementation method is: for all the second character features x r of a line of text content (such as the rth row, the rth column or the rth sorting of other arrangements), these second character features are arithmetically averaged and The Hadamard product of the result and the second position feature y r is obtained to obtain the feature sequence of a line of text content:
  • M ⁇ m r ; r ⁇ [1,N] ⁇ ;
  • T is the vector of the encoded single word in at least one line of text content
  • F is the vector of using the region of interest pooling algorithm to extract the image information of at least one line of text content on the entire image
  • S is the position code of at least one line of text content
  • Acquiring the text information and image information of the text included in the document to be processed includes: using a neural network to extract the image information of the document to be processed.
  • Neural networks include: convolutional neural networks.
  • Fig. 3 shows a schematic flowchart of determining a document category according to a text feature sequence and a predefined document category provided by an embodiment of the present disclosure. As shown in Fig. 3 , the method may mainly include the following steps:
  • S302 Use a classifier function to obtain the probability of the feature sequence of the text on the predefined document category; the classifier function includes: a softmax function.
  • M' mean(M), average all elements m in the text feature sequence M, then use a fully connected layer to a vector of predefined category size, and then use the softmax function to map to a probability distribution, expressed as follows:
  • scores is the mapped probability distribution value; fc is the fully connected layer.
  • S303 Take the predefined document category with the highest probability value among the probabilities as the category of the document.
  • cls is the classification category of the document
  • argmax is the function of taking the maximum value.
  • FIG. 4 shows a schematic diagram of a document classification device provided by the embodiment of the present disclosure.
  • the document classification apparatus 400 includes an acquisition module 401 , a fusion feature module 402 , a feature sequence acquisition module 403 and a classification module 404 .
  • the text includes at least one line of text content; when acquiring the text information of the text included in the document to be processed, the acquisition module 401 is further configured to: acquire at least one line of text content and location information of at least one line of text content.
  • the fusion feature module 402 when used for fusion based on text information and image information to obtain fusion features, it is also used for:
  • the image information is added to the position information of at least one line of text content, and then concatenated with at least one line of text content to obtain fusion features.
  • the feature sequence acquisition module 403 when used to acquire the feature sequence of the text according to the fusion feature, it is also used to: arithmetically average the first word feature in at least one line of text content in the fusion feature, and The result of the arithmetic mean is multiplied by the first position feature in at least one line of text content to obtain a feature sequence of the text.
  • the feature sequence acquisition module 403 when used to acquire the feature sequence of the text according to the fusion feature, it is also used to: input the fusion feature into the stacked self-attention network to obtain an enhanced fusion feature; the initial self-attention network The weights are fused features.
  • the representation of the self-attention network is as follows:
  • W l* represents the learnable parameter matrix of the fully connected layer that multiple learning parameters do not share, * is a positive integer; d represents the feature dimension; H l represents the output of the l-layer self-attention network; V represents the fusion feature; ⁇ represents the normalization function.
  • the feature sequence acquisition module 403 when used to acquire the feature sequence of the text, it is also used to: perform the second word feature in at least one row of text content composed of the feature H1 output by the self-attention network Arithmetic mean, and multiply the result of the arithmetic mean with the second position feature in a line of text content to obtain the feature sequence of the text.
  • the fusion feature is expressed as follows:
  • T is the vector of the encoded single word in at least one line of text content
  • F is the vector of using the region of interest pooling algorithm to extract the image information of at least one line of text content on the entire image
  • S is the position code of at least one line of text content The vector after ; the vector dimensions of T, F, and S are the same.
  • the obtaining module 401 is further configured to: use a neural network to extract image information of the document to be processed.
  • the classification module 404 is also used for:
  • the predefined document category with the highest probability value in the probability is taken as the category of the document.
  • FIG. 5 shows a schematic flowchart of a training method for a document classification model provided by an embodiment of the present disclosure. As shown in FIG. 5 , the method may mainly include the following steps:
  • S501 Predefine categories of test documents, and predefine correct probability values for documents of each category.
  • the categories of predefined test documents are as follows: such as forms, contracts, bills, certificates, etc.
  • the correct probability value for example, is as follows: the probability corresponding to the labeled category is 1, and the rest are 0.
  • S503 Process based on the text information and the image information to obtain a text feature sequence.
  • S504 Determine the predicted category of the test document and the predicted probability distribution value of the test document belonging to each category according to the feature sequence of the text and the category of the predefined test document.
  • S505 Adjust document classification model parameters based on the correct probability value and the predicted probability distribution value, and obtain a target document classification model in response to preset conditions.
  • the preset conditions include: the number of training rounds, the training time, and whether the training samples have been trained; the preset conditions can also include: whether the model converges in the later stage of training, for example: we will correct the probability (corresponding to the labeled category probability is 1 , the rest are 0) and the predicted probability distribution use the minimum cross-entropy function algorithm to calculate and optimize model parameters, and save model snapshots at fixed intervals, wait for the model to converge, that is, the cross-entropy will no longer decrease in the later stage of training, and obtain the snapshot version with the minimum cross-entropy Used as the optimal model for actual forecasting.
  • the technical solution provided by the disclosure integrates multiple modes, that is, text content, text position and image information, and avoids only processing information of a single mode to obtain document classification results.
  • Using the method of multi-modal fusion it effectively solves the visual attributes based on the document, which is limited to the format of the document and cannot handle similar documents; it solves the problem of using plain text for classification, ignoring the visual layout of the content in the document and the content in the document.
  • the image information that will exist can easily lead to semantic confusion; it solves the problem that the use of images and text is independent of each other, and the correlation between the two modal information is not considered, and there is a possibility of conflict.
  • the technical solution provided by the disclosure can effectively solve document confusion and improve classification accuracy.
  • the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
  • FIG. 6 shows a schematic block diagram of an example electronic device 600 that may be used to implement embodiments of the present disclosure.
  • Electronic device is intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers.
  • Electronic devices may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smart phones, wearable devices, and other similar computing devices.
  • the components shown herein, their connections and relationships, and their functions, are by way of example only, and are not intended to limit implementations of the disclosure described and/or claimed herein.
  • the device 600 includes a computing unit 601 that can execute according to a computer program stored in a read-only memory (ROM) 602 or loaded from a storage unit 608 into a random-access memory (RAM) 603. Various appropriate actions and treatments. In the RAM 803, various programs and data necessary for the operation of the device 600 can also be stored.
  • the computing unit 601, ROM 602, and RAM 603 are connected to each other through a bus 604.
  • An input/output (I/O) interface 605 is also connected to the bus 604 .
  • the I/O interface 605 includes: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a magnetic disk, an optical disk, etc. ; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, and the like.
  • the communication unit 609 allows the device 600 to exchange information/data with other devices over a computer network such as the Internet and/or various telecommunication networks.
  • the computing unit 601 may be various general-purpose and/or special-purpose processing components having processing and computing capabilities. Some examples of computing units 601 include, but are not limited to, central processing units (CPUs), graphics processing units (GPUs), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, digital signal processing processor (DSP), and any suitable processor, controller, microcontroller, etc.
  • the computing unit 601 executes the various methods and processes described above, such as the document classification method.
  • the document classification method can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a memory Unit 608.
  • part or all of the computer program may be loaded and/or installed on the device 600 via the ROM 602 and/or the communication unit 609.
  • the computer program When the computer program is loaded into RAM 603 and executed by computing unit 601, one or more steps of the document classification method described above may be performed.
  • the computing unit 601 may be configured in any other appropriate way (for example, by means of firmware) to execute the document classification method.
  • Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips Implemented in a system of systems (SOC), load programmable logic device (CPLD), computer hardware, firmware, software, and/or combinations thereof.
  • FPGAs field programmable gate arrays
  • ASICs application specific integrated circuits
  • ASSPs application specific standard products
  • SOC system of systems
  • CPLD load programmable logic device
  • computer hardware firmware, software, and/or combinations thereof.
  • programmable processor can be special-purpose or general-purpose programmable processor, can receive data and instruction from storage system, at least one input device, and at least one output device, and transmit data and instruction to this storage system, this at least one input device, and this at least one output device an output device.
  • Program codes for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special purpose computer, or other programmable data processing devices, so that the program codes, when executed by the processor or controller, make the functions/functions specified in the flow diagrams and/or block diagrams Action is implemented.
  • the program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device.
  • a machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • a machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing.
  • machine-readable storage media would include one or more wire-based electrical connections, portable computer discs, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.
  • RAM random access memory
  • ROM read only memory
  • EPROM or flash memory erasable programmable read only memory
  • CD-ROM compact disk read only memory
  • magnetic storage or any suitable combination of the foregoing.
  • the systems and techniques described herein can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user. ); and a keyboard and pointing device (eg, a mouse or a trackball) through which a user can provide input to the computer.
  • a display device e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor
  • a keyboard and pointing device eg, a mouse or a trackball
  • Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and can be in any form (including Acoustic input, speech input or, tactile input) to receive input from the user.
  • the systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., as a a user computer having a graphical user interface or web browser through which a user can interact with embodiments of the systems and techniques described herein), or including such backend components, middleware components, Or any combination of front-end components in a computing system.
  • the components of the system can be interconnected by any form or medium of digital data communication, eg, a communication network. Examples of communication networks include: Local Area Network (LAN), Wide Area Network (WAN) and the Internet.
  • a computer system may include clients and servers.
  • Clients and servers are generally remote from each other and typically interact through a communication network.
  • the relationship of client and server arises by computer programs running on the respective computers and having a client-server relationship to each other.
  • steps may be reordered, added or deleted using the various forms of flow shown above.
  • each step described in the present disclosure may be executed in parallel, sequentially, or in a different order, as long as the desired result of the technical solution disclosed in the present disclosure can be achieved, no limitation is imposed herein.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present disclosure provides a document classification method and apparatus, an electronic device and a storage medium, which relate to the technical field of artificial intelligence, in particular to the technical fields of computer vision and deep learning, and can be applied in smart city and smart finance scenarios. A specific implementation solution is: a document classification method, comprising: acquiring text information and image information of text comprised in a document to be processed; performing fusion on the basis of the text information and the image information to obtain a fusion feature; acquiring a feature sequence of the text according to the fusion feature; and determining the category of the document on the basis of a predefined document category and the feature sequence. The technical solution provided in the present disclosure solves the technical problem of document obfuscation in document classification, and improves the classification accuracy.

Description

文档分类的方法、装置、电子设备和存储介质Method, device, electronic device and storage medium for classifying documents
本公开要求申请号为202110994014.X,申请日为2021年8月27日,名称为“文档分类的方法、装置、电子设备和存储介质”的中国专利申请的优先权,其中,上述专利申请公开的内容通过引用结合在本公开中。This disclosure claims the priority of the Chinese patent application with the application number 202110994014.X, the application date is August 27, 2021, and the title is "Document Classification Method, Device, Electronic Equipment, and Storage Medium", wherein the above patent application is published The contents of are incorporated by reference in this disclosure.
技术领域technical field
本公开涉及人工智能技术领域,尤其涉及计算机视觉和深度学习技术领域。The present disclosure relates to the technical field of artificial intelligence, in particular to the technical fields of computer vision and deep learning.
背景技术Background technique
文档是一种重要的信息载体,被广泛用于各种商业、办公等场景。在自动化办公或者录入系统中,对不同文档进行分类是最关键的流程之一。Documents are an important information carrier and are widely used in various business and office scenarios. In an automated office or input system, classifying different documents is one of the most critical processes.
发明内容Contents of the invention
本公开提供了一种用于文档分类的方法、装置、电子设备和存储介质。The present disclosure provides a method, device, electronic equipment and storage medium for document classification.
根据本公开的一方面,提供了一种文档分类的方法,包括:According to an aspect of the present disclosure, a method for document classification is provided, including:
获取待处理文档包括的文本的文本信息和图像信息;Acquiring text information and image information of the text included in the document to be processed;
基于文本信息和图像信息进行融合得到融合特征;Based on the fusion of text information and image information to obtain fusion features;
根据融合特征获取文本的特征序列;Acquire the feature sequence of the text according to the fusion feature;
基于预先定义的文档类别和特征序列,确定待处理文档的类别。Based on the predefined document category and feature sequence, the category of the document to be processed is determined.
在一些实施例中,文本包括至少一行文本内容;获取待处理文档包括的文本的文本信息,包括:获取至少一行文本内容和至少一行文本内容的位置信息。In some embodiments, the text includes at least one line of text content; acquiring text information of the text included in the document to be processed includes: acquiring at least one line of text content and location information of the at least one line of text content.
在一些实施例中,基于文本信息和图像信息进行融合得到融合特征,包括:将图像信息和至少一行文本内容的位置信息相加,再与至少一行文本内容串联,获得融合特征。In some embodiments, performing fusion based on text information and image information to obtain fusion features includes: adding image information to position information of at least one line of text content, and then concatenating with at least one line of text content to obtain fusion features.
在一些实施例中,根据融合特征获取文本的特征序列,包括:将融合特征中的至少一行文本内容中的第一单字特征进行算术平均,并将算术平均的结果与至少一行文本内容中的第一位置特征 做乘积,得到文本的特征序列。In some embodiments, obtaining the feature sequence of the text according to the fusion feature includes: performing arithmetic averaging on the first character feature in at least one line of text content in the fusion feature, and combining the arithmetic mean result with the first word feature in at least one line of text content A position feature is multiplied to obtain the feature sequence of the text.
在一些实施例中,根据融合特征获取文本的特征序列,包括:将融合特征输入堆叠自注意力网络获得增强的融合特征;自注意力网络的初始权重为融合特征。In some embodiments, obtaining the feature sequence of the text according to the fusion feature includes: inputting the fusion feature into a stacked self-attention network to obtain an enhanced fusion feature; the initial weight of the self-attention network is the fusion feature.
在一些实施例中,自注意力网络的表示如下:In some embodiments, the self-attention network is represented as follows:
H 0=V H 0 =V
Figure PCTCN2022094788-appb-000001
Figure PCTCN2022094788-appb-000001
其中,W l*表示多个学习参数不共享的全连接层的可学习参数矩阵,*为正整数;d表示特征维度;H l表示第l层自注意力网络的输出;V表示融合特征;σ表示归一化函数。 Among them, W l* represents the learnable parameter matrix of the fully connected layer that multiple learning parameters do not share, * is a positive integer; d represents the feature dimension; H l represents the output of the l-layer self-attention network; V represents the fusion feature; σ represents the normalization function.
在一些实施例中,获取文本的特征序列,包括:将经过自注意力网络输出的特征H l组成的至少一行文本内容中的第二单字特征进行算术平均,并将算术平均的结果与一行文本内容中的第二位置特征做乘积,得到文本的特征序列。 In some embodiments, obtaining the feature sequence of the text includes: arithmetically averaging the second single-character feature in at least one line of text content composed of the feature H1 output by the self-attention network, and combining the result of the arithmetic mean with a line of text The second position feature in the content is multiplied to obtain the feature sequence of the text.
在一些实施例中,融合特征表示如下:In some embodiments, the fused features are represented as follows:
V=concat(T,F+S)V=concat(T,F+S)
其中,T为至少一行文本内容中的编码后的单字的向量;F为使用感兴趣区域池化算法提取至少一行文本内容在整个图像上的图像信息的向量;S为至少一行文本内容的位置编码后的向量;T、F和S的向量维度相同。Among them, T is the vector of the encoded single word in at least one line of text content; F is the vector of using the region of interest pooling algorithm to extract the image information of at least one line of text content on the entire image; S is the position code of at least one line of text content The vector after ; the vector dimensions of T, F, and S are the same.
在一些实施例中,获取待处理文档包括的文本的文本信息和图像信息,包括:利用神经网络提取待处理文档的图像信息。In some embodiments, acquiring the text information and image information of the text contained in the document to be processed includes: using a neural network to extract the image information of the document to be processed.
在一些实施例中,基于预先定义的文档类别和特征序列,确定待处理文档的类别,包括:In some embodiments, based on a predefined document category and feature sequence, determining the category of the document to be processed includes:
预定义文档类别;使用分类器函数获取文本的特征序列在预定义文档类别上的概率;Predefined document categories; use the classifier function to obtain the probability of the feature sequence of the text on the predefined document categories;
取概率中概率值最高的预定义文档类别作为文档的类别。The predefined document category with the highest probability value in the probability is taken as the category of the document.
根据本公开的第二方面,还提供一种文档分类装置,包括:According to a second aspect of the present disclosure, there is also provided a document classification device, including:
获取模块,用于:获取待处理文档包括的文本的文本信息和图 像信息;An acquisition module, configured to: acquire text information and image information of the text included in the document to be processed;
融合特征模块,用于:基于文本信息和图像信息进行融合得到融合特征;The fusion feature module is used for: performing fusion based on text information and image information to obtain fusion features;
特征序列获取模块,用于:根据融合特征获取文本的特征序列;The feature sequence acquisition module is used to: acquire the feature sequence of the text according to the fusion feature;
分类模块,用于:基于预先定义的文档类别和特征序列,确定待处理文档的类别。The classification module is configured to: determine the category of the document to be processed based on the predefined document category and feature sequence.
根据本公开的第三方面,还提供一种文档分类模型的训练方法,包括:According to a third aspect of the present disclosure, a method for training a document classification model is also provided, including:
预定义测试文档的类别,并且预定义每个类别文档的正确概率值;Predefine the categories of test documents, and predefine the correct probability value of each category document;
获取测试文档的文本的文本信息和图像信息;Obtain the text information and image information of the text of the test document;
基于文本信息和图像信息进行处理得到文本的特征序列;Processing based on text information and image information to obtain the feature sequence of the text;
根据文本的特征序列,以及预定义测试文档的类别,确定测试文档的预测类别和测试文档属于每个类别文档的预测概率分布值;According to the feature sequence of the text and the category of the predefined test document, determine the predicted category of the test document and the predicted probability distribution value of the test document belonging to each category of document;
基于正确概率值和预测概率分布值调整文档分类模型参数,响应于预设条件,获得目标文档分类模型。The parameters of the document classification model are adjusted based on the correct probability value and the predicted probability distribution value, and a target document classification model is obtained in response to preset conditions.
根据本公开的第四方面,还提供一种电子设备,包括:According to a fourth aspect of the present disclosure, there is also provided an electronic device, including:
至少一个处理器;以及at least one processor; and
与至少一个处理器通信连接的存储器;其中,memory communicatively coupled to at least one processor; wherein,
存储器存储有可被至少一个处理器执行的指令,指令被至少一个处理器执行,以使至少一个处理器能够执行上述方法技术方案中任一项的方法。The memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor, so that at least one processor can execute the method in any one of the above method technical solutions.
根据本公开的第五方面,还提供一种存储有计算机指令的非瞬时计算机可读存储介质,其中,计算机指令用于使计算机执行上述方法技术方案中任一项的方法。According to a fifth aspect of the present disclosure, there is also provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to make a computer execute the method in any one of the above-mentioned method technical solutions.
根据本公开的第六方面,还提供一种计算机程序产品,包括计算机程序,计算机程序在被处理器执行时实现上述方法技术方案中任一项的方法。According to a sixth aspect of the present disclosure, there is also provided a computer program product, including a computer program, and when the computer program is executed by a processor, the method in any one of the above method technical solutions is implemented.
本公开提供的技术方案具有如下的有益效果:The technical solution provided by the present disclosure has the following beneficial effects:
(1)本公开提供的技术方案提出一种多模态特征融合的文档分类方法。该方法将文字内容、文字图像块和文字的坐标作为输入信息,增强文档特征的语义表达。(1) The technical solution provided in the present disclosure proposes a document classification method for multimodal feature fusion. This method takes text content, text image blocks and text coordinates as input information to enhance the semantic expression of document features.
(2)本公开提供的技术方案通过搭建深度自注意力网络融合文档的多模态特征,能有效地解决文档混淆,提升分类精度。(2) The technical solution provided by this disclosure can effectively solve document confusion and improve classification accuracy by building a deep self-attention network to fuse multi-modal features of documents.
应当理解,本部分所描述的内容并非旨在标识本公开的实施例的关键或重要特征,也不用于限制本公开的范围。本公开的其它特征将通过以下的说明书而变得容易理解。It should be understood that what is described in this section is not intended to identify key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will be readily understood through the following description.
附图说明Description of drawings
附图用于更好地理解本方案,不构成对本公开的限定。其中:The accompanying drawings are used to better understand the present solution, and do not constitute a limitation to the present disclosure. in:
图1示出了本公开实施例提供的一种文档分类的方法的流程示意图;FIG. 1 shows a schematic flowchart of a method for classifying documents provided by an embodiment of the present disclosure;
图2示出了本公开实施例提供的光学字符识别法的流程示意图;FIG. 2 shows a schematic flowchart of an optical character recognition method provided by an embodiment of the present disclosure;
图3示出了本公开实施例提供的根据文本的特征序列以及预先定义的文档类别确定文档的类别的流程示意图;FIG. 3 shows a schematic flowchart of determining a document category according to a text feature sequence and a predefined document category provided by an embodiment of the present disclosure;
图4示出了本公开实施例提供的一种文档分类装置的示意图;Fig. 4 shows a schematic diagram of a document classification device provided by an embodiment of the present disclosure;
图5示出了本公开实施例提供的一种文档分类模型的训练方法的流程示意图;FIG. 5 shows a schematic flowchart of a method for training a document classification model provided by an embodiment of the present disclosure;
图6是用来实现本公开实施例的文档分类的方法的电子设备的框图。Fig. 6 is a block diagram of an electronic device used to implement the document classification method of the embodiment of the present disclosure.
具体实施方式Detailed ways
以下结合附图对本公开的示范性实施例做出说明,其中包括本公开实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本公开的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and they should be regarded as exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
术语解释:Explanation of terms:
感兴趣区域池化算法:ROI Pooling(RegionOFInterest);池化层夹在连续的卷积层中间,用于压缩数据和参数的量,减小过拟合;如果输入是图像的话,那么池化层的最主要作用就是压缩图像。Region of interest pooling algorithm: ROI Pooling (RegionOFInterest); the pooling layer is sandwiched between consecutive convolutional layers to compress the amount of data and parameters and reduce overfitting; if the input is an image, then the pooling layer The main function of is to compress the image.
OCR:光学光学字符识别法,Optical Character Recognition。OCR: Optical Character Recognition, Optical Character Recognition.
现有技术中,处理文档分类的方法包括:人工途径:该途径在于上传人员填报或者审核员人工分类,耗时费力,效率底下;图像分类:通过文档的视觉信息对图像进行分类;文本分类:基于获取的文档文字内容,利用文本进行分类;基于图像和文本内容的分类:分别基于图像和文本获得分类结果,并基于投票或者预定义规则给出最终结果。In the prior art, the methods for processing document classification include: manual approach: this approach is to fill in the report by the uploader or manual classification by the auditor, which is time-consuming, laborious and inefficient; image classification: classify the image through the visual information of the document; text classification: Based on the acquired document text content, use text to classify; classification based on image and text content: obtain classification results based on images and text respectively, and give the final result based on voting or predefined rules.
目前的文档分类技术大多考虑单一特征的方法,忽略文档排版和文字的关联性。本公开提供的技术方案解决了上述技术问题。Most of the current document classification techniques consider the method of a single feature, ignoring the relevance of document layout and text. The technical solutions provided by the present disclosure solve the above technical problems.
图1示出了本公开实施例提供的一种文档分类的方法的流程示意图,如图1所示,该方法主要可以包括以下步骤:Fig. 1 shows a schematic flowchart of a method for document classification provided by an embodiment of the present disclosure. As shown in Fig. 1, the method may mainly include the following steps:
S101:获取待处理文档包括的文本的文本信息和图像信息;利用摄像头获取打算分类的文档的图像,可以用手机、相机、平板电脑、扫描仪等获取。图像中必定包含文字信息,否则,也不属于本公开分类的文档。通过文本识别算法获取了图像中的文本、文字信息,是用于文档分类的依据之一;图像信息包括图像的颜色特征、纹理特征、形状特征和空间关系特征。S101: Obtain the text information and image information of the text included in the document to be processed; use a camera to obtain the image of the document to be classified, which can be obtained by a mobile phone, camera, tablet computer, scanner, etc. The image must contain text information, otherwise, it does not belong to the document classified in this disclosure. The text and text information in the image is obtained through the text recognition algorithm, which is one of the basis for document classification; the image information includes the color feature, texture feature, shape feature and spatial relationship feature of the image.
S102:基于文本信息和图像信息进行融合得到融合特征;S102: Fusion based on text information and image information to obtain fusion features;
S103:根据融合特征获取文本的特征序列;S103: Obtain a feature sequence of the text according to the fusion feature;
S104:基于预先定义的文档类别和特征序列,确定待处理文档的类别。S104: Determine the category of the document to be processed based on the predefined document category and feature sequence.
本公开将文本信息和图像信息进行处理,融合得到的可以是行文本,也可以是列文本的特征序列,也可以是其他排列方式的文本。所谓文本的特征序列举个例子,即是有文字如:“我很幸福”,那么该文本的特征序列是:M={m r;r∈[1,4]};m表示一个单字的特征序列。 In the present disclosure, text information and image information are processed, and what is obtained through fusion may be a line text, a feature sequence of column text, or text in other arrangements. The so-called feature sequence of the text is an example, that is, there is a text such as: "I am very happy", then the feature sequence of the text is: M={m r ;r∈[1,4]}; m represents the feature of a single word sequence.
将文本的特征序列进行处理,并结合预先定义的文档类别确定文档的类别。预先定义的文档类别,举例如:发票中的增值税发票、出租车票、通行费、火车票、行程单等票据。对同类型的发票进行分类,可以采用本公开的技术方案。也可以是其他类别的文档,例如在医院场景中的病例单,处方单、病案首页、检查报告等文档。The feature sequence of the text is processed, and the category of the document is determined in combination with the predefined document category. Pre-defined document categories, for example: VAT invoices in invoices, taxi tickets, tolls, train tickets, itinerary and other documents. To classify invoices of the same type, the technical solution of the present disclosure can be adopted. It can also be other types of documents, such as case sheets, prescription lists, medical record pages, inspection reports and other documents in hospital scenarios.
文本包括至少一行文本内容;获取待处理文档包括的文本的文本信息,包括:获取至少一行文本内容和至少一行文本内容的位置信息。The text includes at least one line of text content; acquiring text information of the text included in the document to be processed includes: acquiring at least one line of text content and position information of at least one line of text content.
获取至少一行文本内容和至少一行文本内容的位置信息,包括:利用光学字符识别法获取至少一行文本。现有的文本识别算法中,多采用光学字符识别法,即OCR。利用OCR可以获取至少一行文本。Acquiring at least one line of text content and location information of at least one line of text content includes: acquiring at least one line of text by using an optical character recognition method. Among the existing text recognition algorithms, optical character recognition (OCR) is mostly used. OCR can be used to obtain at least one line of text.
图2示出了本公开实施例提供的光学字符识别法的流程示意图,如图2所示,该方法主要可以包括以下步骤:Fig. 2 shows a schematic flowchart of an optical character recognition method provided by an embodiment of the present disclosure. As shown in Fig. 2, the method may mainly include the following steps:
S201:文字检测算法:用于获取待处理文档中的至少一行文本内容的位置信息。S201: Text detection algorithm: used to obtain position information of at least one line of text content in the document to be processed.
S202:文字识别算法:用于获取至少一行文本内容。所谓的文本包括了文本内容的位置,文本的内容,以及文本的横竖排列、斜向排列或者其他排列方式。本技术方案即可识别行文本,也可识别列文本,也可以是其他排列方式的文本,使得本公开的应用范围较广。文字检测算法包括:EAST算法,其是现有技术,在此不赘述。文字检测算法获取的是文档中至少一行文本内容的位置信息。具体的输出一行文本内容的左上、右上、左下、右下坐标S={s i;i∈N}。文字识别算法包括:CTC算法,也是现有技术,在此不赘述。文字识别算法得到一行文本内容T={t i;i∈N},定义一行文本内容t i具有k i个单字t i={c ij;j∈k i}。当OCR识别出了一行文本内容的位置、一行文本的内容,则表示获取了该待处理文档中的文本的文本信息。 S202: Text recognition algorithm: used to obtain at least one line of text content. The so-called text includes the position of the text content, the content of the text, and the horizontal and vertical arrangement, oblique arrangement or other arrangements of the text. The technical solution can recognize row texts, column texts, or texts arranged in other ways, so that the application scope of the present disclosure is wider. The text detection algorithm includes: EAST algorithm, which is a prior art, and will not be described in detail here. The text detection algorithm obtains the position information of at least one line of text content in the document. Specifically output the upper left, upper right, lower left, and lower right coordinates S={s i ; i∈N} of a line of text content. The character recognition algorithm includes: CTC algorithm, which is also a prior art, and will not be described in detail here. The character recognition algorithm obtains a line of text content T={t i ; i∈N}, and defines a line of text content t i with k i words t i ={c ij ; j∈ki } . When the OCR recognizes the position and content of a line of text, it means that the text information of the text in the document to be processed has been obtained.
基于文本信息和图像信息进行融合得到融合特征,包括:将图像信息和至少一行文本内容的位置信息相加,再与至少一行文本内容串联,获得融合特征。Fusion based on text information and image information to obtain fusion features, including: adding image information and position information of at least one line of text content, and then concatenating with at least one line of text content to obtain fusion features.
获得了文档的文本信息和图像信息,并对其进行融合是本技术方案不同于现有技术的技术特征。通过融合多模态特征增强文本语义表达。所谓多模态,即是文档的文本信息和图像信息两个模态。Obtaining text information and image information of a document and merging them is a technical feature of this technical solution that is different from the prior art. Enhance text semantic expression by fusing multimodal features. The so-called multi-modality refers to the two modes of document text information and image information.
根据融合特征获取文本的特征序列,包括:将融合特征中的至少一行文本内容中的第一单字特征进行算术平均,并将算术平均的结果与至少一行文本中的第一位置特征做乘积,得到文本的特征序列。Acquiring the feature sequence of the text according to the fusion feature, including: performing arithmetic mean of the first single character feature in at least one line of text content in the fusion feature, and multiplying the result of the arithmetic mean with the first position feature in at least one line of text to obtain A sequence of features for the text.
至少一行文本内容中的第一单字特征,是将至少一行文本内容中每个单字t i编码成一个768维的向量
Figure PCTCN2022094788-appb-000002
该维度也可以是其他的数目。只要能够将第一单字特征提取出来即可。至少一行文本内容的位置信息中 的第一位置特征,是利用池化算法(pooling)提取出的文档中的一行文本在整个文档中的768维的图像信息
Figure PCTCN2022094788-appb-000003
该维度也可以是其他数目,但是,必须与单字t i编码成的向量维度一致;该第一位置特征还包括:对于至少一行文本的4维空间坐标,同样编码为768维的向量
Figure PCTCN2022094788-appb-000004
该维度也可以是其他维度,但是必须与单字t i编码成的向量维度一致。至少一行文本的4维空间坐标,即是每段文本的左上、右上、左下、右下坐标。
The first word feature in at least one line of text content is to encode each word t i in at least one line of text content into a 768-dimensional vector
Figure PCTCN2022094788-appb-000002
The dimension can also be other numbers. As long as the first word feature can be extracted. The first position feature in the position information of at least one line of text content is the 768-dimensional image information of a line of text in the document extracted by using a pooling algorithm (pooling) in the entire document
Figure PCTCN2022094788-appb-000003
This dimension can also be other numbers, but it must be consistent with the vector dimension encoded by the single word t i ; the first position feature also includes: for the 4-dimensional space coordinates of at least one line of text, it is also encoded as a 768-dimensional vector
Figure PCTCN2022094788-appb-000004
This dimension can also be other dimensions, but it must be consistent with the dimension of the vector encoded by the word t i . The 4-dimensional space coordinates of at least one line of text are the upper left, upper right, lower left, and lower right coordinates of each text.
至此,已经可以对文档进行分类,根据文本的特征序列,以及预先定义的文档类别,确定文档的类别。So far, the document can be classified, and the category of the document can be determined according to the feature sequence of the text and the predefined document category.
但是,为了进一步增强融合特征在空间、视觉,语义等维度上的信息表示,可以采用基于多层自注意力网络堆叠深度网络的技术方案。However, in order to further enhance the information representation of fusion features in spatial, visual, semantic and other dimensions, a technical solution based on multi-layer self-attention network stacking deep networks can be used.
根据融合特征获取文本的特征序列,包括:将融合特征输入堆叠自注意力网络获得增强的融合特征;自注意力网络的初始权重为融合特征。Acquiring the feature sequence of the text according to the fusion feature, including: inputting the fusion feature into the stacked self-attention network to obtain the enhanced fusion feature; the initial weight of the self-attention network is the fusion feature.
自注意力网络的表示如下:The representation of the self-attention network is as follows:
H 0=V H 0 =V
Figure PCTCN2022094788-appb-000005
Figure PCTCN2022094788-appb-000005
其中,W l*表示多个学习参数不共享的全连接层的可学习参数矩阵,*为正整数;d表示特征维度,在上述技术方案中为768维;H l表示第l层自注意力网络的输出;V表示融合特征;σ表示归一化函数,本实施例中,归一化函数采用的是sigmoid函数。将融合特征作为初始权重,逐步堆叠H l。自注意力网络首先使用两个全连接层(W l1和W l2)对输入特征H l-1进行计算,对计算后的特征使用矩阵乘法,并通过sigmoid函数σ进行归一化,从而获得权重矩阵,该权重矩阵再与H l-1进行相乘得到到新的特征H l并作为第l层输出。 Among them, W l* represents the learnable parameter matrix of the fully connected layer that multiple learning parameters do not share, and * is a positive integer; d represents the feature dimension, which is 768 dimensions in the above technical solution; H l represents the self-attention of the l layer The output of the network; V represents the fusion feature; σ represents the normalization function, and in this embodiment, the normalization function adopts the sigmoid function. Taking the fused features as initial weights, stack H l step by step. The self-attention network first uses two fully connected layers (W l1 and W l2 ) to calculate the input feature H l-1 , uses matrix multiplication for the calculated features, and normalizes it by the sigmoid function σ to obtain the weight Matrix, the weight matrix is then multiplied by H l-1 to get a new feature H l and output as the lth layer.
获取文本的特征序列,包括:将经过自注意力网络输出的特征H l组成的至少一行文本内容中的第二单字特征进行算术平均,并将算术平均的结果与一行文本内容中的第二位置特征做乘积,得到文本的特征序列。第二单字特征是将至少一行文本内容中每个单字t i编码成一个768维的向量
Figure PCTCN2022094788-appb-000006
并且经过上述深度自注意力网络输出的编码后的特征,用x表示。 第二位置特征是利用池化算法(pooling)提取出的文档中的至少一行文本在整个文档中的768维的图像信息
Figure PCTCN2022094788-appb-000007
并且经过上述深度自注意力网络输出的编码后的特征,用y表示,y对应于图像信息F和一行文本内容的位置s的编码后特征。768维度是实施例中的一种实现,也可以是其他维度。不过,编码前后都必须保持维度一致。编码后的H表示为:
Obtaining the feature sequence of the text, including: performing arithmetic averaging on the second character feature in at least one line of text content composed of the feature H l output by the self-attention network, and comparing the result of the arithmetic mean with the second position in the line of text content The features are multiplied to obtain the feature sequence of the text. The second word feature is to encode each word t i in at least one line of text content into a 768-dimensional vector
Figure PCTCN2022094788-appb-000006
And the encoded features output by the above deep self-attention network are denoted by x. The second position feature is the 768-dimensional image information of at least one line of text in the document extracted by pooling algorithm (pooling)
Figure PCTCN2022094788-appb-000007
And the encoded features output by the above-mentioned deep self-attention network are denoted by y, and y corresponds to the encoded features of the image information F and the position s of a line of text content. The 768 dimension is an implementation in the embodiment, and may also be other dimensions. However, dimensions must be consistent before and after encoding. The encoded H is expressed as:
H=(x 1,1,x 1,2,…,x 1,k1,x 2,1,x 2,2,…,x 2,k2,…,x n,1,…,x n,kn,y 1,…,y n) H=(x 1,1 ,x 1,2 ,…,x 1,k1 ,x 2,1 ,x 2,2 ,…,x 2,k2 ,…,x n,1 ,…,x n,kn ,y 1 ,…,y n )
将经过自注意力网络输出的特征H l组成的至少一行文本内容中的第二单字特征进行算术平均,并将算术平均的结果与一行文本内容中的第二位置特征做乘积,得到文本的特征序列。具体实施方式为:针对于一行文本内容(例如第r行,第r列或其他排列方式的第r排序)的所有第二单字特征x r,*,将这些第二单字特征进行算术平均并将结果与第二位置特征y r做哈达玛积,得到一行文本内容的特征序列: Carry out arithmetic mean to the second character feature in at least one line of text content composed of the feature H l output by the self-attention network, and multiply the result of the arithmetic mean with the second position feature in a line of text content to obtain the feature of the text sequence. The specific implementation method is: for all the second character features x r of a line of text content (such as the rth row, the rth column or the rth sorting of other arrangements), these second character features are arithmetically averaged and The Hadamard product of the result and the second position feature y r is obtained to obtain the feature sequence of a line of text content:
M={m r;r∈[1,N]}; M={m r ; r∈[1,N]};
其中,
Figure PCTCN2022094788-appb-000008
in,
Figure PCTCN2022094788-appb-000008
融合特征表示如下:The fusion features are expressed as follows:
V=concat(T,F+S)V=concat(T,F+S)
其中,T为至少一行文本内容中的编码后的单字的向量;F为使用感兴趣区域池化算法提取至少一行文本内容在整个图像上的图像信息的向量;S为至少一行文本内容的位置编码后的向量;T、F和S的向量维度相同。获取待处理文档包括的文本的文本信息和图像信息,包括:利用神经网络提取待处理文档的图像信息。神经网络包括:卷积神经网络。Among them, T is the vector of the encoded single word in at least one line of text content; F is the vector of using the region of interest pooling algorithm to extract the image information of at least one line of text content on the entire image; S is the position code of at least one line of text content The vector after ; the vector dimensions of T, F, and S are the same. Acquiring the text information and image information of the text included in the document to be processed includes: using a neural network to extract the image information of the document to be processed. Neural networks include: convolutional neural networks.
图3示出了本公开实施例提供的根据文本的特征序列以及预先定义的文档类别确定文档的类别的流程示意图,如图3所示,该方法主要可以包括以下步骤:Fig. 3 shows a schematic flowchart of determining a document category according to a text feature sequence and a predefined document category provided by an embodiment of the present disclosure. As shown in Fig. 3 , the method may mainly include the following steps:
S301:预定义文档类别。S301: Predefine document categories.
首先,确定文档的类别,例如是发票或医院检查单据等等。First, determine the category of the document, such as an invoice or a hospital inspection document, and so on.
S302:使用分类器函数获取文本的特征序列在预定义文档类别上的概率;分类器函数包括:softmax函数。S302: Use a classifier function to obtain the probability of the feature sequence of the text on the predefined document category; the classifier function includes: a softmax function.
M′=mean(M),把文本特征序列M中所有元素m做平均,然后使用一个全连接层到预定义类别大小的向量,然后使用softmax函数映射为概 率分布,表示如下:M'=mean(M), average all elements m in the text feature sequence M, then use a fully connected layer to a vector of predefined category size, and then use the softmax function to map to a probability distribution, expressed as follows:
Figure PCTCN2022094788-appb-000009
Figure PCTCN2022094788-appb-000009
其中,scores为映射出的概率分布值;fc为全连接层。Among them, scores is the mapped probability distribution value; fc is the fully connected layer.
S303:取概率中概率值最高的预定义文档类别作为文档的类别。S303: Take the predefined document category with the highest probability value among the probabilities as the category of the document.
cls=argmax(scores)cls=argmax(scores)
其中,cls为文档的分类类别,argmax是取最大值的函数。Among them, cls is the classification category of the document, and argmax is the function of taking the maximum value.
至此,在融合特征,以及增强融合特征在空间、视觉、语义等维度上的信息表示后,基于文本的特征序列进行分类,达到了文档分类的要求。So far, after merging features and enhancing the information representation of fused features in spatial, visual, semantic and other dimensions, the text-based feature sequence is classified, meeting the requirements of document classification.
基于与上述的对象标注方法相同的原理,本公开实施例还提供了另一种文档分类装置,图4示出了本公开实施例提供的一种文档分类装置的示意图,如图4所示,文档分类装置400包括获取模块401、融合特征模块402、特征序列获取模块403和分类模块404。Based on the same principle as the above-mentioned object labeling method, the embodiment of the present disclosure also provides another document classification device. FIG. 4 shows a schematic diagram of a document classification device provided by the embodiment of the present disclosure. As shown in FIG. 4 , The document classification apparatus 400 includes an acquisition module 401 , a fusion feature module 402 , a feature sequence acquisition module 403 and a classification module 404 .
在本公开实施例中,文本包括至少一行文本内容;获取模块401在用于获取待处理文档包括的文本的文本信息时,还用于:获取至少一行文本内容和至少一行文本内容的位置信息。In the embodiment of the present disclosure, the text includes at least one line of text content; when acquiring the text information of the text included in the document to be processed, the acquisition module 401 is further configured to: acquire at least one line of text content and location information of at least one line of text content.
在本公开实施例中,融合特征模块402在用于基于文本信息和图像信息进行融合得到融合特征时,还用于:In the embodiment of the present disclosure, when the fusion feature module 402 is used for fusion based on text information and image information to obtain fusion features, it is also used for:
将图像信息和至少一行文本内容的位置信息相加,再与至少一行文本内容串联,获得融合特征。The image information is added to the position information of at least one line of text content, and then concatenated with at least one line of text content to obtain fusion features.
在本公开实施例中,特征序列获取模块403在用于根据融合特征获取文本的特征序列时,还用于:将融合特征中的至少一行文本内容中的第一单字特征进行算术平均,并将算术平均的结果与至少一行文本内容中的第一位置特征做乘积,得到文本的特征序列。In the embodiment of the present disclosure, when the feature sequence acquisition module 403 is used to acquire the feature sequence of the text according to the fusion feature, it is also used to: arithmetically average the first word feature in at least one line of text content in the fusion feature, and The result of the arithmetic mean is multiplied by the first position feature in at least one line of text content to obtain a feature sequence of the text.
在本公开实施例中,特征序列获取模块403在用于根据融合特征获取文本的特征序列时,还用于:将融合特征输入堆叠自注意力网络获得增强的融合特征;自注意力网络的初始权重为融合特征。In the embodiment of the present disclosure, when the feature sequence acquisition module 403 is used to acquire the feature sequence of the text according to the fusion feature, it is also used to: input the fusion feature into the stacked self-attention network to obtain an enhanced fusion feature; the initial self-attention network The weights are fused features.
在本公开实施例中,自注意力网络的表示如下:In the disclosed embodiment, the representation of the self-attention network is as follows:
H 0=V H 0 =V
Figure PCTCN2022094788-appb-000010
Figure PCTCN2022094788-appb-000010
其中,W l*表示多个学习参数不共享的全连接层的可学习参数矩阵,*为正整数;d表示特征维度;H l表示第l层自注意力网络的输出;V表示融合特征;σ表示归一化函数。 Among them, W l* represents the learnable parameter matrix of the fully connected layer that multiple learning parameters do not share, * is a positive integer; d represents the feature dimension; H l represents the output of the l-layer self-attention network; V represents the fusion feature; σ represents the normalization function.
在本公开实施例中,特征序列获取模块403在用于获取文本的特征序列时,还用于:将经过自注意力网络输出的特征H l组成的至少一行文本内容中的第二单字特征进行算术平均,并将算术平均的结果与一行文本内容中的第二位置特征做乘积,得到文本的特征序列。 In the embodiment of the present disclosure, when the feature sequence acquisition module 403 is used to acquire the feature sequence of the text, it is also used to: perform the second word feature in at least one row of text content composed of the feature H1 output by the self-attention network Arithmetic mean, and multiply the result of the arithmetic mean with the second position feature in a line of text content to obtain the feature sequence of the text.
在本公开实施例中,融合特征表示如下:In the embodiment of the present disclosure, the fusion feature is expressed as follows:
V=concat(T,F+S)V=concat(T,F+S)
其中,T为至少一行文本内容中的编码后的单字的向量;F为使用感兴趣区域池化算法提取至少一行文本内容在整个图像上的图像信息的向量;S为至少一行文本内容的位置编码后的向量;T、F和S的向量维度相同。Among them, T is the vector of the encoded single word in at least one line of text content; F is the vector of using the region of interest pooling algorithm to extract the image information of at least one line of text content on the entire image; S is the position code of at least one line of text content The vector after ; the vector dimensions of T, F, and S are the same.
在本公开实施例中,获取模块401还用于:利用神经网络提取待处理文档的图像信息。In the embodiment of the present disclosure, the obtaining module 401 is further configured to: use a neural network to extract image information of the document to be processed.
在本公开实施例中,分类模块404还用于:In the embodiment of the present disclosure, the classification module 404 is also used for:
预定义文档类别;Predefined document categories;
使用分类器函数获取文本的特征序列在预定义文档类别上的概率;Use the classifier function to obtain the probability of the feature sequence of the text on the predefined document category;
取概率中概率值最高的预定义文档类别作为文档的类别。The predefined document category with the highest probability value in the probability is taken as the category of the document.
本公开还提供一种文档分类模型的训练方法,图5示出了本公开实施例提供的一种文档分类模型的训练方法的流程示意图,如图5所示,该方法主要可以包括以下步骤:The present disclosure also provides a training method for a document classification model. FIG. 5 shows a schematic flowchart of a training method for a document classification model provided by an embodiment of the present disclosure. As shown in FIG. 5 , the method may mainly include the following steps:
S501:预定义测试文档的类别,并且预定义每个类别文档的正确概率值。S501: Predefine categories of test documents, and predefine correct probability values for documents of each category.
预定义测试文档的类别,举例如下:例如表格、合同、票据、证照等。正确概率值,举例如下:对应被标注的类别概率为1,其余为0。The categories of predefined test documents are as follows: such as forms, contracts, bills, certificates, etc. The correct probability value, for example, is as follows: the probability corresponding to the labeled category is 1, and the rest are 0.
S502:获取测试文档的文本的文本信息和图像信息。S502: Obtain text information and image information of the text of the test document.
S503:基于文本信息和图像信息进行处理得到文本的特征序列。S503: Process based on the text information and the image information to obtain a text feature sequence.
S504:根据文本的特征序列,以及预定义测试文档的类别,确定测试文档的预测类别和测试文档属于每个类别文档的预测概率分布值。S504: Determine the predicted category of the test document and the predicted probability distribution value of the test document belonging to each category according to the feature sequence of the text and the category of the predefined test document.
S505:基于正确概率值和预测概率分布值调整文档分类模型参数,响应于预设条件,获得目标文档分类模型。S505: Adjust document classification model parameters based on the correct probability value and the predicted probability distribution value, and obtain a target document classification model in response to preset conditions.
预设条件包括:训练的轮数,训练的时间,训练样本是否已训练完毕;预设条件还可以包括:训练后期模型是否收敛,例如:我们将正确的概率(对应被标注的类别概率为1,其余为0)与预测概率分布使用最小交叉熵函算法计算和优化模型参数,并在固定间隔保存模型快照,等待模型收敛后,即训练后期交叉熵不再下降,获取交叉熵最小的快照版本作为最优的模型用于实际预测。The preset conditions include: the number of training rounds, the training time, and whether the training samples have been trained; the preset conditions can also include: whether the model converges in the later stage of training, for example: we will correct the probability (corresponding to the labeled category probability is 1 , the rest are 0) and the predicted probability distribution use the minimum cross-entropy function algorithm to calculate and optimize model parameters, and save model snapshots at fixed intervals, wait for the model to converge, that is, the cross-entropy will no longer decrease in the later stage of training, and obtain the snapshot version with the minimum cross-entropy Used as the optimal model for actual forecasting.
本公开提供的技术方案将多模态融合在一起,即将文字内容,文字位置和图像信息融合在一起,避免了仅将单一模态的信息进行处理得到文档分类的结果。利用多模态融合在一起的方法,有效的解决了基于文档的视觉属性,局限于文档的板式,无法处理相似文档;解决了使用纯文本进行分类,忽略了文档中内容的视觉排版以及文档中会存在的图片信息,容易导致语义混淆问题;解决了图像和文字的使用相互独立,没有考虑到两种模态信息的相关性,存在相互冲突的可能。本公开提供的技术方案能有效地解决文档混淆,提升分类精度。The technical solution provided by the disclosure integrates multiple modes, that is, text content, text position and image information, and avoids only processing information of a single mode to obtain document classification results. Using the method of multi-modal fusion, it effectively solves the visual attributes based on the document, which is limited to the format of the document and cannot handle similar documents; it solves the problem of using plain text for classification, ignoring the visual layout of the content in the document and the content in the document. The image information that will exist can easily lead to semantic confusion; it solves the problem that the use of images and text is independent of each other, and the correlation between the two modal information is not considered, and there is a possibility of conflict. The technical solution provided by the disclosure can effectively solve document confusion and improve classification accuracy.
根据本公开的实施例,本公开还提供了一种电子设备、一种可读存储介质和一种计算机程序产品。According to the embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
图6示出了可以用来实施本公开的实施例的示例电子设备600的示意性框图。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本公开的实现。FIG. 6 shows a schematic block diagram of an example electronic device 600 that may be used to implement embodiments of the present disclosure. Electronic device is intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. Electronic devices may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are by way of example only, and are not intended to limit implementations of the disclosure described and/or claimed herein.
如图6所示,设备600包括计算单元601,其可以根据存储在只读存 储器(ROM)602中的计算机程序或者从存储单元608加载到随机访问存储器(RAM)603中的计算机程序,来执行各种适当的动作和处理。在RAM 803中,还可存储设备600操作所需的各种程序和数据。计算单元601、ROM 602以及RAM 603通过总线604彼此相连。输入/输出(I/O)接口605也连接至总线604。As shown in FIG. 6, the device 600 includes a computing unit 601 that can execute according to a computer program stored in a read-only memory (ROM) 602 or loaded from a storage unit 608 into a random-access memory (RAM) 603. Various appropriate actions and treatments. In the RAM 803, various programs and data necessary for the operation of the device 600 can also be stored. The computing unit 601, ROM 602, and RAM 603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to the bus 604 .
设备600中的多个部件连接至I/O接口605,包括:输入单元606,例如键盘、鼠标等;输出单元607,例如各种类型的显示器、扬声器等;存储单元608,例如磁盘、光盘等;以及通信单元609,例如网卡、调制解调器、无线通信收发机等。通信单元609允许设备600通过诸如因特网的计算机网络和/或各种电信网络与其他设备交换信息/数据。Multiple components in the device 600 are connected to the I/O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a magnetic disk, an optical disk, etc. ; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, and the like. The communication unit 609 allows the device 600 to exchange information/data with other devices over a computer network such as the Internet and/or various telecommunication networks.
计算单元601可以是各种具有处理和计算能力的通用和/或专用处理组件。计算单元601的一些示例包括但不限于中央处理单元(CPU)、图形处理单元(GPU)、各种专用的人工智能(AI)计算芯片、各种运行机器学习模型算法的计算单元、数字信号处理器(DSP)、以及任何适当的处理器、控制器、微控制器等。计算单元601执行上文所描述的各个方法和处理,例如文档分类方法例如,在一些实施例中,文档分类方法可被实现为计算机软件程序,其被有形地包含于机器可读介质,例如存储单元608。在一些实施例中,计算机程序的部分或者全部可以经由ROM 602和/或通信单元609而被载入和/或安装到设备600上。当计算机程序加载到RAM 603并由计算单元601执行时,可以执行上文描述的文档分类方法的一个或多个步骤。备选地,在其他实施例中,计算单元601可以通过其他任何适当的方式(例如,借助于固件)而被配置为执行文档分类方法。The computing unit 601 may be various general-purpose and/or special-purpose processing components having processing and computing capabilities. Some examples of computing units 601 include, but are not limited to, central processing units (CPUs), graphics processing units (GPUs), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, digital signal processing processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 executes the various methods and processes described above, such as the document classification method. For example, in some embodiments, the document classification method can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a memory Unit 608. In some embodiments, part or all of the computer program may be loaded and/or installed on the device 600 via the ROM 602 and/or the communication unit 609. When the computer program is loaded into RAM 603 and executed by computing unit 601, one or more steps of the document classification method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured in any other appropriate way (for example, by means of firmware) to execute the document classification method.
本文中以上描述的系统和技术的各种实施方式可以在数字电子电路系统、集成电路系统、场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、芯片上系统的系统(SOC)、负载可编程逻辑设备(CPLD)、计算机硬件、固件、软件、和/或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和/或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将 数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips Implemented in a system of systems (SOC), load programmable logic device (CPLD), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include being implemented in one or more computer programs executable and/or interpreted on a programmable system including at least one programmable processor, the programmable processor Can be special-purpose or general-purpose programmable processor, can receive data and instruction from storage system, at least one input device, and at least one output device, and transmit data and instruction to this storage system, this at least one input device, and this at least one output device an output device.
用于实施本公开的方法的程序代码可以采用一个或多个编程语言的任何组合来编写。这些程序代码可以提供给通用计算机、专用计算机或其他可编程数据处理装置的处理器或控制器,使得程序代码当由处理器或控制器执行时使流程图和/或框图中所规定的功能/操作被实施。程序代码可以完全在机器上执行、部分地在机器上执行,作为独立软件包部分地在机器上执行且部分地在远程机器上执行或完全在远程机器或服务器上执行。Program codes for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special purpose computer, or other programmable data processing devices, so that the program codes, when executed by the processor or controller, make the functions/functions specified in the flow diagrams and/or block diagrams Action is implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include one or more wire-based electrical connections, portable computer discs, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.
为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。To provide for interaction with the user, the systems and techniques described herein can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user. ); and a keyboard and pointing device (eg, a mouse or a trackball) through which a user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and can be in any form (including Acoustic input, speech input or, tactile input) to receive input from the user.
可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处 描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)和互联网。The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., as a a user computer having a graphical user interface or web browser through which a user can interact with embodiments of the systems and techniques described herein), or including such backend components, middleware components, Or any combination of front-end components in a computing system. The components of the system can be interconnected by any form or medium of digital data communication, eg, a communication network. Examples of communication networks include: Local Area Network (LAN), Wide Area Network (WAN) and the Internet.
计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。A computer system may include clients and servers. Clients and servers are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by computer programs running on the respective computers and having a client-server relationship to each other.
应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本发公开中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本公开公开的技术方案所期望的结果,本文在此不进行限制。It should be understood that steps may be reordered, added or deleted using the various forms of flow shown above. For example, each step described in the present disclosure may be executed in parallel, sequentially, or in a different order, as long as the desired result of the technical solution disclosed in the present disclosure can be achieved, no limitation is imposed herein.
上述具体实施方式,并不构成对本公开保护范围的限制。本领域技术人员应该明白的是,根据设计要求和其他因素,可以进行各种修改、组合、子组合和替代。任何在本公开的精神和原则之内所作的修改、等同替换和改进等,均应包含在本公开保护范围之内。The specific implementation manners described above do not limit the protection scope of the present disclosure. It should be apparent to those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made depending on design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present disclosure shall be included within the protection scope of the present disclosure.

Claims (24)

  1. 一种文档分类的方法,包括:A method for classifying documents, comprising:
    获取待处理文档包括的文本的文本信息和图像信息;Acquiring text information and image information of the text included in the document to be processed;
    基于所述文本信息和所述图像信息进行融合得到融合特征;performing fusion based on the text information and the image information to obtain fusion features;
    根据所述融合特征获取所述文本的特征序列;Obtaining the feature sequence of the text according to the fusion feature;
    基于预先定义的文档类别和所述特征序列,确定所述待处理文档的类别。Based on the predefined document category and the feature sequence, the category of the document to be processed is determined.
  2. 根据权利要求1所述的方法,其中,所述文本包括至少一行文本内容;所述获取待处理文档包括的文本的文本信息,包括:获取所述至少一行文本内容和所述至少一行文本内容的位置信息。The method according to claim 1, wherein the text includes at least one line of text content; said obtaining the text information of the text included in the document to be processed comprises: obtaining the at least one line of text content and the at least one line of text content location information.
  3. 根据权利要求2所述的方法,其中,所述基于所述文本信息和所述图像信息进行融合得到融合特征,包括:The method according to claim 2, wherein said merging based on said text information and said image information to obtain fused features comprises:
    将所述图像信息和所述至少一行文本内容的位置信息相加,再与所述至少一行文本内容串联,获得融合特征。The image information is added to the position information of the at least one line of text content, and then concatenated with the at least one line of text content to obtain a fusion feature.
  4. 根据权利要求3中所述的方法,其中,所述根据所述融合特征获取所述文本的特征序列,包括:将所述融合特征中的至少一行文本内容中的第一单字特征进行算术平均,并将算术平均的结果与所述至少一行文本内容中的第一位置特征做乘积,得到文本的特征序列。The method according to claim 3, wherein said obtaining the feature sequence of the text according to the fusion feature comprises: arithmetically averaging the first single character feature in at least one line of text content in the fusion feature, and multiplying the result of the arithmetic mean by the first position feature in the at least one line of text content to obtain a feature sequence of the text.
  5. 根据权利要求3所述的方法,其中,所述根据所述融合特征获取所述文本的特征序列,包括:将所述融合特征输入堆叠自注意力网络获得增强的融合特征;所述自注意力网络的初始权重为所述融合特征。The method according to claim 3, wherein said obtaining the feature sequence of said text according to said fusion features comprises: inputting said fusion features into a stacked self-attention network to obtain enhanced fusion features; said self-attention The initial weights of the network are the fused features.
  6. 根据权利要求5所述的方法,其中,所述自注意力网络的表示如下:The method according to claim 5, wherein the representation of the self-attention network is as follows:
    H 0=V H 0 =V
    Figure PCTCN2022094788-appb-100001
    Figure PCTCN2022094788-appb-100001
    其中,W l*表示多个学习参数不共享的全连接层的可学习参数 矩阵,*为正整数;d表示特征维度;H l表示第l层自注意力网络的输出;V表示融合特征;σ表示归一化函数。 Among them, W l* represents the learnable parameter matrix of the fully connected layer that multiple learning parameters do not share, * is a positive integer; d represents the feature dimension; H l represents the output of the l-layer self-attention network; V represents the fusion feature; σ represents the normalization function.
  7. 根据权利要求6所述的方法,其中,所述获取所述文本的特征序列,包括:将经过所述自注意力网络输出的特征H l组成的所述至少一行文本内容中的第二单字特征进行算术平均,并将算术平均的结果与所述一行文本内容中的第二位置特征做乘积,得到文本的特征序列。 The method according to claim 6, wherein said obtaining the feature sequence of said text comprises: the second single character feature in said at least one line of text content formed by said self-attention network output feature H1 An arithmetic mean is performed, and the result of the arithmetic mean is multiplied by the second position feature in the line of text content to obtain a feature sequence of the text.
  8. 根据权利要求3所述的方法,其中,所述融合特征表示如下:The method according to claim 3, wherein the fusion feature is represented as follows:
    V=concat(T,F+S)V=concat(T,F+S)
    其中,T为所述至少一行文本内容中的编码后的单字的向量;F为使用感兴趣区域池化算法提取所述至少一行文本内容在整个图像上的图像信息的向量;S为所述至少一行文本内容的位置编码后的向量;所述T、F和S的向量维度相同。Wherein, T is the vector of the encoded single word in the at least one line of text content; F is the vector of using the region of interest pooling algorithm to extract the image information of the at least one line of text content on the entire image; S is the at least one line of text content The position-encoded vector of a line of text content; the vector dimensions of T, F and S are the same.
  9. 根据权利要求1所述的方法,其中,所述获取待处理文档包括的文本的文本信息和图像信息,包括:利用神经网络提取所述待处理文档的图像信息。The method according to claim 1, wherein said acquiring the text information and image information of the text included in the document to be processed comprises: using a neural network to extract the image information of the document to be processed.
  10. 根据权利要求1所述的方法,其中,所述基于预先定义的文档类别和所述特征序列,确定所述待处理文档的类别,包括:The method according to claim 1, wherein said determining the category of the document to be processed based on the predefined document category and the feature sequence comprises:
    预定义文档类别;Predefined document categories;
    使用分类器函数获取所述文本的特征序列在所述预定义文档类别上的概率;Using a classifier function to obtain the probability of the feature sequence of the text on the predefined document category;
    取所述概率中概率值最高的所述预定义文档类别作为所述文档的类别。Taking the predefined document category with the highest probability value among the probabilities as the category of the document.
  11. 一种文档分类装置,包括:A document classification device, comprising:
    获取模块,用于:获取待处理文档包括的文本的文本信息和图像信息;An acquisition module, configured to: acquire text information and image information of the text included in the document to be processed;
    融合特征模块,用于:基于所述文本信息和所述图像信息进行融合得到融合特征;A fusion feature module, configured to: perform fusion based on the text information and the image information to obtain a fusion feature;
    特征序列获取模块,用于:根据所述融合特征获取所述文本的 特征序列;A feature sequence acquisition module, configured to: acquire the feature sequence of the text according to the fusion feature;
    分类模块,用于:基于预先定义的文档类别和所述特征序列,确定所述待处理文档的类别。A classification module, configured to: determine the category of the document to be processed based on the predefined document category and the feature sequence.
  12. 根据权利要求11所述的装置,其中,所述文本包括至少一行文本内容;所述获取模块在用于获取待处理文档包括的文本的文本信息时,还用于:获取所述至少一行文本内容和所述至少一行文本内容的位置信息。The device according to claim 11, wherein the text includes at least one line of text content; when the acquisition module is used to acquire the text information of the text included in the document to be processed, it is also used to: acquire the at least one line of text content and the location information of the at least one line of text content.
  13. 根据权利要求12所述的装置,其中,所述融合特征模块在用于基于文本信息和所述图像信息进行融合得到融合特征时,还用于:The device according to claim 12, wherein, when the fusion feature module is used for fusion based on text information and the image information to obtain fusion features, it is also used for:
    将所述图像信息和所述至少一行文本内容的位置信息相加,再与所述至少一行文本内容串联,获得融合特征。The image information is added to the position information of the at least one line of text content, and then concatenated with the at least one line of text content to obtain a fusion feature.
  14. 根据权利要求13所述的装置,其中,所述特征序列获取模块在用于根据所述融合特征获取所述文本的特征序列时,还用于:将所述融合特征中的至少一行文本内容中的第一单字特征进行算术平均,并将算术平均的结果与所述至少一行文本内容中的第一位置特征做乘积,得到文本的特征序列。The device according to claim 13, wherein, when the feature sequence obtaining module is used to obtain the feature sequence of the text according to the fusion feature, it is also used to: include at least one line of text content in the fusion feature Carry out the arithmetic mean of the first character feature of the first character, and multiply the result of the arithmetic mean with the first position feature in the at least one line of text content to obtain the feature sequence of the text.
  15. 根据权利要求13所述的装置,其中,所述特征序列获取模块在用于根据所述融合特征获取所述文本的特征序列时,还用于:将所述融合特征输入堆叠自注意力网络获得增强的融合特征;所述自注意力网络的初始权重为所述融合特征。The device according to claim 13, wherein, when the feature sequence obtaining module is used to obtain the feature sequence of the text according to the fusion feature, it is also used to: input the fusion feature into a stacked self-attention network to obtain Enhanced fusion features; the initial weight of the self-attention network is the fusion features.
  16. 根据权利要求15所述的装置,其中,所述自注意力网络的表示如下:The device according to claim 15, wherein the representation of the self-attention network is as follows:
    H 0=V H 0 =V
    Figure PCTCN2022094788-appb-100002
    Figure PCTCN2022094788-appb-100002
    其中,W l*表示多个学习参数不共享的全连接层的可学习参数矩阵,*为正整数;d表示特征维度;H l表示第l层自注意力网络的输出;V表示融合特征;σ表示归一化函数。 Among them, W l* represents the learnable parameter matrix of the fully connected layer that multiple learning parameters do not share, * is a positive integer; d represents the feature dimension; H l represents the output of the l-layer self-attention network; V represents the fusion feature; σ represents the normalization function.
  17. 根据权利要求16所述的装置,其中,所述特征序列获取模 块在用于获取所述文本的特征序列时,还用于:将经过所述自注意力网络输出的特征H l组成的所述至少一行文本内容中的第二单字特征进行算术平均,并将算术平均的结果与所述一行文本内容中的第二位置特征做乘积,得到文本的特征序列。 The device according to claim 16, wherein, when the feature sequence obtaining module is used to obtain the feature sequence of the text, it is also used to: the feature H1 formed by the self-attention network output Carrying out the arithmetic mean of the second character feature in at least one line of text content, and multiplying the result of the arithmetic mean with the second position feature in the line of text content to obtain the feature sequence of the text.
  18. 根据权利要求13所述的装置,其中,所述融合特征表示如下:The device according to claim 13, wherein the fusion features are expressed as follows:
    V=concat(T,F+S)V=concat(T,F+S)
    其中,T为所述至少一行文本内容中的编码后的单字的向量;F为使用感兴趣区域池化算法提取所述至少一行文本内容在整个图像上的图像信息的向量;S为所述至少一行文本内容的位置编码后的向量;所述T、F和S的向量维度相同。Wherein, T is the vector of the encoded single word in the at least one line of text content; F is the vector of using the region of interest pooling algorithm to extract the image information of the at least one line of text content on the entire image; S is the at least one line of text content The position-encoded vector of a line of text content; the vector dimensions of T, F and S are the same.
  19. 根据权利要求11所述的装置,其中,所述获取模块还用于:利用神经网络提取所述待处理文档的图像信息。The device according to claim 11, wherein the acquiring module is further configured to: extract the image information of the document to be processed by using a neural network.
  20. 根据权利要求11所述的装置,其中,所述分类模块还用于:The device according to claim 11, wherein the classification module is further used for:
    预定义文档类别;Predefined document categories;
    使用分类器函数获取所述文本的特征序列在所述预定义文档类别上的概率;Using a classifier function to obtain the probability of the feature sequence of the text on the predefined document category;
    取所述概率中概率值最高的所述预定义文档类别作为所述文档的类别。Taking the predefined document category with the highest probability value among the probabilities as the category of the document.
  21. 一种文档分类模型的训练方法,包括:A training method for a document classification model, comprising:
    预定义测试文档的类别,并且预定义每个类别文档的正确概率值;Predefine the categories of test documents, and predefine the correct probability value of each category document;
    获取测试文档的文本的文本信息和图像信息;Obtain the text information and image information of the text of the test document;
    基于所述文本信息和所述图像信息进行处理得到文本的特征序列;processing based on the text information and the image information to obtain a feature sequence of the text;
    根据所述文本的特征序列,以及预定义测试文档的类别,确定所述测试文档的预测类别和所述测试文档属于每个类别文档的预测概率分布值;According to the feature sequence of the text and the category of the predefined test document, determine the predicted category of the test document and the predicted probability distribution value of the test document belonging to each category document;
    基于所述正确概率值和所述预测概率分布值调整文档分类模型参数,响应于预设条件,获得目标文档分类模型。Adjusting document classification model parameters based on the correct probability value and the predicted probability distribution value, and obtaining a target document classification model in response to preset conditions.
  22. 一种电子设备,包括:An electronic device comprising:
    至少一个处理器;以及at least one processor; and
    与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行权利要求1-10中任一项所述的方法。The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can perform any one of claims 1-10. Methods.
  23. 一种存储有计算机指令的非瞬时计算机可读存储介质,其中,所述计算机指令用于使所述计算机执行根据权利要求1-10中任一项所述的方法。A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method according to any one of claims 1-10.
  24. 一种计算机程序产品,包括计算机程序,所述计算机程序在被处理器执行时实现根据权利要求1-10中任一项所述的方法。A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-10.
PCT/CN2022/094788 2021-08-27 2022-05-24 Document classification method and apparatus, electronic device and storage medium WO2023024614A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110994014.XA CN113742483A (en) 2021-08-27 2021-08-27 Document classification method and device, electronic equipment and storage medium
CN202110994014.X 2021-08-27

Publications (1)

Publication Number Publication Date
WO2023024614A1 true WO2023024614A1 (en) 2023-03-02

Family

ID=78733361

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/094788 WO2023024614A1 (en) 2021-08-27 2022-05-24 Document classification method and apparatus, electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN113742483A (en)
WO (1) WO2023024614A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116189193A (en) * 2023-04-25 2023-05-30 杭州镭湖科技有限公司 Data storage visualization method and device based on sample information
CN116912871A (en) * 2023-09-08 2023-10-20 上海蜜度信息技术有限公司 Identity card information extraction method, system, storage medium and electronic equipment
CN117112734A (en) * 2023-10-18 2023-11-24 中山大学深圳研究院 Semantic-based intellectual property text representation and classification method and terminal equipment

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113742483A (en) * 2021-08-27 2021-12-03 北京百度网讯科技有限公司 Document classification method and device, electronic equipment and storage medium
CN114429637B (en) * 2022-01-14 2023-04-07 北京百度网讯科技有限公司 Document classification method, device, equipment and storage medium
CN114399775A (en) * 2022-01-21 2022-04-26 平安科技(深圳)有限公司 Document title generation method, device, equipment and storage medium
CN114445833B (en) * 2022-01-28 2024-05-14 北京百度网讯科技有限公司 Text recognition method, device, electronic equipment and storage medium
CN114626455A (en) * 2022-03-11 2022-06-14 北京百度网讯科技有限公司 Financial information processing method, device, equipment, storage medium and product
CN114898388B (en) * 2022-03-28 2024-05-24 支付宝(杭州)信息技术有限公司 Document picture classification method and device, storage medium and electronic equipment
CN116152817B (en) * 2022-12-30 2024-01-02 北京百度网讯科技有限公司 Information processing method, apparatus, device, medium, and program product

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200019769A1 (en) * 2018-07-15 2020-01-16 Netapp, Inc. Multi-modal electronic document classification
US20200302016A1 (en) * 2019-03-20 2020-09-24 Adobe Inc. Classifying Structural Features of a Digital Document by Feature Type using Machine Learning
CN111782808A (en) * 2020-06-29 2020-10-16 北京市商汤科技开发有限公司 Document processing method, device, equipment and computer readable storage medium
CN112685565A (en) * 2020-12-29 2021-04-20 平安科技(深圳)有限公司 Text classification method based on multi-mode information fusion and related equipment thereof
CN112966522A (en) * 2021-03-03 2021-06-15 北京百度网讯科技有限公司 Image classification method and device, electronic equipment and storage medium
CN113033534A (en) * 2021-03-10 2021-06-25 北京百度网讯科技有限公司 Method and device for establishing bill type identification model and identifying bill type
CN113742483A (en) * 2021-08-27 2021-12-03 北京百度网讯科技有限公司 Document classification method and device, electronic equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109344815B (en) * 2018-12-13 2021-08-13 深源恒际科技有限公司 Document image classification method
CN110298338B (en) * 2019-06-20 2021-08-24 北京易道博识科技有限公司 Document image classification method and device
CN111680490B (en) * 2020-06-10 2022-10-28 东南大学 Cross-modal document processing method and device and electronic equipment
CN113204615B (en) * 2021-04-29 2023-11-24 北京百度网讯科技有限公司 Entity extraction method, device, equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200019769A1 (en) * 2018-07-15 2020-01-16 Netapp, Inc. Multi-modal electronic document classification
US20200302016A1 (en) * 2019-03-20 2020-09-24 Adobe Inc. Classifying Structural Features of a Digital Document by Feature Type using Machine Learning
CN111782808A (en) * 2020-06-29 2020-10-16 北京市商汤科技开发有限公司 Document processing method, device, equipment and computer readable storage medium
CN112685565A (en) * 2020-12-29 2021-04-20 平安科技(深圳)有限公司 Text classification method based on multi-mode information fusion and related equipment thereof
CN112966522A (en) * 2021-03-03 2021-06-15 北京百度网讯科技有限公司 Image classification method and device, electronic equipment and storage medium
CN113033534A (en) * 2021-03-10 2021-06-25 北京百度网讯科技有限公司 Method and device for establishing bill type identification model and identifying bill type
CN113742483A (en) * 2021-08-27 2021-12-03 北京百度网讯科技有限公司 Document classification method and device, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
SUN QIANG, FU YANWEI: "Stacked Self-Attention Networks for Visual Question Answering", PROCEEDINGS OF THE 2019 INTERNATIONAL CONFERENCE ON MULTIMEDIA RETRIEVAL, 13 June 2019 (2019-06-13), pages 207 - 211, XP093038913, DOI: 10.1145/3323873.3325044 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116189193A (en) * 2023-04-25 2023-05-30 杭州镭湖科技有限公司 Data storage visualization method and device based on sample information
CN116189193B (en) * 2023-04-25 2023-11-10 杭州镭湖科技有限公司 Data storage visualization method and device based on sample information
CN116912871A (en) * 2023-09-08 2023-10-20 上海蜜度信息技术有限公司 Identity card information extraction method, system, storage medium and electronic equipment
CN116912871B (en) * 2023-09-08 2024-02-23 上海蜜度信息技术有限公司 Identity card information extraction method, system, storage medium and electronic equipment
CN117112734A (en) * 2023-10-18 2023-11-24 中山大学深圳研究院 Semantic-based intellectual property text representation and classification method and terminal equipment
CN117112734B (en) * 2023-10-18 2024-02-02 中山大学深圳研究院 Semantic-based intellectual property text representation and classification method and terminal equipment

Also Published As

Publication number Publication date
CN113742483A (en) 2021-12-03

Similar Documents

Publication Publication Date Title
WO2023024614A1 (en) Document classification method and apparatus, electronic device and storage medium
CN112966522B (en) Image classification method and device, electronic equipment and storage medium
US11816165B2 (en) Identification of fields in documents with neural networks without templates
US11481605B2 (en) 2D document extractor
US20220253631A1 (en) Image processing method, electronic device and storage medium
CN112001368A (en) Character structured extraction method, device, equipment and storage medium
CN111709339A (en) Bill image recognition method, device, equipment and storage medium
US11816710B2 (en) Identifying key-value pairs in documents
CN113094509B (en) Text information extraction method, system, device and medium
US20230196805A1 (en) Character detection method and apparatus , model training method and apparatus, device and storage medium
WO2023093014A1 (en) Bill recognition method and apparatus, and device and storage medium
CN114724156B (en) Form identification method and device and electronic equipment
CN113627439A (en) Text structuring method, processing device, electronic device and storage medium
CN114429633A (en) Text recognition method, model training method, device, electronic equipment and medium
CN114817612A (en) Method and related device for calculating multi-modal data matching degree and training calculation model
CN112906368A (en) Industry text increment method, related device and computer program product
CN112541055A (en) Method and device for determining text label
CN116311298A (en) Information generation method, information processing device, electronic equipment and medium
US11972625B2 (en) Character-based representation learning for table data extraction using artificial intelligence techniques
US20220392243A1 (en) Method for training text classification model, electronic device and storage medium
CN114445833B (en) Text recognition method, device, electronic equipment and storage medium
CN115880702A (en) Data processing method, device, equipment, program product and storage medium
CN114579876A (en) False information detection method, device, equipment and medium
CN115497112B (en) Form recognition method, form recognition device, form recognition equipment and storage medium
CA3060293A1 (en) 2d document extractor

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22859962

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE