Textual evaluation methods, devices and electronic equipment

By segmenting characters by stroke and extracting feature information, the problem of lack of detailed evidence in the evaluation results of existing technologies is solved, and detailed text evaluation and learning guidance are realized.

CN116863489BActive Publication Date: 2026-03-06DMAI (GUANGZHOU) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-10
Publication Date
2026-03-06

AI Technical Summary

Technical Problem

Existing technologies only evaluate the text as a whole, and the evaluation results lack detailed evidence and cannot provide guidance for text modification.

Method used

By segmenting the text image to be evaluated into strokes, extracting stroke feature information, and combining it with stroke grouping information, a score is calculated to provide a detailed text evaluation.

Benefits of technology

It improves the accuracy and interpretability of written evaluations, provides detailed evaluation results, and helps with learning and teacher guidance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116863489B_ABST
    Figure CN116863489B_ABST
Patent Text Reader

Abstract

This application provides a text evaluation method, apparatus, and electronic device. The method includes: obtaining target feature information and stroke grouping information of the target text corresponding to the text to be evaluated based on an image of the text to be evaluated and a target text database; inputting the image of the text to be evaluated into a preset stroke segmentation model to obtain stroke images contained in the text to be evaluated; obtaining feature information of the text to be evaluated based on the stroke grouping information and the stroke images; and obtaining a score for the text to be evaluated based on the feature information and the target feature information. This application solves the problem in related technologies where only the overall text is evaluated, resulting in a lack of detailed evidence in the evaluation results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a text evaluation method, apparatus, and electronic device. Background Technology

[0002] Current methods for evaluating text using AI only assess the overall quality of the text by matching handwritten text with template text to arrive at an overall score. They cannot provide in-depth evaluation of handwritten text, the evaluation results lack detailed evidence, and they cannot offer guidance for text revision.

[0003] Therefore, existing technologies only evaluate the text as a whole, and the evaluation results lack detailed evidence. Summary of the Invention

[0004] This application provides a text evaluation method, apparatus, and electronic device to at least solve the problem in related technologies that only evaluate the text as a whole, and the evaluation results lack detailed evidence.

[0005] According to one aspect of the embodiments of this application, a text evaluation method is provided, the method comprising:

[0006] Based on the image of the text to be evaluated and the target text database, the target feature information and stroke grouping information of the target text corresponding to the text to be evaluated are obtained;

[0007] The image of the text to be evaluated is input into a preset stroke segmentation model to obtain the stroke image contained in the text to be evaluated.

[0008] Based on the stroke grouping information and the stroke image, the feature information of the character to be evaluated is obtained;

[0009] Based on the feature information and the target feature information, the score information of the text to be evaluated is obtained.

[0010] According to another aspect of the embodiments of this application, a text evaluation device is also provided, the device comprising:

[0011] The first module is used to obtain the target feature information and stroke grouping information of the target text corresponding to the text to be evaluated based on the text image to be evaluated and the target text database.

[0012] The input module is used to input the image of the text to be evaluated into a preset stroke segmentation model to obtain the stroke image contained in the text to be evaluated.

[0013] The second obtaining module is used to obtain the feature information of the character to be evaluated based on the stroke grouping information and the stroke image;

[0014] The third module is used to obtain the score information of the text to be evaluated based on the feature information and the target feature information.

[0015] According to another aspect of the embodiments of this application, an electronic device is also provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; wherein the memory is used to store a computer program; and the processor is used to execute the method steps of any of the above embodiments by running the computer program stored in the memory.

[0016] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program is configured to execute the method steps of any of the above embodiments when running.

[0017] In this embodiment, target feature information and stroke grouping information of the target text corresponding to the text to be evaluated are obtained based on the image of the text to be evaluated and the target text database. The image of the text to be evaluated is input into a preset stroke segmentation model to obtain the stroke images contained in the text to be evaluated. Based on the stroke grouping information and the stroke images, feature information of the text to be evaluated is obtained. Based on the feature information and target feature information, score information of the text to be evaluated is obtained. Through the above method, the text to be evaluated is segmented to obtain all the strokes of the text to be evaluated. Then, combined with the stroke grouping information of the text to be evaluated, the strokes are combined to obtain the feature information of the text to be evaluated. Using the target feature information of the target text as a reference, more comprehensive and complete score information is output, which improves the accuracy and interpretability of text evaluation and is of great significance for tutoring learning and writing practice and teacher evaluation guidance. It solves the problem in related technologies that only evaluate the text as a whole, and the evaluation results lack detailed evidence. Attached Figure Description

[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a flowchart illustrating an optional text evaluation method according to an embodiment of this application;

[0021] Figure 2This is a schematic diagram of an optional text component according to an embodiment of this application;

[0022] Figure 3 This is an optional text feature information diagram according to an embodiment of this application;

[0023] Figure 4 This is an optional illustration of the text to be evaluated and the target text according to an embodiment of this application;

[0024] Figure 5 This is a structural block diagram of an optional text evaluation device according to an embodiment of this application;

[0025] Figure 6 This is a structural block diagram of an optional electronic device according to an embodiment of this application. Detailed Implementation

[0026] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0027] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0028] According to one aspect of the embodiments of this application, a text evaluation method is provided, such as... Figure 1 As shown, the process of this method may include the following steps:

[0029] Step S101: Based on the image of the text to be evaluated and the target text database, obtain the target feature information and stroke grouping information of the target text corresponding to the text to be evaluated.

[0030] Optionally, the user writes Chinese characters on the copybook using an ordinary pen (such as a fountain pen, a pencil, a gel pen, etc.) or a smart pen (various dot-matrix writing pens). The mobile phone takes a picture of the copybook image, or the dot-matrix book transmits the writing trace information to generate a text image to be evaluated. According to the text image to be evaluated, the label information of the text to be evaluated is determined, such as: name, code, serial number, etc. Then, according to the label information, the target text and target feature information corresponding to the text to be evaluated are obtained from the target text database. And according to the strokes included in each component of the target text, the stroke grouping information is determined. Here, the component of a Chinese character refers to a character-forming unit composed of strokes and having the function of combining Chinese characters.

[0031] It should be noted that in this embodiment, the text structure types are divided according to the current text component information. The text structure types include upper-lower structure, left-right structure, upper-middle-lower structure, left-middle-right structure, semi-enclosed structure, three-sided enclosed structure, and full-enclosed structure, etc. And information encoding is performed on the standard texts included in each of the above text structure types. The information encoding of each text includes the component name of the text and all the strokes included in each component, that is, the stroke grouping information. As Figure 2 shown, the text structure type of the character "吉" is the upper-lower structure. Among them, the stroke grouping information of the character "吉" is: the first stroke, the second stroke, and the third stroke belong to the upper component, and the fourth stroke, the fifth stroke, and the sixth stroke belong to the lower component. The encoding information of all texts is incorporated into the target text database. The texts in the target text database are regarded as target texts.

[0032] Step S102: Input the text image to be evaluated into a preset stroke segmentation model to obtain the stroke images included in the text to be evaluated.

[0033] [[ID=**11**]]Optionally, the text image to be evaluated is input into a preset stroke segmentation model that has been trained in advance. The preset stroke segmentation model will split the text to be evaluated into strokes and output the corresponding stroke images, such as stroke grayscale images.

[0034] It should be noted that in this embodiment, each of the above target texts will be split into strokes in advance according to the preset stroke segmentation model to generate the stroke images of each target text, which are stored in the target text database.

