Text processing method and device

Through text area recognition and classification model labeling processing, the problems of information confusion and heavy workload in text processing are solved, and the accuracy and efficiency of text extraction are improved.

CN113362026BActive Publication Date: 2024-08-23BEIJING KINGSOFT DIGITAL ENTERTAINMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110626958.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-04
Publication Date
2024-08-23
Estimated Expiration
2041-06-04

AI Technical Summary

Technical Problem

The existing technology has the problems of heavy workload and information confusion in text processing. Especially when extracting resume information, it is easy to confuse different categories of information, leading to extraction errors.

Method used

By determining the text area in the text to be processed, identifying text fragments, and inputting them into the text classification model to obtain category labels, divide text fragments, reduce the need to filter content, and improve extraction accuracy and efficiency.

Benefits of technology

It implements a simpler and more convenient text processing method, reduces workload, improves the accuracy and efficiency of information extraction, and avoids erroneous extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113362026B
    Figure CN113362026B
Patent Text Reader

Abstract

The present specification provides a text processing method and device, wherein the text processing method includes: determining at least one text area in the text to be processed; identifying the text content in the at least one text area, determining the text fragments in the at least one text area; inputting the text fragments in the at least one text area into a text classification model, and determining the category label of each text fragment. The text processing method provided by the present scheme does not restrict the format of the text to be processed. The method divides the text fragments extracted from the text to be processed according to categories, and labels each text fragment with a category. When extracting information later, it is not necessary to filter the required content from the entire text to be processed, but to extract information from the corresponding text fragment according to the category label, which not only reduces the workload, but also can improve the accuracy of text extraction, improve the efficiency of information extraction, and avoid extracting wrong text content.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a text processing method and device. Background Art

[0002] Text processing can be to identify the text content to extract the text information. For example, in the extraction of resume information, the required text information can be extracted from the resume. For example, information such as learning experience and work experience can be extracted.

[0003] However, the existing technology is to extract text information from the entire text, which not only requires a large workload, but may also confuse different categories of information. For example, the company name of the work experience may be extracted as the company name of the project experience, resulting in errors in the extracted text information. Therefore, a simpler and more convenient method is needed for text processing. Summary of the invention

[0004] In view of this, the embodiment of this specification provides a text processing method. This specification also relates to a text processing device, a computing device, and a computer-readable storage medium to solve the technical defects existing in the prior art.

[0005] According to a first aspect of an embodiment of this specification, a text processing method is provided, including:

[0006] Determining at least one text region in the text to be processed;

[0007] Recognizing text content in the at least one text region to determine text segments in the at least one text region;

[0008] The text segments in the at least one text region are input into a text classification model to determine a category label of each text segment.

[0009] According to a second aspect of the embodiments of this specification, there is provided a text processing device, including:

[0010] A first determination module is configured to determine at least one text region in the text to be processed;

[0011] A second determination module is configured to identify text content in the at least one text region and determine a text segment in the at least one text region;

[0012] The third determination module is configured to input the text segments in the at least one text region into a text classification model to determine a category label of each text segment.

[0013] According to a third aspect of an embodiment of this specification, a computing device is provided, including:

[0014] Memory and processor;

[0015] The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions:

[0016] Determining at least one text region in the text to be processed;

[0017] Recognizing text content in the at least one text region to determine text segments in the at least one text region;

[0018] The text segments in the at least one text region are input into a text classification model to determine a category label of each text segment.

[0019] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the text processing method are implemented.

[0020] The text processing method provided in this specification determines at least one text area in the text to be processed; identifies the text content in the at least one text area to determine the text fragments in the at least one text area; inputs the text fragments in the at least one text area into a text classification model to determine the category label of each text fragment. The text processing method provided in this solution does not restrict the format of the text to be processed. The method divides the text fragments extracted from the text to be processed according to categories and labels each text fragment with a category. When extracting information later, it is not necessary to filter the required content from the entire text to be processed, but to extract information from the corresponding text fragment according to the category label, which not only reduces the workload, but also improves the accuracy of text extraction and the efficiency of information extraction. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1A is a flowchart of a text processing method provided by an embodiment of this specification;

[0022] Figure 1B is a structural diagram of a target detection model provided in an embodiment of this specification;

[0023] Figure 2 is a schematic diagram of a text page provided in an embodiment of this specification;

[0024] Figure 3 is a schematic diagram of another text page provided in an embodiment of this specification;

[0025] Figure 4 is a schematic diagram of a cross-page text segment provided in an embodiment of this specification;

[0026] Figure 5 is a schematic diagram of another cross-page text segment provided in an embodiment of this specification;

[0027] Figure 6 is a schematic diagram of another cross-page text segment provided in an embodiment of this specification;

[0028] Figure 7 It is a processing flow chart of a text processing method applied to resume information extraction provided in an embodiment of this specification;

[0029] Figure 8 It is a schematic diagram of a resume provided in an embodiment of this specification;

[0030] Fig. 9 is a structural schematic diagram of a text processing device provided in an embodiment of this specification;

[0031] Fig.10 It is a structural block diagram of a computing device provided in one embodiment of this specification. DETAILED DESCRIPTION

[0032] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.

[0033] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0034] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0035] First, the terms involved in one or more embodiments of this specification are explained.

[0036] Text classification model: used to classify the input text and determine the category label of the input text.

[0037] Category confidence: Category confidence corresponds to a reference category and indicates the probability that the text belongs to the reference category.

[0038] Word unit: Before any actual processing is done on the input text, it needs to be segmented into language units such as characters, punctuation marks, numbers or letters. These language units are called word units. For English text, a word unit can be a word, a punctuation mark, a number, etc.; for Chinese text, the smallest word unit can be a character, a punctuation mark, a number, etc.

[0039] Word embedding processing: refers to the process of embedding a high-dimensional space with the dimension of all words into a continuous vector space with much lower dimension, and each word or phrase is mapped to a vector in the real number field.

[0040] word2vec: A method for word embedding, it is an efficient word vector training method built by Mikolov based on Bengio Neural Network Language Model (NNLM). That is, by using this method, the text can be embedded and the word vector of the text can be obtained.

[0041] Feature extraction layer: A network layer used to extract features of input text.

[0042] Attention layer: can include an attention mechanism to perform attention calculations on a word unit basis. For example, attention calculations can be performed on multiple word units in a text segment.

[0043] Fully connected layer: Fully Connected Layer, can be considered as a classifier.

[0044] Text feature vector: A vector representation of text obtained by extracting features from a text fragment.

[0045] Format feature vector: A vector representation of format information obtained by extracting features from format information.

[0046] First fused feature vector: sentence-level vector representation of the text fragment.

[0047] Second fused feature vector: a sentence-level vector representation of the text fragment that incorporates format information.

[0048] Yolov4: It is a target detection algorithm based on the original Yolov target detection architecture. It adopts some optimization strategies in the field of CNN (Convolutional Neural Network) in recent years, and optimizes various aspects such as data processing, backbone network, network training, activation function, and loss function.

[0049] Fast R-CNN: (Fast Region-based Convolutional Neural Network) is a region-based object detection algorithm.

[0050] RPN: (Region Proposal Network), which can be used to determine the area where the target exists in the image.

[0051] OCR: (Optical Character Recognition) refers to the process by which electronic devices examine characters printed on paper or analyze and process characters in electronic text, and then use character recognition methods to translate the shapes into computer text.

[0052] CRNN: (Convolutional Recurrent Neural Network), can be used for text recognition.

[0053] In this specification, a text processing method is provided. This specification also relates to a text processing apparatus, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.

[0054] Figure 1A A flowchart of a text processing method provided according to an embodiment of the present specification is shown, which specifically includes the following steps:

[0055] Step 102: Determine at least one text region in the text to be processed.

[0056] In an embodiment of the present application, the text to be processed can be a PDF (Portable Document Format) text or an image. If the acquired text to be processed is not in the above two formats, the text to be processed can be converted into the above two formats before processing. For example, the text to be processed can be converted into a text in PDF format using the lidre office tool. Therefore, it can be considered that this solution does not limit the format of the text to be processed. Taking the case where the text to be processed is a resume, through the method of this step, resumes in different file formats can be processed in different regions, that is, the method provided in this specification is universal for resumes in any file format.

[0057] In an embodiment of the present application, in order to facilitate the subsequent extraction of content in the text and avoid the complexity of extracting text content from the entire text to be processed, the text to be processed can be divided into blocks first, that is, the area where text exists in the text to be processed is determined as the text area, and each text to be processed can include at least one text area.

[0058] In some embodiments, at least one text region in the text to be processed can be determined by a target detection model. For example, the target detection model can be a yolov4 model, Fast R-CNN, Efficient DET, CenterNet, CTPN, etc., which is not limited in the embodiments of the present application.

[0059] Take the target detection model Yolov4 as an example, see Figure 1B , Figure 1BIt is a structural diagram of a target detection model according to an exemplary embodiment. The target detection model includes a Backbone network, a Neck layer and a Head layer. The Backbone network is a convolutional neural network that aggregates and forms image features at different image granularities, and can be composed of multiple CSPDarknet53 networks; the Neck layer is a series of network layers that mix and combine image features, and pass the image features to the prediction layer; the Head layer is also called the prediction layer, which is used to predict image features, generate bounding boxes and predict categories. After data enhancement and preprocessing, the text (picture) to be processed is input into the Backbone network for feature extraction. The Backbone network may include three feature layers, namely the middle layer, the lower middle layer and the bottom layer. Through layer-by-layer feature extraction, the three-layer image features of the text to be processed can be obtained. The three-layer image features are input into the Neck layer for a series of mixing and combination processing to obtain the processed image features, and then the processed image features are input into the Head layer. The Head layer may include PANet, which can extract the output feature vectors of three channels, and the output feature vector contains the generated multiple candidate regions and regional features. By decoding the output feature vector using the configured prior frame, a candidate region containing multiple prediction frames and prediction categories can be obtained. Finally, multiple prediction frames are processed using the non-maximum suppression algorithm to obtain the final output detection frame coordinates and corresponding category information. Based on the detection frame coordinates, the region where the detection frame with the category of text is located is determined as the text region.

