WO2020224115A1 - 图片处理方法、装置、计算机设备及存储介质 - Google Patents

图片处理方法、装置、计算机设备及存储介质 Download PDF

Info

Publication number
WO2020224115A1
WO2020224115A1 PCT/CN2019/103163 CN2019103163W WO2020224115A1 WO 2020224115 A1 WO2020224115 A1 WO 2020224115A1 CN 2019103163 W CN2019103163 W CN 2019103163W WO 2020224115 A1 WO2020224115 A1 WO 2020224115A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
text
classification
preset
training
Prior art date
Application number
PCT/CN2019/103163
Other languages
English (en)
French (fr)
Inventor
高梁梁
王彬
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020224115A1 publication Critical patent/WO2020224115A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/62Text, e.g. of license plates, overlay texts or captions on TV images
    • G06V20/63Scene text, e.g. street names
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/40Document-oriented image-based pattern recognition
    • G06V30/41Analysis of document content
    • G06V30/413Classification of content, e.g. text, photographs or tables

Definitions

  • This application relates to the field of computer data processing, and in particular to an image processing method, device, computer equipment, and computer-readable storage medium.
  • the embodiments of the present application provide an image processing method, device, computer equipment, and storage medium, aiming to solve the problems of slow image processing speed and low accuracy.
  • an embodiment of the present application provides a picture processing method, which includes: recognizing a picture to be recognized to obtain text data corresponding to the picture to be recognized; and performing processing on the text data according to a preset text classification model Classification to obtain the classification data corresponding to the text data; obtain the data type corresponding to the classification data corresponding to the text data and the data content corresponding to the data type, and the data type corresponds to a unique preset text rule; according to The preset text rule corresponding to the data type determines whether the data content corresponding to the data type meets the preset text rule corresponding to the data type; if the data content corresponding to the data type meets the preset corresponding to the data type The text rule determines that the classification data corresponding to the text data meets a preset text rule, and stores the classification data corresponding to the text data.
  • an embodiment of the present application provides a picture processing device, which includes: a recognition unit, configured to recognize a picture to be recognized, to obtain text data corresponding to the picture to be recognized;
  • the text classification model classifies the text data to obtain the classification data corresponding to the text data;
  • the first obtaining unit is used to obtain the data type corresponding to the classification data corresponding to the text data, and the data type corresponding to the data type Data content, the data type corresponds to a unique preset text rule;
  • the first judgment unit is configured to judge whether the data content corresponding to the data type meets the data type correspondence according to the preset text rule corresponding to the data type
  • a storage unit for determining that the classification data corresponding to the text data meets the preset text rule if the data content corresponding to the data type meets the preset text rule corresponding to the data type, and storing Classification data corresponding to the text data.
  • an embodiment of the present application provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and capable of running on the processor, wherein the processor executes all
  • the program implements the method described in the first aspect above.
  • the embodiments of the present application also provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the above-mentioned The method described in one aspect.
  • FIG. 1 is a schematic flowchart of an image processing method provided by an embodiment of this application.
  • FIG. 2 is a schematic diagram of an application scenario of an image processing method provided by an embodiment of this application.
  • FIG. 3 is a schematic diagram of another process of a picture processing method provided by an embodiment of the application.
  • FIG. 4 is a schematic diagram of another flow of an image processing method provided by an embodiment of the application.
  • FIG. 5 is a schematic diagram of another process of a picture processing method provided by an embodiment of the application.
  • FIG. 6 is another schematic flowchart of a picture processing method provided by an embodiment of the application.
  • FIG. 7 is a schematic block diagram of a picture processing apparatus according to an embodiment of the application.
  • FIG. 8 is another schematic block diagram of a picture processing apparatus according to an embodiment of this application.
  • FIG. 9 is another schematic block diagram of a picture processing apparatus according to an embodiment of this application.
  • FIG. 10 is another schematic block diagram of a picture processing apparatus according to an embodiment of this application.
  • FIG. 11 is another schematic block diagram of a picture processing apparatus according to an embodiment of this application.
  • FIG. 12 is a schematic block diagram of a computer device provided by an embodiment of this application.
  • FIG. 1 and FIG. 2 are a schematic flow diagram and a schematic diagram of an application scenario of an image processing method provided by an embodiment of the application.
  • the image processing method provided by the embodiment of the present application can be applied to a server, and the server 20 can interact with the client 10 to process the images uploaded by the client and feed back the processing result to the client 10.
  • the server 20 may be an independent server, or a server cluster composed of multiple servers.
  • the client 10 may be an electronic terminal such as a mobile phone, a tablet computer, or a smart bracelet. As shown in Fig. 1, the picture processing method includes steps S110-S150.
  • S110 Obtain a picture to be recognized and recognize the picture to be recognized to obtain text data corresponding to the picture to be recognized.
  • the server may obtain the picture to be processed uploaded by the client as the picture to be recognized by communicating with the client and use a preset picture recognition technology to recognize the picture to be recognized to extract text data therein.
  • the picture to be recognized may be picture data obtained in advance and stored in the client; in another embodiment, the picture to be recognized may also be directly performed through a picture acquisition device in the client.
  • the client can be a tablet computer, a notebook computer, a desktop computer and other electronic equipment; the image collection device can be a camera, a scanner, etc.
  • the text data corresponding to the picture to be recognized can be obtained.
  • the optical character recognition technology Optical Character Recognition, OCR
  • OCR optical Character Recognition
  • the picture to be recognized may be a business card picture, a book cover picture, a roster picture, a resume picture, etc.
  • the embodiment of the application does not limit the types of pictures to be recognized.
  • the picture to be recognized is a resume picture.
  • the text data corresponding to the picture to be recognized can be: "My name is Zhang San, I am 32 years old and graduated from Shenzhen University, used to be the manager of the business department, and the contact number is 18581858185 «".
  • S120 Classify the text data according to a preset text classification model to obtain classification data corresponding to the text data.
  • step S120 may include steps S121-S123.
  • the preset algorithm may be the TF-IDF algorithm, and TF-IDF (Term Frequency—Inverse Document Frequency) is a commonly used weighting technique for information retrieval and data mining.
  • the TF-IDF algorithm can be used to evaluate the importance of a word in the text data where the word is located.
  • TF means term frequency (Term Frequency)
  • formula for calculating term frequency can be:
  • n i,j represents the frequency of occurrence of word i in document j
  • ⁇ k n k,j represents the sum of the number of occurrences of each word in document j
  • tf i,j represents the probability of occurrence of word i in document j.
  • IDF Inverse Document Frequency Index.
  • the formula for calculating the frequency index can be:
  • is the total number of text data in the training set;
  • the TF-IDF algorithm combines TF and IDF. The larger the value of TF*IDF, the greater the weight of the word, and the higher the importance of the word in the text data where the word is located.
  • the text data corresponding to the picture to be recognized is calculated by the TF-IDF algorithm to extract text features.
  • the text data corresponding to the picture to be recognized may be: "My name is Zhang San, I am 32 years old this year, I graduated from Shenzhen University and used to be the manager of the business department. The contact number is 18581858185.".
  • the text feature calculated by the TF-IDF algorithm is "Zhang San, Manager, 18581858185.".
  • S122 Convert the text feature into a feature vector according to a preset feature vector tool.
  • the preset feature vector tool is the word2vec feature vector tool.
  • Word2Vec mainly uses Skip-Gram and CBOW models to realize the feature vector conversion.
  • this embodiment adopts the Skip-Gram model to achieve word vector conversion.
  • the text feature is encoded to obtain the initial word vector.
  • the result is The initial word vector of is "001, 010, 100", that is, the initial word vector corresponding to "Zhang San” is 001, the initial word vector corresponding to "Manager” is 010, and the initial word vector corresponding to "18581858185” is 100.
  • the Skip-Gram model is used to transform the initial word vector and obtain the feature vector.
  • the Skip-Gram model includes an input layer, a hidden layer, and an output layer.
  • the mapping from the input layer to the hidden layer does not use the activation function, and the hidden layer to the output layer is optimized by the Huffman tree.
  • the Hoffman tree is a binary tree.
  • the leaf nodes represent words in the vocabulary, and the weight of the leaf nodes represents the word frequency. The greater the weight of the leaf node, the closer to the root node, and the path from the root node to the leaf node of the Huffman tree It is the probability of the word.
  • the optimization of the Huffman tree can greatly reduce the amount of calculation and speed up the generation of text summaries. Specifically, the initial word vector (ie 001) corresponding to "Zhang San" is input into the Skip-Gram model, and the resulting feature vector is ⁇ 0.319, 0.681, -0.124 ⁇ .
  • S123 Use the feature vector as an input parameter of a preset text classification model to obtain classification data corresponding to the text data.
  • the classified data includes data type and data content.
  • the preset text classification model is obtained through Convolutional Neural Network (CNN).
  • CNN Convolutional Neural Network
  • the classification data corresponding to the text data can be obtained. For example, taking the obtained feature vector ⁇ 0.319, 0.681, -0.124 ⁇ as the input parameter of the preset text classification model, the obtained classification data specifically includes: the data type "name data" and the data content "Zhang San”.
  • CNN convolutional Neural Network
  • CNN convolutional Neural Network
  • CNN Convolutional Neural Network
  • CNN Convolutional Neural Network
  • Convolutional layer Each convolutional layer in a convolutional neural network consists of several convolutional units, and the parameters of each convolutional unit are optimized through the back propagation algorithm.
  • the purpose of convolution operation is to extract different features of the input.
  • the first layer of convolutional layer may only extract some low-level features such as edges, lines, and corners. More layers of networks can iteratively extract more complex features from low-level features. feature.
  • Linear rectification layer (Rectified Linear Units layer, ReLU layer), the activation function (Activation function) of this layer of nerves uses linear rectification (Rectified Linear Units, ReLU).
  • Pooling layer usually obtains features with large dimensions after the convolutional layer. The features are cut into several regions and the maximum or average value is selected to obtain new features with smaller dimensions.
  • Fully-Connected layer which combines all local features into global features, used to calculate the final score of each category.
  • steps S210-S230 may be further included.
  • S210 Obtain training data used to train a text classification training model, and obtain a data label corresponding to the training data.
  • the text classification training model is trained to obtain a preset text classification model.
  • the text classification training model is obtained through Convolutional Neural Network (CNN).
  • CNN Convolutional Neural Network
  • the training data and the data label corresponding to the training data are input by the user through the client.
  • the training data can be "Zhang San, Manager, 18581858185", etc.
  • the data label corresponding to the training data can be specifically: the data label corresponding to "Zhang San” is "Name Data”, and the data label corresponding to "Manager” is "Position” ", "18581858185” corresponds to the data label "mobile phone number”.
  • classification data corresponding to the training data can be obtained.
  • the obtained classification data corresponding to the training data includes data type and data content.
  • the classification data corresponding to the training data please refer to Table 1.
  • the classification data corresponding to the training data is compared with the data label corresponding to the training text one by one to determine whether the data classification corresponding to the training data is correct. If the data type corresponding to the classification data is the same as the data label corresponding to the training data, it is determined that the data classification corresponding to the training data is correct. If the data type corresponding to the classified data is not the same as the data label corresponding to the training data, it is determined that the data classification corresponding to the training data is incorrect. Then perform statistics on the data classification results to calculate the accuracy of the classification data corresponding to the training data. The specific calculation method is to divide the correct number of data classifications by the total number of data classifications, and the quotient obtained is the classification data accuracy .
  • the preset accuracy threshold can be set according to requirements. If the preset accuracy threshold is 90%, the classification data accuracy shown in Table 1 is not greater than the preset accuracy threshold, and the training The result is output to inform managers to adjust the text classification training model to optimize classification accuracy.
  • the text classification training model is determined as the preset text classification model.
  • S130 Obtain a data type corresponding to the classified data corresponding to the text data, and data content corresponding to the data type, where a unique preset text rule exists corresponding to the data type.
  • the classification data corresponding to the text data includes data type and data content, and the data type corresponds to the data content in a one-to-one correspondence.
  • the classification data corresponding to the text data refer to Table 2 for details.
  • S140 Determine, according to the preset text rule corresponding to the data type, whether the data content corresponding to the data type meets the preset text rule corresponding to the data type.
  • a unique preset text rule corresponding to the data type there is a unique preset text rule corresponding to the data type. If the data type is a known value, a unique preset text rule corresponding to the data type can be determined. By judging whether the data content corresponding to the data type meets the preset text rule corresponding to the data type according to the preset text rule corresponding to the data type, the classification data corresponding to the wrong text data can be checked to improve the text data The accuracy of the corresponding classification data.
  • step S140 includes S141-S142.
  • S141 Determine whether the data content corresponding to the name data is all Chinese characters or whether the data content corresponding to the name data is all English characters.
  • different data types correspond to different preset text rules, where the preset text rules can be set in advance to implement error correction processing for data content.
  • the data type is "name data”
  • the preset text rule corresponding to the data type is the first preset text rule.
  • the first preset text rule is "the data content is all Chinese characters or the data content is all English characters”.
  • judging whether the data content corresponding to the data type meets the preset text rule corresponding to the data type according to the preset text rule corresponding to the data type is specifically: judging whether the data content corresponding to the name data is all Whether the Chinese characters or the data content corresponding to the name data are all English characters.
  • the data content corresponding to the data type is "name data” is "Zhang 1San”
  • the data content corresponding to the data type does not meet the preset text rule corresponding to the data type, it is determined that the classification data corresponding to the text data does not meet the preset text rule.
  • the data content corresponding to the data type satisfies the preset text rule corresponding to the data type, it indicates that the text data after the classification processing of the text classification model meets the preset text rule, and the accuracy of text classification is relatively high. High, and then store the classification data.
  • storing the classified data is specifically: storing in a local file according to the storage format of "data type: data content”.
  • the classified data includes data type and data content, the data type is specifically "name data”, and the data content is specifically "Zhang San”. If the classification data meets the preset text rules, then the classification classification is stored in a local file according to the storage format of "data type: data content", that is, the classification data is stored in the local file in the format of "name: Zhang San" in.
  • step S140 may further include S160.
  • the classified data does not meet the preset text rules, it indicates that the data type in the classified data does not match the data content, and there may be an error in image recognition.
  • an error warning message is generated .
  • the error warning message is used to warn users of data processing errors, so that users can obtain the wrong data in time and make corrections.
  • the error warning information can be displayed on the display device of the client, and can also be sent to the user by means of e-mail, SMS, etc.
  • FIG. 7 is a schematic block diagram of a picture processing apparatus 100 provided by an embodiment of the present application. As shown in FIG. 7, corresponding to the above picture processing method, the present application also provides a picture processing apparatus 100.
  • the picture processing apparatus 100 includes a unit for executing the above-mentioned picture processing method.
  • the apparatus 100 may be configured in a server, and the server may be an independent server or a server cluster composed of multiple servers.
  • the device includes an identification unit 110, a classification unit 120, a first acquisition unit 130, a first judgment unit 140, and a storage unit 150.
  • the recognition unit 110 is configured to recognize the picture to be recognized to obtain text data corresponding to the picture to be recognized.
  • the classification unit 120 is configured to classify the text data according to a preset text classification model to obtain classification data corresponding to the text data.
  • the classification unit 120 includes an extraction unit 121, a first generation unit 122 and a first processing unit 123.
  • the extraction unit 121 is configured to extract text features from the text data according to a preset algorithm.
  • the first generating unit 122 is configured to convert the text feature into a feature vector according to a preset feature vector tool.
  • the first processing unit 123 is configured to use the feature vector as an input parameter of a preset text classification model to obtain classification data corresponding to the text data.
  • the device 100 further includes a second acquiring unit 210, a second determining unit 220, and a first determining unit 230.
  • the second obtaining unit 210 is configured to obtain training data used for training a text classification training model, and obtain a data label corresponding to the training data.
  • the second judging unit 220 is configured to use the training data as input parameters of the text classification training model to obtain classification data corresponding to the training data, and judge the training according to the data label corresponding to the training data Whether the accuracy of the classification data corresponding to the data is greater than the preset accuracy threshold.
  • the first determining unit 230 is configured to determine the text classification training model as a preset text classification model if the accuracy of the classification data corresponding to the training data is greater than a preset accuracy threshold.
  • the first obtaining unit 130 is configured to obtain the data type corresponding to the classified data corresponding to the text data, and the data content corresponding to the data type, and the data type corresponds to a unique preset text rule.
  • the first determining unit 140 is configured to determine whether the data content corresponding to the data type satisfies the preset text rule corresponding to the data type according to the preset text rule corresponding to the data type.
  • the first determining unit 140 includes a third determining unit 141 and a second determining unit 142.
  • the third determining unit 141 is configured to determine whether the data content corresponding to the name data is all Chinese characters or whether the data content corresponding to the name data is all English characters.
  • the second determining unit 142 is configured to determine that the data content corresponding to the name data meets the data type correspondence if the data content corresponding to the name data is all Chinese characters or the data content corresponding to the name data is all English characters The preset text rules.
  • the storage unit 150 is configured to, if the data content corresponding to the data type meets the preset text rule corresponding to the data type, determine that the classification data corresponding to the text data meets the preset text rule, and store the data corresponding to the text data Classification data.
  • the device 100 further includes a warning unit 160 configured to: if the data content corresponding to the data type does not meet the preset text rule corresponding to the data type To generate an error warning message.
  • the above-mentioned apparatus 100 may be implemented in the form of a computer program, and the computer program may run on a computer device as shown in FIG. 12.
  • FIG. 12 is a schematic block diagram of a computer device according to an embodiment of the present application.
  • the computer device 500 may be a server, and the server may be an independent server or a server cluster composed of multiple servers.
  • the computer device 500 includes a processor 520, a memory, and a network interface 550 connected through a system bus 510, where the memory may include a non-volatile storage medium 530 and an internal memory 540.
  • the non-volatile storage medium 530 can store an operating system 531 and a computer program 532.
  • the computer program 532 When executed, it realizes the image processing method of the embodiment of the present application.
  • the processor 520 is used to provide calculation and control capabilities, and support the operation of the entire computer device 500.
  • the internal memory 540 provides an environment for running a computer program in a non-volatile storage medium.
  • the processor 520 can make the processor 520 execute an image processing method.
  • the network interface 550 is used for network communication with other devices.
  • the schematic block diagram of the computer device is only a block diagram of part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied.
  • the specific computer device 500 It may include more or fewer components than shown in the figures, or combine certain components, or have a different component arrangement.
  • the processor 520 may be a central processing unit (Central Processing Unit, CPU), and the processor 520 may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSPs), Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor.
  • the schematic block diagram of the computer device 500 does not constitute a limitation on the computer device 500, and may include more or fewer components than shown, or a combination of certain components, or different component arrangements.
  • the storage medium may be a computer-readable storage medium.
  • the storage medium stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the image processing method described in the above embodiments.
  • the storage medium is a physical, non-transitory storage medium, such as a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a magnetic disk, or an optical disk that can store program codes. medium.
  • a physical, non-transitory storage medium such as a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a magnetic disk, or an optical disk that can store program codes. medium.
  • the disclosed device and method may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of each unit is only a logical function division, and there may be other division methods in actual implementation.
  • more than one unit or component can be combined or integrated into another system, or some features can be omitted or not implemented.
  • the steps in the method of the embodiment of the present application can be adjusted, merged, and deleted in order according to actual needs.
  • the units in the devices in the embodiments of the present application may be combined, divided, and deleted according to actual needs.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of this application is essentially or the part that contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium It includes several instructions to make a computer device (which may be a personal computer, a terminal, or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Artificial Intelligence (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种图片处理方法,应用于智能决策技术领域,其包括对待识别图片进行识别,以获取所述待识别图片对应的文本数据(S110);根据预设的文本分类模型对所述文本数据进行分类,以得出文本数据对应的分类数据(S120);判断所述文本数据对应的分类数据是否满足预设文本规则;若所述分类数据满足预设文本规则,储存所述分类数据。

Description

图片处理方法、装置、计算机设备及存储介质
本申请要求于2019年5月07日提交中国专利局、申请号为201910374785.1、申请名称为“图片处理方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机数据处理领域,尤其涉及一种图片处理方法、装置、计算机设备及计算机可读存储介质。
背景技术
随着数据电子化的不断发展,人们逐渐习惯将纸质数据转换为电子数据进行储存,例如将纸质名片录入至电脑、手机等电子设备储存,以便于储存以及快速查找。人们往往需要手动录入这些纸质数据,耗费时间过长。
发明内容
本申请实施例提供了一种图片处理方法、装置、计算机设备及存储介质,旨在解决图片处理速度慢、准确度低等问题。
第一方面,本申请实施例提供了一种图片处理方法,其包括:对待识别图片进行识别,以获取所述待识别图片对应的文本数据;根据预设的文本分类模型对所述文本数据进行分类,以得出文本数据对应的分类数据;获取所述文本数据对应的分类数据对应的数据类型,以及所述数据类型对应的数据内容,所述数据类型对应存在唯一的预设文本规则;根据所述数据类型对应的预设文本规则判断所述数据类型对应的数据内容是否满足所述数据类型对应的预设文本规则;若所述数据类型对应的数据内容满足所述数据类型对应的预设文本规则,确定所述文本数据对应的分类数据满足预设文本规则,并储存所述文本数据对应的分类数据。
第二方面,本申请实施例提供了一种图片处理装置,其包括:识别单元,用于对待识别图片进行识别,以获取所述待识别图片对应的文本数据;分类单 元,用于根据预设的文本分类模型对所述文本数据进行分类,以得出文本数据对应的分类数据;第一获取单元,用于获取所述文本数据对应的分类数据对应的数据类型,以及所述数据类型对应的数据内容,所述数据类型对应存在唯一的预设文本规则;第一判断单元,用于根据所述数据类型对应的预设文本规则判断所述数据类型对应的数据内容是否满足所述数据类型对应的预设文本规则;以及存储单元,用于若所述数据类型对应的数据内容满足所述数据类型对应的预设文本规则,确定所述文本数据对应的分类数据满足预设文本规则,并储存所述文本数据对应的分类数据。
第三方面,本申请实施例又提供了一种计算机设备,其包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其中,所述处理器执行所述程序时实现上述第一方面所述的方法。
第四方面,本申请实施例还提供了一种计算机可读存储介质,其中所述计算机可读存储介质存储有计算机程序,所述计算机程序当被处理器执行时使所述处理器执行上述第一方面所述的方法。
附图说明
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请一实施例提供的一种图片处理方法的流程示意图;
图2为本申请一实施例提供的一种图片处理方法的应用场景示意图;
图3为本申请一实施例提供的一种图片处理方法的另一流程示意图;
图4为本申请一实施例提供的一种图片处理方法的另一流程示意图;
图5为本申请一实施例提供的一种图片处理方法的另一流程示意图;
图6为本申请一实施例提供的一种图片处理方法的另一流程示意图;
图7为本申请一实施例提供的一种图片处理装置的示意性框图;
图8为本申请一实施例提供的一种图片处理装置的另一示意性框图;
图9为本申请一实施例提供的一种图片处理装置的另一示意性框图;
图10为本申请一实施例提供的一种图片处理装置的另一示意性框图;
图11为本申请一实施例提供的一种图片处理装置的另一示意性框图;
图12为本申请一实施例提供的一种计算机设备的示意性框图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”和“包含”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或一个以上其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。
还应当理解,在此本申请说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本申请。如在本申请说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。
请参照图1以及图2,其为本申请一实施例提供的一种图片处理方法的流程示意图以及应用场景示意图。本申请实施例所提供的图片处理方法可应用于服务器中,所述服务器20可与客户端10进行数据交互,以对客户端上传的图片进行处理并将处理结果反馈给所述客户端10。其中,所述服务器20可以是独立的服务器,也可以是多个服务器组成的服务器集群。所述客户端10可以是手机、平板电脑、智能手环等电子终端。如图1所示,该图片处理方法包括步骤S110-S150。
S110,获取待识别图片并对所述待识别图片进行识别,以获取所述待识别图片对应的文本数据。
具体地,服务器可通过与客户端通信来获取客户端上传的需进行处理的图片作为待识别图片并采用预设的图片识别技术对该待识别图片进行识别,以提取其中的文本数据。在一实施例中,所述待识别图片可以为预先获取并存储于客户端中的图片数据;在另一实施例中,所述待识别图片也可以为直接通过客户端中的图片采集装置进行采集得到。其中客户端可以为平板电脑、笔记本电 脑、台式电脑等电子设备;图片采集装置可以为摄像头、扫描仪等。
在本实施例中,通过调用光学字符识别技术对待识别图片进行识别,可得出所述待识别图片对应的文本数据。其中,光学字符识别技术(Optical Character Recognition,OCR)是采用光学的方式将文字转换成为黑白点阵的图像文件,并通过识别软件将图像文件中的文字转换成文本格式的技术。
具体地,该待识别图片可以为名片图片、书籍封面图片、花名册图片、简历图片等等,本申请实施例并不对待识别图片的种类作出限制。假设该待识别图片为简历图片,通过光学字符识别技术对待识别图片进行识别后,所得到的所述待识别图片对应的文本数据可以为:“我的名字叫张三,今年32岁,毕业于深圳大学,曾担任业务部经理,联系电话为18581858185……”。
S120,根据预设的文本分类模型对所述文本数据进行分类,以得出文本数据对应的分类数据。
在一些实施例中,如图3所示,步骤S120可包括步骤S121-S123。
S121,根据预设算法从所述文本数据中提取文本特征。
具体地,预设算法可以为TF-IDF算法,TF-IDF(Term Frequency–Inverse Document Frequency)是一种用于信息检索与数据挖掘的常用加权技术。TF-IDF算法可用于评估一个词在该词所在文本数据中的重要程度。
其中,TF意思是词频(Term Frequency),计算词频的公式可以为:
Figure PCTCN2019103163-appb-000001
其中,n i,j表示词i在文档j中的出现频次;∑ kn k,j表示文档j中每个词出现次数的总和;tf i,j表示词i在文档j出现的概率。
IDF意思是逆文本频率指数(Inverse Document Frequency),计算频率指数的公式可以为:
Figure PCTCN2019103163-appb-000002
其中,|D|为训练集的总文本数据数量;|{j:t i∈d j}|为包含词t i的所有文本数据。TF-IDF算法通过将TF和IDF结合起来,若TF*IDF的值越大,表明该词的权重就越大,该词对于该词所在的文本数据中的重要程度越高。
具体实施中,通过TF-IDF算法对所述待识别图片对应的文本数据进行计算,以提取文本特征。例如,所述待识别图片对应的文本数据可以为:“我叫张三,今年32岁,毕业于深圳大学,曾担任业务部经理,联系电话为18581858185……”。通过TF-IDF算法计算后得出的文本特征为“张三、经理、18581858185……”。
S122,根据预设的特征向量工具将所述文本特征转换为特征向量。
具体地,预设的特征向量工具以为word2vec特征向量工具。Word2Vec主要采用Skip-Gram和CBOW两种模型来实现特征向量的转换。
具体实施中,本实施例采用Skip-Gram模型来实现词向量的转换,首先先对文本特征进行编码以得出初始词向量,假设文本特征为“张三、经理、18581858185……”,所得出的初始词向量为“001,010,100……”,即“张三”对应的初始词向量为001,“经理”对应的初始词向量为010,“18581858185”对应的初始词向量100。进而通过Skip-Gram模型对所得出的初始词向量进行转换以及得出特征向量。Skip-Gram模型包括输入层、隐藏层以及输出层,从输入层到隐藏层的映射没有采用激活函数,而隐藏层到输出层采用霍夫曼树进行优化。霍夫曼树是一个二叉树,叶子的节点代表词汇表中的词,叶子节点的权重代表词频,叶子节点的权重越大,距离根节点越近,霍夫曼树的根节点到叶子节点的路径即为词的概率,经过霍夫曼树的优化可以大大减少计算量,加快文本摘要的生成速度。具体地,将“张三”对应的初始词向量(即001)输入至Skip-Gram模型,所得出的特征向量为{0.319,0.681,-0.124}。
S123,将所述特征向量作为预设的文本分类模型的输入参数,以得出文本数据对应的分类数据。
具体地,所述分类数据包括数据类型以及数据内容。预设的文本分类模型通过卷积神经网络(Convolutional Neural Network,CNN)得出。通过将所述特征向量作为所述预设的文本分类模型的输入参数,即可得出文本数据对应的分类数据。例如,将所得出的特征向量{0.319,0.681,-0.124}作为预设的文本分类模型的输入参数,所得出的分类数据具体包括:数据类型“姓名数据”以及数据内容“张三”。
其中,卷积神经网络(Convolutional Neural Network,CNN)是一种前馈神经网络,它的人工神经元可以响应一部分覆盖范围内的周围单元,对于大型图像处理有出色表现。其中,卷积神经网络(Convolutional Neural Network,CNN) 通常包含以下几种层:
卷积层(Convolutional layer),卷积神经网络中每层卷积层由若干卷积单元组成,每个卷积单元的参数都是通过反向传播算法优化得到的。卷积运算的目的是提取输入的不同特征,第一层卷积层可能只能提取一些低级的特征如边缘、线条和角等层级,更多层的网络能从低级特征中迭代提取更复杂的特征。
线性整流层(Rectified Linear Units layer,ReLU layer),这一层神经的活性化函数(Activation function)使用线性整流(Rectified Linear Units,ReLU)。
池化层(Pooling layer),通常在卷积层之后会得到维度很大的特征,将特征切成几个区域,取其最大值或平均值,得到新的、维度较小的特征。
全连接层(Fully-Connected layer),把所有局部特征结合变成全局特征,用来计算最后每一类的得分。
在一些实施例中,如图4所示,步骤S120之前,还可包括步骤S210-S230。
S210,获取用于训练文本分类训练模型的训练数据,以及获取所述训练数据对应的数据标签。
具体地,通过对文本分类训练模型进行训练,以得出预设的文本分类模型。该文本分类训练模型为通过卷积神经网络(Convolutional Neural Network,CNN)得出。训练数据以及训练数据对应的数据标签由用户通过客户端进行输入。例如训练数据可以为“张三、经理、18581858185”等等,训练数据对应的数据标签具体可以为:“张三”对应的数据标签为“姓名数据”,“经理”对应的数据标签为“职位”,“18581858185”对应的数据标签为“手机号”。
S220,将所述训练数据作为所述文本分类训练模型的输入参数,以得出所述训练数据对应的分类数据,并根据所述训练数据对应的数据标签判断所述训练数据对应的分类数据准确度是否大于预设的准确度阈值。
具体地,通过将所述训练数据作为所述文本分类训练模型的输入参数,可得出所述训练数据对应的分类数据。例如,所得出的所述训练数据对应的分类数据包括数据类型以及数据内容,训练数据对应的分类数据具体可参照表1。
数据类型 姓名 职位 身份证号 ……
数据内容 张三 经理 18581858185 ……
表1
通过将逐一将训练数据对应的分类数据与所述训练文本对应的数据标签进 行比对,以判断训练数据对应的数据分类是否正确。若分类数据对应的数据类型与训练数据对应的数据标签相同,确定该训练数据对应的数据分类正确。若分类数据对应的数据类型与训练数据对应的数据标签不相同,确定该训练数据对应的数据分类错误。然后对数据分类结果进行统计,以计算出所述训练数据对应的分类数据准确度,具体计算方式为,将数据分类正确的数量除以数据分类的总数,所得出的商即为分类数据准确度。
例如,通过对比可知,表1中数据内容“18581858185”所对应的数据类型应该为“手机号”,即该组分类数据对应的数据分类错误。其余组的分类数据对应分类正确。假设表1包含3组分类数据,则表1所示的分类数据准确度为“66.67%”。
其中,预设的准确度阈值可根据需求进行设定,若预设的准确度阈值为90%,则如表1所示的分类数据准确度不大于预设的准确度阈值,进而将该训练结果输出,以告知管理人员对该文本分类训练模型进行调整,以优化分类准确度。
S230,若所述训练数据对应的分类数据准确度大于预设的准确度阈值,将所述文本分类训练模型确定为预设的文本分类模型。
具体地,若所述训练数据对应的分类数据准确度大于预设的准确度阈值,表明该文本分类训练模型的分类准确度较高,进而将所述文本分类训练模型确定为预设的文本分类模型。
S130,获取所述文本数据对应的分类数据对应的数据类型,以及所述数据类型对应的数据内容,所述数据类型对应存在唯一的预设文本规则。
具体地,所述文本数据对应的分类数据包括数据类型以及数据内容,所述数据类型与数据内容一一对应,文本数据对应的分类数据具体可参照表2。
数据类型 姓名 职位 手机号 ……
数据内容 张三 经理 18581858185 ……
表2
S140,根据所述数据类型对应的预设文本规则判断所述数据类型对应的数据内容是否满足所述数据类型对应的预设文本规则。
具体地,所述数据类型对应存在唯一的预设文本规则。若所述数据类型为已知值,则可确定与该数据类型对应的唯一的预设文本规则。通过根据所述数据类型对应的预设文本规则判断所述数据类型对应的数据内容是否满足所述数 据类型对应的预设文本规则,以对错误的文本数据对应的分类数据进行排查,提高文本数据对应的分类数据的准确度。
在一些实施例中,如图5所示,步骤S140包括S141-S142。
S141,判断所述姓名数据对应的数据内容是否全为中文字符或者所述姓名数据对应的数据内容是否全为英文字符。
具体地,不同的数据类型对应不同的预设文本规则,其中预设文本规则可预先进行设定,以实现对数据内容的纠错处理。例如,数据类型为“姓名数据”,该数据类型对应的预设文本规则为第一预设文本规则。其中,第一预设文本规则为“数据内容全为中文字符或者数据内容全为英文字符”。则所述根据所述数据类型对应的预设文本规则判断所述数据类型对应的数据内容是否满足所述数据类型对应的预设文本规则具体为:判断所述姓名数据对应的数据内容是否全为中文字符或者所述姓名数据对应的数据内容是否全为英文字符。
S142,若所述姓名数据对应的数据内容全为中文字符或者所述姓名数据对应的数据内容全为英文字符,确定所述姓名数据对应的数据内容满足所述数据类型对应的预设文本规则。
具体地,假设所述数据类型为“姓名数据”所对应的数据内容为“张1三”,通过判断所述姓名数据对应的数据内容是否全为中文字符或者所述姓名数据对应的数据内容是否全为英文字符,确定所述姓名数据对应的数据内容不满足所述数据类型对应的预设文本规则(即第一预设文本规则)。若数据类型为“姓名数据”所对应的数据内容为“张三”,则满足所述数据类型对应的预设文本规则。
若所述数据类型对应的数据内容不满足所述数据类型对应的预设文本规则,确定所述文本数据对应的分类数据不满足预设文本规则。
S150,若所述数据类型对应的数据内容满足所述数据类型对应的预设文本规则,确定所述文本数据对应的分类数据满足预设文本规则,并储存所述文本数据对应的分类数据。
具体地,若所述数据类型对应的数据内容满足所述数据类型对应的预设文本规则,表明经过所述文本分类模型分类处理后的文本数据符合预设的文本规则,文本分类的准确度较高,进而储存所述分类数据。
其中,储存所述分类数据具体为:根据“数据类型:数据内容”的储存格 式储存于本地文件中。例如,所述分类数据包括数据类型以及数据内容,数据类型具体为“姓名数据”,数据内容具体为“张三”。若该分类数据满足预设文本规则,则将该分类分级按照“数据类型:数据内容”的储存格式储存于本地文件中,即将所述分类数据以“姓名:张三”的格式储存于本地文件中。
在一些实施例中,如图6所示,步骤S140之后还可包括S160。
S160,若所述分类数据不满足预设文本规则,生成错误警告信息。
具体地,若所述分类数据不满足预设文本规则,表明该分类数据中的数据类型与数据内容不匹配,可能存在图片识别出错的情况,为保证图片处理的准确度,故生成错误警告信息,该错误警告信息用于警告用户数据处理出错,以便用户及时获取错误数据,以及进行修正。错误警告信息可通过展示于客户端的显示装置,还可以通过邮件、短信等方式发送至用户。
图7是本申请实施例提供的一种图片处理装置100的示意性框图。如图7所示,对应于以上图片处理方法,本申请还提供一种图片处理装置100。该图片处理装置100包括用于执行上述图片处理方法的单元,该装置100可以被配置于服务器中,服务器可以是独立的服务器,也可以是多个服务器组成的服务器集群。如图7所示,所述装置包括识别单元110、分类单元120、第一获取单元130、第一判断单元140以及存储单元150。
识别单元110,用于对待识别图片进行识别,以获取所述待识别图片对应的文本数据。
分类单元120,用于根据预设的文本分类模型对所述文本数据进行分类,以得出文本数据对应的分类数据。
在一些实施例中,如图8所示,所述分类单元120包括提取单元121、第一生成单元122以及第一处理单元123。
提取单元121,用于根据预设算法从所述文本数据中提取文本特征。
第一生成单元122,用于根据预设的特征向量工具将所述文本特征转换为特征向量。
第一处理单元123,用于将所述特征向量作为预设的文本分类模型的输入参数,以得出文本数据对应的分类数据。
在一些实施例中,如图9所示,所述装置100还包括第二获取单元210、第二判断单元220以及第一确定单元230。
第二获取单元210,用于获取用于训练文本分类训练模型的训练数据,以及获取所述训练数据对应的数据标签。
第二判断单元220,用于将所述训练数据作为所述文本分类训练模型的输入参数,以得出所述训练数据对应的分类数据,并根据所述训练数据对应的数据标签判断所述训练数据对应的分类数据准确度是否大于预设的准确度阈值。
第一确定单元230,用于若所述训练数据对应的分类数据准确度大于预设的准确度阈值,将所述文本分类训练模型确定为预设的文本分类模型。
第一获取单元130,用于获取所述文本数据对应的分类数据对应的数据类型,以及所述数据类型对应的数据内容,所述数据类型对应存在唯一的预设文本规则。
第一判断单元140,用于根据所述数据类型对应的预设文本规则判断所述数据类型对应的数据内容是否满足所述数据类型对应的预设文本规则。
在一些实施例中,如图10所示,所述第一判断单元140包括第三判断单元141以及第二确定单元142。
第三判断单元141,用于判断所述姓名数据对应的数据内容是否全为中文字符或者所述姓名数据对应的数据内容是否全为英文字符。
第二确定单元142,用于若所述姓名数据对应的数据内容全为中文字符或者所述姓名数据对应的数据内容全为英文字符,确定所述姓名数据对应的数据内容满足所述数据类型对应的预设文本规则。
存储单元150,用于若所述数据类型对应的数据内容满足所述数据类型对应的预设文本规则,确定所述文本数据对应的分类数据满足预设文本规则,并储存所述文本数据对应的分类数据。
在一些实施例中,如图11所示,所述装置100还包括警告单元160,所述警告单元160用于若所述数据类型对应的数据内容不满足所述数据类型对应的预设文本规则,生成错误警告信息。
需要说明的是,所属领域的技术人员可以清楚地了解到,上述图片处理装置100和各单元的具体实现过程,可以参考前述方法实施例中的相应描述,为了描述的方便和简洁,在此不再赘述。
上述装置100可以实现为一种计算机程序的形式,计算机程序可以在如图12所示的计算机设备上运行。
请参阅图12,图12是本申请实施例提供的一种计算机设备的示意性框图。该计算机设备500可以是服务器,所述服务器可以是独立的服务器,也可以是多个服务器组成的服务器集群。
该计算机设备500包括通过系统总线510连接的处理器520、存储器和网络接口550,其中,存储器可以包括非易失性存储介质530和内存储器540。
该非易失性存储介质530可存储操作系统531和计算机程序532。该计算机程序532被执行时,以实现本申请实施例的图片处理方法。
该处理器520用于提供计算和控制能力,支撑整个计算机设备500的运行。
该内存储器540为非易失性存储介质中的计算机程序的运行提供环境,该计算机程序被处理器520执行时,可使得处理器520执行一种图片处理方法。
该网络接口550用于与其它设备进行网络通信。本领域技术人员可以理解,该计算机设备的示意性框图仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备500的限定,具体的计算机设备500可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
应当理解,在本申请实施例中,处理器520可以是中央处理单元(Central Processing Unit,CPU),该处理器520还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。其中,通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
本领域技术人员可以理解,该计算机设备500的示意性框图并不构成对计算机设备500的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
因此,本申请还提供一种存储介质。该存储介质可以为计算机可读存储介质。该存储介质存储有计算机程序,该计算机程序被处理器执行时使处理器执行以上各实施例中所描述的图片处理方法的步骤。
所述存储介质为实体的、非瞬时性的存储介质,例如可以是U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、磁碟或者光盘等各种可以存储 程序代码的实体存储介质。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的。例如,各个单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。例如一个以上单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。
本申请实施例方法中的步骤可以根据实际需要进行顺序调整、合并和删减。本申请实施例装置中的单元可以根据实际需要进行合并、划分和删减。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以是两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
该集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分,或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,终端,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。 因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (20)

  1. 一种图片处理方法,包括:
    对待识别图片进行识别,以获取所述待识别图片对应的文本数据;
    根据预设的文本分类模型对所述文本数据进行分类,以得出文本数据对应的分类数据;
    获取所述文本数据对应的分类数据对应的数据类型,以及所述数据类型对应的数据内容,所述数据类型对应存在唯一的预设文本规则;
    根据所述数据类型对应的预设文本规则判断所述数据类型对应的数据内容是否满足所述数据类型对应的预设文本规则;
    若所述数据类型对应的数据内容满足所述数据类型对应的预设文本规则,确定所述文本数据对应的分类数据满足预设文本规则,并储存所述文本数据对应的分类数据。
  2. 如权利要求1所述的方法,其中,所述根据预设的文本分类模型对所述文本数据进行分类,以得出文本数据对应的分类数据,包括:
    根据预设算法从所述文本数据中提取文本特征;
    根据预设的特征向量工具将所述文本特征转换为特征向量;
    将所述特征向量作为预设的文本分类模型的输入参数,以得出文本数据对应的分类数据。
  3. 如权利要求1所述的方法,其中,所述根据预设的文本分类模型对所述文本数据进行分类,以得出文本数据对应的分类数据之前,还包括:
    获取用于训练文本分类训练模型的训练数据,以及获取所述训练数据对应的数据标签;
    将所述训练数据作为所述文本分类训练模型的输入参数,以得出所述训练数据对应的分类数据,并根据所述训练数据对应的数据标签判断所述训练数据对应的分类数据准确度是否大于预设的准确度阈值;
    若所述训练数据对应的分类数据准确度大于预设的准确度阈值,将所述文本分类训练模型确定为预设的文本分类模型。
  4. 如权利要求1所述的方法,其中,所述数据类型包括姓名数据,所述根据所述数据类型对应的预设文本规则判断所述数据类型对应的数据内容是否满足 所述数据类型对应的预设文本规则,包括:
    判断所述姓名数据对应的数据内容是否全为中文字符或者所述姓名数据对应的数据内容是否全为英文字符;
    若所述姓名数据对应的数据内容全为中文字符或者所述姓名数据对应的数据内容全为英文字符,确定所述姓名数据对应的数据内容满足所述数据类型对应的预设文本规则。
  5. 如权利要求1所述的方法,其中,所述获取与所述数据类型对应的预设文本规则,判断所述数据类型对应的数据内容是否满足所述数据类型对应的预设文本规则之后,还包括:
    若所述数据类型对应的数据内容不满足所述数据类型对应的预设文本规则,生成错误警告信息。
  6. 如权利要求2所述的方法,其中,所述预设算法为TF-IDF算法。
  7. 如权利要求1所述的方法,其中,所述预设的文本分类模型通过卷积神经网络得到,所述卷积神经网络包括卷积层、线性整流层、池化层以及全连接层。
  8. 一种图片处理装置,包括:
    识别单元,用于对待识别图片进行识别,以获取所述待识别图片对应的文本数据;
    分类单元,用于根据预设的文本分类模型对所述文本数据进行分类,以得出文本数据对应的分类数据;
    第一获取单元,用于获取所述文本数据对应的分类数据对应的数据类型,以及所述数据类型对应的数据内容,所述数据类型对应存在唯一的预设文本规则;
    第一判断单元,用于根据所述数据类型对应的预设文本规则判断所述数据类型对应的数据内容是否满足所述数据类型对应的预设文本规则;
    存储单元,用于若所述数据类型对应的数据内容满足所述数据类型对应的预设文本规则,确定所述文本数据对应的分类数据满足预设文本规则,并储存所述文本数据对应的分类数据。
  9. 如权利要求8所述的装置,其中,所述分类单元包括:
    提取单元,用于根据预设算法从所述文本数据中提取文本特征;
    第一生成单元,用于根据预设的特征向量工具将所述文本特征转换为特征 向量;
    第一处理单元,用于将所述特征向量作为预设的文本分类模型的输入参数,以得出文本数据对应的分类数据。
  10. 如权利要求8所述的装置,其中,所述装置还包括:
    第二获取单元,用于获取用于训练文本分类训练模型的训练数据,以及获取所述训练数据对应的数据标签;
    第二判断单元,用于将所述训练数据作为所述文本分类训练模型的输入参数,以得出所述训练数据对应的分类数据,并根据所述训练数据对应的数据标签判断所述训练数据对应的分类数据准确度是否大于预设的准确度阈值;
    第一确定单元,用于若所述训练数据对应的分类数据准确度大于预设的准确度阈值,将所述文本分类训练模型确定为预设的文本分类模型。
  11. 一种计算机设备,包括存储器以及与所述存储器相连的处理器;其中,所述存储器用于存储计算机程序;所述处理器用于运行所述存储器中存储的计算机程序,以执行如下步骤:
    对待识别图片进行识别,以获取所述待识别图片对应的文本数据;
    根据预设的文本分类模型对所述文本数据进行分类,以得出文本数据对应的分类数据;
    获取所述文本数据对应的分类数据对应的数据类型,以及所述数据类型对应的数据内容,所述数据类型对应存在唯一的预设文本规则;
    根据所述数据类型对应的预设文本规则判断所述数据类型对应的数据内容是否满足所述数据类型对应的预设文本规则;
    若所述数据类型对应的数据内容满足所述数据类型对应的预设文本规则,确定所述文本数据对应的分类数据满足预设文本规则,并储存所述文本数据对应的分类数据。
  12. 根据权利要求11所述的计算机设备,其中,所述根据预设的文本分类模型对所述文本数据进行分类,以得出文本数据对应的分类数据的步骤包括:
    根据预设算法从所述文本数据中提取文本特征;
    根据预设的特征向量工具将所述文本特征转换为特征向量;
    将所述特征向量作为预设的文本分类模型的输入参数,以得出文本数据对应的分类数据。
  13. 根据权利要求11所述的计算机设备,其中,所述根据预设的文本分类模型对所述文本数据进行分类,以得出文本数据对应的分类数据的步骤之前还包括:
    获取用于训练文本分类训练模型的训练数据,以及获取所述训练数据对应的数据标签;
    将所述训练数据作为所述文本分类训练模型的输入参数,以得出所述训练数据对应的分类数据,并根据所述训练数据对应的数据标签判断所述训练数据对应的分类数据准确度是否大于预设的准确度阈值;
    若所述训练数据对应的分类数据准确度大于预设的准确度阈值,将所述文本分类训练模型确定为预设的文本分类模型。
  14. 根据权利要求11所述的计算机设备,其中,所述数据类型包括姓名数据,所述根据所述数据类型对应的预设文本规则判断所述数据类型对应的数据内容是否满足所述数据类型对应的预设文本规则的步骤包括:
    判断所述姓名数据对应的数据内容是否全为中文字符或者所述姓名数据对应的数据内容是否全为英文字符;
    若所述姓名数据对应的数据内容全为中文字符或者所述姓名数据对应的数据内容全为英文字符,确定所述姓名数据对应的数据内容满足所述数据类型对应的预设文本规则。
  15. 根据权利要求11所述的计算机设备,其中,所述获取与所述数据类型对应的预设文本规则,判断所述数据类型对应的数据内容是否满足所述数据类型对应的预设文本规则的步骤之后还包括:
    若所述数据类型对应的数据内容不满足所述数据类型对应的预设文本规则,生成错误警告信息。
  16. 根据权利要求12所述的计算机设备,其中,所述预设算法为TF-IDF算法。
  17. 根据权利要求11所述的计算机设备,其中,所述预设的文本分类模型通过卷积神经网络得到,所述卷积神经网络包括卷积层、线性整流层、池化层以及全连接层。
  18. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时使所述处理器执行以下步骤:
    对待识别图片进行识别,以获取所述待识别图片对应的文本数据;
    根据预设的文本分类模型对所述文本数据进行分类,以得出文本数据对应的分类数据;
    获取所述文本数据对应的分类数据对应的数据类型,以及所述数据类型对应的数据内容,所述数据类型对应存在唯一的预设文本规则;
    根据所述数据类型对应的预设文本规则判断所述数据类型对应的数据内容是否满足所述数据类型对应的预设文本规则;
    若所述数据类型对应的数据内容满足所述数据类型对应的预设文本规则,确定所述文本数据对应的分类数据满足预设文本规则,并储存所述文本数据对应的分类数据。
  19. 根据权利要求18所述的计算机可读存储介质,其中,所述根据预设的文本分类模型对所述文本数据进行分类,以得出文本数据对应的分类数据的步骤包括:
    根据预设算法从所述文本数据中提取文本特征;
    根据预设的特征向量工具将所述文本特征转换为特征向量;
    将所述特征向量作为预设的文本分类模型的输入参数,以得出文本数据对应的分类数据。
  20. 根据权利要求18所述的计算机可读存储介质,其中,所述根据预设的文本分类模型对所述文本数据进行分类,以得出文本数据对应的分类数据的步骤之前还包括:
    获取用于训练文本分类训练模型的训练数据,以及获取所述训练数据对应的数据标签;
    将所述训练数据作为所述文本分类训练模型的输入参数,以得出所述训练数据对应的分类数据,并根据所述训练数据对应的数据标签判断所述训练数据对应的分类数据准确度是否大于预设的准确度阈值;
    若所述训练数据对应的分类数据准确度大于预设的准确度阈值,将所述文本分类训练模型确定为预设的文本分类模型。
PCT/CN2019/103163 2019-05-07 2019-08-29 图片处理方法、装置、计算机设备及存储介质 WO2020224115A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910374785.1 2019-05-07
CN201910374785.1A CN110245557B (zh) 2019-05-07 2019-05-07 图片处理方法、装置、计算机设备及存储介质

Publications (1)

Publication Number Publication Date
WO2020224115A1 true WO2020224115A1 (zh) 2020-11-12

Family

ID=67883799

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/103163 WO2020224115A1 (zh) 2019-05-07 2019-08-29 图片处理方法、装置、计算机设备及存储介质

Country Status (2)

Country Link
CN (1) CN110245557B (zh)
WO (1) WO2020224115A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113051901A (zh) * 2021-03-26 2021-06-29 重庆紫光华山智安科技有限公司 一种身份证文本识别方法、系统、介质及电子终端
CN116883986A (zh) * 2023-08-07 2023-10-13 上海威派格智慧水务股份有限公司 水表数据的识别方法、装置、设备及计算机可读介质

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110750641B (zh) * 2019-09-24 2022-02-11 武汉大学 一种基于序列连接模型和二叉树模型的分类纠错方法
CN110659640B (zh) * 2019-09-27 2021-11-30 深圳市商汤科技有限公司 文本序列的识别方法及装置、电子设备和存储介质
CN111191614B (zh) * 2020-01-02 2023-08-29 中国建设银行股份有限公司 一种单据分类方法和装置
CN111339910B (zh) * 2020-02-24 2023-11-28 支付宝实验室(新加坡)有限公司 文本的处理、文本分类模型的训练方法及装置
CN111539021A (zh) * 2020-04-26 2020-08-14 支付宝(杭州)信息技术有限公司 一种数据隐私类型识别方法、装置及设备
CN112434686B (zh) * 2020-11-16 2023-05-23 浙江大学 针对ocr图片的端到端含错文本分类识别仪
CN113407682A (zh) * 2021-08-19 2021-09-17 北京好欣晴移动医疗科技有限公司 基于深度学习的数据处理方法、装置和系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105512145A (zh) * 2014-09-26 2016-04-20 阿里巴巴集团控股有限公司 信息分类方法及装置
CN108563782A (zh) * 2018-04-25 2018-09-21 平安科技(深圳)有限公司 商品信息格式处理方法、装置、计算机设备和存储介质
CN108717519A (zh) * 2018-04-03 2018-10-30 北京捷通华声科技股份有限公司 一种文本分类方法及装置
CN109344253A (zh) * 2018-09-18 2019-02-15 平安科技(深圳)有限公司 添加用户标签的方法、装置、计算机设备和存储介质

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108182279B (zh) * 2018-01-26 2019-10-01 有米科技股份有限公司 基于文本特征的对象分类方法、装置和计算机设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105512145A (zh) * 2014-09-26 2016-04-20 阿里巴巴集团控股有限公司 信息分类方法及装置
CN108717519A (zh) * 2018-04-03 2018-10-30 北京捷通华声科技股份有限公司 一种文本分类方法及装置
CN108563782A (zh) * 2018-04-25 2018-09-21 平安科技(深圳)有限公司 商品信息格式处理方法、装置、计算机设备和存储介质
CN109344253A (zh) * 2018-09-18 2019-02-15 平安科技(深圳)有限公司 添加用户标签的方法、装置、计算机设备和存储介质

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113051901A (zh) * 2021-03-26 2021-06-29 重庆紫光华山智安科技有限公司 一种身份证文本识别方法、系统、介质及电子终端
CN116883986A (zh) * 2023-08-07 2023-10-13 上海威派格智慧水务股份有限公司 水表数据的识别方法、装置、设备及计算机可读介质
CN116883986B (zh) * 2023-08-07 2024-04-26 上海威派格智慧水务股份有限公司 水表数据的识别方法、装置、设备及计算机可读介质

Also Published As

Publication number Publication date
CN110245557B (zh) 2023-12-22
CN110245557A (zh) 2019-09-17

Similar Documents

Publication Publication Date Title
WO2020224115A1 (zh) 图片处理方法、装置、计算机设备及存储介质
US11244205B2 (en) Generating multi modal image representation for an image
WO2021012570A1 (zh) 数据录入方法、装置、设备及存储介质
WO2022048173A1 (zh) 基于人工智能的客户意图识别方法、装置、设备及介质
WO2019153551A1 (zh) 文章分类方法、装置、计算机设备及存储介质
WO2020238054A1 (zh) Pdf文档中图表的定位方法、装置及计算机设备
WO2021051598A1 (zh) 文本情感分析模型训练方法、装置、设备及可读存储介质
WO2021164481A1 (zh) 基于神经网络模型的手写签名的自动校验的方法和装置
EP3680850A1 (en) Method and system for determining risk score for a contract document
WO2019137185A1 (zh) 一种图片筛选方法及装置、存储介质、计算机设备
CN110929025A (zh) 垃圾文本的识别方法、装置、计算设备及可读存储介质
CN111428485A (zh) 司法文书段落分类方法、装置、计算机设备及存储介质
JP2021166070A (ja) 文書比較方法、装置、電子機器、コンピュータ読取可能な記憶媒体及びコンピュータプログラム
CN112052331A (zh) 一种处理文本信息的方法及终端
US20210209482A1 (en) Method and apparatus for verifying accuracy of judgment result, electronic device and medium
CN112580324A (zh) 文本纠错方法、装置、电子设备以及存储介质
CN113723270A (zh) 基于rpa及ai的文件处理方法及装置
WO2022267167A1 (zh) 文本类型智能识别方法、装置、设备及介质
CN114724156B (zh) 表单识别方法、装置及电子设备
CN112328735A (zh) 热点话题确定方法、装置及终端设备
WO2021000400A1 (zh) 导诊相似问题对生成方法、系统及计算机设备
CN115062621A (zh) 标签提取方法、装置、电子设备和存储介质
CN115248890B (zh) 用户兴趣画像的生成方法、装置、电子设备以及存储介质
US20050065899A1 (en) Data classification using stochastic key feature generation
CN114926322A (zh) 图像生成方法、装置、电子设备和存储介质

Legal Events

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

Ref document number: 19927697

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19927697

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 19927697

Country of ref document: EP

Kind code of ref document: A1