[0035] Step S103: Obtain the feature information of the text to be evaluated according to the stroke grouping information and the stroke images.

[0036] Optionally, according to the above multiple stroke images, the features of each stroke in multiple dimensions are extracted, including the size feature and centroid feature of the stroke. According to the stroke grouping information in step S101, the features of all strokes are combined into the feature information of the text to be evaluated, including the features of each component of the text to be evaluated.

[0037] It should be noted that this embodiment extracts the features of the strokes of the target characters in advance and combines them to obtain the component features of each target character. The component features of the target characters are then encoded to obtain target feature information, which is stored in the target character database as reference information for evaluating the characters to be evaluated.

[0038] Step S104: Based on the feature information and target feature information, obtain the score information of the text to be evaluated.

[0039] Optionally, using target feature information as a reference, intelligent analysis is performed on every detail of the text to be evaluated based on the feature information, including details such as the size of each component, the distance between components, and the position of components, and score information reflecting the writing quality of the text to be evaluated in each dimension is obtained.

[0040] In this embodiment, target feature information and stroke grouping information of the target text corresponding to the text to be evaluated are obtained based on the image of the text to be evaluated and the target text database. The image of the text to be evaluated is input into a preset stroke segmentation model to obtain the stroke images contained in the text to be evaluated. Based on the stroke grouping information and the stroke images, feature information of the text to be evaluated is obtained. Based on the feature information and target feature information, score information of the text to be evaluated is obtained. Through the above method, the text to be evaluated is segmented to obtain all the strokes of the text to be evaluated. Then, combined with the stroke grouping information of the text to be evaluated, the strokes are combined to obtain the feature information of the text to be evaluated. Using the target feature information of the target text as a reference, more comprehensive and complete score information is output, which improves the accuracy and interpretability of text evaluation and is of great significance for tutoring learning and writing practice and teacher evaluation guidance. It solves the problem in related technologies that only evaluate the text as a whole, and the evaluation results lack detailed evidence.

[0041] As an optional embodiment, feature information of the character to be evaluated is obtained based on stroke grouping information and stroke images, including:

[0042] Based on the stroke image, obtain the outline points of the first preset number of strokes;

[0043] Based on the contour points, obtain the bounding rectangle of each stroke;

[0044] Based on the stroke grouping information and the stroke bounding rectangle, the bounding rectangles of the second preset number of components are obtained, wherein the strokes are contained in the components and the components are contained in the text to be evaluated.

[0045] Based on the stroke image, obtain the centroid coordinates of each stroke;

[0046] Based on the stroke grouping information and centroid coordinates, the centroid coordinates of each component are obtained;

[0047] Obtain the feature information based on the external bounding rectangle of the component and the centroid coordinates of the component.

[0048] Optionally, extract the contour points of the strokes from the stroke image to obtain the contour points of the first preset number of strokes. The stroke image can be a stroke grayscale image, and the first preset number represents the total number of strokes of the text to be evaluated.

[0049] Based on the above contour points, obtain the maximum external bounding rectangle of each stroke as the stroke external bounding rectangle. And determine all the strokes included in each component according to the stroke grouping information. Determine the maximum external bounding rectangle of the component as the component external bounding rectangle based on the maximum external bounding rectangles of each stroke in the same component, and obtain the component external bounding rectangles of the second preset number of components. The second preset number represents the total number of components of the text to be evaluated.

[0050] Obtain the centroid coordinates of each stroke according to the stroke grayscale image. Determine all the strokes included in each component according to the stroke grouping information, and obtain the centroid feature of the component by weighted averaging the centroid coordinates of all the strokes in the same component according to the number of stroke pixel points. Repeat the above process to obtain the component centroid coordinates of each component.

[0051] Based on the component external bounding rectangle and the component centroid coordinates, obtain the feature information of the text to be evaluated, including: the size feature and the centroid feature of the text to be evaluated. The size feature is, for example, the length, width, and area of the maximum external bounding rectangle of the component.

[0052] It should be noted that in this embodiment, the features of all the strokes of the target text will be extracted in advance according to the above process, and the target feature information of each target text will be combined. As Figure 3 shown: "Li" is a target text. Determine the component external bounding rectangle of the component "Mu" as rectangle 7 according to the stroke external bounding rectangles of each stroke of the component "Mu", and determine the centroid of the component "Mu" as centroid 1 according to the centroid coordinates of each stroke. Similarly, determine the component external bounding rectangle of the component "Zi" as rectangle 8 and the centroid as centroid 2. Store the features of all the strokes of the target text as the target feature information in the target text database as the reference information for evaluating the text to be evaluated.

[0053] In the embodiment of the present application, according to the stroke image, obtain the maximum external bounding rectangle and the centroid coordinates of each stroke, and combine the stroke grouping information to obtain the component size feature and the component centroid feature of each component in the text to be evaluated. It is convenient to calculate the scores of multiple dimensions of the text to be evaluated according to the target feature information later.

[0054] As an optional embodiment, obtain the score information of the text to be evaluated according to the feature information and the target feature information, including:

[0055] Based on the feature information, obtain the multi-dimensional data information of each component in the text to be evaluated;

[0056] Based on the target feature information, multi-dimensional data information of each component in the target text is obtained;

[0057] Based on multi-dimensional data information and target multi-dimensional data information, a multi-dimensional score for the text to be evaluated is obtained;

[0058] Based on the multi-dimensional scoring and the first preset formula, the total score of the text to be evaluated is obtained;

[0059] The score information is obtained based on the multi-dimensional scoring and the total score.

[0060] Optionally, based on the feature information, multi-dimensional data information can be obtained, including: the area of ​​the bounding rectangle of the component, the aspect ratio, the centroid distance between the bounding rectangles of the component, orientation data, and other information.

[0061] Based on the target feature information, multi-dimensional data information of the target is obtained, including: the target area of ​​the bounding rectangle of the component in the target text, the target aspect ratio, the target centroid distance between the bounding rectangles of the component in the target text, the target orientation data, etc.

[0062] Based on the aforementioned multi-dimensional data and the target multi-dimensional data, a multi-dimensional score for the text to be evaluated is obtained, including: area score. area Aspect Ratio Score aspect Distance dimension score distance and the orientation dimension score angle .

[0063] Substituting the above multi-dimensional scores into the first preset formula, such as formula (1), the total score (Score) of the text to be evaluated is calculated. total .

[0064] Score total =(Score) area +Score aspect +Score distance +Score angle ) / 4(1)

[0065] By integrating the above multi-dimensional scores and the total score, the score information of the text to be evaluated is obtained.

[0066] In this embodiment of the application, the scores of the text to be evaluated under multiple dimensions are calculated based on the feature information of the text to be evaluated and the corresponding target feature information. Finally, the average of the scores of the multiple dimensions is calculated as the total score. This can automatically evaluate all text by binding the component structure type and the handwritten component dimension, and output the scores of each dimension and the total score of the text to be evaluated.

[0067] As an optional embodiment, when the text to be evaluated contains two components, a multi-dimensional score for the text to be evaluated is obtained based on multi-dimensional data information and target multi-dimensional data information, including:

[0068] Based on multi-dimensional data, we obtain the aspect ratio, area, distance between components, and orientation data of each component in the text to be evaluated.

[0069] Based on the multi-dimensional data of the target, the target aspect ratio, target area, distance between target components, and orientation data between target components are obtained for each component in the target text.

