CN112199946B - Data processing method, device, electronic equipment and readable storage medium - Google Patents

Data processing method, device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN112199946B
CN112199946B CN202010969815.6A CN202010969815A CN112199946B CN 112199946 B CN112199946 B CN 112199946B CN 202010969815 A CN202010969815 A CN 202010969815A CN 112199946 B CN112199946 B CN 112199946B
Authority
CN
China
Prior art keywords
text
picture
sequence
text picture
input
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202010969815.6A
Other languages
Chinese (zh)
Other versions
CN112199946A (en
Inventor
黄恺
周佳
闫嵩
包英泽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dami Technology Co Ltd
Original Assignee
Beijing Dami Technology Co Ltd
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 Beijing Dami Technology Co Ltd filed Critical Beijing Dami Technology Co Ltd
Priority to CN202010969815.6A priority Critical patent/CN112199946B/en
Publication of CN112199946A publication Critical patent/CN112199946A/en
Application granted granted Critical
Publication of CN112199946B publication Critical patent/CN112199946B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/232Orthographic correction, e.g. spell checking or vowelisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/10Services
    • G06Q50/20Education
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/22Character recognition characterised by the type of writing
    • G06V30/224Character recognition characterised by the type of writing of printed characters having additional code marks or containing code marks

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Artificial Intelligence (AREA)
  • General Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computational Linguistics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Tourism & Hospitality (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Biology (AREA)
  • Economics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Educational Administration (AREA)
  • Educational Technology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Human Resources & Organizations (AREA)
  • Marketing (AREA)
  • Primary Health Care (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Multimedia (AREA)
  • Character Input (AREA)
  • Machine Translation (AREA)

Abstract

The embodiment of the invention discloses a data processing method, a device, electronic equipment and a readable storage medium, wherein the method is characterized in that a first position and at least one first text picture are obtained by carrying out text detection on an input text picture, a corresponding first text sequence is obtained according to the first text picture, at least one second text sequence is obtained by carrying out word segmentation on the first text sequence, a second position is obtained according to the first position, the first text sequence and the second text sequence, a spelling check result is obtained by carrying out spelling check on the second text sequence, and an error correction result is obtained according to the spelling check result and the second position. Thereby, the automation degree efficiency of the operation correction is improved.

Description

Data processing method, device, electronic equipment and readable storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a data processing method, a data processing device, an electronic device, and a readable storage medium.
Background
The homework correction is an important link in the teaching process, and the homework correction result can directly reflect the course mastering condition of students and influence the development of subsequent courses.
In the current teaching process, students usually need to be manually corrected by teachers after finishing homework, the manual correction efficiency is low, and meanwhile, response data of the students are difficult to be efficiently and completely arranged, so that the students cannot acquire homework correction results in time.
Disclosure of Invention
In view of the above, the embodiments of the present invention provide a data processing method, apparatus, electronic device, and readable storage medium, so as to improve the automation degree and efficiency of job modification.
In a first aspect, an embodiment of the present invention provides a data processing method, where the method includes:
acquiring an input text picture;
Performing text detection on the input text picture to obtain a first position and at least one first text picture, wherein the first position is the position of the text content of each line level on the text picture, and the first text picture is the text picture of the line level of the text picture;
Obtaining a corresponding first text sequence according to the first text picture, wherein the first text sequence is a text of a line level on the text picture;
word segmentation is carried out on the first text sequence to obtain at least one second text sequence, wherein the second text sequence is text of word level of the first text picture;
obtaining a second position according to the first position, the first text sequence and the second text sequence, wherein the second position is the position of the text content of each word level on the text picture;
performing spelling check on the second text sequence to obtain a spelling check result; and
And obtaining an error correction result according to the spelling check result and the second position.
Further, the acquiring the input text picture includes:
Acquiring at least one original text picture;
Classifying the at least one original text picture according to the text direction to obtain a classification result; and
And correcting the direction of the original text picture according to the classification result, and acquiring the input text picture.
Further, the classifying the at least one original text picture according to the text direction, and the obtaining the classification result specifically includes:
inputting the at least one original text picture into a classification neural network model, and taking the output result of the classification neural network model as a classification result.
Further, the text detection on the input text picture to obtain a first position and at least one first text picture includes:
inputting the input text picture into a text detection neural network model to obtain the first position; and
And cutting the input text picture according to the first position to obtain at least one first text picture.
Further, the obtaining the corresponding first text sequence according to the first text picture specifically includes:
and inputting the first text picture into a text recognition network, and obtaining the first text sequence according to an output result of the text recognition network.
Further, the word segmentation is performed on the first text sequence to obtain at least one second text sequence specifically includes:
and carrying out semantic word segmentation on the first text sequence based on a natural language processing library to obtain the second text sequence.
Further, the spell checking is performed on the second text sequence, and the spell checking result is specifically:
And performing spell checking on the second text sequence based on a spell checking tool to obtain a spell checking result.
Further, after the error correction result is obtained according to the spell check result and the second position, the method further includes:
recommending correct candidate words according to the error correction result; and
And displaying a correction result, wherein the correction result comprises the error correction result and a candidate word.
In a second aspect, an embodiment of the present invention provides a data processing apparatus, the apparatus including:
the acquisition unit is used for acquiring an input text picture;
The detection and segmentation unit is used for carrying out text detection on the input text picture to obtain a first position and at least one first text picture, wherein the first position is the position of the text content of each line level on the text picture, and the first text picture is the line-level text picture of the text picture;
the identification unit is used for obtaining a corresponding first text sequence according to the first text picture, wherein the first text sequence is a line-level text on the text picture;
the word segmentation unit is used for segmenting the first text sequence to obtain at least one second text sequence, wherein the second text sequence is a word-level text of the first text picture;
the determining unit is used for obtaining a second position according to the first position, the first text sequence and the second text sequence, wherein the second position is the position of the text content of each word level on the text picture;
The checking unit is used for performing spelling check on the second text sequence to obtain a spelling check result; and
And the integration unit is used for obtaining an error correction result according to the spelling check result and the second position.
In a third aspect, embodiments of the present invention provide an electronic device comprising a memory for storing one or more computer program instructions, and a processor, wherein the one or more computer program instructions are executed by the processor to implement a method as described above.
In a fourth aspect, embodiments of the present invention provide a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement a method as described above.
According to the data processing method, a first position, at least one first text picture and a first text sequence corresponding to the first text picture are obtained through text detection on the input text picture, at least one second text sequence is obtained through word segmentation on the first text sequence, the second position is obtained according to the first position, the first text sequence and the second text sequence, spelling check is conducted on the second text sequence, a spelling check result is obtained, and an error correction result is obtained according to the spelling check result and the second position. Thereby, the automation degree and the efficiency of the operation correction are improved.
Drawings
The above and other objects, features and advantages of the present invention will become more apparent from the following description of embodiments of the present invention with reference to the accompanying drawings, in which:
FIG. 1 is a flow chart of a data processing method of an embodiment of the present invention;
FIG. 2 is a flow chart of acquiring an input text picture in accordance with an embodiment of the present invention;
FIG. 3 is a flow chart of obtaining a first text picture according to an embodiment of the present invention;
FIG. 4 is a flow chart of a particular implementation of a data processing method of an embodiment of the present invention;
FIG. 5 is a data flow diagram of a data processing method according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a data processing apparatus according to an embodiment of the present invention;
Fig. 7 is a schematic diagram of an electronic device according to an embodiment of the invention.
Detailed Description
The present invention is described below based on examples, but the present invention is not limited to only these examples. In the following detailed description of the present invention, certain specific details are set forth in detail. The present invention will be fully understood by those skilled in the art without the details described herein. Well-known methods, procedures, flows, components and circuits have not been described in detail so as not to obscure the nature of the invention.
Moreover, those of ordinary skill in the art will appreciate that the drawings are provided herein for illustrative purposes and that the drawings are not necessarily drawn to scale.
Unless the context clearly requires otherwise, the words "comprise," "comprising," and the like in the description are to be construed in an inclusive sense as opposed to an exclusive or exhaustive sense; that is, it is the meaning of "including but not limited to".
In the description of the present invention, it should be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. Furthermore, in the description of the present invention, unless otherwise indicated, the meaning of "at least one" is two or more.
The homework correction is an important link in the teaching process, and the homework correction result directly reflects the mastering condition of students on knowledge points and plays an important role in developing subsequent courses.
The existing operation correcting method generally needs manual correction by a teacher, and the degree of automation of correcting operation and the correction efficiency of operation still need to be improved.
The technical scheme of the embodiment of the invention provides a data processing method which can improve the automation degree and the efficiency of operation modification.
In this embodiment, an example of modification of a word spelling operation in an english subjective question will be described. It will be readily appreciated by those skilled in the art that the methods of embodiments of the present invention are equally applicable for spell checking in different scenarios, such as spell checking in other alphabetic languages or spell checking of vocabularies or phrases in chinese writing.
FIG. 1 is a flow chart of a data processing method according to an embodiment of the present invention. As shown in fig. 1, the data processing method according to the embodiment of the present invention includes the following steps:
In step S100, an input text picture is acquired.
In this embodiment, the input text picture is at least one picture of the job to be modified. Wherein, each picture is displayed with partial operation content, and the content displayed by at least one picture of the operation to be modified forms the whole content of one operation.
In an alternative implementation, when there is a deviation in the position direction of the picture of the job to be modified, as shown in fig. 2, the step of obtaining the input text picture includes the following steps:
at step S110, at least one original text picture is acquired.
In this embodiment, the original text picture includes an image of a handwritten text paragraph written by the student.
In an alternative implementation manner, students can write homework on the special answering paper, and scan and read data of texts on the answering paper through the special scanner equipment, so that original text pictures are obtained.
In another alternative implementation, the job may be written on plain paper and the original text image is obtained by scanning and reading the text data in the job by means of scanning software installed on the mobile device.
In step S120, the at least one original text picture is classified according to the text direction, so as to obtain a classification result.
Since the directions of scanning or photographing the original text pictures may be different, in order to improve the efficiency and accuracy of job correction, at least one original text picture is classified according to the difference of the text directions when the job is preprocessed.
In the present embodiment, the basis of classification of the original text pictures is to classify the original text pictures by 0 °, 90 °, 180 °, and 270 ° with reference to the start position of the text content on the paper and the paper direction as the vertical direction.
Preferably, when at least one original text picture is classified according to a text direction, the at least one original text picture is input to a resnet classification network, and an output result of the resnet classification network is used as a classification result.
Resnet50 the Network is a Residual Network (resnet is an abbreviation for Residual Network). The resnet network includes an input layer (image), 1 independent convolutional layer (conv 1), 1 max-pooling layer (maxpool), 4 convolutional residual modules (conv2_x, conv3_x, conv4_x, and conv5_x, respectively), 1 average pooling layer (avgpool), and one soft maximum output layer. Wherein the independent convolution layer (conv 1) uses 64 convolution kernels of size 7*7 and step size 2. The max pooling layer (maxpool) selects a convolution kernel with a pooling window of 3*3 and a step size of 2. The conv2_x in the convolution residual modules is configured with 3, the conv3_x is configured with 4, the conv4_x is configured with 6, the conv5_x is configured with 3, each convolution residual module has 2-3 convolution layers and cascade components spanning different convolution layers. Resnet50 can effectively identify the text direction in the original text picture, thereby providing basis for subsequent correction processing.
It should be appreciated that other types of methods or machine learning models may be employed to perform the classification of the text direction.
In step S130, the direction of the original text picture is corrected according to the classification result, and the input text picture is obtained.
In this embodiment, the original text pictures with deviation are corrected according to the classification results in different directions, so as to ensure that the directions of the input text pictures corresponding to all the original text pictures are consistent, avoid the influence of inconsistent directions on the operation correction process and the operation correction result, and be beneficial to improving the operation correction efficiency and accuracy.
In step S200, text detection is performed on the input text picture, so as to obtain a first position and at least one first text picture.
In this embodiment, the first position is a position of text content at a line level on a text picture, and the first text picture is a text picture at a line level of the text picture.
Fig. 3 is a flowchart of obtaining a first text picture according to an embodiment of the present invention. As shown in fig. 3, the first text picture is obtained by the steps of:
In step S210, an input text picture is input to a text detection network to obtain a first location.
Most of the existing text detection methods are based on target detection of an priori frame (anchor base) to detect texts, the detection speed is high, but the situation of text defect or loss is easy to occur, or the text alignment effect is not ideal. Therefore, in the embodiment of the invention, the PAN (PSENet) network is adopted as the text detection network to perform text detection on the content of the input text picture, and the first position is obtained, so that the method and the device not only can adapt to text detection of different formats and contents, but also have good text segmentation effect.
In step S220, the input text picture is cut according to the first position, so as to obtain at least one first text picture.
In this embodiment, a PAN (PSENet) network is used to segment the input text picture. Wherein PSENet is taken as a new example segmentation network, pixel level segmentation is carried out based on a segmentation method, text with any shape can be positioned, and a progressive scale expansion algorithm is adopted, so that adjacent text examples can be effectively identified.
The backbone network of PSENet model uses Resnet (residual network) and can also be adjusted as needed. The method comprises the steps of inputting an input text picture with a certain width and height parameter and an image dimension into a Resnet network, and sequentially carrying out downsampling, feature fusion and upsampling to obtain an output image with the same specific dimension as the input text picture in size, namely obtaining at least one image P1, P2, and P & m & gt. And the images P1, P2, and (3) processing the first text picture and the second text picture to obtain at least one first text picture.
Preferably, resnet is adopted in Resnet of the present embodiment, the outputs of convolutional layers Conv2, conv3, conv4, conv5 with stride (step size) of 4,8, 16, 32 are extracted as high and low layer features, and the dimension number (also called channel number) of the feature image output by each layer is reduced by using a 1*1 convolutional layer to obtain at least one feature image.
The working principle of the progressive scale expansion algorithm is as follows: first, different segmented regions of each line-level text line, also referred to as kernels (kernels) are predicted, each kernel having the same shape as the original text line and the center being the same as the original text line, but in different proportions, progressively increasing in scale, the largest kernel being the same size as the original text line. Secondly, a BFS (breadth first algorithm) algorithm is adopted for all the cores, and the cores are gradually amplified to larger cores from the core with the smallest scale, and finally the cores are amplified to the original text line size.
Since the kernel boundary with the smallest dimension is furthest and is easy to separate, the edge pixels of different text lines can be accurately distinguished. Furthermore, each core is supervised by the previous core in the gradual expansion process, and even if the size of the original text line is expanded, the edge pixels can be distinguished, so that the alignment and segmentation of the line-level text line are ensured, and the efficiency and accuracy of obtaining the first text picture are further improved.
In step S300, a corresponding first text sequence is obtained according to the first text picture.
In this embodiment, the first text sequence is a line-level text on a text picture.
In an alternative implementation, at least one first text picture at the line level is input to the text recognition network and the result output by the text recognition network is taken as the corresponding first text sequence.
Preferably, the text recognition network in this embodiment adopts a text recognition network with a crnn+ctc structure, and recognizes the text in the located at least one first text picture area through the crnn+ctc text recognition network, and converts the text content in the first text picture area into character information.
In step S400, the first text sequence is segmented to obtain at least one second text sequence.
In this embodiment, the second text sequence is word-level text in the first text picture.
In an alternative implementation, the present embodiment uses nltk tools to semantically word the first text sequence.
The nltk tool is a tool for teaching and calculating linguistic work based on a Python program, and provides a set of text processing libraries for classification, marking, word drying, marking, parsing and semantic reasoning. When the method is used, python editing software is only required to be opened, a ntlk module is imported, a text to be segmented is defined, segmentation and part-of-speech tagging are carried out, and then segmentation is completed. The operation is simple and flexible, and the word segmentation efficiency is high.
In step S500, a second position is obtained from the first position, the first text sequence, and the second text sequence.
In this embodiment, the second position is a position of the text content of each word level on the input text picture. Specifically, the position of the text content of each word level in the corresponding first text picture can be obtained according to the second text sequence. Meanwhile, the position of the image corresponding to each second text sequence in the input text picture can be obtained according to the position (namely the first position) of the first text picture.
In step S600, a spell check is performed on the second text sequence, resulting in a spell check result.
In this embodiment, the second text sequence is automatically spell checked using PYENCHANT tools to obtain a spell check result.
Specifically, in spell checking the second text sequence using the PYENCHANT tool, the PYENCHANT component is first installed using the pip and the spell checking of the words is performed on the second text sequence resulting from the word segmentation process by creating and using the Dict object (dictionary). Among the ways to create Dict objects are mainly the following, including creating Dict objects in a given language, creating Dict objects using words in a local file, and merging a built-in language with words in a local file to create Dict objects, etc. In addition, spell checking of words in the second text sequence is performed using the SPELLCHECKER classes in the enchant.
It should be noted that the PYENCHANT component has attached to it a partial dictionary (e.g., en_GB, en_US, de_DE, fr_ FR. any Openoffice dictionary may be used when spell checking of more words in different languages is required.
In step S700, an error correction result is obtained based on the spell check result and the second position.
In the embodiment, the error correction result is obtained by combining the spelling check result and the second position, so that the content of the error correction result is richer, and students can know the misspelled word content and the position of the misspelled word in time.
In an alternative implementation, in order to facilitate observation and statistics of the result of job modification, after performing a spell check on the second text sequence to obtain a spell check result, the data processing method of this embodiment further includes the steps of:
In step S800, correct candidate words are recommended based on the error correction result.
In this embodiment, the correct candidate word is recommended at the second location based on the spell check result.
Preferably, the recommended function of providing correctly spelled words for misspelled words is implemented by the PYENCHANT component. Therefore, in the process of correcting the homework, not only can the misspelled word and the position of the misspelled word in the homework text be marked, so that students can know the correction result of the homework, but also correct candidate words can be recommended for the misspelled word, the student can correct the misspelled word in time, and the learning efficiency is improved.
In step S900, the correction result is displayed.
In this embodiment, the correction result includes an error correction result and a candidate word. Therefore, the correction result and the candidate words in the operation text are displayed to replace the operations of manually correcting the operation by a teacher and marking the misspelled words and marking the correctly spelled words, so that the workload of correcting the operation by the teacher is reduced, and the correction efficiency of the operation is improved. Meanwhile, students can intuitively know the misspelled word, the position of the misspelled word and the correct candidate word corresponding to the misspelled word in the homework text.
FIG. 4 is a flow chart of a specific implementation of a data processing method according to an embodiment of the present invention. Fig. 5 is a data flow chart of a data processing method according to an embodiment of the present invention. Referring to fig. 4 and fig. 5, when performing an altering operation, the data processing method according to the embodiment of the present invention first obtains at least one original text picture, and classifies the original text picture according to a text direction of each original text picture by using resnet to obtain a classification result. And correcting the text direction of the original text picture with the deviation according to the classification result to obtain the input text picture corresponding to each original text picture.
In this embodiment, the following steps of the data processing method of this embodiment will be described by taking the input text picture in fig. 5 as an example. A total of 4 lines of text content are displayed in the input text picture a.
It should be noted that, in this embodiment, graphic symbols with different combinations are used to represent text contents corresponding to different lines in the input text picture, which is only used to facilitate description of the technical solution of this embodiment.
According to the above data processing method, the method for job correction in the input text picture a includes the steps of:
And carrying out text detection on the corrected input text picture A through a PAN text detection network to obtain first positions S1, S2, S3 and S4 respectively. Wherein S1, S2, S3 and S4 are used to characterize the starting position of the text content of the first to fourth lines on the input text picture a, respectively.
And cutting the input text picture A according to the first positions S1, S2, S3 and S4 to obtain first text pictures A1, A2, A3 and A4 respectively. Wherein A1, A2, A3 and A4 are used to characterize text content displayed on the first, second, third and fourth lines, respectively.
The following description will be made taking the text content "Have you a nace day" in the first text picture A1 as an example.
In this embodiment, a crnn+ctc text recognition network is used to recognize the content in the first text picture A1, so as to obtain a first text sequence, where the content of the first text sequence is "Have you a nace day".
And segmenting the first text sequence 'Have you a nace day' according to semantics through nltk open source tools to obtain a second text sequence, wherein the text contents in the second text sequence are A11, A12, A13, A14 and A15 respectively. Wherein A11, A12, A13, A14 and A15 are "Have", "you", "a", "nace" and "day", respectively.
The second positions S11, S12, S13, S14, and S15 are obtained from the first position S1, the first text sequence "Have you a nace day", and the second text sequences "Have", "you", "a", "nace", "day". Wherein S11, S12, S13, S14 and S15 are used to characterize the positions of english words Have, you, a, nace and day, respectively, in the input text picture a.
And adopting PYENCHANT tools to automatically spell-check text contents "Have", "you", "a", "nace" and "day" in the second text sequence, and obtaining a spell-check result. The spell check results are english words nace for characterizing word misspellings of english words nace.
And obtaining an error correction result according to the spelling check result and the second position, wherein the error correction result is that the English word nace at the position of the input text picture S13 is misspelled.
The correct candidate word nice is recommended at the second location S13 by means of the PYENCHANT component according to the error correction result.
The correction result is displayed, and the correction result of the present embodiment includes misspelled english word nace and correct candidate word nice at the position of the input picture S13.
Therefore, the data processing method replaces manual correction operation of a teacher, and the automation degree and efficiency of operation correction can be improved. Meanwhile, students can intuitively acquire the content and the position of the English word with misspelling by looking at the displayed correction result, and can know the correct word spelling by looking at the candidate words, thereby being beneficial to improving the learning rate of the students.
According to the technical scheme, the first position and at least one first text picture are obtained through text detection on the input text picture, a corresponding first text sequence is obtained according to the first text picture, the first text sequence is segmented to obtain at least one second text sequence, the second position is obtained according to the first position, the first text sequence and the second text sequence, spell checking is conducted on the second text sequence, a spell checking result is obtained, and an error correction result is obtained according to the spell checking result and the second position. Thereby, the automation degree and the efficiency of the operation correction are improved.
Fig. 6 is a block diagram of a data processing apparatus according to an embodiment of the present invention. As shown in fig. 6, the data processing apparatus of the present embodiment includes an acquisition unit 1, a detection segmentation unit 2, a recognition unit 3, a word segmentation unit 4, a determination unit 5, a check unit 6, and an integration unit 7.
The acquisition unit 1 is used for acquiring an input text picture.
In this embodiment, the input text picture includes at least one picture of the job to be modified.
In an alternative implementation, when there is a deviation in the position direction of the picture of the job to be modified, as shown in fig. 6, the acquisition unit 1 includes a sub-acquisition unit 11, a classification unit 12, and a correction unit 13.
In the present embodiment, the sub-acquisition unit 11 is configured to acquire at least one original text picture.
In an alternative implementation, students can write homework on special answering papers and scan texts on the answering papers through special scanner equipment to obtain original text pictures.
In another alternative implementation, the job may be written on plain paper and the original text image is obtained by scanning the text in the job with scanning software installed on the mobile device.
The classifying unit 12 is configured to classify the at least one original text picture according to a text direction, so as to obtain a classification result.
In this embodiment, at least one original text picture is classified according to the difference of the text directions, and the original text picture is classified by 0 °, 90 °, 180 °, and 270 ° based on the starting position of the text content on the paper and the vertical direction of the paper.
The correcting unit 13 is configured to correct the direction of the original text picture according to the classification result, and obtain the input text picture. Therefore, the original text pictures with deviation are corrected according to the classification results in different directions, so that the directions of the input text pictures corresponding to all the original text pictures are consistent, the influence of the inconsistent directions on the operation correction process and the operation correction result is avoided, and the improvement of the operation correction efficiency and accuracy is facilitated.
The detection and segmentation unit 2 is configured to perform text detection on an input text picture, so as to obtain a first position and at least one first text picture.
In this embodiment, the first position is a position of text content at each line level on a text picture, and the first text picture is a text picture at a line level of the text picture.
Preferably, as shown in fig. 6, the detection and segmentation unit 2 includes a detection unit 21 and a segmentation unit 22.
In this embodiment, the detecting unit 21 is configured to input an input text picture to the text detection network to obtain the first position.
Preferably, the detection unit of the embodiment is configured as a PAN (PSENet 2) network, and performs text detection on the content of the input text picture through the PAN (PSENet 2) network, and obtains the first position, so that the detection unit not only can adapt to text detection of different formats and contents, but also has good text segmentation effect.
The segmentation unit 22 is configured to segment the input text picture according to a first position to obtain at least one first text picture.
Preferably, the segmentation unit and the detection unit 21 in this embodiment use the same PAN (PSENet 2) network, so as to further achieve segmentation of the input text picture.
The recognition unit 3 is configured to obtain a corresponding first text sequence according to the first text picture.
In this embodiment, the first text sequence is a line-level text on a text picture.
Preferably, the recognition unit 3 in this embodiment is configured as a text recognition network with a crnn+ctc structure, and recognizes the text in the located at least one first text picture area through the crnn+ctc text recognition network, and converts the text content in the first text picture area into character information.
The word segmentation unit 4 is configured to perform semantic word segmentation on the first text sequence to obtain at least one second text sequence.
In this embodiment, the second text sequence is word-level text of the first text picture.
In an alternative implementation manner, the word segmentation unit 4 in this embodiment is configured as nltk tools, and the nltk tools are used to segment the first text sequence to obtain the second text sequence.
The determining unit 5 is configured to obtain a second position according to the first position, the first text sequence and the second text sequence.
In this embodiment, the second position is a position of the text content of each word level on the text picture.
The checking unit 6 is configured to perform a spell check on the second text sequence, to obtain a spell check result.
Preferably, the checking unit 6 in this embodiment is configured as PYENCHANT tool kit, and the second text sequence is spell checked by using PYENCHANT tool, so as to obtain a spell check result.
The integrating unit 7 is used for obtaining an error correction result according to the spelling check result and the second position.
In this embodiment, the integration unit 7 combines the spelling check result and the second position to obtain the error correction result, so that the error correction result is more abundant in content, and the students can know the misspelled word content and the position of the misspelled word in time.
In an alternative implementation, in order to facilitate observation and statistics of the result of job modification, the data processing apparatus of the embodiment of the present invention further includes a recommending unit 8 and a displaying unit 9.
The recommending unit 8 is used for recommending correct candidate words according to the error correction result.
The display unit 9 is used for displaying the result of the correction.
In this embodiment, the correction result includes an error correction result and a candidate word. Therefore, the correction result and the candidate words in the operation text are displayed to replace the operations of manually correcting the operation by a teacher and marking the misspelled words and marking the correctly spelled words, so that the workload of correcting the operation by the teacher is reduced, and the automation degree and the efficiency of correcting the operation are improved. Meanwhile, students can intuitively know the misspelled word, the position of the misspelled word and the correct candidate word corresponding to the misspelled word in the homework text.
Fig. 7 is a schematic diagram of an electronic device according to an embodiment of the invention. As shown in fig. 7, the electronic device 10 shown in fig. 7 is a general-purpose data processing apparatus including a general-purpose computer hardware structure including at least a processor 101 and a memory 102. The processor 101 and the memory 102 are connected by a bus 103. The memory 102 is adapted to store instructions or programs executable by the processor 101. The processor 101 may be a separate microprocessor or may be one or at least one microprocessor set. Thus, the processor 101 implements processing of data and control of other devices by executing instructions stored by the memory 102 to perform the method flows of embodiments of the invention as described above. Bus 103 connects the at least one component together and connects the component to display controller 104 and to display devices and input/output (I/O) devices 105. Input/output (I/O) device 105 may be a mouse, keyboard, modem, network interface, touch input device, somatosensory input device, printer, and other devices known in the art. Typically, the input/output devices 105 are connected to the system through input/output (I/O) controllers 106.
It will be apparent to those skilled in the art that embodiments of the present application may be provided as a method, apparatus (device) or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations of methods, apparatus (devices) and computer program products according to embodiments of the application. It will be understood that each of the flows in the flowchart may be implemented by computer program instructions.
These computer program instructions may be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart block or blocks.
These computer program instructions may also be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart block or blocks.
Another embodiment of the present invention is directed to a computer readable storage medium storing a computer readable program for causing a computer to perform some or all of the above-described method embodiments.
That is, it will be understood by those skilled in the art that all or part of the steps in implementing the methods of the embodiments described above may be implemented by specifying relevant hardware by a program, where the program is stored in a storage medium, and includes several instructions for causing a device (which may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform all or part of the steps in the methods of the embodiments of the application. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, and various modifications and variations may be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method of data processing, the method comprising:
acquiring an input text picture;
Performing text detection on the input text picture to obtain a first position and at least one first text picture, wherein the first position is the position of text content of each line level on the input text picture, and the first text picture is the line-level text picture of the input text picture;
Obtaining a corresponding first text sequence according to the first text picture, wherein the first text sequence is a text of a line level on the input text picture;
word segmentation is carried out on the first text sequence to obtain at least one second text sequence, wherein the second text sequence is text of word level of the first text picture;
Obtaining a second position according to the first position, the first text sequence and the second text sequence, wherein the second position is the position of text content of each word level on the input text picture;
performing spelling check on the second text sequence to obtain a spelling check result; and
Obtaining an error correction result according to the spelling check result and the second position;
wherein the obtaining the second position according to the first position, the first text sequence and the second text sequence includes:
acquiring the position of text content of each word level in a corresponding first text picture according to the second text sequence;
Acquiring the positions of images corresponding to each second text sequence in the input text pictures according to the first positions;
The text detection of the input text picture to obtain a first position and at least one first text picture includes:
inputting the input text picture into a text detection neural network model to obtain the first position;
dividing the input text picture according to the first position to obtain at least one first text picture;
the step of dividing the input text picture according to the first position to obtain at least one first text picture comprises the following steps:
Inputting the input text picture into a residual error network to obtain at least one characteristic image;
And processing the at least one characteristic image through a breadth-first algorithm to obtain the at least one first text picture.
2. The data processing method according to claim 1, wherein the acquiring the input text picture includes:
Acquiring at least one original text picture;
Classifying the at least one original text picture according to the text direction to obtain a classification result; and
And correcting the direction of the original text picture according to the classification result, and acquiring the input text picture.
3. The data processing method according to claim 2, wherein the classifying the at least one original text picture according to the text direction specifically includes:
inputting the at least one original text picture into a classification neural network model, and taking the output result of the classification neural network model as a classification result.
4. The method of claim 1, wherein the obtaining the corresponding first text sequence according to the first text picture specifically includes:
and inputting the first text picture into a text recognition network, and obtaining the first text sequence according to an output result of the text recognition network.
5. The data processing method according to claim 1, wherein the word segmentation of the first text sequence to obtain at least one second text sequence specifically includes:
and carrying out semantic word segmentation on the first text sequence based on a natural language processing library to obtain the second text sequence.
6. The method for processing data according to claim 1, wherein the spell checking is performed on the second text sequence to obtain a spell checking result specifically:
And performing spell checking on the second text sequence based on a spell checking tool to obtain a spell checking result.
7. The data processing method of claim 1, wherein after the obtaining an error correction result based on the spell check result and the second location, the method further comprises:
recommending correct candidate words according to the error correction result; and
And displaying a correction result, wherein the correction result comprises the error correction result and a candidate word.
8. A data processing apparatus, the apparatus comprising:
the acquisition unit is used for acquiring an input text picture;
the detection and segmentation unit is used for carrying out text detection on the input text picture to obtain a first position and at least one first text picture, wherein the first position is the position of text content of each line level on the input text picture, and the first text picture is the line-level text picture of the input text picture;
the identification unit is used for obtaining a corresponding first text sequence according to the first text picture, wherein the first text sequence is a text of a line level on the input text picture;
the word segmentation unit is used for segmenting the first text sequence to obtain at least one second text sequence, wherein the second text sequence is a word-level text of the first text picture;
The determining unit is used for obtaining a second position according to the first position, the first text sequence and the second text sequence, wherein the second position is the position of the text content of each word level on the input text picture;
The checking unit is used for performing spelling check on the second text sequence to obtain a spelling check result; and
The integration unit is used for obtaining an error correction result according to the spelling check result and the second position;
Wherein the determining unit is further configured to:
acquiring the position of text content of each word level in a corresponding first text picture according to the second text sequence;
Acquiring the positions of images corresponding to each second text sequence in the input text pictures according to the first positions;
wherein, detect segmentation unit includes:
The detection unit is used for inputting the input text picture into the text detection network to obtain a first position;
The segmentation unit is used for segmenting the input text picture according to the first position to obtain at least one first text picture;
wherein, the segmentation unit is further used for:
Inputting the input text picture into a residual error network to obtain at least one characteristic image;
And processing the at least one characteristic image through a breadth-first algorithm to obtain the at least one first text picture.
9. An electronic device comprising a memory and a processor, wherein the memory is configured to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method of any of claims 1-7.
10. A computer readable storage medium, on which computer program instructions are stored, which computer program instructions, when executed by a processor, implement the method of any of claims 1-7.
CN202010969815.6A 2020-09-15 2020-09-15 Data processing method, device, electronic equipment and readable storage medium Active CN112199946B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010969815.6A CN112199946B (en) 2020-09-15 2020-09-15 Data processing method, device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010969815.6A CN112199946B (en) 2020-09-15 2020-09-15 Data processing method, device, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN112199946A CN112199946A (en) 2021-01-08
CN112199946B true CN112199946B (en) 2024-05-07

Family

ID=74015152

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010969815.6A Active CN112199946B (en) 2020-09-15 2020-09-15 Data processing method, device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN112199946B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109522900A (en) * 2018-10-30 2019-03-26 北京陌上花科技有限公司 Natural scene character recognition method and device
CN109583445A (en) * 2018-11-26 2019-04-05 平安科技(深圳)有限公司 Character image correction processing method, device, equipment and storage medium
CN110110585A (en) * 2019-03-15 2019-08-09 西安电子科技大学 Intelligently reading realization method and system based on deep learning, computer program
CN110851599A (en) * 2019-11-01 2020-02-28 中山大学 Automatic scoring method and teaching and assisting system for Chinese composition
CN111639646A (en) * 2020-05-18 2020-09-08 山东大学 Test paper handwritten English character recognition method and system based on deep learning

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110280481A1 (en) * 2010-05-17 2011-11-17 Microsoft Corporation User correction of errors arising in a textual document undergoing optical character recognition (ocr) process

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109522900A (en) * 2018-10-30 2019-03-26 北京陌上花科技有限公司 Natural scene character recognition method and device
CN109583445A (en) * 2018-11-26 2019-04-05 平安科技(深圳)有限公司 Character image correction processing method, device, equipment and storage medium
CN110110585A (en) * 2019-03-15 2019-08-09 西安电子科技大学 Intelligently reading realization method and system based on deep learning, computer program
CN110851599A (en) * 2019-11-01 2020-02-28 中山大学 Automatic scoring method and teaching and assisting system for Chinese composition
CN111639646A (en) * 2020-05-18 2020-09-08 山东大学 Test paper handwritten English character recognition method and system based on deep learning

Also Published As

Publication number Publication date
CN112199946A (en) 2021-01-08

Similar Documents

Publication Publication Date Title
US10699111B2 (en) Page segmentation of vector graphics documents
CN113158808B (en) Method, medium and equipment for Chinese ancient book character recognition, paragraph grouping and layout reconstruction
CN111597908A (en) Test paper correcting method and test paper correcting device
US8208737B1 (en) Methods and systems for identifying captions in media material
KR20180077152A (en) Systems and methods for guiding handwriting input
CN113255652B (en) Text correction method, device, equipment and medium
CN110737785B (en) Picture labeling method and device
CN108153915B (en) Internet-based educational information rapid acquisition method
CN110147546B (en) Grammar correction method and device for spoken English
CN112149680B (en) Method and device for detecting and identifying wrong words, electronic equipment and storage medium
CN112417899A (en) Character translation method, device, computer equipment and storage medium
CN112347997A (en) Test question detection and identification method and device, electronic equipment and medium
CN115661836A (en) Automatic correction method, device and system and readable storage medium
CN113673294B (en) Method, device, computer equipment and storage medium for extracting document key information
CN113610068B (en) Test question disassembling method, system, storage medium and equipment based on test paper image
CN112199946B (en) Data processing method, device, electronic equipment and readable storage medium
CN115880708A (en) Method for detecting character paragraph spacing compliance in APP (application) aging-adapted mode
US20220414336A1 (en) Semantic Difference Characterization for Documents
KR102467096B1 (en) Method and apparatus for checking dataset to learn extraction model for metadata of thesis
US20210042555A1 (en) Information Processing Apparatus and Table Recognition Method
JP2008027133A (en) Form processor, form processing method, program for executing form processing method, and recording medium
JP2007164719A (en) Line direction judgement program, method, and device
CN112183253A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN111859943A (en) Study method and system for identifying source of examination words and sentences
CN112966689B (en) Text recognition method, apparatus, electronic device and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant