An image classification method, apparatus, electronic device, and storage medium
By employing a multi-level classification method and utilizing parsing and recognition rules to filter and identify business text, the problem of inaccurate image classification caused by long-tail distribution is solved, thereby improving the accuracy of image classification in credit certificate approval scenarios.
Patent Information
- Application Number
- CN202210763807.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-29
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2042-06-29
AI Technical Summary
In existing technologies, due to the long-tail distribution of training data, statistical machine learning classification models are not sufficiently trained for some business types, resulting in low accuracy of image classification results. This is especially true in credit certificate approval scenarios, where business images with similar image structures and text information are prone to misclassification.
A multi-level classification method is adopted. The business text is filtered by preset parsing rules to eliminate interference data. The business classification model is used to accurately classify the first text, and the second text that was not accurately classified is further recognized by recognition rules. The image classification result is determined by combining the text recognition results.
It improves the accuracy of image classification, reduces the resource requirements for long-tail training samples, and ensures the accuracy of classification results, especially in business images with similar image structure and text information, achieving higher classification accuracy.
Smart Images

Figure CN115221308B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image data processing technology, and in particular to an image classification method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the rapid development of information technology, images are widely used for data display and carrying. Among them, business images under different business types often adopt different data carrying methods. Therefore, accurate classification of images during the data extraction process helps data reviewers quickly identify and call up the data carrying method required for the image to be reviewed, thereby ensuring the rapid extraction of image data and the rapid progress of subsequent data approval processes.
[0003] For example, in credit certificate approval scenarios, multiple preset business types are typically used to classify a business image carrying credit data, such as transportation type, endorsement type, etc. In related technologies, training data related to multiple business types is typically collected to train a statistical machine learning classification model. Based on the trained statistical machine learning classification model, features are extracted from the target image to be identified, and the extracted image features are used to output the classification probability of the target image corresponding to each preset business type.
[0004] However, in reality, the training data used for model training often has a long-tail distribution. This situation can easily lead to insufficient training of some long-tail business types during the training process, resulting in low accuracy of the classification results output by the model.
[0005] Therefore, in related technologies, there is often a problem that the accuracy of the image classification results output by the statistical machine learning classification model is not high due to insufficient training. Summary of the Invention
[0006] This application provides an image classification method, apparatus, electronic device, and storage medium to improve the accuracy of image classification.
[0007] In a first aspect, embodiments of this application provide an image classification method, including:
[0008] Obtain the business text for each business image to be classified, wherein each business text includes at least the optical characters of the corresponding business image.
[0009] Based on preset parsing rules, each obtained business text is parsed and filtered to determine at least one first text to be classified, wherein the number of optical characters in each first text does not exceed a preset threshold.
[0010] Based on a pre-defined business classification model, at least one first text is classified, and based on the classification results, at least one second text to be identified is determined from the at least one first text.
[0011] Based on preset recognition rules, text recognition is performed on at least one second text obtained, and based on the recognition results, image classification results for each business image are obtained.
[0012] Secondly, embodiments of this application provide an image classification apparatus, including:
[0013] The acquisition module is used to acquire the business text of each business image to be classified, wherein each business text includes at least the optical characters of the corresponding business image.
[0014] The filtering module is used to parse and filter the obtained business texts based on preset parsing rules to determine at least one first text to be classified, wherein the number of optical characters in each first text does not exceed a preset threshold.
[0015] The first classification module is used to classify at least one first text obtained based on a preset business classification model, and based on the classification results, to determine at least one second text to be identified from at least one first text.
[0016] The second classification module is used to perform text recognition on at least one second text obtained based on preset recognition rules, and to obtain image classification results for each business image based on the recognition results.
[0017] In one optional embodiment, based on preset parsing rules, the obtained business texts are parsed and filtered to determine at least one first text to be classified. The filtering module is specifically used for:
[0018] Based on the number of optical characters in each business text, each business text whose number of corresponding optical characters does not exceed a preset character threshold is identified as a candidate text to be matched.
[0019] Based on the preset first feature word, each candidate text is matched to obtain the first matching result for each candidate text.
[0020] From each candidate text, at least one candidate text whose corresponding first matching result satisfies the preset first matching condition is identified as the first text to be classified.
[0021] In one optional embodiment, based on a preset business classification model, at least one first text is classified, wherein the first classification module is specifically used for:
[0022] For at least one first text, perform the following operations respectively:
[0023] Based on a preset business classification model, feature extraction is performed on a first text to obtain the text features of the first text. Based on the text features, the target attribution probability of the first text is obtained. The target attribution probability represents the maximum attribution probability among the various attribution probabilities corresponding to each preset first text type.
[0024] Determine whether the probability of belonging to the target is greater than a preset probability threshold, where:
[0025] If the target attribution probability is greater than the preset probability threshold, then the first text type corresponding to the target attribution probability will be used as the business type of the first text.
[0026] If the probability of target attribution is not greater than the preset probability threshold, then the preset candidate type will be used as the business type of the first text, and the first text will be used as the second text to be identified.
[0027] In one optional embodiment, based on preset recognition rules, text recognition is performed on at least one second text obtained, and the second classification module is specifically used for:
[0028] For at least one second text, perform the following operations respectively:
[0029] Based on preset cleaning rules, a second text is cleaned to obtain a second cleaned text corresponding to the second text.
[0030] Based on the preset second feature words, the second cleaned text is matched to obtain the corresponding second matching result, wherein the second feature words are associated with the preset second text type.
[0031] When it is determined that the second matching result meets the preset second matching conditions, the second text type associated with the second feature word is taken as a business type of the second text.
[0032] In one optional embodiment, the second matching result does not meet the preset second matching condition.
[0033] Based on the preset second feature words, the second cleaned text is matched to obtain the corresponding second matching result. The second classification module is also used for:
[0034] Based on the preset third feature words, the second cleaned text is matched to obtain the target matching number of the third feature words in the second cleaned text. The third feature words are associated with the preset third text type. The target matching number represents the maximum number of matching times among the various matching times corresponding to each preset third feature word in the second cleaned text.
[0035] When the number of target matches meets the preset counting threshold, the third text type associated with the third feature word is treated as a business type of the second text.
[0036] In one optional embodiment, based on the recognition results, the respective service type of each service image is obtained, and the second classification module is specifically used for:
[0037] Based on the identification results, determine the business type of at least one second text, and based on the classification results, determine the business type of at least one first text.
[0038] From each business text, identify the business texts that meet the preset subdivision conditions for the corresponding business type, and these will be the third texts to be subdivided.
[0039] Based on preset segmentation rules, the obtained third-party texts are further segmented and categorized, and the business type of each third-party text is updated based on the obtained segmentation results.
[0040] Based on the updated business types, image classification results for each business image are obtained.
[0041] Thirdly, an electronic device is proposed, comprising a processor and a memory, wherein the memory stores program code that, when executed by the processor, causes the processor to perform the steps of the image classification method described in the first aspect.
[0042] Fourthly, a computer-readable storage medium is proposed, comprising program code that, when executed on an electronic device, causes the electronic device to perform the steps of the image classification method described in the first aspect.
[0043] Fifthly, a computer program product is provided, which, when invoked by a computer, causes the computer to perform the image classification method steps as described in the first aspect.
[0044] The technical effects of the embodiments of this application are as follows:
[0045] In this embodiment, a multi-level classification method is adopted. After accurately classifying each first text based on a preset first text type using a pre-defined business classification model, each specified second text is further classified based on its second text type based on the obtained classification results. In the above process, the classification target under the specified business type is achieved through the business classification model and recognition rules, so as to effectively improve the accuracy of the final image classification result while ensuring that the accuracy of each classification target reaches the highest level.
[0046] On the other hand, based on the above image classification method, only a preset business classification model is needed to achieve the classification target for some business types. Therefore, when training the preset business classification model, only training data for some business types needs to be collected to ensure the accurate classification effect of business images. Based on the above method, the resource requirements for long-tail training samples in the training data are effectively reduced during the model training process, avoiding the low accuracy of image classification results due to insufficient model training. Furthermore, based on the above multi-level image classification method, business images with similar image structures and / or text information are subdivided hierarchically, further ensuring the classification accuracy of business images. Attached Figure Description
[0047] Figure 1 This is a schematic diagram illustrating a possible application scenario provided by an embodiment of this application;
[0048] Figure 2 A flowchart illustrating an image classification method provided in this application embodiment;
[0049] Figure 3 A schematic diagram illustrating a method for classifying a first text as provided in an embodiment of this application;
[0050] Figure 4 A schematic diagram illustrating a method for determining a second text provided in an embodiment of this application;
[0051] Figure 5 A schematic diagram illustrating a second text classification method provided in an embodiment of this application;
[0052] Figure 6 A schematic diagram illustrating a third-party text classification method provided in an embodiment of this application;
[0053] Figure 7 A logical schematic diagram of an image classification method provided in an embodiment of this application;
[0054] Figure 8 This is a schematic diagram of the structure of an image classification device provided in an embodiment of this application;
[0055] Figure 9 This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0056] The technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this invention.
[0057] It should be noted that in the description of this application, "multiple" is understood as "at least two". "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. A connected to B can represent: A and B directly connected, or A and B connected through C. Furthermore, in the description of this application, terms such as "first" and "second" are used only for descriptive purposes and should not be construed as indicating or implying relative importance or order.
[0058] Furthermore, the data collection, dissemination, and use in the technical solution of this application all comply with the requirements of relevant national laws and regulations.
[0059] To facilitate understanding by those skilled in the art, some of the nouns and terms involved in the embodiments of this application will be briefly described and explained as follows:
[0060] Optical Character Recognition (OCR) refers to the process by which electronic devices (e.g., scanners or digital cameras) examine printed characters on paper, determine their shapes by detecting dark and light patterns, and then translate the shapes into computer text using character recognition methods. In other words, for printed characters, it uses optical methods to convert the text in a paper document into a black-and-white dot matrix image file, and then uses recognition software to convert the text in the image into text format for further editing by word processing software. This includes techniques such as adjusting the image rotation angle, recognizing text and table lines in the image, etc.
[0061] Hypertext Markup Language (HTML) files are files that can be read by various web browsers to generate web pages that convey various types of information. Essentially, the Internet is a collection of a series of transmission protocols and various types of documents; HTML files are just one type. These HTML files are stored on server hard drives distributed around the world, and users can remotely access the information conveyed by these files through transmission protocols.
[0062] Business Images: Image or video frames used to carry business data. For example, in a credit document approval scenario, a business image can be an image-based document carrying the credit data of the business object, including but not limited to various common documents (such as invoices, bills of lading, etc.) or various credit documents.
[0063] Long-tailed distributions refer to distributions where the number of individuals with extremely low values constitutes the vast majority of the population. For example, in credit document approval scenarios, some uncommon documents or credit documents may be difficult to collect, thus long-tailed distributions can easily lead to a situation where certain types of credit documents or business documents have an extremely low probability of appearing in the model training data.
[0064] Furthermore, based on the above definitions, the design concept of the embodiments of this application will be briefly introduced below:
[0065] In related technologies, image classification (IC) can specifically include: image classification based on statistical machine learning classification models and / or image classification based on rule-based classification models. Specifically:
[0066] Method 1: Image classification based on statistical machine learning classification models.
[0067] Specifically, one possible related technical implementation is to train a statistical machine learning classification model for one or more specified business types using a deep learning network (such as CNN). The statistical machine learning classification model is an end-to-end supervised deep learning training model that aims to extract the structural features of the input target image and output the classification probability between the target image and the aforementioned preset business types through transformations such as pooling, sampling, and fully connected mapping. Based on the obtained classification probabilities, the related technology can achieve image classification of the target image.
[0068] Method 2: Image classification based on rule-based classification models.
[0069] Specifically, one possible related technical implementation is to convert the target image to be classified into structured text data. For example, OCR technology can be used to convert the target image into HTML text carrying its corresponding image structure. In this case, the related technology can adopt an unsupervised learning training method, based on a feature word library of one or more specified business types, to achieve image classification based on the rule classification model built thereon.
[0070] Method 3: Image classification based on fusion rule classification model and statistical machine learning classification model.
[0071] Specifically, in one possible related technical implementation, the structural features and text features of the target image can be extracted simultaneously based on the rule classification model and statistical machine learning classification model obtained through training, and the corresponding fused target features can be obtained by using feature fusion. Based on the above method, the related technology can obtain the classification probabilities of each preset business type corresponding to the target features of the target image, and achieve image classification of the target image based on the obtained classification probabilities.
[0072] However, in practice, the training data used for model training often has a long-tailed distribution, which can easily lead to low accuracy in image classification based on the above method.
[0073] For example, in the credit certificate approval scenario, it is usually necessary to collect training data related to multiple business types based on preset business types, and use the collected training data as training samples for each business type to iteratively train the preset rule classification model and / or statistical deep learning classification model. In this process, due to the long-tail distribution problem of the training data, the model may not be trained sufficiently for some long-tail business types (e.g., the amount of corresponding training samples is small), resulting in low accuracy of the classification results output by the model.
[0074] On the other hand, in actual credit certificate approval scenarios, the image structures and / or text information of multiple business images carrying credit data may be quite similar, which can easily lead to low accuracy in image classification based on the above approach.
[0075] For example, when classifying business images under business types such as invoices and packing lists, the image classification methods adopted based on the aforementioned related technologies, the text features extracted by the rule classification model and / or statistical deep learning training model may be quite similar. This can easily lead to the model misclassifying or incorrectly classifying multiple input business images, thus seriously affecting the accuracy of the final image classification results.
[0076] To improve the accuracy of image classification, embodiments of this application provide an image classification method, apparatus, electronic device, and storage medium. Based on preset parsing rules, the business text of each acquired business image is parsed and filtered, thereby ensuring the accuracy of the business classification model in classifying each filtered first text while eliminating interference. Furthermore, after obtaining the classification results of the first text, for the set of second texts in the classification results that were not accurately classified or not finely classified by the model, preset recognition rules are used to further recognize each obtained second text. Combining the text recognition results of each second text with the classification results of each first text, the image classification result of each business image is determined.
[0077] In this embodiment, a multi-level classification method is adopted. After accurately classifying each first text based on a preset first text type using a pre-defined business classification model, each specified second text is further classified based on its second text type based on the obtained classification results. In the above process, the classification target under the specified business type is achieved through the business classification model and recognition rules, so as to effectively improve the accuracy of the final image classification result while ensuring that the accuracy of each classification target reaches the highest level.
[0078] On the other hand, based on the above image classification method, only a preset business classification model is needed to achieve the classification target for some business types. Therefore, when training the preset business classification model, only training data for some business types needs to be collected to ensure the accurate classification effect of business images. Based on the above method, the resource requirements for long-tail training samples in the training data are effectively reduced during the model training process, avoiding the low accuracy of image classification results due to insufficient model training. Furthermore, based on the above multi-level image classification method, business images with similar image structures and / or text information are subdivided hierarchically, further ensuring the accurate classification effect of business images.
[0079] Based on the above technical effects, the preferred embodiments of this application will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are only for illustration and explanation of this application and are not intended to limit this application. Furthermore, the embodiments of this application and the features in the embodiments can be combined with each other without conflict.
[0080] See Figure 1The diagram illustrates a possible application scenario provided by an embodiment of this application. This application scenario includes a target terminal (101a, 101b) and a server 102. The target terminal (101a, 101b) and the server 102 can interact via a communication network. The communication network can employ wireless communication or wired communication methods.
[0081] For example, the target terminal (101a, 101b) can access the network and communicate with the server 102 through cellular mobile communication technology, including 5th Generation Mobile Networks (5G) technology.
[0082] Optionally, the target terminal (101a, 101b) can access the network and communicate with the server 102 via short-range wireless communication, including Wireless Fidelity (Wi-Fi) technology.
[0083] This application embodiment does not impose any limitation on the number of the above-mentioned devices, such as Figure 1 As shown, only the target terminal (101a, 201b) and server 102 are described as examples. The following is a brief introduction to each of the above devices and their respective functions.
[0084] The target terminal (101a, 101b) is a device that can provide voice and / or data connectivity to users, including: handheld terminal devices with wireless connectivity, vehicle-mounted terminal devices, etc.
[0085] For example, the target terminals (101a, 101b) include, but are not limited to: mobile phones, tablets, laptops, handheld computers, mobile internet devices (MID), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminal devices in industrial control, wireless terminal devices in autonomous driving, wireless terminal devices in smart grids, wireless terminal devices in transportation safety, wireless terminal devices in smart cities, or wireless terminal devices in smart homes, etc.
[0086] Furthermore, the target terminals (101a, 101b) may have image classification-related clients installed. These clients can be software (e.g., apps, browsers, short video apps, etc.), or web pages, mini-programs, etc. In this embodiment, the target terminals (101a, 101b) can use the installed image classification clients to send their specified business images to be classified to the server 102.
[0087] Specifically, the aforementioned business images can be multiple images to be classified that carry business data of the same business object, or they can be image data credentials that carry some business data generated during data exchange or resource scheduling.
[0088] For example, in a credit document approval scenario, multiple image documents pending approval can be used as the aforementioned business images. These image documents include, but are not limited to, bills of lading, bills of lading endorsements, invoices, weight notes, and other documents carrying credit data pending approval.
[0089] Furthermore, server 102 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0090] Based on the above application scenarios, the image classification method provided in the embodiments of this application will be further described and explained below with reference to the accompanying drawings. Figure 2 As shown, this application provides an image classification method, including:
[0091] S201: Obtain the business text for each business image to be classified.
[0092] Specifically, in this embodiment of the application, after the server 102 obtains the various business images to be classified sent by the target terminal (101a, 101b), it uses image conversion technology to convert each business image into business text carrying the corresponding image structure.
[0093] Optionally, using optical recognition technologies such as OCR, each optical character contained in the corresponding business image is extracted based on the image structure contained in each business image, thereby converting each obtained business image into business text carrying its corresponding image structure.
[0094] For example, in one optional embodiment, for each image document (1.jpg-10.jpg) to be approved, optical characters in their respective image structures can be extracted using OCR technology. The resulting business texts are shown in Table 1 below:
[0095] Table 1
[0096] Business Images Business text 1.jpg 1.html 2.jpg 2.html 3.jpg 3.html 4.jpg 4.html 5.jpg 5.html 6.jpg 6.html 7.jpg 7.html 8.jpg 8.html 9.jpg 9.html 10.jpg 10.html
[0097] It is worth noting that the image conversion operations described above can be performed either on server 102 or on the target terminals (101a, 101b), and this application does not impose any restrictions on this. For ease of understanding, taking server 102 as an example, based on the above method, server 102 can obtain the corresponding business text for each business image to be approved, so that in subsequent processes, the corresponding business images can be accurately classified based on the obtained business text.
[0098] S202: Based on preset parsing rules, parse and filter the obtained business texts to determine at least one first text to be classified.
[0099] Specifically, in real-world situations, the converted business texts may contain interfering data that affects the model's accurate recognition, such as spaces, meaningless characters, or some special and uncommon business texts. This interfering data usually leads to insufficient feature extraction by the model from the business text, thereby affecting the model's classification performance. In this embodiment, to improve the accuracy of the classification results output by the subsequent model, a preset parsing rule is used to parse and filter the obtained business texts, thereby eliminating the various interfering data contained therein.
[0100] For example, in an optional embodiment, in order to avoid interference from certain special business texts on model classification, business texts with an optical character count exceeding a preset character threshold can be used as the aforementioned interference data based on the number of optical characters in each business text.
[0101] For example, in the credit certificate approval scenario described above, assuming a preset character threshold of 6000, then based on this preset character threshold, in this embodiment of the application, based on the number of optical characters in each of the obtained business texts, the business texts with a corresponding number of optical characters exceeding 6000 in each of the obtained business texts (1.html-10.html) are used as the aforementioned interference data, specifically as shown in Table 2 below:
[0102] Table 2
[0103] Interference data 5.html
[0104] For example, in an optional embodiment, based on a preset first feature word, each business text in the obtained business text whose corresponding first matching result does not meet the preset first matching condition can also be used as the aforementioned interference data.
[0105] For example, in the credit certificate approval scenario mentioned above, assuming the preset first feature word is "legal fishing certificate", and the corresponding first matching condition for this first feature word is "the number of times the business text matches the first feature word does not exceed 1", then by using the preset first feature word to perform feature word matching on each of the obtained business texts, based on the recorded first matching results of each business text, it is possible to determine the business texts whose corresponding first matching results do not meet the preset first matching condition, which are the aforementioned interference data, thereby eliminating data interference from special business texts, as shown in Table 3 below:
[0106] Table 3
[0107] Interference data 6.html
[0108] It is understood that the first feature words mentioned above are only illustrative examples. In actual situations, one or more first feature words and their corresponding first matching conditions can be set based on the specific business requirements for each of the above business images. This application does not impose any restrictions on this.
[0109] Furthermore, after excluding the aforementioned interfering data, at least one remaining business text is used as the first text input into the preset business classification model in subsequent processes. This ensures the accuracy of the classification results output by the subsequent business classification model, as shown in Table 4 below:
[0110] Table 4
[0111] First Text 1.html 2.html 3.html 4.html 7.html 8.html 9.html 10.html
[0112] S203: Based on a preset business classification model, classify at least one first text obtained, and based on the classification results, determine at least one second text to be identified from the at least one first text.
[0113] Furthermore, to ensure the accuracy of the image classification results, in this embodiment, a preset business classification model is used to accurately classify each of the obtained first texts based on non-long-tail business types. For ease of understanding, in this embodiment, each specified non-long-tail business type is used as the first text type for the obtained first texts, and the preset business classification model is trained using training data related to each first text type.
[0114] Specifically, the aforementioned non-long-tail business types can be one or more common business types in actual situations where corresponding training samples are relatively easy to collect, or they can be manually specified by relevant technical personnel based on actual business needs, at least one first text to be classified.
[0115] For example, in a credit certificate approval scenario, suppose that the preset multiple business types for business images include: {Image.Type 1, Image.Type 2, ..., Image.Type 8}, and the relevant technical personnel determine, based on actual business needs, that the non-long-tail business types included in the above multiple business types are: {Image.Type 1, Image.Type 2, ..., Image.Type 6}. Then, based on each of the specified non-long-tail business types, they are respectively used as the first text type for the above first text, as shown in Table 5 below:
[0116] Table 5
[0117]
[0118] Optionally, training data related to each first text type can be used to train a preset business classification model, wherein the business classification model can be obtained by training the aforementioned rule classification model and / or statistical machine learning training model.
[0119] For example, in the embodiments of this application, the above-mentioned business classification model can be trained by unsupervised learning or supervised learning, and obtained by iteratively training a preset logistic regression (LR) model based on the training data related to each of the first text types; optionally, the above-mentioned business classification model can also be trained by decision tree (DT) model, text-convolutional neural network (TextCNN) model for text classification, bidirectional long short-term memory (BiLSTM) model, etc., and this application does not limit it.
[0120] Specifically, this application uses the logistic regression (LR) model as an example for illustration. In the training process of the above-mentioned business classification model, training samples related to each first text type in the training data can be used to perform multiple rounds of iterative training on the preset logistic regression (LR) model, so that when the LR model reaches the preset convergence condition, the corresponding business classification model is output.
[0121] For example, in this embodiment of the application, a preset set of business texts {A.html, B.html, ..., L.html} can be subjected to specified text preprocessing (e.g., string concatenation, word segmentation, garbled character processing, stop word processing, punctuation and part-of-speech restoration, etc.) to obtain training data for a preset logistic regression (LR) model. Based on the obtained training data, a benchmark lexicon is constructed using the Term Frequency–Inverse Document Frequency (TF-IDF) algorithm to indicate the various business feature words under the corresponding first text type. Based on the above method, the logistic regression (LR) model continuously outputs the business types of the corresponding training samples based on the above benchmark lexicon, so that relevant technicians can continuously adjust the model parameters of the logistic regression (LR) model according to the output business types until the model converges and the corresponding business classification model is obtained.
[0122] Furthermore, based on the above method, after obtaining the trained business classification model, refer to... Figure 3 As shown, using a business classification model, the following operations are performed on each of the obtained first texts:
[0123] S2031: Extract features from the obtained first text to obtain the text features of the first text, and obtain the target attribution probability of the first text based on the text features.
[0124] Specifically, in this embodiment of the application, a trained business classification model is used to extract the text features of an input first text, and further outputs the target attribution probability of the first text based on the obtained text features. Optionally, the target attribution probability represents the maximum attribution probability among the various attribution probabilities corresponding to the text features of a first text and each preset first text type.
[0125] For example, in an optional embodiment, for the obtained first text 1.html, the text features of the first text 1.html can be extracted based on the trained business classification model using the Term Frequency-Inverse Text Frequency Index (TF-IDF) algorithm. Furthermore, a preset softmax classifier is used to output the belonging probabilities of the first text 1.html to each of the first text types shown in Table 5 above, specifically as shown in Table 6 below:
[0126] Table 6
[0127]
[0128] Optionally, in this embodiment of the application, the maximum belonging probability among the various belonging probabilities output by the business classification model is used as the target belonging probability of the first text. Specifically, as shown in Table 6 above, the target belonging probability of the first text 1.html is 0.6.
[0129] S2032: Determine if the target ownership probability is greater than the preset probability threshold. If yes, execute S2033; otherwise, execute S2034.
[0130] Furthermore, based on the target attribution probability of the first text output by the business classification model, the business type of the first text is determined.
[0131] S2033: Treat the first text type corresponding to the target attribution probability as a business type of the first text.
[0132] Optionally, when the probability of a target being assigned is greater than a preset probability threshold, the first text type corresponding to the probability of that target being assigned can be used as a business type of the first text.
[0133] For example, assuming that the preset probability threshold for determining the target attribution probability in this application embodiment is 0.5, then based on the target attribution probability determined by the first text 1.html, the first text 1.html is assigned to the first text type indicated by its corresponding target attribution probability: Image.Type 3.
[0134] S2034: Take the preset candidate type as the business type of the first text, and take the first text as the second text to be identified.
[0135] Optionally, when the probability of belonging to the target is determined to be no greater than a preset probability threshold, the preset candidate type is used as the business type of the first text.
[0136] For example, assuming that the preset probability threshold for determining the target attribution probability in this embodiment of the application is 0.5, and that the target attribution probability of the first text 10.html output by the model in the above process is 0.4, then based on the target attribution probability of the first text 10.html, the first text 10.html is assigned to its preset candidate type, such as "Image.Type X".
[0137] Based on the above approach, this embodiment of the application uses training data of various first text types with sufficient data volume and obvious features in the corresponding training samples during the training process to fully train the preset business classification model, thereby ensuring that the model can accurately classify the at least one first text when it is input as described above. In this process, the target attribution probability output by the model is used to determine each first text with a lower target attribution probability (or, under the candidate type) as a set of second texts that still need to be processed, so that in the subsequent process, the preset recognition rules can be used to accurately classify each determined second text.
[0138] For example, for each of the first texts shown in Table 4 above, assuming that the business classification model has been trained, the corresponding classification results are shown in Table 7 below:
[0139] Table 7
[0140] First Text Business type 1.html Image.Type 3 2.html Image.Type 2 3.html Image.Type 1 4.html Image.Type 5 7.html Image.Type 6 8.html Image.Type 4 9.html Image.Type X 10.html Image.Type X
[0141] Based on the classification results shown in Table 7 above, the second texts to be identified from the first texts obtained above are: 9.html and 10.html.
[0142] S204: Based on preset recognition rules, perform text recognition on at least one second text obtained, and based on the recognition results, obtain the image classification results of each business image.
[0143] Furthermore, to address the issue that some business images may have similar image structures in real-world scenarios, this application embodiment employs text recognition to determine the business type of each obtained second text, which is difficult for the model to distinguish. Optionally, refer to... Figure 4 As shown, using keyword-based recognition rules, the following operations are performed on at least one obtained second text:
[0144] S2041: Based on preset cleaning rules, perform text cleaning on the obtained second text to obtain a second cleaned text corresponding to the second text.
[0145] Optionally, based on preset cleaning rules, a second text is cleaned to remove optical characters in the second text that may cause recognition interference.
[0146] For example, in the credit certificate approval scenario described above, actual business needs can be considered, and various business stop words that may cause matching interference can be set (e.g., "INVOICE DATE"). Based on the corresponding cleaning rules set for each business stop word, the obtained second text 9.html can be cleaned to avoid matching errors between the second text and the preset second feature words (e.g., INVOICE) in the subsequent process.
[0147] S2042: Based on the preset second feature words, match the second cleaned text to obtain the corresponding second matching result.
[0148] Optionally, a pre-defined second feature word is used to match a cleaned second text. The second feature word can be associated with a pre-defined second text type to determine the business type of the corresponding second text based on the second matching result between the second cleaned text and the second feature word.
[0149] For example, for the second cleaned text 9.html obtained after text cleaning, a preset second feature word (such as "HEALTH CERTIFICATE") can be used to match the obtained second cleaned text 9.html*, and the corresponding second matching result can be recorded.
[0150] S2043: Determine whether the second matching result meets the preset second matching condition? If yes, execute S2044; otherwise, execute S2045.
[0151] S2044: Associate the second text type with the second feature word as a business type of the second text.
[0152] Furthermore, based on the second matching result between the second cleaned text and the second feature word, when it is determined that the second matching result meets the preset second matching condition, the second text type associated with the second feature word is taken as a business type of the second text.
[0153] For example, assuming the second text type associated with the second feature word "HEALTH CERTIFICATE" is Image.Type 7, and the preset second matching condition is: "the number of matches between the second cleaned text and the second feature word is at least one", then when it is determined that the second matching result between the second cleaned text 9.html* and the second feature word meets the above-mentioned second matching condition, the business type of the second text 9.html to be identified is determined to be "Image.Type 7".
[0154] S2045: Based on the preset third feature word, match the second cleaned text to obtain the number of times the third feature word matches in the second cleaned text.
[0155] For further details, please refer to [link / reference]. Figure 5 As shown, when it is determined that the second matching result does not meet the preset second matching condition, the feature word counting method can also be used to obtain the number of times the preset third feature word matches the above-mentioned second cleaned text.
[0156] For example, in an optional embodiment, for the second cleaned text 10.html* that does not meet the above second matching conditions, assuming that the preset third feature words include: {word 1, word 2, ..., word 3}, the second cleaned text is matched with each of the above third feature words respectively to obtain the number of times the second cleaned text matches each of the above third feature words, as shown in Table 8 below:
[0157] Table 8
[0158]
[0159] As can be seen, specifically referring to the matching counts shown in Table 8 above, the target matching count for the second cleaned text 10.html* is determined to be 50.
[0160] S2046: Determine if the number of target matches meets the preset count threshold. If yes, proceed to S2047; otherwise, proceed to S2048.
[0161] S2047: The third text type associated with the third feature word is treated as a business type of the second text.
[0162] Optionally, when the number of target matches is determined to be greater than a preset count threshold, the third text type associated with the third feature word corresponding to the number of target matches is taken as a business type of the second text.
[0163] For example, assuming that the threshold for the number of times the target matches is determined is 40 in this embodiment of the application, then based on the target number of times the second cleaned text 10.html* is matched, the second text 10.html is assigned to the third text type associated with word 1, such as "Image.Type 8".
[0164] S2048: Use the preset candidate type as a business type for a second text.
[0165] Optionally, when it is determined that the number of target matches is not greater than the preset count threshold, the preset candidate type can also be used as a business type of the second text.
[0166] For example, assuming that the threshold for the number of times the target matches is determined is 60 in this embodiment of the application, then based on the target number of times the second cleaned text 10.html* is matched, the second text 10.html can be assigned to a preset candidate type, such as "Image.Type X".
[0167] It is understood that the first text type, the second text type, and the third text type mentioned above can be flexibly adjusted by those skilled in the art according to actual business needs. For example, in actual situations, the second text type and the third text type mentioned above can be other business types to be analyzed that are not covered by the first text type, or they can be subdivided business types that need to be further analyzed and classified based on the first text type. This application does not impose any restrictions on this.
[0168] Furthermore, based on the above method, this application embodiment further adopts preset recognition rules to perform rule-based text recognition on each second text that has not been accurately classified by the model in the previous level, and further determines the business type of each second text based on the recognition results.
[0169] For example, regarding the second texts 9.html and 10.html shown in Table 7 above, assuming that the business type of each of the two second texts is determined based on the preset recognition rules, the classification results can be further shown in Table 9 below:
[0170] Table 9
[0171]
[0172]
[0173] As can be seen, by adopting the multi-level classification method described in the embodiments of this application, the specified first text and second text in each business text to be classified can be accurately identified and classified through the preset business classification model and preset recognition rules.
[0174] Furthermore, to improve the completeness and accuracy of image classification results, after determining the business types of each first text and second text in the above classification results and recognition results, further subdivision can be performed on each third text in the business text whose corresponding business type meets the subdivision conditions based on preset subdivision conditions.
[0175] It is understood that the aforementioned third text can be any of the business texts in S2048 whose business type is a preset candidate type, or it can be specified by relevant technical personnel from various business texts to be classified based on the actual business situation. Specifically, in this embodiment of the application, the aforementioned third text may include:
[0176] 1) Business text of candidate types.
[0177] For example, in an optional embodiment, assuming that the above-mentioned type segmentation conditions include: "the business type of the second text is a preset candidate type", then for the second text 10.html whose corresponding business type is determined to be a preset candidate type in S2048, it can be regarded as the third text to be segmented, and the business type of the second text 10.html can be determined according to its corresponding segmentation rules.
[0178] 2) Business texts with more than the preset character threshold in terms of the number of optical characters.
[0179] For example, in an optional embodiment, assuming that the above-mentioned type segmentation conditions also include "the number of optical characters in the business text exceeds a preset character threshold", then for the filtered business text 5.html in S202 above, it can also be regarded as a third text to be segmented, and the business type of business text 5.html can be determined according to its corresponding segmentation rules.
[0180] 3) Business texts whose first matching result does not meet the preset first matching conditions.
[0181] For example, in an optional embodiment, assuming that the above-mentioned type segmentation conditions also include: "the first matching result between the business text and the preset first feature word does not meet the preset first matching condition", then for the filtered business text 6.html in S202 above, it can also be regarded as a third text to be segmented, and the business type of the business text 6.html can be determined according to its corresponding segmentation rules.
[0182] 4) Specify the business text under the business type to be subdivided.
[0183] For example, assuming that in actual business needs, the above business type Image.Type 7 needs to be further divided into: {Image.Type 7_1, Image.Type 7_2}, then based on the above method, when determining that the business type of business text 9.html is Image.Type 7, business text 9.html can also be selected as the third text to be subdivided based on preset type subdivision conditions, and the business type of business text 9.html can be determined through the corresponding subdivision rules.
[0184] Understandably, see Figure 6 As shown, based on the above method, the embodiments of this application can further classify the specified third texts to be classified or to be further classified in each business text shown in Table 1 above, so that the final classification results can accurately distinguish the business texts with similar image structures and / or text information. Based on the method, the business types of each selected third text are updated, thereby further enhancing the accuracy of the image classification results.
[0185] For example, for the specified third texts 5.html, 6.html, 9.html, and 10.html, based on preset recognition rules, after further subdivision and classification of each of the third texts, the final updated classification results and corresponding image classification results are shown in Table 10 below:
[0186] Table 10
[0187]
[0188]
[0189] For ease of understanding, please refer to Figure 7 The diagram shown is a logical schematic of the above image classification method. As can be seen, based on the above multi-level classification method, the embodiments of this application can effectively reduce the resource requirements of long-tail training samples in the training data during the model training process. At the same time, the above multi-level image classification method can accurately subdivide various business images with multiple business types, a lot of interference data, and similar image structures and / or text information, further ensuring the image classification effect of business images.
[0190] Furthermore, based on the same technical concept, embodiments of this application also provide an image classification apparatus for implementing the above-described method flow of embodiments of this application. See also... Figure 8 As shown, the image classification device includes: an acquisition module 801, a filtering module 802, a first classification module 803, and a second classification module 804, wherein:
[0191] The acquisition module 801 is used to acquire the business text of each business image to be classified, wherein each business text includes at least the optical characters of the corresponding business image.
[0192] The filtering module 802 is used to parse and filter the obtained business texts based on preset parsing rules to determine at least one first text to be classified, wherein the number of optical characters in each first text does not exceed a preset threshold.
[0193] The first classification module 803 is used to classify at least one first text obtained based on a preset business classification model, and to determine at least one second text to be identified from at least one first text based on the classification results.
[0194] The second classification module 804 is used to perform text recognition on at least one second text obtained based on preset recognition rules, and to obtain image classification results for each business image based on the recognition results.
[0195] In one optional embodiment, based on preset parsing rules, the obtained business texts are parsed and filtered to determine at least one first text to be classified. The filtering module 802 is specifically used for:
[0196] Based on the number of optical characters in each business text, each business text whose number of corresponding optical characters does not exceed a preset character threshold is identified as a candidate text to be matched.
[0197] Based on the preset first feature word, each candidate text is matched to obtain the first matching result for each candidate text.
[0198] From each candidate text, at least one candidate text whose corresponding first matching result satisfies the preset first matching condition is identified as the first text to be classified.
[0199] In an optional embodiment, based on a preset business classification model, at least one first text is classified, and the first classification module 803 is specifically used for:
[0200] For at least one first text, perform the following operations respectively:
[0201] Based on a preset business classification model, feature extraction is performed on a first text to obtain the text features of the first text. Based on the text features, the target attribution probability of the first text is obtained. The target attribution probability represents the maximum attribution probability among the various attribution probabilities corresponding to each preset first text type.
[0202] Determine whether the probability of belonging to the target is greater than a preset probability threshold, where:
[0203] If the target attribution probability is greater than the preset probability threshold, then the first text type corresponding to the target attribution probability will be used as the business type of the first text.
[0204] If the probability of target attribution is not greater than the preset probability threshold, then the preset candidate type will be used as the business type of the first text, and the first text will be used as the second text to be identified.
[0205] In one optional embodiment, based on preset recognition rules, text recognition is performed on at least one second text obtained, and the second classification module 804 is specifically used for:
[0206] For at least one second text, perform the following operations respectively:
[0207] Based on preset cleaning rules, a second text is cleaned to obtain a second cleaned text corresponding to the second text.
[0208] Based on the preset second feature words, the second cleaned text is matched to obtain the corresponding second matching result, wherein the second feature words are associated with the preset second text type.
[0209] When it is determined that the second matching result meets the preset second matching conditions, the second text type associated with the second feature word is taken as a business type of the second text.
[0210] In one optional embodiment, the second matching result does not meet the preset second matching condition.
[0211] Based on the preset second feature words, the second cleaned text is matched to obtain the corresponding second matching result. The second classification module 804 is then further used for:
[0212] Based on the preset third feature words, the second cleaned text is matched to obtain the target matching number of the third feature words in the second cleaned text. The third feature words are associated with the preset third text type. The target matching number represents the maximum number of matching times among the various matching times corresponding to each preset third feature word in the second cleaned text.
[0213] When the number of target matches meets the preset counting threshold, the third text type associated with the third feature word is treated as a business type of the second text.
[0214] In an optional embodiment, based on the recognition results, the service type of each service image is obtained, and the second classification module 804 is specifically used for:
[0215] Based on the identification results, determine the business type of at least one second text, and based on the classification results, determine the business type of at least one first text.
[0216] From each business text, identify the business texts that meet the preset subdivision conditions for the corresponding business type, and these will be the third texts to be subdivided.
[0217] Based on preset segmentation rules, the obtained third-party texts are further segmented and categorized, and the business type of each third-party text is updated based on the obtained segmentation results.
[0218] Based on the updated business types, image classification results for each business image are obtained.
[0219] Based on the same inventive concept as the embodiments described above, this application also provides an electronic device that can be used for image classification. In one embodiment, the electronic device can be a server, a terminal device, or other electronic equipment. In this embodiment, the structure of the electronic device can be as follows: Figure 9 As shown, it includes a memory 901, a communication interface 903, and one or more processors 902.
[0220] The memory 901 is used to store computer programs executed by the processor 902. The memory 901 may mainly include a program storage area and a data storage area. The program storage area may store the operating system and programs required to run instant messaging functions, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.
[0221] Memory 901 may be volatile memory, such as random-access memory (RAM); memory 901 may also be non-volatile memory, such as read-only memory, flash memory, hard disk drive (HDD), or solid-state drive (SSD); or memory 901 may be any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto. Memory 901 may be a combination of the above-mentioned memories.
[0222] The processor 902 may include one or more central processing units (CPUs) or digital processing units, etc. The processor 902 is used to implement the aforementioned image classification method when it calls the computer program stored in the memory 901.
[0223] Communication interface 903 is used to communicate with terminal devices and other servers.
[0224] This application embodiment does not limit the specific connection medium between the memory 901, the communication interface 903, and the processor 902. This application embodiment... Figure 9 The memory 901 and the processor 902 are connected via a bus 904, which is in... Figure 9The connections between other components are shown in thick lines and are for illustrative purposes only, not as limiting information. The 904 bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, Figure 9 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0225] Based on the same inventive concept, embodiments of this application also provide a storage medium storing computer instructions that, when executed on a computer, cause the computer to perform an image classification method as described above.
[0226] In some possible implementations, various aspects of the image classification method provided by this application can also be implemented in the form of a program product, which includes program code that, when the program product is run on a device, causes the control device to perform the steps in an image classification method according to various exemplary embodiments of this application as described above.
[0227] It should be noted that although several units or sub-units of the device have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of this application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided and embodied by multiple units.
[0228] Furthermore, although the operations of the method of this application are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0229] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0230] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a server, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0231] Program code for performing the operations of this application can be written using any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0232] In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0233] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0234] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0235] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. An image classification method, characterized in that, include: Obtain the business text for each business image to be classified, wherein each business text includes at least: each optical character of the corresponding business image; Based on the number of optical characters in each of the business texts and the preset first feature words, the interference data in each of the business texts is filtered out to determine at least one first text to be classified, wherein the number of optical characters in each first text does not exceed a preset threshold. Based on a preset business classification model, at least one first text is classified, and based on the classification results, at least one second text to be identified is determined from the at least one first text. Based on preset recognition rules, text recognition is performed on at least one second text obtained; Based on the identification results, the business type of each of the at least one second text is determined, and based on the classification results, the business type of each of the at least one first text is determined; From the various business texts, identify the business texts whose corresponding business types meet the preset subdivision conditions, and these are the third texts to be subdivided. Based on preset segmentation rules, the obtained third texts are segmented and classified, and based on the obtained segmentation results, the business type of each third text is updated. Based on the updated service types, the image classification results for each service image are obtained.
2. The method as described in claim 1, characterized in that, The process involves parsing and filtering the obtained business texts based on preset parsing rules to determine at least one first text to be classified, including: Based on the number of optical characters in each of the business texts, each business text whose number of corresponding optical characters does not exceed a preset character threshold is identified as a candidate text to be matched. Based on the preset first feature word, each candidate text is matched to obtain the first matching result of each candidate text; From the candidate texts, at least one candidate text whose corresponding first matching result satisfies the preset first matching condition is determined as the first text to be classified.
3. The method as described in claim 1 or 2, characterized in that, The classification of at least one first text obtained based on the preset business classification model includes: For each of the at least one first text, perform the following operations: Based on a preset business classification model, feature extraction is performed on a first text to obtain the text features of the first text, and based on the text features, the target attribution probability of the first text is obtained, wherein the target attribution probability represents the maximum attribution probability among the attribution probabilities corresponding to each preset first text type. Determine whether the target attribution probability is greater than a preset probability threshold, wherein: If the target attribution probability is greater than a preset probability threshold, then the first text type corresponding to the target attribution probability is taken as the business type of the first text. If the target attribution probability is not greater than a preset probability threshold, then the preset candidate type is taken as the business type of the first text, and the first text is taken as the second text to be identified.
4. The method as described in claim 1 or 2, characterized in that, The text recognition based on the preset recognition rules for at least one second text includes: For each of the at least one second text, perform the following operations: Based on preset cleaning rules, a second text is cleaned to obtain a second cleaned text corresponding to the first second text; Based on the preset second feature words, the second cleaned text is matched to obtain the corresponding second matching result, wherein the second feature words are associated with the preset second text type; When it is determined that the second matching result meets the preset second matching condition, the second text type associated with the second feature word is taken as the business type of the second text.
5. The method as described in claim 4, characterized in that, The second matching result does not meet the preset second matching condition. After matching the second cleaned text based on the preset second feature words to obtain the corresponding second matching result, the process further includes: Based on a preset third feature word, the second cleaned text is matched to obtain the target number of matches of the third feature word in the second cleaned text. The third feature word is associated with a preset third text type. The target number of matches represents the maximum number of matches between the second cleaned text and each preset third feature word. When the number of target matches meets the preset counting threshold, the third text type associated with the third feature word is taken as the business type of the second text.
6. An image classification device, characterized in that, include: The acquisition module is used to acquire the business text of each business image to be classified, wherein each business text includes at least: each optical character of the corresponding business image; The filtering module is used to filter out interference data in each business text based on the number of optical characters in each business text and a preset first feature word, and to determine at least one first text to be classified, wherein the number of optical characters in each first text does not exceed a preset threshold. The first classification module is used to classify at least one first text obtained based on a preset business classification model, and to determine at least one second text to be identified from the at least one first text based on the classification results. The second classification module is used to perform text recognition on at least one second text obtained based on preset recognition rules; Based on the identification results, the business type of each of the at least one second text is determined, and based on the classification results, the business type of each of the at least one first text is determined; From the various business texts, identify the business texts whose corresponding business types meet the preset subdivision conditions, and these are the third texts to be subdivided. Based on preset segmentation rules, the obtained third texts are segmented and classified, and based on the obtained segmentation results, the business type of each third text is updated. Based on the updated service types, the image classification results for each service image are obtained.
7. The apparatus as claimed in claim 6, characterized in that, The obtained business texts are parsed and filtered based on preset parsing rules to determine at least one first text to be classified. The filtering module is specifically used for: Based on the number of optical characters in each of the business texts, each business text whose number of corresponding optical characters does not exceed a preset character threshold is identified as a candidate text to be matched. Based on the preset first feature word, each candidate text is matched to obtain the first matching result of each candidate text; From the candidate texts, at least one candidate text whose corresponding first matching result satisfies the preset first matching condition is determined as the first text to be classified.
8. The apparatus as claimed in claim 6 or 7, characterized in that, The first classification module, based on a preset business classification model, classifies at least one first text obtained therefrom. Specifically, the first classification module is used for: For each of the at least one first text, perform the following operations: Based on a preset business classification model, feature extraction is performed on a first text to obtain the text features of the first text, and based on the text features, the target attribution probability of the first text is obtained, wherein the target attribution probability represents the maximum attribution probability among the attribution probabilities corresponding to each preset first text type. Determine whether the target attribution probability is greater than a preset probability threshold, wherein: If the target attribution probability is greater than a preset probability threshold, then the first text type corresponding to the target attribution probability is taken as the business type of the first text. If the target attribution probability is not greater than a preset probability threshold, then the preset candidate type is taken as the business type of the first text, and the first text is taken as the second text to be identified.
9. The apparatus as claimed in claim 6 or 7, characterized in that, The second classification module is specifically used to perform text recognition on at least one second text obtained based on preset recognition rules. For each of the at least one second text, perform the following operations: Based on preset cleaning rules, a second text is cleaned to obtain a second cleaned text corresponding to the first second text; Based on the preset second feature words, the second cleaned text is matched to obtain the corresponding second matching result, wherein the second feature words are associated with the preset second text type; When it is determined that the second matching result meets the preset second matching condition, the second text type associated with the second feature word is taken as the business type of the second text.
10. The apparatus as claimed in claim 9, characterized in that, The second matching result does not meet the preset second matching condition. After matching the second cleaned text based on the preset second feature words to obtain the corresponding second matching result, the second classification module is further used for: Based on a preset third feature word, the second cleaned text is matched to obtain the target number of matches of the third feature word in the second cleaned text. The third feature word is associated with a preset third text type. The target number of matches represents the maximum number of matches between the second cleaned text and each preset third feature word. When the number of target matches meets the preset counting threshold, the third text type associated with the third feature word is taken as the business type of the second text.
11. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1-5.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1-5.
13. A computer program product, characterized in that, When the computer program product is invoked by a computer, it causes the computer to perform the method as described in any one of claims 1-5.
Citation Information
Patent Citations
Image classification method and device, electronic equipment and storage medium
CN113177479A