[0070] Based on the area, the target area, and the second preset formula, the first difference is obtained;

[0071] Based on the first difference, the preset area threshold, the preset area tolerance threshold, and the third preset formula, the first dimension score of the text to be evaluated is obtained;

[0072] The second difference is obtained based on the aspect ratio, the target aspect ratio, and the fourth preset formula;

[0073] The second dimension score of the text to be evaluated is obtained based on the second difference, the preset aspect ratio threshold, the preset aspect ratio tolerance threshold, and the third preset formula.

[0074] The third difference is obtained based on the distance between components, the distance between target components, and the fifth preset formula;

[0075] The third dimension score of the text to be evaluated is obtained based on the third difference, the preset inter-component distance threshold, the preset inter-component distance tolerance threshold, and the third preset formula.

[0076] The fourth difference is obtained based on the orientation data between components, the orientation data between target components, and the sixth preset formula;

[0077] The fourth dimension score of the text to be evaluated is obtained based on the fourth difference, the preset inter-component orientation threshold, the preset inter-component orientation tolerance threshold, and the third preset formula.

[0078] Optionally, when the structure of the text to be evaluated is top-bottom or left-right, the text contains two components. In addition, some semi-enclosed and fully enclosed texts also contain two components. Let the serial numbers of the two components be component 1 and component 2, respectively.

[0079] Based on the multi-dimensional data of the text to be evaluated, the aspect ratio of each component in the text to be evaluated is obtained asect. hw area hw Distance between components hw and the orientation data between components (angle)hw , where the subscript hw represents the text to be evaluated, and distance hw and angle hw can be calculated from the centroid coordinates of the two components. According to the target multi-dimensional data information of the target text, the target aspect ratio aspect gt , target area area gt , target distance between components distance gt and target orientation data angle gt between the components of the target text are obtained, where the subscript gt represents the target text.

[0080] As Figure 4 shown: Figure 4 On the right is the text "艺" to be evaluated, component 1 is "艹", and component 2 is "乙". The aspect ratio and area corresponding to component 1 are the aspect ratio and area of rectangle 11, and the aspect ratio and area corresponding to component 2 are the aspect ratio and area of rectangle 12. The distance between the components of the text to be evaluated is the length of the line connecting centroid 5 and centroid 6, and the orientation data between the components is the relative angle of the line connecting centroid 5 and centroid 6, such as the angle with the coordinate axis. Figure 4 On the left is the target text "艺". The target aspect ratio and target area corresponding to component 1 are the aspect ratio and area of rectangle 9, and the target aspect ratio and target area corresponding to component 2 are the aspect ratio and area of rectangle 10. The target distance between the components is the length of the line connecting centroid 3 and centroid 4, and the target orientation data between the components is the relative angle of the line connecting centroid 3 and centroid 4.

[0081] According to the multi-dimensional data information and the target multi-dimensional data information, multi-dimensional analysis is performed on the text to be evaluated in sequence, including four dimensions: area dimension, aspect ratio dimension, distance dimension, and orientation dimension. Specifically, it includes:

[0082] Substitute the area of component 1 in the text to be evaluated the area of component 2 the target area of component 1 and the target area of component 2 into the second preset formula, such as formula (2), corresponding to area′ hw , corresponding to area hw , corresponding to area′ gt , corresponding to area gt , and calculate the difference between the area ratio between the two components of the text to be evaluated and the area ratio between the two components of the target text, that is, the first difference D area .

[0083] Darea =(area hw / area′ hw ) / (area gt / area′ gt )-1 (2)

[0084] The first difference D area Preset area threshold α area Preset area tolerance threshold β area Substituting into the third preset formula, such as formula (3), D area Corresponding to D, α area Corresponding to α, β area Calculate the score for the text to be evaluated in the area dimension, corresponding to β. araa That is, the first dimension of the score. Wherein, α area Used to determine whether the area ratio between components is reasonable, it is obtained from pre-classified data through k-means clustering. β area It is manually set. The pre-classified data is obtained by analyzing and classifying multiple standard handwritten character samples.

[0085] Score=1-(|D|-|α|) / β (3)

[0086] The aspect ratio of component 1 in the text to be evaluated Aspect Ratio of Component 2 Target aspect ratio of component 1 And the target aspect ratio of component 2 Substituting into the fourth preset formula, for example, formula (4), Corresponding aspect′ hw , Corresponding aspect hw , Corresponding aspect′ gt , Corresponding aspect gt The difference between the aspect ratio of the two components of the text to be evaluated and the aspect ratio of the two components of the target text is calculated, which is the second difference D. aspect .

[0087] D aspect =(aspect) hw / aspect′ hw ) / (aspect gt / aspect′ gt )-1 (4)

[0088] The second difference D aspect Preset aspect ratio threshold α aspect Preset aspect ratio tolerance threshold β aspectSubstituting into the third preset formula, such as formula (3), D aspect Corresponding to D, α aspect Corresponding to α, β aspect For β, calculate the score of the text to be evaluated in the aspect ratio dimension. aspect This refers to the second dimension of the score. Wherein, α aspect To determine whether the aspect ratio between components is reasonable, the value is obtained from the pre-classified data using k-means clustering. β aspect It is set manually.

[0089] The inter-component distance between component 1 and component 2 in the text to be evaluated. Distance between the target component and Substitute into the fifth preset formula, for example, formula (5), Corresponding distance hw , Corresponding distance gt The difference between the distance between the two components of the text to be evaluated and the distance between the two components of the target text is calculated, which is the third difference D. distance .

[0090] D distance =distance hw / distance gt -1 (5)

[0091] The third difference D distance Preset distance threshold α between components distance Preset inter-component distance tolerance threshold β distance Substituting into the third preset formula, such as formula (3), D distance Corresponding to D, α distance Corresponding to α, β distance For β, calculate the score of the text to be evaluated in the distance dimension. distance This refers to the third dimension of the score. Among them, α distance To determine whether the distance between components is reasonable, the value is obtained from the pre-classified data using k-means clustering. β distance It is set manually.

[0092] The inter-component orientation data between component 1 and component 2 in the text to be evaluated. Orientation data between target components Substitute into the sixth preset formula, for example, formula (6), Corresponding angle hw , Corresponding angle gt The fourth difference, D, is calculated by comparing the orientation data between the text components to be evaluated with the orientation data between the target components.angle .

[0093] D angle =angle hw / angle gt -1 (6)

[0094] The fourth difference D angle Preset orientation threshold α between components angle Preset orientation tolerance threshold β between components angle Substituting into the third preset formula, such as formula (3), D angle Corresponding to D, α angle Corresponding to α, β angle Calculate the score for the text to be evaluated in the orientation dimension, corresponding to β. angle This refers to the fourth dimension of scoring. Among them, α angle To determine whether the orientation between components is reasonable, the data is obtained through k-means clustering from the pre-classified data. β angle It is set manually.

[0095] In this embodiment of the application, for the text to be evaluated that contains two components, based on multi-dimensional data information and target multi-dimensional data information, the text to be evaluated is analyzed in four dimensions: area dimension, aspect ratio dimension, distance dimension, and orientation dimension, and the score corresponding to each dimension is calculated. This solves the problem of lack of detailed basis for the evaluation results in the prior art, and makes the score information of the text to be evaluated more accurate.

[0096] As an optional embodiment, when the text to be evaluated contains three components, a multi-dimensional score for the text to be evaluated is obtained based on multi-dimensional data information and target multi-dimensional data information, including:

