Data labeling method, device and electronic equipment
By analyzing and single-word recognition of handwritten input logs, automatic labeling of handwritten input samples is realized, solving the problem of high manual labeling costs, and improving the efficiency of model iterative updates and recognition accuracy.
Patent Information
- Application Number
- CN202010950078.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-09
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2040-09-09
AI Technical Summary
In the prior art, the cost of manually labeling handwritten input samples is too high, resulting in low model iteration update efficiency.
By analyzing the handwritten input log, converting it into an input handwriting image, and single-word recognition is performed based on user input parameters, and sample data is automatically marked for handwritten input recognition model for model training.
Automatic labeling of handwritten input samples is realized, reducing manual labeling costs, improving the efficiency of model iterative updates and identification accuracy.
Smart Images

Figure CN114241488B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of software technology, and in particular to a data labeling method, device and electronic equipment. Background Art
[0002] The handwriting input method can be used for rare characters, unfamiliar characters and for the middle-aged and elderly. The handwriting input method is very simple to use. After writing a character, the application will provide candidate options according to the written character. If the character is in the candidate options, just click on it on the screen. If not, you can rewrite it or cancel it.
[0003] In the iterative process, the handwriting input method often continuously updates the recognition ability of the input handwriting based on the user's handwriting to improve the recognition efficiency and accuracy, thereby increasing the speed of handwriting input. This iterative update process is often implemented through a model, which requires a large number of training samples. However, at present, the annotation of training samples is usually completed by manual annotation, and a lot of manpower and material resources are required to obtain high-quality data. Summary of the invention
[0004] Embodiments of the present invention provide a data annotation method, device, and electronic device for realizing automatic annotation of handwriting input samples, thereby solving the technical problem of excessively high model iteration and updating costs caused by manual annotation in the prior art.
[0005] An embodiment of the present invention provides a data annotation method, which is applied to a handwriting input method. The method includes:
[0006] Parse the handwriting input log to obtain the coordinate points of the input handwriting and the user input parameters;
[0007] Based on the coordinate points of the input handwriting, convert and obtain an input handwriting image;
[0008] Based on the user input parameters and the input handwriting image, performing single word recognition on the input handwriting image;
[0009] Based on the single-word recognition result, sample annotation is performed on the input log and the annotation data is stored for model training of the handwriting input recognition model.
[0010] Optionally, the performing sample annotation on the input log based on the single word recognition result and storing the annotation data includes:
[0011] If the recognition result indicates that the input handwriting image is not a single word, finding the segmentation points of the input handwriting image, and obtaining the input handwriting segmentation image based on the combination of the segmentation points;
[0012] Based on the user input parameters, performing single word recognition of segmented words on the input handwriting segmentation image;
[0013] Based on the single word recognition result set of all segmented words, a single word segmentation image and segmentation data corresponding to the single word segmentation image are obtained;
[0014] The input log is sample labeled based on the single-word segmentation image and the segmentation data, and the labeled data is stored.
[0015] Optionally, based on the single word recognition result set of all segmented words, obtaining a single word segmentation image and segmentation data corresponding to the single word segmentation image includes:
[0016] If the single word recognition result set of all segmented words is inconsistent with the user's upper screen multiple words, the segmentation point is re-searched and the single word recognition of the segmented words is performed until the single word segmentation image and the segmentation data are obtained.
[0017] Optionally, the performing sample annotation on the input log based on the single word recognition result and storing the annotation data includes:
[0018] If the single word recognition result indicates that the recognition object is a single word, obtaining the probability corresponding to the single word recognition result that the recognition object is a single word;
[0019] Based on the probability and a preset probability threshold, sample annotation is performed on the input log and the annotation data is stored.
[0020] Optionally, the performing sample labeling on the input log and storing the labeling data based on the probability and a preset probability threshold includes:
[0021] Determine whether the probability is greater than the probability threshold; if so, mark the input handwriting image as a single word; if not, determine whether the target single word in the recognition result is in the first n candidate items provided by the input method, n≥1;
[0022] If the target word is in the first n candidate items, the input handwriting image is marked as a word; if the target word is not in the first n candidate items, the input log is marked as a difficult sample.
[0023] Optionally, the performing sample annotation on the input log based on the single word recognition result and storing the annotation data includes:
[0024] If the single-word recognition result indicates that the recognition object is a single word, determine whether the target single word in the recognition result is consistent with the user's upper screen item. If so, mark the input handwriting image as a single word and store the marking data.
[0025] Optionally, the method further includes:
[0026] When the number of labeled samples is greater than the number threshold, the computing resources of the current device are obtained;
[0027] Based on the computing resources and the labeled samples, the handwriting input recognition model is triggered to perform model training.
[0028] An embodiment of the present invention further provides a data labeling device, the device comprising:
[0029] A parsing unit, used to parse the handwriting input log to obtain the coordinate points of the input handwriting and the user input parameters;
[0030] A conversion unit, used for converting and obtaining an input handwriting image based on the coordinate points of the input handwriting;
[0031] A recognition unit, used for performing single word recognition on the input handwriting image based on the user input parameter and the input handwriting image;
[0032] The labeling unit is used to label the input log based on the single word recognition result and store the labeling data for the handwriting input recognition model to perform model training.
[0033] Optionally, the marking unit includes: a segmentation unit, for finding segmentation points of the input handwriting image when the recognition result indicates that the input handwriting image is not a single word, and obtaining an input handwriting segmentation image based on a combination of the segmentation points;
[0034] The recognition unit is also used for: performing single word recognition of segmented words on the input handwriting segmentation image based on the user input parameters;
[0035] The segmentation unit is also used to: obtain a single-word segmentation image and segmentation data corresponding to the single-word segmentation image based on a single-word recognition result set of all segmented words;
[0036] The labeling unit further includes: a sample labeling unit, which is used to perform sample labeling on the input log based on the single-word segmentation image and the segmentation data and store the labeling data.
[0037] Optionally, the segmentation unit is further used for:
[0038] If the single word recognition result set of all segmented words is inconsistent with the user's upper screen multiple words, the segmentation point is re-searched and the single word recognition of the segmented words is performed until the single word segmentation image and the segmentation data are obtained.
[0039] Optionally, the marking unit is further used for:
[0040] If the single word recognition result indicates that the recognition object is a single word, obtaining the probability corresponding to the single word recognition result that the recognition object is a single word;
[0041] Based on the probability and a preset probability threshold, sample annotation is performed on the input log and the annotation data is stored.
[0042] Optionally, the marking unit is further used for:
[0043] Determine whether the probability is greater than the probability threshold; if so, mark the input handwriting image as a single word; if not, determine whether the target single word in the recognition result is in the first n candidate items provided by the input method, n≥1;
[0044] If the target word is in the first n candidate items, the input handwriting image is marked as a word; if the target word is not in the first n candidate items, the input log is marked as a difficult sample.
[0045] Optionally, the marking unit is further used for:
[0046] If the single-word recognition result indicates that the recognition object is a single word, determine whether the target single word in the recognition result is consistent with the user's upper screen item. If so, mark the input handwriting image as a single word and store the marking data.
[0047] Optionally, the device further comprises a training unit, wherein the training unit is used to:
[0048] When the number of labeled samples is greater than the number threshold, the computing resources of the current device are obtained;
[0049] Based on the computing resources and the labeled samples, the handwriting input recognition model is triggered to perform model training.
[0050] The above one or more technical solutions in the embodiments of the present invention have at least the following technical effects:
[0051] The embodiment of the present invention provides a data annotation method, which parses a handwriting input log to obtain the coordinate points of the input handwriting and the user input parameters; based on the coordinate points of the input handwriting, converts to obtain an input handwriting image; based on the user input parameters and the input handwriting image, performs single word recognition on the input handwriting image; based on the single word recognition result, performs sample annotation on the input log and stores the annotation data for model training of the handwriting input recognition model. By converting the coordinate points of the input handwriting, the input handwriting is converted into an image and single word recognition is performed with reference to the user input parameters, and sample annotation is performed according to the recognition result, thereby realizing the automation of sample annotation, and performing sample annotation by single word recognition simplifies the difficulty of text recognition, improves recognition efficiency and thus improves annotation efficiency, solves the technical problem of high cost of iterative update of manual annotation in the prior art, and improves the efficiency of sample annotation. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1A schematic diagram of a flow chart of a data labeling method provided by an embodiment of the present invention;
[0053] Figure 2 A flow chart of a method for segmenting an input handwriting image provided by an embodiment of the present invention;
[0054] Figure 3 A block diagram of a data labeling device provided in an embodiment of the present invention;
[0055] Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0056] In the technical solution provided in the embodiment of the present invention, a data labeling method is provided, which performs sample labeling by means of single-word recognition, thereby realizing automation of sample labeling, so as to solve the technical problem of excessively high cost of iterative updating of manual labeling in the prior art.
[0057] The main implementation principles, specific implementation methods and corresponding beneficial effects of the technical solutions of the embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0058] Example
[0059] Please refer to Figure 1 The embodiment of the present invention provides a data annotation method, which is applied to a handwriting input method. The method includes:
[0060] S11, parsing the handwriting input log to obtain the coordinate points of the input handwriting and the user input parameters;
[0061] S13, converting and obtaining an input handwriting image based on the coordinate points of the input handwriting;
[0062] S15, based on the user input parameters and the input handwriting image, performing single word recognition on the input handwriting image;
[0063] S17. Based on the single-word recognition result, sample annotation is performed on the input log and the annotation data is stored for model training of the handwriting input recognition model.
[0064] In the specific implementation process, the handwriting input log is used to record the handwriting input behavior of the user when using the handwriting input method, such as the user's handwriting input "I" appears on the screen. S11 parses the handwriting input log to obtain the coordinates of the user's input handwriting and the user input parameters. Among them, the coordinate points of the input handwriting are the coordinate points corresponding to each stroke when the user writes on the electronic device. The user input parameters include the candidate items provided by the input method corresponding to the user's input handwriting and the upper screen items of the user, or one or more of the following parameters: user ID (Identity Document, identity identification number), date of use, version number of the handwriting input method used, and timestamp, etc. Different users have different ways of handwriting input. The user ID can be used to effectively distinguish users, and different data annotation and model training are performed for different users. S11 can perform log analysis on time, such as automatic analysis at a scheduled time every day, or it can be analyzed after detecting the generation of a handwriting input log. The data obtained by analysis is stored in the database for subsequent use.
[0065] For the input handwriting coordinate points obtained in S11, S13 is executed to convert and obtain the user input handwriting image. Specifically, the user's input handwriting can be restored by connecting each coordinate point, and then the restored input handwriting is converted into an image format to obtain the input handwriting image. The image size of the input handwriting image can be 64x64.
[0066] After S13, continue to execute S15 to perform single word recognition. Specifically, NAS (Neural Architecture Search) can be used to search CNN (Convolutional Neural Networks) network structure for single word recognition. The CNN network structure searched by NAS is a pre-trained handwritten single word recognition model. Single word recognition is mainly used to identify whether the input handwriting in the input image is a single word, and if it is a single word, which word is the specific word. Correspondingly, after single word recognition, the single word recognition result is obtained, including: the probability of characterizing the recognition object as a single word and the target word (when it is recognized as a single word).
[0067] Based on the recognition result obtained by S15, S17 is further executed to annotate the input log samples and store the annotated data for the handwriting input recognition model to perform model training. Among them, when the target word in the recognition result is consistent with the user's screen item, the data label is the user's screen item and is marked as "0"; when the recognition probability value is very high, that is, the probability is greater than the probability threshold, regardless of whether the recognition result is consistent with the user's screen item, the data label is the target word and is marked as "1"; when the recognition probability is very low, such as the probability is less than the probability threshold, and the target word in the recognition result is not among the five online candidates, it is marked as "2", that is, it is a difficult sample. The difficult sample will be put into the manual annotation system, and after being manually reviewed and annotated, it will be stored in the annotation database.
[0068] In the specific implementation process, this implementation can automatically train and iterate the handwriting input recognition model. Specifically, the number of labeled samples is counted, and when the number of labeled samples is greater than the number threshold, the computing resources of the current device are obtained; based on the computing resources and the labeled samples, the handwriting input recognition model is triggered to perform model training. For the automatically started online model training, the final training accuracy can determine whether the training model is online.
[0069] Based on the above method provided in this embodiment, the handwriting input recognition model is independently completed by the electronic device from sample labeling to model training, realizing full automation of model training, improving the rate of model iteration and updating, thereby continuously improving the accuracy of model recognition.
[0070] In a specific application, when a user writes, he often writes multiple words at a time. When S15 performs single word recognition, it may not be able to recognize a single word due to the influence of multiple words. Then the recognition result will indicate that the input handwriting image is not a single word. Figure 2 As shown, this embodiment further performs the following steps:
[0071] S21, finding segmentation points of the input handwriting image, and obtaining the input handwriting segmentation image based on the combination of segmentation points.
[0072] Specifically, the input handwriting image corresponds to the coordinate points of each stroke, and the segmentation point can be obtained based on the coordinate points where each stroke ends. For example, for "we", the coordinate point of the stroke "," can be used as the segmentation point; the segmentation point can also be obtained based on the distance between the strokes. For example, the distance between the two words "we" is usually greater than the distance between each stroke in a single word, and the midpoint of the distance can be used as the segmentation point.
[0073] S22. Based on the user input parameters, single word recognition of segmented characters is performed on the input handwriting segmentation image.
[0074] Similarly, NAS can be used to search the CNN network structure for single-word recognition of segmented characters.
[0075] S23. Based on the single word recognition result set of all segmented words, obtain the target word and segmentation data corresponding to the single word segmentation image.
[0076] In the specific implementation process, after the input handwriting is segmented, it usually corresponds to multiple characters. If the set of single-character recognition results of the segmented characters corresponding to the multiple characters is the same as the multiple characters input by the user on the screen, it indicates that the input handwriting segmentation is successful. Obtain the target characters and segmentation data corresponding to the single-character segmentation images in the recognition results, and continue to execute S24; if the set of single-character recognition results of all segmented characters is inconsistent with the multiple characters input by the user on the screen, it is necessary to re-find the segmentation point and perform the single-character recognition of the segmented characters, that is, re-execute S22 and S23 until the single-character segmentation image and its segmentation data are obtained.
[0077] For example: for the handwritten input of "我们" (We), the first segmentation is made from the 6th stroke of the character "我" (I), resulting in the 7th stroke "," being combined with the character "们" (们). When recognizing this segmented image, both of the two characters after segmentation will be incorrect. At this time, re-segmentation and recognition will be performed until the characters "我" (I) and "们" (们) are recognized, and then annotation will be carried out.
[0078] S24. Based on the single-character segmentation image and segmentation data, perform sample annotation on the input log and store the annotation data. Among them, the execution method of S24 is the same as that of S17.
[0079] Specifically, S17 performs sample annotation on the input log based on the single-character recognition result and stores the annotation data. When the single-character recognition result indicates that the recognition object is a single character, the probability of the single-character recognition result can be obtained; based on the probability and a preset probability threshold, perform sample annotation on the input log and store the annotation data. Sometimes, due to reasons such as user input errors or random input, the item on the screen often does not match the user's input. Therefore, if the handwritten input log is directly annotated based on the item on the screen by the user, it is often inaccurate. For example: the user handwrites "好" (good), but the item on the screen is "的" (of). At this time, the recognition result "好" (good) is actually correct, but if it is judged based on the item on the screen "的" (of), the recognition result "好" (good) is considered wrong.
[0080] To avoid the above errors, in this embodiment, before performing annotation when the single-character recognition result indicates that the recognition object is a single character, first judge whether the probability is greater than the preset probability threshold; if so, it is considered that the recognition is correct, and the input handwriting image is annotated as the single character corresponding to the recognition result, such as annotating the corresponding sample as "1"; if not, it is considered that the credibility of the recognition result is not high, and it can be further judged whether the target single character in the recognition result is in the first n candidate items provided by the input method (i.e., the topn candidate items), n≥1, generally n can be taken as 3, 4 or 5; if the target single character is in the first n candidate items, the input handwriting image is annotated as a single character, such as annotating the corresponding sample as "0"; if the target single character is not in the first n candidate items, the input log is annotated as a difficult sample, such as annotating the corresponding sample as "2".
[0081] Of course, during the specific implementation process, when the input log is marked with samples based on the single-word recognition results, when the single-word recognition results show that the recognition object is a single word, it is also possible to determine whether the target single word in the recognition result is consistent with the user's screen item. If so, the input handwriting image is marked as a single word, but at this time the single word marking should be distinguished from the single word marked with the above probability, such as marking the corresponding sample as "0". If the target word is inconsistent with the user's screen item, it is further marked according to the probability and probability threshold. This is conducive to the model providing corresponding candidate items according to the user's personalized input. For example: the user's handwriting input "Q" corresponds to the screen "mother", then after the model is trained based on the marked sample, the candidate item "mother" can be set as the first candidate item, that is, the default screen item, corresponding to the handwriting input "Q". This can save the user's screen operation and improve the efficiency of handwriting input.
[0082] In the above embodiment, on the one hand, by converting the input handwriting coordinate points, the input handwriting is converted into an image and single-word recognition is performed with reference to the user input parameters, and sample annotation is performed according to the recognition result, thereby realizing the automation of sample annotation, and sample annotation by single-word recognition simplifies the difficulty of text recognition, improves the recognition efficiency and thus improves the annotation efficiency, solves the technical problem of the high cost of iterative update of manual annotation in the prior art, and improves the efficiency of sample annotation. On the other hand, single-word segmentation and recognition are performed through segmentation points, thereby reducing the complexity of multi-word recognition, realizing multi-word recognition through a single-word recognition model, and simplifying the complexity of the handwriting input method.
[0083] A data labeling method is provided in accordance with the above embodiment. The present invention also provides a data labeling device. Figure 3 , the device comprises:
[0084] The parsing unit 31 is used to parse the handwriting input log to obtain the coordinate points of the input handwriting and the user input parameters;
[0085] A conversion unit 32, used for converting and obtaining an input handwriting image based on the coordinate points of the input handwriting;
[0086] A recognition unit 33, configured to perform single word recognition on the input handwriting image based on the user input parameter and the input handwriting image;
[0087] The labeling unit 34 is used to label the input log samples based on the single word recognition results and store the labeling data for the handwriting input recognition model to perform model training.
[0088] As an optional implementation, the marking unit 34 includes: a segmentation unit, for finding segmentation points of the input handwriting image when the recognition result indicates that the input handwriting image is not a single word, and obtaining an input handwriting segmentation image based on a combination of the segmentation points;
[0089] The recognition unit 33 is also used for: performing single word recognition of segmented words on the input handwriting segmentation image based on the user input parameters;
[0090] The segmentation unit is also used to: obtain a single-word segmentation image and segmentation data corresponding to the single-word segmentation image based on a single-word recognition result set of all segmented words;
[0091] The labeling unit 34 further includes: a sample labeling unit, which is used to label the input log with samples based on the single-word segmentation image and the segmentation data and store the labeling data.
[0092] Furthermore, the segmentation unit is also used to: if the single word recognition result set of all segmented words is inconsistent with the user's upper screen multi-words, re-find the segmentation point and perform single word recognition of the segmented words until the single word segmentation image and the segmentation data are obtained.
[0093] As an optional implementation, the labeling unit 34 is also used for: if the single-word recognition result indicates that the recognition object is a single word, obtaining the probability corresponding to the single-word recognition result that the recognition object is a single word; based on the probability and a preset probability threshold, labeling the input log sample and storing the labeling data. Specifically, determine whether the probability is greater than the probability threshold; if so, label the input handwriting image as a single word; if not, determine whether the target single word in the recognition result is in the first n candidate items provided by the input method, n≥1; if the target single word is in the first n candidate items, label the input handwriting image as a single word; if the target single word is not in the first n candidate items, label the input log as a difficult sample.
[0094] As an optional implementation, the labeling unit 34 is also used for: if the single-word recognition result indicates that the recognition object is a single word, determining whether the target single word in the recognition result is consistent with the user's upper screen item; if so, labeling the input handwriting image as a single word and storing the labeling data.
[0095] As an optional implementation, the device also includes a training unit 35, and the training unit 25 is used to: when the number of labeled samples is greater than a quantity threshold, obtain computing resources of the current device; based on the computing resources and the labeled samples, trigger the handwriting input recognition model to perform model training.
[0096] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0097] Figure 4 1 is a block diagram of an electronic device 800 for implementing a data annotation method according to an exemplary embodiment. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0098] Reference Figure 4 , the electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / display (I / O) interface 812 , a sensor component 814 , and a communication component 816 .
[0099] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0100] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0101] The power supply component 806 provides power to the various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 800.
[0102] The multimedia component 808 includes a screen that provides a display interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0103] The audio component 810 is configured to present and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for presenting audio signals.
[0104] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
[0105] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0106] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0107] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0108] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by a processor 820 of an electronic device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0109] A non-temporary computer-readable storage medium, when the instructions in the storage medium are executed by a processor of a mobile terminal, enables the mobile terminal to execute a data annotation method, the method comprising: parsing a handwriting input log to obtain the coordinate points of the input handwriting and user input parameters; based on the coordinate points of the input handwriting, converting to obtain an input handwriting image; based on the user input parameters and the input handwriting image, performing single-word recognition on the input handwriting image; based on the single-word recognition result, performing sample annotation on the input log and storing the annotation data for model training of a handwriting input recognition model.
[0110] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in this disclosure. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.
[0111] It should be understood that the present invention is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims. The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention shall be included in the scope of protection of the present invention.
Claims
1. A data labeling method, characterized in that: Applied to handwriting input method, the method comprises: Parse the handwriting input log to obtain the coordinate points of the input handwriting and the user input parameters; Based on the coordinate points of the input handwriting, convert and obtain an input handwriting image; Based on the user input parameters and the input handwriting image, performing single word recognition on the input handwriting image; Based on the single word recognition result, sample annotation is performed on the input log and the annotation data is stored for model training of the handwriting input recognition model; The step of performing sample tagging on the input log based on the single word recognition result and storing the tagging data includes: If the single word recognition result indicates that the recognition object is a single word, obtaining the probability corresponding to the single word recognition result that the recognition object is a single word; Based on the probability and a preset probability threshold, perform sample labeling on the input log and store the labeling data; The step of labeling the input log sample based on the probability and a preset probability threshold and storing the labeling data includes: Determine whether the probability is greater than the probability threshold; if so, mark the input handwriting image as a single word; if not, determine whether the target single word in the recognition result is in the first n candidate items provided by the input method, n≥1; If the target word is in the first n candidate items, the input handwriting image is marked as a word; if the target word is not in the first n candidate items, the input log is marked as a difficult sample.
2. The method according to claim 1, characterized in that The step of performing sample tagging on the input log based on the single word recognition result and storing the tagging data includes: If the recognition result indicates that the input handwriting image is not a single word, finding the segmentation points of the input handwriting image, and obtaining the input handwriting segmentation image based on the combination of the segmentation points; Based on the user input parameters, performing single word recognition of segmented words on the input handwriting segmentation image; Based on the single word recognition result set of all segmented words, a single word segmentation image and segmentation data corresponding to the single word segmentation image are obtained; The input log is sample labeled based on the single-word segmentation image and the segmentation data, and the labeled data is stored.
3. The method according to claim 2, characterized in that Based on the single word recognition result set of all segmented words, a single word segmentation image and segmentation data corresponding to the single word segmentation image are obtained, including: If the single word recognition result set of all segmented words is inconsistent with the user's upper screen multiple words, the segmentation point is re-searched and the single word recognition of the segmented words is performed until the single word segmentation image and the segmentation data are obtained.
4. The method according to claim 1, characterized in that The step of performing sample tagging on the input log based on the single word recognition result and storing the tagging data includes: If the single-word recognition result indicates that the recognition object is a single word, determine whether the target single word in the recognition result is consistent with the user's upper screen item. If so, mark the input handwriting image as a single word and store the marking data.
5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: When the number of labeled samples is greater than the number threshold, the computing resources of the current device are obtained; Based on the computing resources and the labeled samples, the handwriting input recognition model is triggered to perform model training.
6. A data labeling device, characterized in that: The device comprises: A parsing unit, used to parse the handwriting input log to obtain the coordinate points of the input handwriting and the user input parameters; A conversion unit, used for converting and obtaining an input handwriting image based on the coordinate points of the input handwriting; A recognition unit, used for performing single word recognition on the input handwriting image based on the user input parameter and the input handwriting image; A labeling unit, used for labeling samples of the input log based on the single word recognition result and storing the labeling data for model training of the handwriting input recognition model; The marking unit is also used for: If the single word recognition result indicates that the recognition object is a single word, obtaining the probability corresponding to the single word recognition result that the recognition object is a single word; Based on the probability and a preset probability threshold, perform sample labeling on the input log and store the labeling data; The marking unit is also used for: Determine whether the probability is greater than the probability threshold; if so, mark the input handwriting image as a single word; if not, determine whether the target single word in the recognition result is in the first n candidate items provided by the input method, n≥1; If the target word is in the first n candidate items, the input handwriting image is marked as a word; if the target word is not in the first n candidate items, the input log is marked as a difficult sample.
7. An electronic device, characterized in that: It includes a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors to execute the operation instructions corresponding to the method as described in any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps corresponding to the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Handwriting recognition method and system as well as handwriting recognition terminal
CN102750552A
Handwriting input method and system
CN110348306A