[0060] The target detection models used in the embodiments of the present application are all trained target detection models with high accuracy. As an example, the target detection model can be trained by a large number of sample texts with text area labels, so that the target detection model has the function of identifying text areas. It is worth noting that the more sample texts are used for model training, the better the text area recognition effect of the target detection model.

[0061] It should be noted that the above only uses Yolov4 as an example to illustrate the determination of at least one text area of ​​the text to be processed. In other embodiments, this step can be implemented by any of the target detection models mentioned above, and the embodiments of the present application do not limit this.

[0062] As an example, if the text to be processed includes at least two text pages, the at least two text pages can be respectively input into the object detection model to determine at least one text region of each text page. Figure 2 , Figure 2 Shown is a schematic diagram of a text page including two text areas.

[0063] In an embodiment of the present application, a target detection model can be used to perform target detection on the text to be processed, determine the text area containing characters in the text to be processed, and divide different text areas to facilitate the extraction of content in the text to be processed.

[0064] Step 104: Identify the text content in the at least one text region and determine the text segments in the at least one text region.

[0065] In an embodiment of the present application, after determining the text area, in order to facilitate the subsequent extraction of text content so that the required content can be accurately extracted from the corresponding text area, the text content in the text area can be identified, that is, the content recorded in each text area can be determined.

[0066] In some embodiments, the text content of the text area can be identified by a text recognition algorithm. For example, the text recognition algorithm can be an OCR algorithm. Alternatively, the text content of the text area can be identified by a text recognition model. For example, the text recognition model can be a CRNN model.

[0067] Taking the example of recognizing the text content of a text area through a text recognition model, and the text recognition model is a CRNN model, the CRNN model can include a convolution layer, a recurrent layer, and a transcription layer. The convolution layer uses the Resnet-34 network, and the text area (image) is input into the convolution layer. The convolution layer can extract features from the image and extract the feature sequence of the text area; the recurrent layer uses a bidirectional RNN (BiLSTM) to predict the feature sequence, learns each feature vector in the feature sequence, and inputs the feature sequence output by the convolution layer into the recurrent layer. The recurrent layer can predict the feature sequence and output the predicted label (true value) distribution; the transcription layer uses CTC loss to convert a series of label distributions obtained from the recurrent layer into the final label sequence, and then converts the label sequence into the final recognition result through deduplication, integration and other operations, that is, the text fragment of the text area can be obtained.

[0068] The text recognition models used in the embodiments of the present application are all trained and have a high accuracy. As an example, the text recognition model can be trained by a large number of sample texts with correct text fragments, so that the text recognition model has the function of recognizing text. It is worth noting that the more sample texts are used for model training, the better the text recognition effect of the text recognition model.

[0069] It should be noted that the above only illustrates text content recognition by taking the text recognition model as a CRNN model as an example. In other embodiments, this step can also be implemented by an OCR algorithm, which is not limited in the embodiments of the present application.

[0070] As an example, if a text page includes at least two text regions, the at least two text regions can be respectively input into the text recognition model to determine the text segment of each text region. Figure 2 , Figure 2 The diagram shown is a schematic diagram of a text page including two text areas, wherein the first text area includes a text segment "XXXX" and the second text area includes a text segment "YYY".

[0071] In the embodiment of the present application, the text content in the text area can be recognized by a text recognition model, the text content in the text area can be determined, and the text fragment corresponding to each text area can be obtained.

[0072] Step 106: Input the text segments in the at least one text region into a text classification model to determine a category label for each text segment.

[0073] As an example, a category label can be used to characterize the subject of a text segment, that is, the main content described in the text segment can be roughly determined based on the category label.

[0074] In the embodiment of the present application, after determining the text fragments recorded in each text area, the text fragments of each text area can be labeled, that is, the category label of each text fragment can be determined. In this way, when extracting text content later, it is not necessary to filter the required content from the entire text to be processed, but the text content can be extracted from the text fragment corresponding to the label according to the demand, which can improve the accuracy of text extraction, improve the efficiency of text extraction, and avoid obtaining wrong text content.

[0075] In implementation, the specific implementation of inputting the text fragments in the at least one text region into the text classification model and determining the category label of each text fragment may include: inputting the text fragments in each text region into the text classification model, determining multiple category confidences of each text fragment, wherein each category confidence of each text fragment is used to characterize the probability that the text fragment belongs to a reference category; and determining the category label of each text fragment based on the multiple category confidences of each text fragment.

[0076] That is to say, each text fragment can be input into the text classification model to determine the probability that each text fragment belongs to each reference category, then each text fragment can obtain multiple probabilities, and, based on the multiple probabilities of each text fragment, the category label of each text fragment can be determined.

[0077] For example, assuming that the text fragment is "Educational experience: studied at XX University from 20XX to 20XX, major XXXXXX", then the text fragment is input into the text classification model, and it can be determined that the category label of the text fragment is educational experience.

[0078] In the embodiments of the present application, the text classification model used is a pre-trained model with a relatively high accuracy. As an example, the text classification model can be trained by a large number of sample text segments with category labels, so that the text classification model can have the function of determining the category label for the input text segment. It is worth noting that the more sample texts are used for model training, the higher the classification accuracy of the text classification model.

[0079] Taking the case where the text to be processed is a resume as an example, since resume texts are written in various ways, classification based only on the subheadings in the resume is not only too simplistic, but also the classification results for resumes written in different ways may vary greatly, making it difficult to manage them uniformly. The embodiment of the present application uses a text classification model to classify based on text fragments, which can be considered as classification based on the semantic information of the text, with higher classification accuracy. In addition, the category labels obtained through classification by the model are easier to count and manage.

[0080] In some embodiments, the text classification model may include a feature extraction layer, an attention layer and a fully connected layer. The text fragments in each text area are input into the text classification model. The specific implementation of determining the category confidence that each text fragment belongs to multiple reference categories may include: inputting each text fragment into the feature extraction layer to obtain a text feature vector of each text fragment; inputting the text feature vector of each text fragment into the attention layer to obtain a first fused feature vector of each text fragment; inputting the first fused feature vector into the fully connected layer for classification, and determining the category confidence that each text fragment belongs to multiple reference categories.

[0081] That is to say, each text fragment can be input into the feature extraction layer for feature extraction, and the text feature vector of each text fragment can be extracted. The text feature vector of each text fragment is input into the attention layer, and self-attention calculation is performed on the text feature vector of each text fragment to obtain a first fused feature vector of each text fragment combined with the feature vector of each word in the text fragment. The first fused feature vector is input into the fully connected layer, and the probability of each text fragment belonging to multiple reference categories is determined through the fully connected layer.

[0082] In an optional embodiment of the present application, after each text fragment is input into the feature extraction layer, each text fragment can be firstly segmented to obtain multiple word units of each text fragment, and then each word unit can be embedded to obtain a feature vector of each word unit. The feature vectors of multiple word units of the same text fragment can be concatenated to obtain a text feature vector of the text fragment.

[0083] As an example, word segmentation can be performed on a text segment according to a pre-compiled vocabulary. Exemplarily, in the pre-compiled vocabulary, if the text segment is a Chinese text, a single Chinese character or a punctuation mark can be used as a word unit. If the text segment is a foreign language text, a single word or a punctuation mark can be used as a word unit. If the text segment includes numbers, a single number can be used as a word unit. For example, assuming the text segment is "Received scholarships many times during school", after performing word segmentation on this text segment, multiple word units obtained can be [at], [school], [period], [between], [many], [times], [received], [scholarship].

[0084] As an example, word embedding processing can be performed on each of the above-mentioned multiple word units by means of one-hot encoding or word2vec encoding to obtain the feature vector of each word unit. Then, the feature vectors of multiple word units can be concatenated according to the sorting of the word units in the text segment to obtain the text feature vector of the text segment. For example, assuming the multiple word units of the text segment are [student], [union], and the feature vectors corresponding to these three word units are all 1×n matrices, then the text feature vector of the text segment can be obtained as a 3×n matrix.

[0085] In an alternative embodiment of the present application, the text feature vector of each text segment is input into an attention layer, and each text feature vector includes the feature vectors of multiple word units. For any reference text segment, in the self-attention layer, the feature vector of each word unit of the reference text segment can be subjected to attention calculation with the feature vectors of other word units to obtain a first fusion feature vector that combines the context information of the reference text segment. The first fusion feature vector is a sentence-level feature vector corresponding to the entire reference text segment.

[0086] In an optional embodiment of the present application, the fully connected layer can be called a Fully Connected Layer, and the fully connected layer includes an activation function. Exemplarily, the activation function can be a Softmax function. In general, Softmax will calculate the probability of each target category in all possible categories. The main advantage of using Softmax is the range of output probabilities, which ranges from 0 to 1, and the sum of all probabilities will be equal to 1. For a reference text segment, the first fused feature vector of the reference text segment can be represented by a matrix, then the first fused feature vector can be a 1×M matrix, and the 1×M matrix can be called a matrix representation of the first fused feature vector. The 1×M matrix is ​​multiplied by the conversion matrix M×N composed of the parameters of the fully connected layer to obtain a 1×N matrix, in which the numerical value of each column in the matrix represents the correlation score between the reference text segment and the reference category, and then the 1×N matrix is ​​input into the activation function for processing, and the probability that each reference category may be the category label of the reference text segment can be obtained, that is, multiple category confidences of the reference text segment can be obtained.

[0087] In an embodiment of the present application, text fragments can be classified through a text classification model, and the category label of each text fragment can be determined. In this way, if it is necessary to query text content from the text to be processed, the category label of the content to be queried can be used to query from the text fragment corresponding to the category label. This can avoid querying erroneous text content, and can more accurately locate the text content to be queried, thereby improving query efficiency.

[0088] It should be noted that when determining the category label according to the confidence level, it can be divided into two cases according to whether the confidence level is compared with a preset threshold.

[0089] The first case: the confidence is compared with a preset threshold, and the category label of each text segment is determined according to the relationship between the confidence and the preset threshold.

[0090] In implementation, if the text to be processed includes at least two text pages, wherein each text page includes at least one text area, and each text area includes at least one text fragment, after identifying the text content in the at least one text area and determining the text fragment in the at least one text area, it also includes: numbering at least one text area in a reference text page in order from top to bottom and from left to right, and determining the layout order of the corresponding text fragment according to the number of each text area, wherein the reference text page is any one of the at least two text pages.

[0091] Accordingly, in a possible implementation, based on multiple category confidences of each text segment, a specific implementation of determining the category label of each text segment may include:

[0092] Determining whether there is a category confidence greater than a preset threshold among multiple category confidences of a reference text segment, wherein the reference text segment is any text segment in the reference text page;

[0093] If not, determining the position of the reference text segment in the reference text page according to the layout order of the reference text segment;

[0094] If it is determined that the reference text segment is the first text segment in the reference text page, determining whether there is a category confidence greater than a preset threshold among multiple category confidences of the last text segment in a previous text page of the reference text page;

[0095] If yes, the category label of the last text segment in the previous text page of the reference text page is used as the category label of the reference text segment.

[0096] It should be noted that the preset threshold can be set by the user according to actual needs, or can be set by the device by default, and the embodiments of the present application do not limit this.

[0097] That is, if the text to be processed includes at least two text pages, and each text page can obtain at least one text area through target detection, and text recognition is performed on each text area to extract text fragments in the text area, then in the case where the text to be processed includes at least two text pages, the text to be processed may include at least two text fragments. After identifying the text fragments of the reference text page, the text areas in the reference text page can also be numbered in order from top to bottom and from left to right based on the positions of the text fragments in the reference text page, and the layout order of the text fragments can be determined according to the numbering order.

[0098] For example, see Figure 3 , Figure 3 The following is a schematic diagram of another text page. Figure 3 It is a reference text page, and the reference text page includes 4 text areas. The 4 text areas can be numbered 1, 2, 3, and 4 in order from top to bottom and from left to right, and the numbers can be determined as the layout order of the text fragments of each text area in the reference text page. Then, the layout order of the text fragment of the text area numbered 1 in the reference page is 1, and so on. The layout order of each text fragment in the reference text page can be determined.

[0099] In this case, for the reference text segment, determining the category label based on the category confidence requires first determining whether there is a category confidence greater than a preset threshold among the multiple category confidences of the reference text segment. If not, it means that the multiple category confidences of the reference text segment are all less than the preset threshold. It can be considered that the multiple category confidences of the reference text segment are not very accurate, and the category label of the reference text segment cannot be directly determined based on these category confidences. In addition, the layout order of the reference text segment on the reference text page is different, and the method of determining the category label is different. Therefore, the position of the reference text segment on the reference text page can be determined based on the layout order of the reference text segment. If the reference text segment is the first text segment of the reference text page, that is, the layout order of the reference text page is 1, it can be considered that the reference text segment may be a text segment that spans pages. It can then be determined whether there is a category confidence level greater than a preset threshold among the multiple category confidence levels of the last text fragment in the previous text page of the reference text page. If so, it can be considered that the category label of the last text fragment in the previous text page of the reference text page is relatively accurate. Also, because if the reference text fragment is a text fragment that spans pages, the category label of the reference text fragment is the same as the category label of the last text fragment in the previous text page. Therefore, the category label of the last text fragment in the previous text page can be determined as the category label of the reference text fragment.

[0100] For example, see Figure 4 , Figure 4 It is a schematic diagram of a text segment across pages. Assuming that the reference text segment is text segment A, multiple category confidences of the text segment A are all less than a preset threshold, and the text segment A is the first text segment in the reference text page a, and there is a category confidence greater than the preset threshold among the multiple category confidences of the last text segment B in the previous text page b of the reference text page a, the category label of the text segment B can be determined as the category label of the text segment A.

[0101] In the embodiment of the present application, when the category confidence of the first text segment in the reference text page is less than the preset threshold, it can be considered that the first text segment may be a cross-page text segment, and then it can be determined whether the category confidence of the last text segment of the previous text page is greater than the preset threshold. If so, it can be considered that the category label of the last text segment is relatively accurate, and therefore, the category label of the last text segment can be determined as the category label of the first text segment in the reference text page. In this way, the category label of each text segment can be accurately determined in the case of paging, thereby improving the accuracy of the determined text labels.

[0102] In some embodiments, after determining whether there is a category confidence greater than a preset threshold among the multiple category confidences of the last text segment in the previous text page of the reference text page, the method further includes:

[0103] If not, the reference text segment is merged with the last text segment in the previous text page of the reference text page to obtain a merged text segment, and the merged text segment is input into the text classification model to determine the category label of the merged text segment.

[0104] That is to say, when it is determined that there is no category confidence greater than a preset threshold among the multiple category confidences of the last text fragment in the previous text page, it means that the content of the last text fragment may be relatively small, or the content of the last text fragment may not be closely related to the topic. Therefore, the text classification model cannot determine the category label of the last text fragment. The reference text fragment and the last text fragment can be merged to obtain a merged text fragment, and the merged text fragment can be input into the text classification model to determine the category label of the merged text fragment.

[0105] For example, see Figure 5 , Figure 5 is a schematic diagram of another cross-page text segment. Assuming that the reference text segment is text segment A, multiple category confidences of the text segment A are all less than a preset threshold, and the text segment A is the first text segment in the reference text page a, and multiple category confidences of the last text segment B in the previous text page b of the reference text page a are all less than the preset threshold, the text segment B and the text segment A can be merged to obtain a merged text segment, and the merged text segment is input into the text classification model to obtain the category label of the merged text segment.

[0106] As an example, the merged text segment may be input into a text classification model, multiple category confidences of the merged text segment may be determined, and a reference category corresponding to a maximum category confidence may be determined as a category label of the merged text segment.

[0107] It should be noted that the implementation process of inputting the merged text fragments into the text classification model and determining the multiple category confidences of the merged text fragments is the same as the implementation process of determining the multiple category confidences of each text fragment. For its specific implementation, please refer to the relevant description of determining the multiple category confidences of each text fragment. The embodiments of the present application are not limited to this.

[0108] In the embodiment of the present application, when the category confidence of the first text segment in the reference text page is less than the preset threshold, it can be considered that the first text segment may be a cross-page text segment, and then it can be determined whether the category confidence of the last text segment of the previous text page is greater than the preset threshold. If not, it can be considered that the category label of the last text segment is not accurate enough, and the last text segment may be a cross-page text segment. Therefore, the last text segment and the reference text segment can be merged to determine the category label of the merged text segment. In this way, the category label of each text segment can be accurately determined in the case of paging, thereby improving the accuracy of the determined text label.

[0109] It should be noted that the above is a specific implementation of determining the category label of the reference text fragment when the reference text fragment is the first text fragment of the reference text page. Next, it will be explained how to determine the category label of the reference text fragment when the reference text fragment is the last text fragment of the reference text page.

[0110] In some embodiments, after determining the position of the reference text segment in the reference text page according to the layout order of the reference text segment, the method further includes:

[0111] If it is determined that the reference text segment is the last text segment in the reference text page, determining whether there is a category confidence greater than a preset threshold among multiple category confidences of the first text segment in the next text page of the reference text page, wherein the reference text segment is any text segment in the reference text page;

[0112] If so, the category label of the first text segment in the text page next to the reference text page is used as the category label of the reference text segment.

[0113] That is to say, for a reference text segment, when multiple category confidences of the reference text segment are all less than a preset threshold, if the reference text segment is determined to be the last text segment of the reference text page according to the layout order of the reference text segment, it can be considered that the reference text segment may be a cross-page text segment. Then it can be determined whether there is a category confidence greater than the preset threshold among the multiple category confidences of the first text segment in the next text page of the reference text page. If so, it can be considered that the category label of the first text segment of the next text page is relatively accurate. And because if the reference text segment is a cross-page text segment, the category label of the reference text segment is the same as the category label of the first text segment of the next text page, therefore, the category label of the first text segment in the next text page can be determined as the category label of the reference text segment.

[0114] For example, see Figure 6 , Figure 6 It is a schematic diagram of another cross-page text segment. Assuming that the reference text segment is text segment B, multiple category confidences of text segment B are all less than a preset threshold, and text segment B is the last text segment in reference text page b, and there is a category confidence greater than the preset threshold among multiple category confidences of the first text segment A in the next text page a of reference text page b, the category label of text segment A can be determined as the category label of text segment B.

[0115] In the embodiment of the present application, when the category confidence of the last text segment in the reference text page is less than the preset threshold, it can be considered that the last text segment may be a cross-page text segment, and it can be determined whether the category confidence of the first text segment of the next text page is greater than the preset threshold. If so, it can be considered that the category label of the first text segment is relatively accurate, and therefore, the category label of the first text segment can be determined as the category label of the last text segment in the reference text page. In this way, the category label of each text segment can be accurately determined in the case of paging, thereby improving the accuracy of the determined text labels.

[0116] In some embodiments, after determining whether there is a category confidence greater than a preset threshold among the multiple category confidences of the first text segment in the next text page of the reference text page, the method further includes:

[0117] If not, the reference text segment is merged with the first text segment in the next text page of the reference text page to obtain a merged text segment, and the merged text segment is input into the text classification model to determine the category label of the merged text segment.

[0118] That is to say, when it is determined that there is no category confidence greater than a preset threshold among the multiple category confidences of the first text fragment in the next text page, it means that the content of the first text fragment may be relatively small, or the content of the first text fragment may not be closely related to the topic. Therefore, the text classification model cannot determine the category label of the first text fragment. The first text fragment and the reference text fragment can be merged to obtain a merged text fragment, and the merged text fragment can be input into the text classification model to determine the category label of the merged text fragment.

[0119] For example, see Figure 5, assuming that the reference text segment is text segment B, multiple category confidences of the text segment B are all less than the preset threshold, and the text segment B is the last text segment in the reference text page b, and multiple category confidences of the first text segment A in the next text page a of the reference text page b are all less than the preset threshold, the text segment B and the text segment A can be merged to obtain a merged text segment, and the merged text segment is input into the text classification model to obtain the category label of the merged text segment.

[0120] As an example, the merged text segment may be input into a text classification model, multiple category confidences of the merged text segment may be determined, and a reference category corresponding to a maximum category confidence may be determined as a category label of the merged text segment.

[0121] It should be noted that the implementation process of inputting the merged text fragments into the text classification model and determining the multiple category confidences of the merged text fragments is the same as the implementation process of determining the multiple category confidences of each text fragment. For its specific implementation, please refer to the relevant description of determining the multiple category confidences of each text fragment. The embodiments of the present application are not limited to this.

[0122] In the embodiment of the present application, when the category confidence of the last text segment in the reference text page is less than the preset threshold, it can be considered that the first text segment may be a cross-page text segment, and then it can be determined whether the category confidence of the first text segment of the previous text page is greater than the preset threshold. If not, it can be considered that the category label of the first text segment is not accurate enough, and the first text segment may be a cross-page text segment. Therefore, the reference text segment and the first text segment can be merged to determine the category label of the merged text segment. In this way, the category label of each text segment can be accurately determined in the case of paging, thereby improving the accuracy of the determined text label.

[0123] It should be noted that the above is a specific implementation of determining the category label of the reference text segment when the reference text segment is the first text segment or the last text segment of the reference text page. Next, it is described how to determine the category label of the reference text segment when the reference text segment is a middle text segment of the reference text page. The middle text segment is a text segment other than the first text segment and the last text segment.

[0124] In some embodiments, after determining the position of the reference text segment in the reference text page according to the layout order of the reference text segment, the method further includes:

[0125] If it is determined that the reference text segment is not the first text segment or the last text segment of the reference text page, determining whether there is a category confidence greater than a preset threshold among multiple category confidences of a previous text segment of the reference text segment;

[0126] If yes, the category label of the previous text segment of the reference text segment is used as the category label of the reference text segment.

[0127] That is to say, if the reference text fragment is the middle text fragment of the reference text page, it can be considered that the text area corresponding to the reference text fragment may not be divided very accurately, and the text area of ​​one category may be divided into two or even more text areas. Therefore, it can be judged according to the layout order whether there are multiple category confidences of the previous text fragment of the reference text fragment that are greater than the preset threshold. If so, it can be considered that the determined category label of the previous text fragment is relatively accurate. Because if the reference text fragment is an incorrectly partitioned text fragment, the category label of the reference text fragment is the same as the category label of the previous text page fragment. Therefore, the category label of the previous text fragment can be determined as the category label of the reference text fragment.

[0128] In the embodiment of the present application, when the category confidence of the reference text segment is less than the preset threshold, it can be considered that the reference text segment may be a text segment with a partition error, and it can be determined whether the category confidence of the previous text segment is greater than the preset threshold. If so, it can be considered that the category label of the previous text segment is relatively accurate. Because if the reference text segment is a text segment with a partition error, the category label of the reference text segment is the same as the category label of the previous text segment, therefore, the category label of the previous text segment can be determined as the category label of the reference text segment. In this way, the category label of each text segment can be accurately determined in the event of a partition error, thereby improving the accuracy of the determined text labels.

[0129] In some embodiments, after determining whether there is a category confidence greater than a preset threshold among multiple category confidences of a previous text segment of the reference text segment, the method further includes:

[0130] If not, the reference text segment is merged with a previous text segment of the reference text segment to obtain a merged text segment, and the merged text segment is input into the text classification model to determine the category label of the merged text segment.

[0131] That is to say, when it is determined that there is no category confidence greater than a preset threshold among the multiple category confidences of the previous text segment, it means that the previous text segment may also be an incorrectly partitioned text segment. Therefore, the text classification model cannot accurately determine the category label of the previous text segment. The reference text segment and the previous text segment can be merged to obtain a merged text segment, and the merged text segment is input into the text classification model to determine the category label of the merged text segment.

[0132] As an example, the merged text segment may be input into a text classification model, multiple category confidences of the merged text segment may be determined, and a reference category corresponding to a maximum category confidence may be determined as a category label of the merged text segment.

[0133] It should be noted that the implementation process of inputting the merged text fragments into the text classification model and determining the multiple category confidences of the merged text fragments is the same as the implementation process of determining the multiple category confidences of each text fragment. For its specific implementation, please refer to the relevant description of determining the multiple category confidences of each text fragment. The embodiments of the present application are not limited to this.

[0134] In the embodiment of the present application, when the category confidence of the reference text segment is less than the preset threshold, it can be considered that the reference text segment may be a text segment with a partition error, and then it can be determined whether the category confidence of the previous text segment is greater than the preset threshold. If not, it can be considered that the category label of the previous text segment is not accurate enough, and the previous text segment may also be a text segment with a partition error. Because if the reference text segment and the previous text segment are both text segments with partition errors, the reference text segment and the previous text segment may belong to the same category, therefore, the previous text segment and the reference text segment can be merged to determine the category label of the merged text segment. In this way, the category label of each text segment can be accurately determined in the event of a partition error, thereby improving the accuracy of the determined text label.

[0135] It should be noted that the above is a specific implementation of determining the category label of a reference text fragment when there is no category confidence greater than a preset threshold among multiple category confidences of the reference text fragment. Next, it will be explained how to determine the category label of a reference text fragment when there is a category confidence greater than a preset threshold among multiple category confidences of the reference text fragment.

[0136] In another possible implementation, after determining whether there is a category confidence greater than a preset threshold among multiple category confidences of the reference text segment, the method further includes:

[0137] If so, determining a maximum category confidence from category confidences greater than the preset threshold, wherein the reference text segment is any text segment in the reference text page;

[0138] The reference category corresponding to the maximum category confidence is determined as the category label of the reference text segment.

[0139] That is to say, if there is a category confidence greater than a preset threshold among the multiple category confidences of the reference text fragment, it can be considered that the division of the text area corresponding to the text fragment is relatively accurate, and the text fragment is not a text fragment that spans pages. Therefore, the maximum category confidence can be determined from the category confidences greater than the preset threshold, and the reference category corresponding to the maximum category confidence is determined as the category label of the reference text fragment.

[0140] Exemplarily, assuming that the reference text fragment includes 5 category confidences, which are 0.5, 0.6, 0.88, 0.85, and 0.5 respectively, and assuming that the preset threshold is 0.8, it can be determined that there are category confidences 0.85 and 0.88 that are greater than the preset threshold, then the reference category work experience corresponding to 0.88 can be determined as the category label of the reference text fragment.

[0141] In the embodiment of the present application, when there is a category confidence greater than a preset threshold among the multiple category confidences of the reference text segment, it can be considered that the category label of the reference text segment can be accurately determined by the text classification model, and the reference category corresponding to the maximum category confidence can be determined as the category label of the reference text segment. In this way, the category label of each text segment can be accurately determined.

[0142] It should be noted that the above is a description of the first case where a comparison with a preset threshold is required, and the second case where a comparison with a preset threshold is not required will be described below.

[0143] The second case: the category label of each text segment is determined directly based on multiple category confidences without comparing with a preset threshold.

[0144] In implementation, based on multiple category confidences of each text segment, the specific implementation of determining the category label of each text segment may include: determining the reference category corresponding to the largest category confidence among the multiple category confidences of each text segment as the category label of the text segment.

[0145] In this case, since the category confidence represents the probability that the category label of the reference text is the reference category, the reference category corresponding to the largest probability in the reference text segment can be determined as the category label of the reference text segment. For example, assuming that the reference text segment includes 5 category confidences, which are 0.5, 0.6, 0.88, 0.85, and 0.5 respectively, it can be determined that the largest category confidence is 0.88. Assuming that the reference category corresponding to 0.88 is the reward and punishment system, the reward and punishment system can be determined as the category label of the reference text segment.

[0146] In the embodiment of the present application, multiple category confidences may not be compared with a preset threshold, and the reference category corresponding to the maximum category confidence may be directly selected as the category label, which can reduce the amount of calculation and improve the efficiency of determining the category label.

[0147] In implementation, some text areas may include subtitles or small headings, and these subtitles or small headings may be in a format different from that of the main text. Since these subtitles or small headings can usually summarize the text fragments of the text area, in order to improve the accuracy of determining the category label, the format information of the text fragment can also be input into the text classification model so that the model can obtain the format information of the text fragment and take the format information into consideration when determining the category label, thereby achieving more accurate classification.