[0097] Based on multi-dimensional data, we obtain the aspect ratio, area, distance between components, and orientation data of each component in the text to be evaluated.

[0098] Based on the multi-dimensional data of the target, the target aspect ratio, target area, distance between target components, and orientation data between target components are obtained for each component in the target text.

[0099] Based on the components, a first combination and a second combination are obtained, wherein both the first combination and the second combination contain two different components, and the first combination and the second combination are not completely identical;

[0100] Based on the target area, determine the first weight corresponding to the first combination and the second weight corresponding to the second combination;

[0101] Based on the area, the target area, and the second preset formula, the first combination difference of the first combination and the second combination difference of the second combination are obtained.

[0102] Based on the first combination difference, the second combination difference, the preset area threshold, the preset area tolerance threshold, and the third preset formula, the first intermediate score of the first combination and the second intermediate score of the second combination are obtained.

[0103] Based on the first weight, the first intermediate score, the second weight, the second intermediate score, and the seventh preset formula, the first dimension score of the text to be evaluated is obtained.

[0104] Based on the aspect ratio, the target aspect ratio, and the fourth preset formula, the third combination difference of the first combination and the fourth combination difference of the second combination are obtained.

[0105] Based on the difference between the third combination and the difference between the fourth combination, the preset aspect ratio threshold, the preset aspect ratio tolerance threshold, and the third preset formula, the third intermediate score of the first combination and the fourth intermediate score of the second combination are obtained.

[0106] The second dimension score of the text to be evaluated is obtained based on the first weight, the third intermediate score, the second weight, the fourth intermediate score, and the seventh preset formula.

[0107] Based on the distance between components, the distance between target components, and the fifth preset formula, the fifth combination difference of the first combination and the sixth combination difference of the second combination are obtained.

[0108] Based on the fifth combination difference, the sixth combination difference, the preset inter-component distance threshold, the preset inter-component distance tolerance threshold, and the third preset formula, the fifth intermediate score of the first combination and the sixth intermediate score of the second combination are obtained.

[0109] The third-dimensional score of the text to be evaluated is obtained based on the first weight, the fifth intermediate score, the second weight, the sixth intermediate score, and the seventh preset formula.

[0110] Based on the orientation data between components, the orientation data between target components, and the sixth preset formula, the seventh combination difference of the first combination and the eighth combination difference of the second combination are obtained.

[0111] Based on the seventh combination difference, the eighth combination difference, the preset inter-component orientation threshold, the preset inter-component orientation tolerance threshold, and the third preset formula, the seventh intermediate score of the first combination and the eighth intermediate score of the second combination are obtained.

[0112] The fourth dimension score of the text to be evaluated is obtained based on the first weight, the seventh intermediate score, the second weight, the eighth intermediate score, and the seventh preset formula.

[0113] Optionally, when the structure of the text to be evaluated is a top-middle-bottom structure or a left-middle-right structure, the text to be evaluated contains three components. In addition, some semi-enclosed and fully enclosed structures also contain three components. Let the serial numbers of the two components be component 1, component 2, and component 3, respectively.

[0114] Based on the multi-dimensional data of the text to be evaluated, the aspect ratio of each component in the text to be evaluated is obtained asect. hw area hw Distance between components hw and the orientation data between components (angle) hw Where the subscript hw represents the text to be evaluated. Based on the multi-dimensional data of the target text, the target aspect ratio corresponding to each component in the target text is obtained. gt Target area gt Distance between target components gt and the orientation data between target components (angle) gt , where the subscript gt represents the target text.

[0115] Based on component 1, component 2, and component 3, a first combination and a second combination are generated. Both the first combination and the second combination contain two different components. The first combination and the second combination are not completely the same. For example, if the first combination contains component 1 and component 2, then the second combination can contain component 2 and component 3 or component 1 and component 3. If the first combination contains component 1 and component 3, then the second combination can contain component 2 and component 3.

[0116] This embodiment uses the example of a first combination including component 1 and component 2, and a second combination including component 2 and component 3, for illustration:

[0117] Based on the target areas of component 1, component 2, and component 3, determine the first weight W corresponding to the first combination. 21 The second weight W corresponding to the second combination 32 .

[0118] The area of ​​component 1 in the first assembly Area of ​​component 2 Target area of ​​component 1 and the target area of ​​component 2 Substitute into the second preset formula, such as formula (2), Corresponding area′ hw , Corresponding area hw , Corresponding area′ gt , Corresponding areagt Calculate the difference of the first combination. The area of ​​component 3 in the second assembly. Area of ​​component 2 Target area of ​​component 3 and the target area of ​​component 2 Substitute into the second preset formula, such as formula (2), Corresponding area′ hw , Corresponding area hw , Corresponding area′ gt , Corresponding area gt Calculate the difference between the second combination and the second combination. .

[0119] The first combination difference Preset area threshold α area Preset area tolerance threshold β area Substituting into the third preset formula, such as formula (3), Corresponding to D, α area Corresponding to α, β area Calculate the first intermediate score for the first combination corresponding to β. The second combination difference Preset area threshold α area Preset area tolerance threshold β area Substituting into the third preset formula, such as formula (3), Corresponding to D, α area Corresponding to α, β area Calculate the second intermediate score for the second combination corresponding to β. .

[0120] The first weight W 21 First Intermediate Rating Second weight W 32 Second Intermediate Rating Substitute into the seventh preset formula, for example, formula (7), Corresponding Score 21 , Corresponding Score 32 Calculate the first-dimensional score (Score) of the text to be evaluated. area .

[0121] Score = W 21 Score 21 +W 32 Score 32 (7)

[0122] The aspect ratio of component 1 in the first assembly Aspect Ratio of Component 2 Target aspect ratio of component 1 And the target aspect ratio of component 2 Substituting into the fourth preset formula, for example, formula (4), Corresponding aspect′ hw ,

[0123] Corresponding aspect hw , Corresponding aspect′ gt , Corresponding aspect gt Calculate the difference between the first combination and the third combination. The aspect ratio of component 3 in the second assembly is adjusted. Aspect Ratio of Component 2 Target aspect ratio of component 3 And the target aspect ratio of component 2 Substituting into the fourth preset formula, for example, formula (4),

[0124] Corresponding aspect′ hw , Corresponding aspect hw , Corresponding aspect′ gt , Corresponding aspect gt Calculate the difference between the second and fourth combinations. .

[0125] The difference of the third combination Preset aspect ratio threshold α aspect Preset aspect ratio tolerance threshold β aspect Substituting into the third preset formula, such as formula (3), Corresponding to D, α aspect Corresponding to α, β aspect Calculate the third intermediate score for the first combination, corresponding to β. The fourth combination difference Preset aspect ratio threshold α aspect Preset aspect ratio tolerance threshold β aspect Substituting into the third preset formula, such as formula (3), Corresponding to D, α aspect Corresponding to α, β aspect Calculate the fourth intermediate score for the second combination corresponding to β. .

[0126] The first weight W 21 Third intermediate rating Second weight W 32 Fourth Intermediate Rating Substitute into the seventh preset formula, for example, formula (7), Corresponding Score 21 , Corresponding Score 32 Calculate the second dimension score of the text to be evaluated. aspect .

[0127] The distance between components 1 and 2 in the first assembly Distance between the target component and Substitute into the fifth preset formula, for example, formula (5), Corresponding distance hw , Corresponding distance gt Calculate the difference between the first and fifth combinations. The distance between components 2 and 3 in the second assembly. Distance between the target component and Substitute into the fifth preset formula, for example, formula (5), Corresponding distance hw , Corresponding distance gt Calculate the difference between the second and sixth combinations. .

[0128] The difference of the fifth combination Preset distance threshold α between components distance Preset inter-component distance tolerance threshold β distance Substituting into the third preset formula, such as formula (3), Corresponding to D, α distance Corresponding to α, β didtance Calculate the fifth intermediate score for the first combination, corresponding to β. The sixth combination difference Preset distance threshold α between components distance Preset inter-component distance tolerance threshold β distance Substituting into the third preset formula, such as formula (3), Corresponding to D, α distance Corresponding to α, β distance Calculate the sixth intermediate score for the second combination corresponding to β. .

[0129] The first weight W 21 Fifth Intermediate Rating Second weight W32 Sixth Intermediate Rating Substitute into the seventh preset formula, for example, formula (7), Corresponding Score 21 , Corresponding Score 32 Calculate the third-dimensional score (Score) of the text to be evaluated. distance .

[0130] The inter-component orientation data between component 1 and component 2 in the first assembly Orientation data between target components Substitute into the sixth preset formula, for example, formula (6), Corresponding angle hw , Corresponding angle gt Calculate the difference between the first and seventh combinations. The inter-component orientation data between component 2 and component 3 in the second assembly Orientation data between target components Substitute into the sixth preset formula, Corresponding angle hw , Corresponding angle gt For example, formula (6) calculates the difference between the eighth combination of the second combination. .

[0131] The difference of the seventh combination Preset component orientation data threshold α angle Preset tolerance threshold β for orientation data between components angle Substituting into the third preset formula, such as formula (3), Corresponding to D, α angle Corresponding to α, β angle Calculate the seventh intermediate score for the first combination, corresponding to β. The difference of the eighth combination Preset component orientation data threshold α angle Preset tolerance threshold β for orientation data between components angle Substituting into the third preset formula, such as formula (3), Corresponding to D, α angle Corresponding to α, β angle Calculate the eighth intermediate score for the second combination corresponding to β. .

[0132] The first weight W 21 7th Intermediate Rating Second weight W 32 Eighth Intermediate Rating Substitute into the seventh preset formula, for example, formula (7), Corresponding Score 21 , Corresponding Score 32 Calculate the fourth dimension score of the text to be evaluated. angle .

[0133] In this embodiment of the application, for the text to be evaluated that contains three components, based on multi-dimensional data information and target multi-dimensional data information, the text to be evaluated is analyzed in turn from four dimensions: area dimension, aspect ratio dimension, distance dimension, and orientation dimension, and the score corresponding to each dimension is calculated. This solves the problem of lack of detailed basis for the evaluation results in the prior art, and makes the score information of the text to be evaluated more accurate.

[0134] As an optional embodiment, determining a first weight corresponding to the first combination and a second weight corresponding to the second combination based on the target area includes:

[0135] Based on the first combination and the second combination, a first component and a second component are obtained, wherein the first component is only included in the first combination, and the second component is only included in the second combination;

[0136] Based on the target area of ​​the first component, the target area of ​​the second component, and the eighth preset formula, the first weight and the second weight are obtained.

[0137] Optionally, taking the first combination containing component 1 and component 2, and the second combination containing component 2 and component 3 as an example, the first weight is represented as W. 21 The second weight is represented as W. 32 Based on the first combination and the second combination, the first component is component 1 and the second component is component 3, wherein component 1 is only included in the first combination and component 3 is only included in the second combination.

[0138] The target area of ​​component 1 and the target area of ​​component 3 Substituting into the eighth preset formula, including formula (8) and formula (9), the first weight W is calculated. 21 Second weight W 32 :

[0139]

[0140]

[0141] In this embodiment of the application, a first weight and a second weight are determined based on the target area, so that the subsequent calculation of the multi-dimensional score of the text to be evaluated can take into account the characteristics of each component, making the score more accurate.

[0142] As an optional embodiment, after obtaining the score information of the text to be evaluated, the method further includes:

[0143] Based on the scoring information, the total score and multi-dimensional scores of the text to be evaluated are obtained;

[0144] Based on the total score and preset indicators, generate overall evaluation information for the text to be evaluated;

[0145] Multi-dimensional evaluation information is generated based on multi-dimensional scores and a preset hash table.

[0146] Optionally, based on the scoring information, a total score (Score) is obtained for the text to be evaluated. total And multi-dimensional scoring, including: area dimension score area Aspect Ratio Score aspect Distance dimension score distance and the orientation dimension score angle .

[0147] Score total The score is calculated by combining the scores of each dimension based on the deviation degree D of each component. It is a number ranging from 0 to 100, representing the overall score of a handwritten character based on component evaluation, reflecting the quality of the handwriting. By setting preset indicators, such as 60 or 90, the excellent, good, average, and poor grades of the handwriting to be evaluated are determined. Based on the total score and preset indicators, overall evaluation information for the handwriting to be evaluated is generated, including ratings such as excellent, good, average, and poor.

[0148] The evaluation of handwriting is obtained by querying a pre-defined hash table, with each dimension having its own corresponding hash table. The pre-defined hash table is created by mapping the degree of dimensional deviation to the corresponding set comments. Based on the multi-dimensional scores and the pre-defined hash tables, multi-dimensional evaluation information is generated, such as the difference in area between the middle and lower parts. If the value is too large, it will output that the lower component is too large relative to the middle component, and the degree is... The evaluation will be generated as follows: When the angular difference between the upper and middle components in the orientation dimension is too large, the deviation of the middle component relative to the upper component will be output, such as being too far to the left. The evaluation information for each dimension will be generated through the above process.

[0149] In this embodiment, intelligent analysis of the size, distance, and position of the components of the text to be evaluated yields comprehensive and complete component evaluation results and guidance suggestions, pointing out writing problems in various dimensions of the text. This is helpful for teachers' teaching work and facilitates students' understanding of text structure and correction of errors. It is of great significance for tutoring students in writing practice and for teachers' evaluation and guidance.

[0150] As an optional embodiment, based on the image of the text to be evaluated and the target text database, the target feature information and stroke grouping information of the target text corresponding to the text to be evaluated are obtained, including:

[0151] Input the image of the text to be evaluated into the preset text classification model to obtain the name of the text to be evaluated;

[0152] Based on the name and target text database, target feature information and stroke grouping information are obtained.

[0153] Optionally, the text image to be evaluated can be, for example, an input image of a handwritten character template. First, the handwritten character regions of the text image to be evaluated are determined using a text detection model. Then, the name of the text to be evaluated is obtained using a preset text classification model. Based on the name, the target feature information of the target text corresponding to the text to be evaluated and the stroke grouping information of the text to be evaluated are retrieved from the target text database.

[0154] In this embodiment, the name of the text to be evaluated is determined by a preset text classification model. Based on the name, target feature information and stroke grouping information are retrieved from the target text database. The model is then used to perform text detection and text classification, which facilitates subsequent multi-dimensional evaluation of the text to be evaluated.

[0155] According to another aspect of the embodiments of this application, a text evaluation apparatus for implementing the above-described text evaluation method is also provided. Figure 5 This is a structural block diagram of an optional text evaluation device according to an embodiment of this application, such as... Figure 5 As shown, the device may include:

[0156] The first obtaining module 501 is used to obtain the target feature information and stroke grouping information of the target text corresponding to the text to be evaluated based on the text image to be evaluated and the target text database;

[0157] The input module 502 is used to input the image of the text to be evaluated into a preset stroke segmentation model to obtain the stroke image contained in the text to be evaluated.

[0158] The second module 503 is used to obtain the feature information of the text to be evaluated based on the stroke grouping information and the stroke image;

[0159] The third module 504 is used to obtain the score information of the text to be evaluated based on the feature information and the target feature information.

[0160] It should be noted that the first obtaining module 501 in this embodiment can be used to execute the above step S101, the input module 502 in this embodiment can be used to execute the above step S102, the second obtaining module 503 in this embodiment can be used to execute the above step S103, and the third obtaining module 504 in this embodiment can be used to execute the above step S104.

[0161] The above modules segment the text to be evaluated, obtaining all its strokes. Then, combining this with the stroke grouping information of the text to be evaluated, the strokes are combined to obtain the feature information of the text to be evaluated. Using the target feature information of the target text as a reference, more comprehensive and complete score information is output, improving the accuracy and interpretability of text evaluation. This is of great significance for tutoring handwriting practice and teacher evaluation guidance. It solves the problem in related technologies that only evaluate the text as a whole, lacking detailed evidence in the evaluation results.

[0162] As an optional embodiment, the second obtaining module includes:

[0163] The first obtaining unit is used to obtain the outline points of a first preset number of strokes based on the stroke image;

[0164] The second unit is used to obtain the bounding rectangle of each stroke based on the contour points;

[0165] The third obtaining unit is used to obtain the component bounding rectangles of a second preset number of components based on the stroke grouping information and the stroke bounding rectangle, wherein the strokes are contained in the components and the components are contained in the text to be evaluated.

[0166] The fourth unit is used to obtain the centroid coordinates of each stroke based on the stroke image;

[0167] The fifth unit is used to obtain the component centroid coordinates of each component based on the stroke grouping information and centroid coordinates;

[0168] The sixth unit is used to obtain feature information based on the component's circumscribed rectangle and the component's centroid coordinates.

[0169] As an optional embodiment, the third obtaining module includes:

[0170] The seventh unit is used to obtain multi-dimensional data information of each component in the text to be evaluated based on the feature information;

[0171] The eighth unit is used to obtain multi-dimensional data information of each component in the target text based on the target feature information;

[0172] The ninth unit is used to obtain a multi-dimensional score of the text to be evaluated based on multi-dimensional data information and target multi-dimensional data information;

[0173] The tenth unit is used to obtain the total score of the text to be evaluated based on the multi-dimensional scoring and the first preset formula;

[0174] The eleventh unit is used to obtain scoring information based on multi-dimensional scoring and total scoring.

[0175] As an optional embodiment, when the text to be evaluated contains two components, the ninth obtaining unit includes:

[0176] The first submodule is used to obtain the aspect ratio, area, distance between components, and orientation data between components for each component in the text to be evaluated based on multi-dimensional data information.

[0177] The second submodule is used to obtain the target aspect ratio, target area, distance between target components, and orientation data between target components for each component in the target text based on the multi-dimensional data information of the target.

[0178] The third submodule is used to obtain the first difference based on the area, the target area, and the second preset formula;

[0179] The fourth submodule is used to obtain the first dimension score of the text to be evaluated based on the first difference, the preset area threshold, the preset area tolerance threshold, and the third preset formula.

[0180] The fifth submodule is used to obtain the second difference based on the aspect ratio, the target aspect ratio, and the fourth preset formula;

[0181] The sixth submodule is used to obtain the second dimension score of the text to be evaluated based on the second difference, the preset aspect ratio threshold, the preset aspect ratio tolerance threshold, and the third preset formula.

[0182] The seventh submodule is used to obtain the third difference based on the distance between components, the distance between target components, and the fifth preset formula;

[0183] The eighth submodule is used to obtain the third dimension score of the text to be evaluated based on the third difference, the preset inter-component distance threshold, the preset inter-component distance tolerance threshold, and the third preset formula.

[0184] The ninth submodule is used to obtain the fourth difference based on the orientation data between components, the orientation data between target components, and the sixth preset formula;

[0185] The tenth submodule is used to obtain the fourth dimension score of the text to be evaluated based on the fourth difference, the preset inter-component orientation threshold, the preset inter-component orientation tolerance threshold, and the third preset formula.

[0186] As an optional embodiment, when the text to be evaluated contains three components, the ninth obtaining unit includes:

[0187] The eleventh submodule is used to obtain the aspect ratio, area, distance between components, and orientation data between components for each component in the text to be evaluated based on multi-dimensional data information.

[0188] The twelfth submodule is used to obtain the target aspect ratio, target area, distance between target components, and orientation data between target components for each component in the target text based on the multi-dimensional data information of the target.

[0189] The thirteenth submodule is used to obtain a first combination and a second combination based on the components, wherein both the first combination and the second combination contain two different components, and the first combination and the second combination are not completely the same.

[0190] The determination submodule is used to determine the first weight corresponding to the first combination and the second weight corresponding to the second combination based on the target area.

[0191] The fourteenth submodule is used to obtain the first combination difference of the first combination and the second combination difference of the second combination based on the area, the target area and the second preset formula.

[0192] The fifteenth submodule is used to obtain the first intermediate score of the first combination and the second intermediate score of the second combination based on the first combination difference, the second combination difference, the preset area threshold, the preset area tolerance threshold and the third preset formula.

[0193] The sixteenth submodule is used to obtain the first dimension score of the text to be evaluated based on the first weight, the first intermediate score, the second weight, the second intermediate score, and the seventh preset formula.

[0194] The seventeenth submodule is used to obtain the third combination difference of the first combination and the fourth combination difference of the second combination based on the aspect ratio, the target aspect ratio and the fourth preset formula.

[0195] The eighteenth submodule is used to obtain the third intermediate score of the first combination and the fourth intermediate score of the second combination based on the third combination difference, the fourth combination difference, the preset aspect ratio threshold, the preset aspect ratio tolerance threshold and the third preset formula.

[0196] The nineteenth submodule is used to obtain the second dimension score of the text to be evaluated based on the first weight, the third intermediate score, the second weight, the fourth intermediate score and the seventh preset formula.

[0197] The twentieth sub-module is used to obtain the fifth combination difference of the first combination and the sixth combination difference of the second combination based on the distance between components, the distance between target components and the fifth preset formula.

[0198] The twenty-first sub-module is used to obtain the fifth intermediate score of the first combination and the sixth intermediate score of the second combination based on the fifth combination difference, the sixth combination difference, the preset inter-component distance threshold, the preset inter-component distance tolerance threshold, and the third preset formula.

[0199] The twenty-second sub-module is used to obtain the third-dimensional score of the text to be evaluated based on the first weight, the fifth intermediate score, the second weight, the sixth intermediate score, and the seventh preset formula.

[0200] The twenty-third sub-module is used to obtain the seventh combination difference of the first combination and the eighth combination difference of the second combination based on the orientation data between components, the orientation data between target components, and the sixth preset formula.

[0201] The twenty-fourth sub-module is used to obtain the seventh intermediate score of the first combination and the eighth intermediate score of the second combination based on the seventh combination difference, the eighth combination difference, the preset inter-component orientation threshold, the preset inter-component orientation tolerance threshold and the third preset formula.