[0148] In this case, before inputting the text segments in the at least one text region into the text classification model and determining the category label of each text segment, the method further includes:

[0149] Format information of a text segment in the at least one text region is determined.

[0150] Accordingly, the specific implementation of inputting the text fragments in the at least one text area into the text classification model and determining the category label of each text fragment may include: inputting the text fragments in the at least one text area and the format information of the text fragments into the text classification model, and determining the category label of each text fragment.

[0151] That is, the format information of the text segment can be considered when determining the category label of the text segment. Therefore, the format information of the text segment in at least one text region can be obtained, and the format information and the text segment are input into the text classification model together, and the category label of each text segment can be obtained.

[0152] As an example, the format information of the text segment can be extracted by a pre-trained format recognition model. For example, the format information may include bold, font size, underline, italics, etc.

[0153] As an example, the format recognition model can be trained using sample texts with format information, so that the format recognition model has the function of recognizing the format information of the text.

[0154] Exemplarily, assuming that the reference text segment includes "XXXYYZZZZ", and "XXX" is bold, the format information can be identified by the format recognition model. "XXXYYZZZZ" and "XXX bold" can be input into the text classification model, and the text classification model can determine that the category label of the reference text segment is XXX.

[0155] In an embodiment of the present application, since the more important words or words that can express the theme in the text fragment usually have format information different from other text, determining the category label of the text fragment through the text fragment and the format information can improve the accuracy of determining the text label.

[0156] In some embodiments, the text classification model includes a feature extraction layer, an attention layer and a fully connected layer. The text fragments in the at least one text area and the format information of the text fragments are input into the text classification model. The specific implementation of determining the category label of each text fragment may include: inputting each text fragment and the format information of each text fragment into the feature extraction layer to obtain a text feature vector of each text fragment and a format feature vector of each format information; inputting the text feature vector and the format feature vector into the attention layer to obtain a second fused feature vector of each text fragment combined with the corresponding format feature vector; inputting the second fused feature vector of each text fragment into the fully connected layer for classification, and determining the category confidence that each text fragment belongs to multiple reference categories; and determining the category label of each text fragment based on multiple category confidences of each text fragment.

[0157] That is to say, each text fragment and format information can be input into the feature extraction layer for feature extraction, and the text feature vector of each text fragment and the format feature vector of the format information can be extracted. Each text feature vector and the format feature vector are input into the attention layer, and attention calculation is performed on the text feature vector of each text fragment and the format feature vector corresponding to the text fragment. A second fused feature vector of each text fragment combined with the format feature vector of the text fragment can be obtained, and the second fused feature vector is input into the fully connected layer, and the probability of each text fragment belonging to multiple reference categories is determined through the fully connected layer.

[0158] As an example, after each text segment is input into the feature extraction layer, each text segment can be firstly processed by word segmentation to obtain multiple word units of each text segment, and then each word unit can be processed by word embedding to obtain a feature vector of each word unit, and the feature vectors of multiple word units of the same text segment can be concatenated to obtain the text feature vector of the text segment. Similarly, the format information can be processed by word segmentation to obtain multiple word units of each format information, and then each word unit can be processed by word embedding to obtain a feature vector of each word unit, and the feature vectors of multiple word units of the same format information can be concatenated to obtain the format feature vector of the format information.

[0159] As an example, the text feature vector and format feature vector of each text segment are input into the attention layer. For any reference text segment, since the format information of the reference text segment includes the format of a certain word unit in the reference text segment, the feature vectors of word units with different formats and the corresponding format feature vectors can be subjected to attention calculation, and then a second fused feature vector combined with the format feature vector of the reference text segment can be obtained, and the second fused feature vector is a sentence-level feature vector corresponding to the entire reference text segment.

[0160] As an example, the fully connected layer can be called a Fully Connected Layer, and the fully connected layer includes an activation function. Exemplarily, the activation function can be a Softmax function. The Softmax function can calculate the probability of each target category in all possible categories. After the input is normalized by Softmax, the output probability ranges from 0 to 1, and the sum of all probabilities is equal to 1. For the reference text segment, the second fused feature vector of the reference text segment can be represented by a matrix, and the second fused feature vector can be a 1×M matrix, which can be called a matrix representation of the second fused feature vector. The 1×M matrix is ​​multiplied by the conversion matrix M×N composed of the parameters of the fully connected layer to obtain a 1×N matrix. The numerical value of each column in the matrix represents the correlation score between the reference text segment and the reference category. The 1×N matrix is ​​then input into the activation function for processing, and the probability that each reference category may be the category label of the reference text segment can be obtained, that is, multiple category confidences of the reference text segment can be obtained.

[0161] In the embodiment of the present application, the text fragments can be classified based on the text fragments and format information through the text classification model, and the category label of each text fragment can be determined. The format information of the text fragment is considered in the classification process, which can improve the accuracy of classification. In addition, after determining the category label of each text fragment, if it is necessary to query the text content from the text to be processed, the category label of the content to be queried can be used to query from the text fragment corresponding to the category label, which can avoid querying the wrong text content, and can more accurately locate the text content to be queried, which can improve the query efficiency.

[0162] It should be noted that the text processing method provided in the present application can be implemented through the above description. Next, after determining the label of the text segment, the specific implementation of how to query the required text content according to the label will be described.

[0163] In some embodiments, if one wants to query the required text content based on the tag, the method further includes: receiving a query instruction, wherein the query instruction includes the category tag to be queried; and in response to the query instruction, obtaining a target text segment corresponding to the category tag to be queried.

[0164] That is to say, if the user wants to query the text content in the text to be processed, he can click the query option through the interactive interface, and the terminal receives the query instruction, and the query instruction includes the category label to be queried, and then the target text segment can be obtained according to the category label to be queried.

[0165] Taking the text to be processed as a resume as an example, assuming that you want to query the educational information of multiple interviewees, the user can click on the query option through the interactive interface, and select the label to be queried "learning experience", then the terminal can receive the query instruction including "learning experience" and can obtain the target text segment corresponding to the "learning experience".

[0166] In an embodiment of the present application, the text to be processed is divided into multiple text segments, and the category label of each text segment is determined. In this way, when a query instruction is received, the desired content can be accurately and quickly queried based on the category label, thereby improving the efficiency of information query.

[0167] Furthermore, before receiving the query instruction, the method further includes: storing the category label of each text segment and each text segment in a database corresponding to each text segment, wherein the database includes at least one text segment of different categories;

[0168] Accordingly, in response to the query instruction, the specific implementation of obtaining the target text segment corresponding to the category label to be queried may include: in response to the query instruction, querying the text segment corresponding to the category label to be queried from the database, and taking the text segment as the target text segment.

[0169] As an example, the database may be a database configured on the terminal, or the database may be a database configured on other devices.

[0170] That is, after determining the category label of each text segment, the text segment and its corresponding category label can be stored in the database. In this case, after receiving the query instruction, the text segment corresponding to the category label to be queried can be queried from the database, and the queried text segment is determined as the target text segment.

[0171] For example, suppose the text to be processed is a XX contract, and after the above processing, the XX contract can be divided into Party A information, Party B information, contract period, etc., and each category label and the corresponding text segment can be stored in the database. If you want to query the work content, you can query the text segment corresponding to the "contract period" from the database, and use the text segment corresponding to the "contract period" as the target text segment.

[0172] It should be noted that if there are at least two text segments with the same category label in the same text to be processed, the at least two text segments can be merged into a merged text segment, and the merged text segment and the category label are stored in the database in correspondence.

[0173] In an embodiment of the present application, the text fragments and their corresponding category labels are stored in a database, which can facilitate subsequent query of the text fragments according to the category labels and improve query efficiency.

[0174] Furthermore, the query instruction also includes a preset condition. In response to the query instruction, after obtaining the target text segment corresponding to the category label to be queried, it also includes: screening the target text segment according to the preset condition to obtain the text segment that meets the preset condition.

[0175] That is to say, in some cases, the query instruction may also include preset conditions. After determining the target text fragment according to the tag to be queried, the target text fragment can be further screened according to the preset conditions to filter out the text fragments that meet the preset conditions.

[0176] In an embodiment of the present application, after determining the target text fragment, the target text fragment can be screened according to preset conditions. When the category label to be queried is determined, the text content can also be queried according to various conditions or rules, making the text query more flexible and accurate.

[0177] In some embodiments, the preset condition includes a keyword, and the specific implementation of obtaining the text segment that meets the preset condition may include: obtaining a text segment containing the keyword in the target text segment.

[0178] That is, the preset condition may be a keyword, and it can be determined that the text segment to be queried corresponds to the category label to be queried and includes the keyword, that is, the text segment including the keyword in the target text segment can be obtained.

[0179] For example, assuming that the number of target text segments is 3, and the category label to be queried is "learning experience", the keyword is "master", and target text segment 1 includes "undergraduate XXXX University", target text segment 2 includes "undergraduate XX University Master YY University", and target text segment 3 includes "undergraduate degree", then it can be determined that the target text segments 1 and 2 include the keyword, and then the target text segment 1 and target text segment 2 can be obtained.

[0180] The text processing method provided in this specification can determine at least one text area in the text to be processed; identify the text content in the at least one text area to determine the text fragments in the at least one text area; input the text fragments in the at least one text area into a text classification model to determine the category label of each text fragment. The text processing method provided in this scheme does not restrict the format of the text to be processed. The method divides the text fragments extracted from the text to be processed according to categories and labels each text fragment with a category. When extracting information later, it is not necessary to filter the required content from the entire text to be processed, but to extract information from the corresponding text fragment according to the category label, which not only reduces the workload, but also can improve the accuracy of text extraction, improve the efficiency of information extraction, and avoid extracting wrong text content.