[0202] The twenty-fifth submodule is used to obtain the fourth dimension score of the text to be evaluated based on the first weight, the seventh intermediate score, the second weight, the eighth intermediate score, and the seventh preset formula.

[0203] As an optional embodiment, the determined submodule includes:

[0204] The first obtaining subunit is used to obtain a first component and a second component based on the first combination and the second combination, wherein the first component is only included in the first combination and the second component is only included in the second combination; the second obtaining subunit is used to obtain a first weight and a second weight based on the target area of ​​the first component, the target area of ​​the second component and the eighth preset formula.

[0205] As an optional embodiment, the device further includes:

[0206] The fourth module is used to obtain the total score and multi-dimensional score of the text to be evaluated based on the scoring information; the first generation module is used to generate the overall evaluation information of the text to be evaluated based on the total score and preset indicators; the second generation module is used to generate multi-dimensional evaluation information based on the multi-dimensional score and preset hash table.

[0207] As an optional embodiment, the first obtaining module includes:

[0208] The twelfth obtaining unit is used to input the image of the text to be evaluated into the preset text classification model to obtain the name of the text to be evaluated; the thirteenth obtaining unit is used to obtain the target feature information and stroke grouping information based on the name and the target text database.

[0209] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the content disclosed in the above embodiments.

[0210] According to another aspect of the embodiments of this application, an electronic device for implementing the above-described text evaluation method is also provided. The electronic device may be a server, a terminal, or a combination thereof.

[0211] Figure 6 This is a structural block diagram of an optional electronic device according to an embodiment of this application, such as... Figure 6 As shown, it includes a processor 601, a communication interface 602, a memory 603, and a communication bus 604. The processor 601, communication interface 602, and memory 603 communicate with each other via the communication bus 604.

[0212] Memory 603 is used to store computer programs;

[0213] When processor 601 executes a computer program stored in memory 603, it performs the following steps:

[0214] Based on the image of the text to be evaluated and the target text database, the target feature information and stroke grouping information of the target text corresponding to the text to be evaluated are obtained; the image of the text to be evaluated is input into the preset stroke segmentation model to obtain the stroke images contained in the text to be evaluated; based on the stroke grouping information and the stroke images, the feature information of the text to be evaluated is obtained; based on the feature information and the target feature information, the score information of the text to be evaluated is obtained.

[0215] Optionally, in this embodiment, the communication bus can be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0216] The communication interface is used for communication between the aforementioned electronic devices and other devices.

[0217] The memory may include RAM, or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0218] As an example, such as Figure 6 As shown, the memory 603 may include, but is not limited to, the first obtaining module 501, the input module 502, the second obtaining module 503, and the third obtaining module 504 of the text evaluation device. Furthermore, it may include, but is not limited to, other module units of the text evaluation device, which will not be elaborated upon in this example.

[0219] The processors mentioned above can be general-purpose processors, including but not limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; they can also be DSP (Digital Signal Processor), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0220] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments, and will not be repeated here.

[0221] Those skilled in the art will understand that Figure 6 The structure shown is for illustrative purposes only. The device that implements the above text evaluation method can be a terminal device, such as a smartphone (e.g., Android phone, iOS phone), tablet computer, handheld computer, mobile internet device (MID), PAD, etc. Figure 6 This does not limit the structure of the aforementioned electronic devices. For example, the terminal device may also include components that are more advanced than those described above. Figure 6 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 6 The different configurations shown.

[0222] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, ROM, RAM, disk or optical disk, etc.

[0223] According to another aspect of the embodiments of this application, a storage medium is also provided. Optionally, in this embodiment, the storage medium can be used to store program code for performing a text evaluation method.

[0224] Optionally, in this embodiment, the storage medium may be located on at least one of the network devices in the network shown in the above embodiment.

[0225] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps:

[0226] Based on the image of the text to be evaluated and the target text database, the target feature information and stroke grouping information of the target text corresponding to the text to be evaluated are obtained; the image of the text to be evaluated is input into the preset stroke segmentation model to obtain the stroke images contained in the text to be evaluated; based on the stroke grouping information and the stroke images, the feature information of the text to be evaluated is obtained; based on the feature information and the target feature information, the score information of the text to be evaluated is obtained.

[0227] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments, and will not be repeated in this embodiment.

[0228] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, ROMs, RAMs, portable hard drives, magnetic disks, or optical disks.

[0229] In the description of this specification, the references to terms such as "this embodiment," "an embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this disclosure. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples, without contradiction. In the description of this disclosure, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0230] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.

Claims

1. A character evaluation method characterized by comprising: The method comprises: According to the to-be-evaluated character image and the target character database, target feature information and stroke grouping information of a target character corresponding to the to-be-evaluated character are obtained; The to-be-evaluated character image is input into a preset stroke segmentation model to obtain stroke images contained in the to-be-evaluated character; According to the stroke grouping information and the stroke images, feature information of the to-be-evaluated character is obtained; According to the feature information and the target feature information, score information of the to-be-evaluated character is obtained; According to the feature information, multi-dimensional data information of each component in the to-be-evaluated character is obtained; according to the target feature information, target multi-dimensional data information of each component in the target character is obtained; according to the multi-dimensional data information and the target multi-dimensional data information, multi-dimensional scores of the to-be-evaluated character are obtained; according to the multi-dimensional scores and a first preset formula, total scores of the to-be-evaluated character are obtained; and according to the multi-dimensional scores and the total scores, the score information is obtained; In the case where the to-be-evaluated character contains two components, according to the multi-dimensional data information, height-width ratios, areas, component-to-component distances and component-to-component orientation data corresponding to each component in the to-be-evaluated character are obtained; according to the target multi-dimensional data information, target height-width ratios, target areas, target component-to-component distances and target component-to-component orientation data corresponding to each component in the target character are obtained; according to the areas, the target areas and a second preset formula, a first difference value is obtained; according to the first difference value, a preset area threshold, a preset area tolerance threshold and a third preset formula, a first-dimensional score of the to-be-evaluated character is obtained; according to the height-width ratios, the target height-width ratios and a fourth preset formula, a second difference value is obtained; according to the second difference value, a preset height-width ratio threshold, a preset height-width ratio tolerance threshold and the third preset formula, a second-dimensional score of the to-be-evaluated character is obtained; according to the component-to-component distances, the target component-to-component distances and a fifth preset formula, a third difference value is obtained; according to the third difference value, a preset component-to-component distance threshold, a preset component-to-component distance tolerance threshold and the third preset formula, a third-dimensional score of the to-be-evaluated character is obtained; according to the component-to-component orientation data, the target component-to-component orientation data and a sixth preset formula, a fourth difference value is obtained; and according to the fourth difference value, a preset component-to-component orientation threshold, a preset component-to-component orientation tolerance threshold and the third preset formula, a fourth-dimensional score of the to-be-evaluated character is obtained.

2. The method of claim 1, wherein, According to the stroke grouping information and the stroke images, feature information of the to-be-evaluated character is obtained, which comprises: According to the stroke images, contour points of a first preset number of strokes are obtained; According to the contour points, stroke circumscribed rectangles of each stroke are obtained; According to the stroke grouping information and the stroke bounding rectangle, a component bounding rectangle of a second preset number of components is obtained, wherein the strokes are contained in the components, and the components are contained in the to-be-evaluated text; According to the stroke image, a centroid coordinate of each stroke is obtained; According to the stroke grouping information and the centroid coordinate, a component centroid coordinate of each component is obtained; According to the component bounding rectangle and the component centroid coordinate, the feature information is obtained.