[0181] The following combination Figure 7 , taking the application of the text processing method provided in this specification in resume information extraction as an example, the text processing method is further described. Figure 7 A processing flow chart of a text processing method for extracting resume information provided by an embodiment of this specification is shown, which specifically includes the following steps:

[0182] Step 702: Convert the acquired resume into PDF format, and determine at least one text area on each page of the resume after format conversion.

[0183] Due to the various formats of resume files, such as doc, docx, pdf, wps, etc., the methods of extracting text from files of different formats are often different, resulting in different effects and a lack of a universal method. In addition, resume information extraction is often based on the chapter level. Due to the various resume writing styles, chapter-based information extraction often confuses different categories of information, such as extracting the company name of work experience into the company name of project experience. Therefore, in an embodiment of the present application, the resume text can be pre-divided into regions and the labels of the text fragments of each text region can be determined (for example, the text can be first split into work experience and project experience), and on this basis, the company name, position, etc. can be extracted to avoid confusion.

[0184] For example, see Figure 8 , Figure 8 A diagram of a resume. Figure 8 , the resume includes two pages, and it can be determined that there are four text areas in the first page and two text areas in the second page.

[0185] Step 704: Identify text content in at least one text region and determine text segments in the at least one text region.

[0186] Continue to see Figure 8 , the text contents in the four text areas on the first page are recognized, and it can be obtained that the text fragment of the first text area on the first page is "Name: Zhang San Age: 30 Phone: 1xxxxxxxxxx Email: xxxxx@xx.com Hometown: xx Province Current Address: xx District, xx City", the text fragment of the second text area is "Job Seeking Occupation: Senior Financial Manager Expected Salary: 20k-25k", the text fragment of the third text area is "Educational Experience School Name: A University in Beijing Study Time: 20xx.09-20xx.06 Major: Computer Technology Degree: Master", and the text fragment of the fourth text area is "Work Experience Company Name: A Company in Beijing Position: Senior Financial Manager Working Time: 20xx.07-Present Monthly Salary Before Tax: 15k-20k Job Description: 1.xxxxxxxxxx;". By recognizing the text content in the two text areas on the second page, we can get that the text fragment in the first text area on the second page is "2.xxxxxxxxxxxxxxxxxxxx; 3.xxxxxxxxxxxxxxxxxxxx." The text fragment in the second text area on the second page is "I evaluate myself as optimistic, good at communication and listening, xxxx, have xx experience, good at xxx, and can effectively meet the company's needs."

[0187] Step 706: number at least one text region in the reference text page in order from top to bottom and from left to right, and determine the layout order of the corresponding text segments according to the number of each text region.

[0188] Continue to see Figure 8 , number the four text areas in the first page respectively, and number the four text areas in the second page respectively.

[0189] Step 708: Determine format information of a text segment in at least one text region in a reference text page.

[0190] Continue to see Figure 8 , taking the text area numbered 4 in the first page as an example, the format information of the text area is determined to be "Work Experience" in bold and the font size is 2, and the words "Company Name", "Position", "Employment Time" and "Monthly Salary Before Tax" are bold and the font size is 4. Taking the text area numbered 1 in the second page as an example, the format information of the text area is determined to be "2.xxxxxxxxxxxxxxxxxxxx; 3.xxxxxxxxxxxxxxxxxxxx" and the font size of these words are all 4.

[0191] Step 710: Input text segments in at least one text region in the reference text page and format information of the text segments into a text classification model to determine multiple category confidences of each text segment.

[0192] For example, suppose that multiple categories include personal information, educational experience, work experience, project experience, self-evaluation, and job-seeking intention. Take the text segment of text area 1 in the first page as an example. Suppose that the text segment and its format information are input into the text classification model, six category confidences of the text segment of text area 1 can be obtained. The six category confidences are the probabilities that the text segment belongs to the above six categories respectively.

[0193] Step 712 : Determine whether there is a category confidence greater than a preset threshold among the multiple category confidences of the reference text segment. If not, execute step 714 ; if so, execute step 728 .

[0194] Step 714: Determine the position of the reference text segment in the reference text page according to the layout order of the reference text segment.

[0195] Step 716: If it is determined that the reference text segment is the first text segment in the reference text page, determine whether there is a category confidence greater than a preset threshold among the multiple category confidences of the last text segment in the previous text page of the reference text page; if so, execute step 718; if not, execute step 720.

[0196] by Figure 8 The text segment of the text area 1 in the second page is the reference text segment, and the preset threshold is 0.8. As an example, if the six category confidences of the text segment are 0.02, 0.03, 0.7, 0.15, 0.04, and 0.06, respectively, 0.02 represents the probability that the category of the text segment is personal information, 0.03 represents the probability that the category of the text segment is educational experience, 0.7 represents the probability that the category of the text segment is work experience, 0.15 represents the probability that the category of the text segment is project experience, 0.04 represents the probability that the category of the text segment is self-evaluation, and 0.06 represents the probability that the category of the text segment is job-seeking intention. It can be determined that there is no category confidence greater than the preset threshold among the six category confidences, and the reference text segment is the first text segment in the second page, and the multiple category confidences of the last text segment in the first page can be further judged.

[0197] Step 718: Using the category label of the last text segment in the previous text page of the reference text page as the category label of the reference text segment.

[0198] Continuing with the example of step 716 above, as an example, assume that Figure 8 The six category confidences of the last text segment in the first page, that is, the text segment in text area 4 in the first page, are 0.02, 0.03, 0.85, 0.05, 0.01, and 0.04, respectively, where 0.02 indicates the probability that the category of the text segment is personal information, 0.03 indicates the probability that the category of the text segment is educational experience, 0.8 indicates the probability that the category of the text segment is work experience, 0.05 indicates the probability that the category of the text segment is project experience, 0.01 indicates the probability that the category of the text segment is self-evaluation, and 0.04 indicates the probability that the category of the text segment is job-seeking intention. It can be determined that there is a category confidence greater than a preset threshold among the six category confidences, then it can be determined that the category label of the text segment in text area 4 in the first page is work experience, and the category label of the reference text segment, that is, the text segment in text area 1 in the second page, can be determined as work experience.

[0199] Step 720: merge the reference text segment with the last text segment in the previous text page of the reference text page to obtain a merged text segment, input the merged text segment into a text classification model, and determine a category label of the merged text segment.

[0200] Continuing with the example of step 716 above, as another example, assume that Figure 8The six category confidences of the last text segment in the first page, that is, the text segment in text area 4 in the first page, are 0.02, 0.03, 0.75, 0.15, 0.01, and 0.04, respectively, where 0.02 indicates the probability that the category of the text segment is personal information, 0.03 indicates the probability that the category of the text segment is educational experience, 0.75 indicates the probability that the category of the text segment is work experience, 0.15 indicates the probability that the category of the text segment is project experience, 0.01 indicates the probability that the category of the text segment is self-evaluation, and 0.04 indicates the probability that the category of the text segment is job-seeking intention. It can be determined that there is no category confidence greater than a preset threshold among the six category confidences, and the last text segment in the first page and the first text segment in the second page can be merged to obtain a merged text segment, and the merged text segment is input into the text classification model to determine the category label of the merged text segment.

[0201] Step 722: If it is determined that the reference text segment is the last text segment in the reference text page, determine whether there is a category confidence greater than a preset threshold among the multiple category confidences of the first text segment in the next text page of the reference text page; if so, execute step 724; if not, execute step 726.

[0202] by Figure 8 The text segment in text area 4 in the first page is taken as the reference text segment. Assuming that the six confidences of the text segment are all less than the preset threshold, the confidences of multiple categories of the text segment in text area 1 in the second page can be determined.

[0203] Step 724: Using the category label of the first text segment in the text page next to the reference text page as the category label of the reference text segment.

[0204] Continuing with the example of step 722 above, as an example, assume that Figure 8 The six category confidences of the text segment in the text area 1 in the second page are 0.02, 0.03, 0.85, 0.05, 0.01, and 0.04, respectively, where 0.02 indicates the probability that the category of the text segment is personal information, 0.03 indicates the probability that the category of the text segment is educational experience, 0.8 indicates the probability that the category of the text segment is work experience, 0.05 indicates the probability that the category of the text segment is project experience, 0.01 indicates the probability that the category of the text segment is self-evaluation, and 0.04 indicates the probability that the category of the text segment is job-seeking intention. It can be determined that there is a category confidence greater than the preset threshold among the six category confidences, then it can be determined that the category label of the text segment in the text area 1 in the second page is work experience, and further the category label of the text segment in the text area 4 in the first page can be determined as work experience.

[0205] Step 726: Merge the reference text segment with the first text segment in the next text page of the reference text page to obtain a merged text segment, input the merged text segment into the text classification model, and determine the category label of the merged text segment.

[0206] Continuing with the example of step 722 above, as another example, assume that Figure 8 The six category confidences of the text fragment in the text area 1 in the second page are 0.02, 0.03, 0.75, 0.15, 0.01, and 0.04, respectively, where 0.02 indicates the probability that the category of the text fragment is personal information, 0.03 indicates the probability that the category of the text fragment is educational experience, 0.75 indicates the probability that the category of the text fragment is work experience, 0.15 indicates the probability that the category of the text fragment is project experience, 0.01 indicates the probability that the category of the text fragment is self-evaluation, and 0.04 indicates the probability that the category of the text fragment is job-seeking intention. It can be determined that there is no category confidence greater than a preset threshold among the six category confidences, then the last text fragment in the first page and the first text fragment in the second page can be merged to obtain a merged text fragment, and the merged text fragment is input into the text classification model to determine the category label of the merged text fragment.