3. The method of claim 1, wherein, In a case where the to-be-evaluated text contains three components, the obtaining of the multi-dimension score of the to-be-evaluated text according to the multi-dimension data information and the target multi-dimension data information comprises: According to the multi-dimension data information, a height-width ratio, an area, an inter-component distance, and an inter-component orientation data corresponding to each component in the to-be-evaluated text are obtained; According to the target multi-dimension data information, a target height-width ratio, a target area, a target inter-component distance, and a target inter-component orientation data corresponding to each component in the target text are obtained; According to the components, a first combination and a second combination are obtained, wherein the first combination and the second combination each contain two different components, and the first combination and the second combination are not completely same; According to the target area, a first weight corresponding to the first combination and a second weight corresponding to the second combination are determined; According to the area, the target area, and a second preset formula, a first combination difference value of the first combination and a second combination difference value of the second combination are obtained; According to the first combination difference value, the second combination difference value, a preset area threshold, a preset area tolerance threshold, and a third preset formula, a first intermediate score of the first combination and a second intermediate score of the second combination are obtained; According to the first weight, the first intermediate score, the second weight, the second intermediate score, and a seventh preset formula, a first dimension score of the to-be-evaluated text is obtained; According to the height-width ratio, the target height-width ratio, and a fourth preset formula, a third combination difference value of the first combination and a fourth combination difference value of the second combination are obtained; According to the third combination difference value, the fourth combination difference value, a preset height-width ratio threshold, a preset height-width ratio tolerance threshold, and the third preset formula, a third intermediate score of the first combination and a fourth intermediate score of the second combination are obtained; According to the first weight, the third intermediate score, the second weight, the fourth intermediate score, and the seventh preset formula, a second dimension score of the to-be-evaluated text is obtained; According to the inter-component distance, the target inter-component distance, and a fifth preset formula, a fifth combination difference value of the first combination and a sixth combination difference value of the second combination are obtained; According to the fifth combination difference value, the sixth combination difference value, a preset inter-component distance threshold, a preset inter-component distance tolerance threshold, and the third preset formula, a fifth intermediate score of the first combination and a sixth intermediate score of the second combination are obtained; According to the first weight, the fifth intermediate score, the second weight, the sixth intermediate score, and the seventh preset formula, a third dimension score of the to-be-evaluated text is obtained. According to the inter-component orientation data, the target inter-component orientation data, and a sixth preset formula, a seventh combination difference value of the first combination and an eighth combination difference value of the second combination are obtained. According to the seventh combination difference value, the eighth combination difference value, a preset inter-component orientation threshold, a preset inter-component orientation tolerance threshold, and the third preset formula, a seventh intermediate score of the first combination and an eighth intermediate score of the second combination are obtained. According to the first weight, the seventh intermediate score, the second weight, the eighth intermediate score, and the seventh preset formula, a fourth dimension score of the to-be-evaluated text is obtained.

4. The method of claim 3, wherein, The first weight corresponding to the first combination and the second weight corresponding to the second combination are determined according to the target area, including: According to the first combination and the second combination, a first component and a second component are obtained, wherein the first component is only included in the first combination, and the second component is only included in the second combination; According to the target area of the first component, the target area of the second component, and an eighth preset formula, the first weight and the second weight are obtained.

5. The method of claim 1, wherein, After obtaining the score information of the to-be-evaluated text, the method further includes: According to the score information, a total score and multi-dimension scores of the to-be-evaluated text are obtained; According to the total score and a preset index, overall evaluation information of the to-be-evaluated text is generated; According to the multi-dimension scores and a preset hash table, multi-dimension evaluation information is generated.

6. The method of claim 1, wherein, The target feature information and stroke grouping information of the target text corresponding to the to-be-evaluated text are obtained according to the to-be-evaluated text image and the target text database, including: The to-be-evaluated text image is input into a preset text classification model to obtain a name of the to-be-evaluated text; According to the name and the target text database, the target feature information and the stroke grouping information are obtained.

7. A character evaluation device characterized by comprising: The device includes: A first obtaining module is configured to obtain target feature information and stroke grouping information of a target text corresponding to a to-be-evaluated text according to a to-be-evaluated text image and a target text database; An input module is configured to input the to-be-evaluated text image into a preset stroke segmentation model to obtain stroke images included in the to-be-evaluated text; A second obtaining module is configured to obtain feature information of the to-be-evaluated text according to the stroke grouping information and the stroke images; A third obtaining module is configured to obtain score information of the to-be-evaluated text according to the feature information and the target feature information; The third obtaining module comprises: a seventh obtaining unit, configured to obtain multi-dimension data information of each component in the to-be-evaluated text according to the feature information; an eighth obtaining unit, configured to obtain target multi-dimension data information of each component in the target text according to the target feature information; a ninth obtaining unit, configured to obtain a multi-dimension score of the to-be-evaluated text according to the multi-dimension data information and the target multi-dimension data information; a tenth obtaining unit, configured to obtain a total score of the to-be-evaluated text according to the multi-dimension score and a first preset formula; and an eleventh obtaining unit, configured to obtain the score information according to the multi-dimension score and the total score. In a case where the to-be-evaluated text comprises two components, the ninth obtaining unit comprises: a first obtaining submodule, configured to obtain aspect ratio, area, inter-component distance and inter-component orientation data corresponding to each component in the to-be-evaluated text according to the multi-dimension data information; a second obtaining submodule, configured to obtain target aspect ratio, target area, target inter-component distance and target inter-component orientation data corresponding to each component in the target text according to the target multi-dimension data information; a third obtaining submodule, configured to obtain a first difference value according to the area, the target area and a second preset formula; a fourth obtaining submodule, configured to obtain a first dimension score of the to-be-evaluated text according to the first difference value, a preset area threshold, a preset area tolerance threshold and the third preset formula; a fifth obtaining submodule, configured to obtain a second difference value according to the aspect ratio, the target aspect ratio and a fourth preset formula; a sixth obtaining submodule, configured to obtain a second dimension score of the to-be-evaluated text according to the second difference value, a preset aspect ratio threshold, a preset aspect ratio tolerance threshold and the third preset formula; a seventh obtaining submodule, configured to obtain a third difference value according to the inter-component distance, the target inter-component distance and a fifth preset formula; an eighth obtaining submodule, configured to obtain a third dimension score of the to-be-evaluated text according to the third difference value, a preset inter-component distance threshold, a preset inter-component distance tolerance threshold and the third preset formula; a ninth obtaining submodule, configured to obtain a fourth difference value according to the inter-component orientation data, the target inter-component orientation data and a sixth preset formula; and a tenth obtaining submodule, configured to obtain a fourth dimension score of the to-be-evaluated text according to the fourth difference value, a preset inter-component orientation threshold, a preset inter-component orientation tolerance threshold and the third preset formula.

8. An electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein, The processor, the communication interface and the memory complete mutual communication through the communication bus, characterized in that, The memory is configured to store a computer program; The processor is configured to execute the method steps in any one of claims 1 to 6 by running the computer program stored on the memory.

Citation Information

Patent Citations

  • Character pattern evaluation method, device and equipment, and computer readable storage medium

    CN110503101A

  • Character object evaluation method and device, and electronic equipment

    CN111797822A