[0207] Step 728: Determine a maximum category confidence from the category confidences that are greater than the preset threshold, and determine the reference category corresponding to the maximum category confidence as the category label of the reference text segment.

[0208] by Figure 8 The text segment in the text area 1 in the first page is the reference text segment. Taking the preset threshold of 0.3 as an example, if the six category confidences of the text segment are 0.9, 0.015, 0.025, 0.02, 0.03, and 0.01, respectively, 0.9 represents the probability that the category of the text segment is personal information, 0.015 represents the probability that the category of the text segment is educational experience, 0.025 represents the probability that the category of the text segment is work experience, 0.02 represents the probability that the category of the text segment is project experience, 0.03 represents the probability that the category of the text segment is self-evaluation, and 0.01 represents the probability that the category of the text segment is job-seeking intention. Among the six category confidences, there is a category confidence greater than the preset threshold, and the maximum category confidence among the category confidences greater than the preset threshold is 0.9, then personal information can be determined as the category label of the reference text segment.

[0209] Step 730: Store the category label of each text segment in a database corresponding to each text segment, wherein the database includes at least one text segment of a different category.

[0210] Step 732: Receive a query instruction, wherein the query instruction includes a category label to be queried.

[0211] For example, a query instruction is received, and the category label to be queried included in the query instruction is "education experience".

[0212] Step 734: In response to the query instruction, query the database for a text segment corresponding to the category label to be queried, and use the text segment as a target text segment.

[0213] For example, the text fragments corresponding to "educational experience" can be queried from the database. Assuming that the text fragments include text fragment A "Educational experience school name: a certain university in Beijing, study time: 20xx.09-20xx.06 Degree: Master" and text fragment B "Educational experience school name: a certain university in Nanjing, study time: 20xx.09-20xx.06 Degree: Bachelor", then the text fragment A and text fragment B can be determined as the target text fragments.

[0214] Step 736: Filter the target text segments according to the preset conditions to obtain text segments that meet the preset conditions.

[0215] Continuing with the above example, assuming that the preset condition is to include the keyword "Master", the text segment A in the target text segment can be determined as the text segment that meets the preset condition.

[0216] The text processing method provided in this specification determines at least one text area in the text to be processed; identifies the text content in the at least one text area to determine the text fragments in the at least one text area; inputs the text fragments in the at least one text area into a text classification model to determine the category label of each text fragment. The text processing method provided in this scheme does not restrict the format of the text to be processed. The method divides the text fragments extracted from the text to be processed according to categories and labels each text fragment with a category. When extracting information later, it is not necessary to filter the required content from the entire text to be processed, but to extract information from the corresponding text fragment according to the category label, which not only reduces the workload, but also can improve the accuracy of text extraction, improve the efficiency of information extraction, and avoid extracting wrong text content.

[0217] Corresponding to the above method embodiment, this specification also provides a text processing device embodiment, Fig. 9 FIG. 1 shows a schematic diagram of the structure of a text processing device provided by an embodiment of the present specification. Fig. 9 As shown, the device comprises:

[0218] A first determination module 902 is configured to determine at least one text region in the text to be processed;

[0219] A second determination module 904 is configured to identify text content in the at least one text region and determine a text segment in the at least one text region;

[0220] The third determination module 906 is configured to input the text segments in the at least one text region into a text classification model to determine a category label of each text segment.

[0221] Optionally, the third determining module 906 is configured to:

[0222] Inputting the text segments in each text region into a text classification model, and determining a plurality of category confidences of each text segment, wherein each category confidence of each text segment is used to characterize the probability that the text segment belongs to a reference category;

[0223] Based on multiple category confidences of each text segment, a category label of each text segment is determined.

[0224] Optionally, the second determining module 904 is further configured to:

[0225] If the text to be processed includes at least two text pages, wherein each text page includes at least one text area, and each text area includes at least one text segment, at least one text area in a reference text page is numbered in order from top to bottom and from left to right, and a layout order of corresponding text segments is determined according to the number of each text area, wherein the reference text page is any one of the at least two text pages;

[0226] Accordingly, the third determining module 906 is configured to:

[0227] Determining whether there is a category confidence greater than a preset threshold among multiple category confidences of a reference text segment, wherein the reference text segment is any text segment in the reference text page;

[0228] If not, determining the position of the reference text segment in the reference text page according to the layout order of the reference text segment;

[0229] If it is determined that the reference text segment is the first text segment in the reference text page, determining whether there is a category confidence greater than a preset threshold among multiple category confidences of the last text segment in a previous text page of the reference text page;

[0230] If yes, the category label of the last text segment in the previous text page of the reference text page is used as the category label of the reference text segment.

[0231] Optionally, the third determining module 906 is further configured to:

[0232] If not, the reference text segment is merged with the last text segment in the previous text page of the reference text page to obtain a merged text segment, and the merged text segment is input into the text classification model to determine the category label of the merged text segment.

[0233] Optionally, the third determining module 906 is further configured to:

[0234] If it is determined that the reference text segment is the last text segment in the reference text page, determining whether there is a category confidence greater than a preset threshold among multiple category confidences of the first text segment in the next text page of the reference text page, wherein the reference text segment is any text segment in the reference text page;

[0235] If so, the category label of the first text segment in the text page next to the reference text page is used as the category label of the reference text segment.

[0236] Optionally, the third determining module 906 is further configured to:

[0237] If not, the reference text segment is merged with the first text segment in the next text page of the reference text page to obtain a merged text segment, and the merged text segment is input into the text classification model to determine the category label of the merged text segment.

[0238] Optionally, the third determining module 906 is further configured to:

[0239] If it is determined that the reference text segment is not the first text segment or the last text segment of the reference text page, determining whether there is a category confidence greater than a preset threshold among multiple category confidences of a previous text segment of the reference text segment;

[0240] If yes, the category label of the previous text segment of the reference text segment is used as the category label of the reference text segment.

[0241] Optionally, the third determining module 906 is further configured to:

[0242] If not, the reference text segment is merged with a previous text segment of the reference text segment to obtain a merged text segment, and the merged text segment is input into the text classification model to determine the category label of the merged text segment.

[0243] Optionally, the third determining module 906 is further configured to:

[0244] If so, determining a maximum category confidence from category confidences greater than the preset threshold, wherein the reference text segment is any text segment in the reference text page;

[0245] The reference category corresponding to the maximum category confidence is determined as the category label of the reference text segment.

[0246] Optionally, the third determining module 906 is configured to:

[0247] The reference category corresponding to the maximum category confidence among multiple category confidences of each text segment is determined as the category label of the text segment.

[0248] Optionally, the device further comprises:

[0249] A receiving module is configured to receive a query instruction, wherein the query instruction includes a category label to be queried;

[0250] The acquisition module is configured to acquire the target text segment corresponding to the category label to be queried in response to the query instruction.

[0251] Optionally, the receiving module is further configured to:

[0252] storing the category label of each text segment in correspondence with each text segment in a database, wherein the database includes at least one text segment of different categories;

[0253] Accordingly, the acquisition module is also configured as follows:

[0254] In response to the query instruction, the text segment corresponding to the category label to be queried is queried from the database, and the text segment is used as the target text segment.

[0255] Optionally, the acquisition module is further configured to:

[0256] The query instruction also includes a preset condition, and the target text segment is screened according to the preset condition to obtain the text segment that meets the preset condition.

[0257] Optionally, the acquisition module is configured to:

[0258] The preset condition includes a keyword, and a text segment containing the keyword in the target text segment is obtained.

[0259] Optionally, the third determining module 906 is configured to:

[0260] The text classification model includes a feature extraction layer, an attention layer and a fully connected layer, and each text segment is input into the feature extraction layer to obtain a text feature vector of each text segment;

[0261] Inputting the text feature vector of each text segment into the attention layer to obtain a first fused feature vector of each text segment;

[0262] The first fused feature vector is input into the fully connected layer for classification to determine the category confidence that each text segment belongs to multiple reference categories.

[0263] Optionally, the third determining module 906 is further configured to:

[0264] determining format information of a text segment in the at least one text region;

[0265] The text segments in the at least one text region and the format information of the text segments are input into a text classification model to determine a category label of each text segment.

[0266] Optionally, the third determining module 906 is configured to:

[0267] The text classification model includes a feature extraction layer, an attention layer and a fully connected layer, each text segment and the format information of each text segment are input into the feature extraction layer to obtain a text feature vector of each text segment and a format feature vector of each format information;

[0268] Inputting the text feature vector and the format feature vector into the attention layer to obtain a second fused feature vector of the format feature vector corresponding to each text segment;

[0269] Inputting the second fused feature vector of each text segment into the fully connected layer for classification, and determining the category confidence that each text segment belongs to multiple reference categories;

[0270] Based on multiple category confidences of each text segment, a category label of each text segment is determined.

[0271] The text processing method provided by this solution does not restrict the format of the text to be processed. The method divides the text fragments extracted from the text to be processed into categories and labels each text fragment with a category. When extracting information subsequently, there is no need to filter the required content from the entire text to be processed. Instead, information is extracted from the corresponding text fragment according to the category label. This not only reduces the workload, but also improves the accuracy of text extraction, improves the efficiency of information extraction, and avoids extracting erroneous text content.

[0272] The above is a schematic scheme of a text processing device of this embodiment. It should be noted that the technical scheme of the text processing device and the technical scheme of the above text processing method belong to the same concept, and the details not described in detail in the technical scheme of the text processing device can be referred to the description of the technical scheme of the above text processing method.

[0273] Fig.10 The structure block diagram of a computing device 1000 provided according to an embodiment of the present specification is shown. The components of the computing device 1000 include but are not limited to a memory 1010 and a processor 1020. The processor 1020 is connected to the memory 1010 via a bus 1030, and the database 1050 is used to store data.

[0274] The computing device 1000 also includes an access device 1040 that enables the computing device 1000 to communicate via one or more networks 1060. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 1040 may include one or more of any type of network interface (e.g., a network interface card (NIC)) that is wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0275] In one embodiment of the present specification, the above components of the computing device 1000 and Fig.10 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Fig.10 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0276] The computing device 1000 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 1000 may also be a mobile or stationary server.

[0277] The processor 1020 is used to execute the following computer executable instructions:

[0278] Determining at least one text region in the text to be processed;

[0279] Recognizing text content in the at least one text region to determine text segments in the at least one text region;

[0280] The text segments in the at least one text region are input into a text classification model to determine a category label of each text segment.

[0281] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above text processing method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above text processing method.

[0282] An embodiment of the present specification further provides a computer-readable storage medium storing computer instructions, which are used when executed by a processor to:

[0283] Determining at least one text region in the text to be processed;

[0284] Recognizing text content in the at least one text region to determine text segments in the at least one text region;

[0285] The text segments in the at least one text region are input into a text classification model to determine a category label of each text segment.

[0286] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above text processing method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above text processing method.

[0287] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0288] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0289] It should be noted that, for the convenience of description, the aforementioned method embodiments are all described as a series of action combinations, but those skilled in the art should be aware that this specification is not limited by the order of the actions described, because according to this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this specification.

[0290] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0291] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is limited only by the claims and their full scope and equivalents.

Claims

1. A text processing method, characterized in that: include: Determine at least one text region in the text to be processed, wherein the text to be processed includes at least two text pages, and each text page includes at least one text region; Recognizing text content in the at least one text region to determine text segments in the at least one text region; Numbering at least one text area in a reference text page in a sequence from top to bottom and from left to right, and determining a layout order of corresponding text segments according to the number of each text area, wherein the reference text page is any one of the at least two text pages; Inputting the text segments in each text region into a text classification model, and determining a plurality of category confidences of each text segment, wherein each category confidence of each text segment is used to characterize the probability that the text segment belongs to a reference category; Determining whether there is a category confidence greater than a preset threshold among multiple category confidences of a reference text segment, wherein the reference text segment is any text segment in the reference text page; If not, the category label of the reference text segment is determined according to the layout order of the reference text segment.

2. The text processing method according to claim 1, characterized in that: Determining the category label of the reference text segment according to the layout order of the reference text segment includes: Determining the position of the reference text segment in the reference text page according to the layout order of the reference text segment; If it is determined that the reference text segment is the first text segment in the reference text page, determining whether there is a category confidence greater than a preset threshold among multiple category confidences of the last text segment in a previous text page of the reference text page; If yes, the category label of the last text segment in the previous text page of the reference text page is used as the category label of the reference text segment.

3. The text processing method according to claim 2, characterized in that: After determining whether there is a category confidence greater than a preset threshold among the multiple category confidences of the last text segment in the previous text page of the reference text page, the method further includes: If not, the reference text segment is merged with the last text segment in the previous text page of the reference text page to obtain a merged text segment, and the merged text segment is input into the text classification model to determine the category label of the merged text segment.

4. The text processing method according to claim 2, characterized in that: After determining the position of the reference text segment in the reference text page according to the layout order of the reference text segment, the method further includes: If it is determined that the reference text segment is the last text segment in the reference text page, determining whether there is a category confidence greater than a preset threshold among multiple category confidences of the first text segment in the next text page of the reference text page, wherein the reference text segment is any text segment in the reference text page; If so, the category label of the first text segment in the text page next to the reference text page is used as the category label of the reference text segment.

5. The text processing method according to claim 4, characterized in that: After determining whether there is a category confidence greater than a preset threshold among the multiple category confidences of the first text segment in the next text page of the reference text page, the method further includes: If not, the reference text segment is merged with the first text segment in the next text page of the reference text page to obtain a merged text segment, and the merged text segment is input into the text classification model to determine the category label of the merged text segment.

6. The text processing method according to claim 2, characterized in that: After determining the position of the reference text segment in the reference text page according to the layout order of the reference text segment, the method further includes: If it is determined that the reference text segment is not the first text segment or the last text segment of the reference text page, determining whether there is a category confidence greater than a preset threshold among multiple category confidences of a previous text segment of the reference text segment; If yes, the category label of the previous text segment of the reference text segment is used as the category label of the reference text segment.

7. The text processing method according to claim 6, characterized in that: After determining whether there is a category confidence greater than a preset threshold among the multiple category confidences of the previous text segment of the reference text segment, the method further includes: If not, the reference text segment is merged with a previous text segment of the reference text segment to obtain a merged text segment, and the merged text segment is input into the text classification model to determine the category label of the merged text segment.

8. The text processing method according to claim 2, characterized in that: After determining whether there is a category confidence greater than a preset threshold among the multiple category confidences of the reference text segment, the method further includes: If so, determining a maximum category confidence from category confidences greater than the preset threshold, wherein the reference text segment is any text segment in the reference text page; The reference category corresponding to the maximum category confidence is determined as the category label of the reference text segment.

9. The text processing method according to any one of claims 1 to 8, characterized in that: The method further comprises: Receiving a query instruction, wherein the query instruction includes a category label to be queried; In response to the query instruction, a target text segment corresponding to the category label to be queried is obtained.

10. The text processing method according to claim 9, characterized in that: Before receiving the query command, it also includes: storing the category label of each text segment in correspondence with each text segment in a database, wherein the database includes at least one text segment of different categories; Accordingly, in response to the query instruction, obtaining the target text segment corresponding to the category label to be queried includes: In response to the query instruction, the text segment corresponding to the category label to be queried is queried from the database, and the text segment is used as the target text segment.

11. The text processing method according to claim 9, characterized in that: The query instruction further includes a preset condition. After obtaining the target text segment corresponding to the category label to be queried in response to the query instruction, the following steps are further included: The target text segments are screened according to the preset conditions to obtain text segments that meet the preset conditions.

12. The text processing method according to claim 11, characterized in that: The preset condition includes a keyword, and obtaining a text segment that meets the preset condition includes: A text segment containing the keyword in the target text segment is obtained.

13. The text processing method according to claim 1, characterized in that: The text classification model includes a feature extraction layer, an attention layer, and a fully connected layer. The text segments in each text region are input into the text classification model to determine the category confidence that each text segment belongs to multiple reference categories, including: Input each text segment into the feature extraction layer to obtain a text feature vector of each text segment; Inputting the text feature vector of each text segment into the attention layer to obtain a first fused feature vector of each text segment; The first fused feature vector is input into the fully connected layer for classification to determine the category confidence that each text segment belongs to multiple reference categories.

14. The text processing method according to claim 1, characterized in that: Before inputting the text segments in the at least one text region into the text classification model and determining the category label of each text segment, the method further includes: determining format information of a text segment in the at least one text region; Accordingly, inputting the text segments in the at least one text region into a text classification model to determine the category label of each text segment includes: The text segments in the at least one text region and the format information of the text segments are input into a text classification model to determine a category label of each text segment.

15. The text processing method according to claim 14, characterized in that: The text classification model includes a feature extraction layer, an attention layer, and a fully connected layer. The text segments in the at least one text region and the format information of the text segments are input into the text classification model to determine the category label of each text segment, including: Inputting each text segment and the format information of each text segment into the feature extraction layer to obtain a text feature vector of each text segment and a format feature vector of each format information; Inputting the text feature vector and the format feature vector into the attention layer to obtain a second fused feature vector of the format feature vector corresponding to each text segment; Inputting the second fused feature vector of each text segment into the fully connected layer for classification, and determining the category confidence that each text segment belongs to multiple reference categories; Based on multiple category confidences of each text segment, a category label of each text segment is determined.

16. A text processing device, characterized in that: include: A first determining module is configured to determine at least one text region in a text to be processed, wherein the text to be processed includes at least two text pages, and each text page includes at least one text region; A second determination module is configured to identify text content in the at least one text region and determine a text segment in the at least one text region; The third determination module is configured to number at least one text area in a reference text page in order from top to bottom and from left to right, and determine the layout order of the corresponding text fragments according to the number of each text area, wherein the reference text page is any one of the at least two text pages; input the text fragments in each text area into the text classification model, and determine multiple category confidences of each text fragment, wherein each category confidence of each text fragment is used to characterize the probability that the text fragment belongs to a reference category; determine whether there is a category confidence greater than a preset threshold among the multiple category confidences of the reference text fragment, wherein the reference text fragment is any text fragment in the reference text page; if not, determine the category label of the reference text fragment according to the layout order of the reference text fragment.

17. A computing device, characterized in that include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the following method: Determine at least one text region in the text to be processed, wherein the text to be processed includes at least two text pages, and each text page includes at least one text region; Recognizing text content in the at least one text region to determine text segments in the at least one text region; Numbering at least one text area in a reference text page in a sequence from top to bottom and from left to right, and determining a layout order of corresponding text segments according to the number of each text area, wherein the reference text page is any one of the at least two text pages; Inputting the text segments in each text region into a text classification model, and determining a plurality of category confidences of each text segment, wherein each category confidence of each text segment is used to characterize the probability that the text segment belongs to a reference category; Determining whether there is a category confidence greater than a preset threshold among multiple category confidences of a reference text segment, wherein the reference text segment is any text segment in the reference text page; If not, the category label of the reference text segment is determined according to the layout order of the reference text segment.

18. A computer-readable storage medium storing computer instructions, which, when executed by a processor, implement the steps of the text processing method according to any one of claims 1 to 15.