Text processing method and device, equipment and storage medium

By providing text processing methods and devices on the Xiwo whiteboard to identify and match the pinyin and Chinese characters in the courseware file, the problem of the existing technology not being able to recognize and display pinyin and Chinese characters in the courseware file is solved, and more flexible text display is achieved.

CN119849443APending Publication Date: 2025-04-18GUANGZHOU SHIKUN ELECTRONICS TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311339037.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-16
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

During the teaching process, the Xiwo whiteboard cannot recognize the pinyin and Chinese characters in the courseware files uploaded by users or teachers and match them.

Method used

Provide a text processing method and device, by receiving the input courseware file, identifying the location information and content of each text in the file, and matching the pinyin with Chinese characters based on this information, generating and displaying the pinyin Chinese character card.

Benefits of technology

It realizes the recognition and matching of pinyin and Chinese characters in the courseware file, improves the flexibility of text display, and can display the pinyin and Chinese characters in the courseware file uploaded by the user during the teaching process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119849443A_ABST
    Figure CN119849443A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of text recognition, and discloses a text processing method which is applied to electronic equipment, and the electronic equipment can display a pinyin Chinese character card. The method comprises the following steps: receiving an input courseware file; identifying position information and text content of each text in the courseware file; according to the position information and the text content of each text, pinyin and Chinese characters in the courseware file are matched, and a pinyin and Chinese character card is obtained and displayed. According to the method, on the basis of the position information and content of the pinyin in the courseware file and the position information and content of the Chinese character, the pinyin in the courseware file can be matched with the Chinese character, and the pinyin Chinese character card is obtained and displayed. The electronic equipment not only can display the target Chinese characters edited by the user through the pinyin Chinese character card interface, but also can identify pinyin and Chinese characters in the courseware file uploaded by the user, and displays the pinyin and Chinese characters through the pinyin Chinese character card, so that the flexibility of text display is improved. The invention furthermore discloses a text processing apparatus and device, and a storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of text recognition, and in particular to a text processing method and apparatus, device, and storage medium. Background Art

[0002] seewo Whiteboard is an interactive teaching platform designed for information-based teaching. During the operation of seewo Whiteboard, users can edit pinyin Chinese character cards. That is, after the user enters the target Chinese character in the pinyin Chinese character card interface of seewo Whiteboard, the pinyin Chinese character card corresponding to the target Chinese character will be displayed.

[0003] At present, during the teaching process, the pinyin Chinese character cards of the seewo whiteboard can only display the target Chinese characters edited by the user, and cannot recognize the pinyin and Chinese characters in the courseware files uploaded by the user or teacher and display them in a matching manner.

[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0005] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.

[0006] The embodiments of the present disclosure provide a text processing method, device, equipment, and storage medium, which can recognize pinyin and Chinese characters in a user's courseware file and display them in a matching manner.

[0007] In a first aspect, an embodiment of the present disclosure provides a text processing method, which is applied to an electronic device, and the electronic device can display pinyin Chinese character cards; the method comprises:

[0008] Receive input courseware files;

[0009] Identify the location information and text content of each text in the courseware file;

[0010] According to the location information and text content of each text, the pinyin in the courseware file is matched with the Chinese characters to obtain the pinyin Chinese character cards and display them.

[0011] In a second aspect, an embodiment of the present disclosure provides a text processing device, including:

[0012] The sending and receiving module is used to receive the input courseware files;

[0013] Recognition module, used to identify the location information and text content of each text in the courseware file;

[0014] The matching module is used to match the pinyin and Chinese characters in the courseware file according to the location information and text content of each text, obtain the pinyin Chinese character card and display it.

[0015] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising a processor and a memory storing program instructions, wherein the processor is configured to execute the text processing method as described in the first aspect when running the program instructions.

[0016] In a fourth aspect, an embodiment of the present disclosure provides a storage medium storing program instructions, wherein the program instructions, when run, execute the text processing method as described in the first aspect.

[0017] The text processing method, apparatus, device, and storage medium provided by the embodiments of the present disclosure can achieve the following technical effects:

[0018] The electronic device can identify the location information and text content of each text in the courseware file. Based on the location information and text content of each text, that is, based on the location information and content of the pinyin in the courseware file, and based on the location information and content of the Chinese characters, the pinyin in the courseware file can be matched with the Chinese characters to obtain the pinyin Chinese character card for display. In this way, the electronic device can not only display the target Chinese characters edited by the user through the pinyin Chinese character card interface, but also recognize the pinyin and Chinese characters in the courseware file uploaded by the user, and after the recognized pinyin and Chinese characters are matched, they can be displayed through the pinyin Chinese character card. Thus, the flexibility of text display is improved.

[0019] The above general description and the following description are exemplary and explanatory only and are not intended to limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] One or more embodiments are exemplarily described by corresponding drawings, which do not limit the embodiments. Elements with the same reference numerals in the drawings are shown as similar elements, and the drawings do not constitute a scale limitation, and wherein:

[0021] Figure 1 This is a schematic diagram of the Pinyin Chinese character card display during the operation of the seewo whiteboard;

[0022] Figure 2 It is a schematic diagram of an environment to which the text processing method provided by the embodiment of the present disclosure is applicable;

[0023] Figure 3 is a flowchart of a text processing method provided by an embodiment of the present disclosure;

[0024] Figure 4is a schematic diagram of the location of text in a courseware file provided by an embodiment of the present disclosure;

[0025] Figure 5 is a schematic diagram of a text processing device provided by an embodiment of the present disclosure;

[0026] Figure 6 It is a schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0027] In order to be able to understand the features and technical contents of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present disclosure. In the following technical description, for the convenience of explanation, a full understanding of the disclosed embodiments is provided through multiple details. However, one or more embodiments can still be implemented without these details. In other cases, to simplify the drawings, well-known structures and devices can be simplified for display.

[0028] The terms "first", "second", etc. in the specification and claims of the embodiments of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so that the embodiments of the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.

[0029] Unless otherwise stated, the term "plurality" means two or more.

[0030] In the embodiment of the present disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B indicates: A or B.

[0031] The term "and / or" is a description of the association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B.

[0032] The term "correspondence" may refer to an association relationship or a binding relationship. The correspondence between A and B means that there is an association relationship or a binding relationship between A and B.

[0033] At present, in order to facilitate information-based teaching, related technologies can use Chinese character pinyin cards in the teaching process. For example, seewo Whiteboard is an interactive teaching platform designed for information-based teaching. During the operation of seewo Whiteboard, users can edit pinyin Chinese character cards, that is, after the user enters the target Chinese character in the pinyin Chinese character card interface of seewo Whiteboard, the pinyin Chinese character card corresponding to the target Chinese character will be displayed. For example, after entering "Chinese character" in the pinyin Chinese character card interface of seewo Whiteboard, the following will be displayed: Figure 1 The pinyin Chinese character card corresponding to the "Chinese character" shown.

[0034] However, during the teaching process, the pinyin Chinese character cards of the seewo whiteboard or the pinyin Chinese character cards in the related technology can only display the target Chinese characters edited by the user, and cannot recognize the pinyin and Chinese characters in the courseware files uploaded by the user or teacher and display them in a matching manner.

[0035] In view of this, the embodiments of the present disclosure provide a text processing method, device, equipment, and storage medium, which can not only display the target Chinese characters edited by the user through the Pinyin-Chinese character card interface, but also recognize the Pinyin and Chinese characters in the courseware files uploaded by the user. After the recognized Pinyin and Chinese characters are matched, they can be displayed through the Pinyin-Chinese character cards to improve the flexibility of text display.

[0036] Combination Figure 2 As shown, a schematic diagram of an environment in which the text processing method provided by the embodiment of the present disclosure is applicable. The environment includes a terminal device 11 and a server 12. A network connection is established between the terminal device 11 and the server 12. Among them:

[0037] In the disclosed embodiment, the terminal device 11 has a display screen that can be used to display pinyin Chinese character cards. The terminal device 11 can be a mobile terminal or a PC (Personal Computer), and the terminal device 11 can run operating systems such as Android, iOS, and Harmony OS. For example, the terminal device 11 can edit the pinyin Chinese character cards in the seewo whiteboard through the seewo whiteboard application installed in the above operating system, so that the pinyin Chinese character cards display the pinyin and Chinese characters edited by the user.

[0038] In the disclosed embodiment, the server 12 has computing power associated with text processing and can provide services to the terminal device 11. The server 12 can be hardware or software. That is, the terminal device 11 can integrate the server 12. The integration relationship described here is not limited to the placement of the server 12 inside the terminal device 11, but also includes the installation connection between the server 12 and other components of the terminal device 11, including but not limited to physical connection, electrical connection or signal transmission connection. It can be understood by those skilled in the art that the server 12 can be adapted to a feasible product body (for example, an electronic device) to realize other feasible embodiments. In this way, the terminal device 11 can use the server 12 to implement the text processing process.

[0039] Combination Figure 3 As shown, the embodiment of the present disclosure provides a text processing method, the execution subject of the method may be an electronic device, and the electronic device may be the terminal device integrated with the server. The method includes:

[0040] S31, receiving input courseware files.

[0041] S32, identifying the location information and text content of each text in the courseware file.

[0042] S33, according to the location information and text content of each text, the pinyin in the courseware file is matched with the Chinese characters to obtain the pinyin Chinese character card and display it.

[0043] By adopting the text processing method provided by the embodiment of the present disclosure, the electronic device can identify the position information and text content of each text in the courseware file, and based on the position information and text content of each text, that is, based on the position information and content of the pinyin in the courseware file, and based on the position information and content of the Chinese character, the pinyin in the courseware file can be matched with the Chinese character to obtain the pinyin Chinese character card for display. In this way, the electronic device can not only display the target Chinese characters edited by the user through the pinyin Chinese character card interface, but also identify the pinyin and Chinese characters in the courseware file uploaded by the user, and after the identified pinyin and Chinese characters are matched, they can be displayed through the pinyin Chinese character card. Thereby, the flexibility of text display is improved.

[0044] Optionally, in the above step S32, the electronic device identifies the position information and text content of each text in the courseware file, including: when the courseware file is an XML (eXtensible Markup Language) file, parsing the XML file to obtain the position information and text content of each text in the courseware file. Alternatively, when the courseware file is an image file, the position information and text content of each text in the courseware file are detected by a text detection model and a text recognition model.

[0045] Considering that users may upload courseware files of different formats to electronic devices, in this implementation, the electronic device can identify courseware files in XML format and courseware files in picture format according to different situations. Specifically, for courseware files in XML format, courseware files in XML format can be parsed directly. For example, when an electronic device uses Python, a programming language, to parse courseware files in XML format, it can use a third-party library provided by Python (such as the xmltodict parsing library) to convert XML data into a Python dictionary to process courseware files in XML format. For courseware files in picture format, it is necessary to detect text from the picture file. Using this implementation, the recognition of courseware files in different formats can be achieved to improve the applicability of the solution.

[0046] Optionally, the position information and text content of each text in the courseware file are detected by a text detection model and a text recognition model, including: inputting the image file into the text detection model so that the text detection model detects the position information of each text in the courseware file. According to the position information of each text, the image corresponding to each text is obtained; and the image corresponding to each text is input into the text recognition model so that the text recognition model detects the text content of each text in the courseware file.

[0047] In the disclosed embodiment, the text detection model and the text recognition model may be algorithm models related to text recognition in the field of OCR (Optical Character Recognition) recognition technology. The text detection model is used to detect the position information of each text in a courseware file in a picture format, and the text recognition model is used to recognize the text content of each text.

[0048] In this implementation, when the courseware file is a picture file, the text detection model is used to detect the position information of each text in the courseware file, and the picture corresponding to each text is obtained according to the position information of each text, and the text recognition model is further used to recognize the pictures corresponding to each text to recognize the text content of each text. In this way, after the position information and text content of each text in the courseware file in the picture format are recognized, it is beneficial to match the pinyin and Chinese characters in the courseware file in the picture format.

[0049] Optionally, in the above step S33, the electronic device matches the pinyin and Chinese characters in the courseware file according to the position information and text content of each text, obtains and displays the pinyin Chinese character card, including: according to the position information and text content of each text in the courseware file, respectively calculating the overlap between the target pinyin and all Chinese characters in the courseware file; wherein the target pinyin is any pinyin in the courseware file. From all Chinese characters, Chinese characters whose overlap with the target Chinese characters is greater than the overlap threshold are selected to form a target Chinese character set. Based on the target Chinese character set, a target pinyin Chinese character card corresponding to the target Chinese character is generated and displayed.

[0050] In the disclosed embodiment, Intersection over Union (IOU) characterizes the degree of overlap between Pinyin and Chinese characters, and the degree of overlap between Pinyin and Chinese characters is high, indicating that there may be a corresponding relationship between Pinyin and Chinese characters. The value range of overlap is 0 to 1, and the greater the value of overlap, the higher the degree of overlap. In this implementation, based on the overlap between the target Pinyin and all Chinese characters in the courseware file, Chinese characters with a high degree of overlap with the target Pinyin can be screened out to form a target Chinese character combination, and the target Chinese character corresponding to the target Pinyin can be determined based on the target Chinese character set, and then the target Chinese character card is generated.

[0051] Exemplarily, the process of calculating the overlap degree between the target pinyin and all Chinese characters in the courseware file can be as follows: Combine Figure 4 As shown, the position information of each text in the courseware file can be represented by coordinates in a pre-constructed rectangular coordinate system. Specifically, based on the position information of the pinyin "wèi", the first coordinate of the upper left corner of the pinyin "wèi" can be obtained as (x1, y1), and the second coordinate of the lower right corner is (x2, y2). Based on the position information of the Chinese character "谓", the third coordinate of the upper left corner of the Chinese character "谓" can be obtained as (x1', y1'), and the fourth coordinate of the lower right corner is (x2', y2'). Calculate the overlap degree W iou between the pinyin "wèi" and the Chinese character "谓" according to the first coordinate, the second coordinate, the third coordinate, and the fourth coordinate. The formula is as follows:

[0052]

[0053] Optionally, in the embodiments of the present disclosure, the overlap degree threshold may be 0.3. In this way, when the overlap degree between the pinyin and the Chinese character in the courseware file is greater than 0.3, it can be considered that the overlap degree between the pinyin and the Chinese character is relatively high, and there may be a corresponding relationship between the two.

[0054] Optionally, since each Chinese character in the target Chinese character set may have a corresponding relationship with the target pinyin, the electronic device needs to generate and display a target pinyin-Chinese character card corresponding to the target Chinese character based on the target Chinese character set, specifically including: deleting the abnormal Chinese characters in the target Chinese character set to obtain an updated target Chinese character set; wherein, the position of the abnormal Chinese character is higher than the position of the target pinyin. Sort each Chinese character in the updated target Chinese character set according to the overlap degree with the target pinyin. And determine the Chinese character with the largest overlap degree with the target pinyin in the updated target Chinese character set as the target Chinese character. Generate and display a target pinyin-Chinese character card based on the target pinyin and the target Chinese character.

[0055] Since some Chinese characters in the target Chinese character set may be located above the target pinyin, and the overlap degree between these Chinese characters and the target pinyin may be relatively high respectively. However, in the pinyin-Chinese character card or the courseware file, the pinyin is usually located above the Chinese character. In this way, the Chinese characters in the target Chinese character set that are located above the target pinyin obviously have no corresponding relationship with the target pinyin. In this embodiment, by deleting the abnormal Chinese characters in the target Chinese character set whose positions are higher than the target pinyin, the Chinese characters in the target Chinese character set that obviously have no corresponding relationship with the target pinyin can be filtered out, realizing the update of the target Chinese character set. Further, each Chinese character in the updated target Chinese character set can also be sorted according to the overlap degree with the target pinyin, so as to screen out the Chinese character with the largest overlap degree with the target pinyin from the target Chinese character set as the target Chinese character.

[0056] Optionally, the electronic device may also determine the target Chinese character corresponding to the target pinyin according to the distance between each Chinese character in the updated target Chinese character set and the target pinyin. Specifically, the electronic device may sort each Chinese character in the updated target Chinese character set according to the distance from the target pinyin, so as to screen out the Chinese character with the closest distance to the target pinyin from the target Chinese character set as the target Chinese character. Further, in the embodiments of the present disclosure, the distance between each Chinese character in the updated target Chinese character set and the target pinyin may be determined according to the coordinate information of each Chinese character and the coordinate information of the target pinyin.

[0057] Exemplarily, as shown in Figure 4 the distance between the pinyin "wèi" and the Chinese character "谓" can be determined by the second coordinate (x2, y2) at the lower right corner of the pinyin "wèi" and the third coordinate (x1', y1') at the upper left corner of the Chinese character "谓". Specifically, the distance between the ordinate y2 of the second coordinate and the ordinate y1' of the third coordinate is the distance between the pinyin "wèi" and the Chinese character "谓".

[0058] In this embodiment, by screening out the Chinese character with the largest overlap degree or the closest distance to the target pinyin from the updated target Chinese character set as the target Chinese character corresponding to the target pinyin, the matching accuracy between the target pinyin and the target Chinese character can be improved. Thus, the accuracy of text recognition in the courseware file is improved.

[0059] Optionally, since in the courseware file in XML format, the position information and text content of each text are recorded by key-value pair data in JSON (JavaScript Object Notation) format, for the courseware file in XML format, the position information and text content of each determined text are not likely to be incorrect. In this way, when the courseware file is an XML file, the electronic device may calculate the position information of the target pinyin Chinese character card according to the position information of the target pinyin and the target Chinese character; wherein, the position information of the target pinyin Chinese character card is used to represent the positions of the target pinyin and the target Chinese character in the courseware file. According to the position information of the target pinyin Chinese character card and the text content of the target pinyin and the target Chinese character in the target pinyin Chinese character card, the target pinyin Chinese character card is displayed.

[0060] In this embodiment, when the courseware file is an XML file, since the position information and text content of each text in the courseware file are relatively accurate, the target pinyin Chinese character card can be directly generated and displayed according to the matching result between the target pinyin and the target Chinese character in the courseware file without verifying or correcting the matching result between the target pinyin and the target Chinese character. Thus, the processing efficiency of the text in the courseware file can be improved.

[0061] Optionally, since the position information and text content of each text in the courseware file in the picture format are obtained by detecting the algorithm model, the position information and text content of each text determined for the courseware file in the picture format are prone to errors. In this way, when the courseware file is a picture file, the electronic device needs to further determine whether the target pinyin and the target Chinese character matching results are correct. Further, the electronic device determines the target pinyin and the target Chinese character matching results based on the target pinyin and the target Chinese character, including: determining the correct pinyin of the target Chinese character according to the content of the target Chinese character. Compare whether the target pinyin and the correct pinyin of the target Chinese character are the same. If they are the same, the target pinyin and the target Chinese character match correctly. If they are not the same, the target pinyin and the target Chinese character matching result are determined based on the edit distance between the correct pinyin of the target Chinese character and the target pinyin.

[0062] In this implementation, the target pinyin is compared with the correct pinyin of the target Chinese character to determine whether the target pinyin matched by the target Chinese character is accurate. When the target pinyin is accurate, it indicates that the target pinyin matches the target Chinese character correctly. When the target pinyin is inaccurate, in order to avoid misjudgment of the target pinyin, the target pinyin and the target Chinese character matching result can be further determined based on the edit distance between the target pinyin and the correct pinyin. Thus, the accuracy of the target pinyin and the target Chinese character matching result can be further improved to improve the accuracy of text recognition in the courseware file.

[0063] Optionally, judging the matching result of the target pinyin and the target Chinese character according to the edit distance between the correct pinyin of the target Chinese character and the target pinyin includes: determining that the target pinyin and the target Chinese character match correctly when the edit distance between the correct pinyin of the target Chinese character and the target pinyin is less than the edit distance threshold. Alternatively, determining that the target pinyin and the target Chinese character match incorrectly when the edit distance between the correct pinyin of the target Chinese character and the target pinyin is greater than or equal to the edit distance threshold.

[0064] In the disclosed embodiment, the edit distance is a quantitative measurement of the degree of difference between two character strings (i.e., a target pinyin character string and a correct pinyin character string), and the measurement method is to see how many times the target pinyin character string is converted into a correct pinyin character string.

[0065] In this embodiment, when the edit distance between the target pinyin and the correct pinyin is small, it can be considered that the result of judging that the target pinyin is inaccurate by comparing the target pinyin with the correct pinyin of the target Chinese character is a misjudgment, that is, the target pinyin and the target Chinese character match correctly. When the edit distance between the target pinyin and the correct pinyin is large, it indicates that the similarity between the target pinyin and the correct pinyin is low. It can be considered that the result of judging that the target pinyin is inaccurate by comparing the target pinyin with the correct pinyin of the target Chinese character is not a misjudgment, that is, the target pinyin and the target Chinese character match incorrectly. In this way, when the target pinyin is inaccurate, further judging the matching result of the target pinyin and the target Chinese character according to the edit distance between the target pinyin and the correct pinyin can improve the accuracy of judging the matching result of the target pinyin and the target Chinese character. Therefore, the accuracy of text recognition in the courseware file is improved.

[0066] Optionally, in the embodiments of the present disclosure, the value of the edit distance threshold can be 2. In this way, when the target pinyin can be modified to the correct pinyin within two or fewer modifications, it indicates that the target pinyin is relatively similar to the correct pinyin, and it is very likely that a misjudgment has occurred on the target pinyin.

[0067] Optionally, when the target pinyin and the target Chinese character match correctly, the position information of the target pinyin Chinese character card is calculated according to the position information of the target pinyin and the target Chinese character; wherein, the position information of the target pinyin Chinese character card is used to represent the positions of the target pinyin and the target Chinese character in the courseware file. The target pinyin Chinese character card is displayed according to the position information of the target pinyin Chinese character card, as well as the text content of the target pinyin and the text content of the target Chinese character in the target pinyin Chinese character card.

[0068] Exemplarily, as shown in combination with Figure 4 , when the electronic device determines that the target pinyin and the target Chinese character match correctly, the process of calculating the position information of the target pinyin Chinese character card according to the position information of the target pinyin and the target Chinese character can be as follows: Assume that the target pinyin is the pinyin "wèi" in Figure 4 , and the target Chinese character is the Chinese character "谓" in Figure 4 . In this way, the position information of the target pinyin Chinese character card formed by the pinyin "wèi" and the Chinese character "谓" can be calculated through the first coordinate (x1, y1) at the upper left corner of the pinyin "wèi", the second coordinate (x2, y2) at the lower right corner of the pinyin "wèi", and the fourth coordinate (x2', y2') at the lower right corner of the Chinese character "谓". The coordinate at the upper left corner of the target pinyin Chinese character card is obtained as (x1, y1), and the coordinate at the lower right corner of the target pinyin Chinese character card is (x2, y2').

[0069] Optionally, when the target pinyin and the target Chinese character do not match, the target pinyin and the target Chinese character are not displayed.

[0070] In this implementation, when the courseware file is a picture file, since errors are prone to occur during the position information and text content detection process of each text in the courseware file, it is necessary to further determine whether the matching result of the target pinyin and the target Chinese character in the courseware file is correct. If the matching result is correct, the target pinyin Chinese character card can be directly generated for display. If the matching result is wrong, there is no need to display the target pinyin and the target Chinese character. In this way, the accuracy of the content conversion in the picture format courseware file to the pinyin Chinese character card for display is improved.

[0071] Combination Figure 5 As shown, in an embodiment of the present disclosure, a text processing device is provided, which includes a transceiver module 501, a recognition module 502 and a matching module 503.

[0072] The transceiver module 501 is used to receive input courseware files.

[0073] Identification module 502, for identifying the location information and text content of each text in the courseware file.

[0074] The matching module 503 is used to match the pinyin and Chinese characters in the courseware file according to the position information and text content of each text, obtain the pinyin Chinese character card and display it.

[0075] Optionally, the recognition module 502 is also used to parse the XML file to obtain the position information and text content of each text in the courseware file when the courseware file is an XML file. Alternatively, when the courseware file is an image file, the position information and text content of each text in the courseware file are detected by a text detection model and a text recognition model.

[0076] Optionally, the recognition module 502 is also used to input the picture file into the text detection model so that the text detection model detects the position information of each text in the courseware file. According to the position information of each text, the picture corresponding to each text is obtained. The picture corresponding to each text is input into the text recognition model so that the text recognition model detects the text content of each text in the courseware file.

[0077] Optionally, the matching module 503 is also used to calculate the overlap between the target pinyin and all Chinese characters in the courseware file according to the position information and text content of each text in the courseware file; wherein the target pinyin is any pinyin in the courseware file; select from all Chinese characters the Chinese characters whose overlap with the target Chinese characters is greater than an overlap threshold to form a target Chinese character set; based on the target Chinese character set, generate and display the target pinyin Chinese character card corresponding to the target Chinese character.

[0078] Optionally, the matching module 503 is also used to delete abnormal Chinese characters in the target Chinese character set to obtain an updated target Chinese character set; wherein the position of the abnormal Chinese characters is higher than the position of the target pinyin; from the updated target Chinese character set, select the target Chinese characters that match the target pinyin; based on the target pinyin and the target Chinese characters, generate and display the target pinyin Chinese character card.

[0079] Optionally, the matching module 503 is further configured to sort the Chinese characters in the updated target Chinese character set according to the degree of overlap between them and the target pinyin; and determine the Chinese character in the updated target Chinese character set with the greatest degree of overlap with the target pinyin as the target Chinese character.

[0080] Optionally, the matching module 503 is also used to calculate the position information of the target pinyin Chinese character card according to the position information of the target pinyin and the target Chinese character when the courseware file is an XML file; wherein the position information of the target Chinese character card is used to characterize the position of the target pinyin and the target Chinese character in the courseware file. The text processing device provided by the embodiment of the present disclosure also includes a display module 505, which is used to display the target pinyin Chinese character card according to the position information of the target pinyin Chinese character card, and the text content of the target pinyin and the text content of the target Chinese character in the target pinyin Chinese character card.

[0081] Optionally, the text processing device provided by the embodiment of the present disclosure further includes a correction module 504, which is used to determine the matching result of the target pinyin and the target Chinese character based on the target pinyin and the target Chinese character when the courseware file is a picture file. The display module 505 is used to generate and display the target pinyin Chinese character card according to the matching result of the target pinyin and the target Chinese character.

[0082] Optionally, the correction module 504 is also used to determine the correct pinyin of the target Chinese character based on the content of the target Chinese character; compare whether the target pinyin and the correct pinyin of the target Chinese character are the same; if they are the same, the target pinyin and the target Chinese character match correctly; if they are not the same, judge the matching result of the target pinyin and the target Chinese character based on the edit distance between the correct pinyin of the target Chinese character and the target pinyin.

[0083] Optionally, the correction module 504 is also used to determine that the target pinyin and the target Chinese character match correctly when the edit distance between the correct pinyin of the target Chinese character and the target pinyin is less than the edit distance threshold; or to determine that the target pinyin and the target Chinese character match incorrectly when the edit distance between the correct pinyin of the target Chinese character and the target pinyin is greater than or equal to the edit distance threshold.

[0084] Optionally, the display module 505 is also used to calculate the position information of the target pinyin Chinese character card according to the position information of the target pinyin and the target Chinese character when the target pinyin and the target Chinese character match correctly; wherein the position information of the target Chinese character card is used to characterize the position of the target pinyin and the target Chinese character in the courseware file; and display the target pinyin Chinese character card according to the position information of the target pinyin Chinese character card, and the text content of the target pinyin and the text content of the target Chinese character in the target pinyin Chinese character card.

[0085] Optionally, the display module 505 is also used for not displaying the target pinyin and the target Chinese character when the target pinyin and the target Chinese character do not match correctly.

[0086] The text processing device provided in the embodiments of the present disclosure can execute the actions of the electronic device in the above embodiments. Its implementation principle and technical effects are similar and will not be described in detail here.

[0087] Combination Figure 6 As shown, an embodiment of the present disclosure provides an electronic device 600, including a processor 100 and a memory 101. Optionally, the device may also include a communication interface 102 and a bus 103. The processor 100, the communication interface 102, and the memory 101 may communicate with each other through the bus 103. The communication interface 102 may be used for information transmission. The processor 100 may call the logic instructions in the memory 101 to execute the text processing method in the above embodiment.

[0088] In addition, the logic instructions in the memory 101 described above may be implemented in the form of software functional units and when sold or used as independent products, may be stored in a computer-readable storage medium.

[0089] The memory 101 is a computer-readable storage medium that can be used to store software programs and computer executable programs, such as program instructions / modules corresponding to the methods in the embodiments of the present disclosure. The processor 100 executes functional applications and data processing by running the program instructions / modules stored in the memory 101, that is, implementing the text processing method in the above-mentioned embodiment.

[0090] The memory 101 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 101 may include a high-speed random access memory and may also include a non-volatile memory.

[0091] An embodiment of the present disclosure provides a storage medium storing computer executable instructions, wherein the computer executable instructions are configured to execute the above text processing method.

[0092] The above-mentioned storage medium may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.

[0093] The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiment of the present disclosure. The aforementioned storage medium may be a non-transient storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes, or a transient storage medium.

[0094] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent only possible changes. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. The parts and features of some embodiments may be included in or replace the parts and features of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and the claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of listings containing one or more associated ones. In addition, when used in the present application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.

[0095] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. The technicians may use different methods for each specific application to implement the described functions, but such implementations should not be considered to exceed the scope of the embodiments of the present disclosure. The technicians may clearly understand that, for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above may refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.

[0096] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.

[0097] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.

Claims

1. A text processing method, characterized in that: Applied to electronic devices, the electronic devices can display pinyin Chinese character cards; the method comprises: Receive input courseware files; Identify the location information and text content of each text in the courseware file; According to the location information and text content of each text, the pinyin in the courseware file is matched with the Chinese characters to obtain the pinyin Chinese character cards and display them.

2. The method according to claim 1, characterized in that Identify the location information and text content of each text in the courseware file, including: When the courseware file is an XML file, the XML file is parsed to obtain the position information and text content of each text in the courseware file; or, When the courseware file is a picture file, the position information and text content of each text in the courseware file are detected through the text detection model and the text recognition model.

3. The method according to claim 2, characterized in that Through the text detection model and text recognition model, the location information and text content of each text in the courseware file are detected, including: Input the image file into the text detection model so that the text detection model can detect the position information of each text in the courseware file; According to the location information of each text, obtain the image corresponding to each text; The pictures corresponding to each text are input into the text recognition model so that the text recognition model can detect the text content of each text in the courseware file.

4. The method according to claim 2, characterized in that: According to the location information and text content of each text, the pinyin in the courseware file is matched with the Chinese characters to obtain the pinyin Chinese character cards and display them, including: According to the position information and text content of each text in the courseware file, respectively calculate the overlap between the target pinyin and all Chinese characters in the courseware file; wherein the target pinyin is any pinyin in the courseware file; Selecting Chinese characters whose overlap with the target Chinese characters is greater than an overlap threshold from all Chinese characters to form a target Chinese character set; Based on the target Chinese character set, the target pinyin Chinese character card corresponding to the target Chinese character is generated and displayed.

5. The method according to claim 4, characterized in that Based on the target Chinese character set, generate and display the target pinyin Chinese character card corresponding to the target Chinese character, including: Deleting abnormal Chinese characters in the target Chinese character set to obtain an updated target Chinese character set; wherein the position of the abnormal Chinese characters is higher than the position of the target pinyin; Filtering target Chinese characters matching the target pinyin from the updated target Chinese character set; Based on the target pinyin and target Chinese characters, the target pinyin and Chinese character cards are generated and displayed.

6. The method according to claim 5, characterized in that From the updated target Chinese character set, select the target Chinese characters that match the target pinyin, including: Sort the Chinese characters in the updated target Chinese character set according to their overlap with the target pinyin; and The Chinese character with the largest overlap with the target pinyin in the updated target Chinese character set is determined as the target Chinese character.

7. The method according to claim 5, characterized in that Based on the target pinyin and target Chinese characters, generate and display the target pinyin and Chinese character cards, including: When the courseware file is an XML file, the position information of the target pinyin and the target Chinese character card is calculated according to the position information of the target pinyin and the target Chinese character; wherein the position information of the target Chinese character card is used to represent the position of the target pinyin and the target Chinese character in the courseware file; The target pinyin Chinese character card is displayed according to the position information of the target pinyin Chinese character card and the text content of the target pinyin and the text content of the target Chinese character in the target pinyin Chinese character card.

8. The method according to claim 5, characterized in that Based on the target pinyin and target Chinese characters, generate and display the target pinyin and Chinese character cards, including: In the case where the courseware file is a picture file, based on the target pinyin and the target Chinese character, determining the matching result of the target pinyin and the target Chinese character; According to the matching results of the target pinyin and the target Chinese character, the target pinyin Chinese character card is generated and displayed.

9. The method according to claim 8, characterized in that Based on the target pinyin and the target Chinese character, the matching result of the target pinyin and the target Chinese character is determined, including: Determine the correct pinyin of the target Chinese character according to the content of the target Chinese character; Compare the target pinyin and the correct pinyin of the target Chinese character to see if they are the same; If they are the same, the target pinyin and target Chinese characters match correctly; If they are not the same, the matching result of the target pinyin and the target Chinese character is determined based on the edit distance between the correct pinyin of the target Chinese character and the target pinyin.

10. The method according to claim 9, characterized in that According to the edit distance between the correct pinyin of the target Chinese character and the target pinyin, the matching result between the target pinyin and the target Chinese character is determined, including: When the edit distance between the correct pinyin of the target Chinese character and the target pinyin is less than the edit distance threshold, it is determined that the target pinyin matches the target Chinese character correctly; or, When the edit distance between the correct pinyin of the target Chinese character and the target pinyin is greater than or equal to the edit distance threshold, it is determined that the target pinyin and the target Chinese character are incorrectly matched.

11. The method according to claim 8, characterized in that According to the matching results of the target pinyin and the target Chinese character, the target pinyin Chinese character card is generated and displayed, including When the target pinyin and the target Chinese character match correctly, the position information of the target pinyin Chinese character card is calculated according to the position information of the target pinyin and the target Chinese character; wherein the position information of the target Chinese character card is used to represent the position of the target pinyin and the target Chinese character in the courseware file; The target pinyin Chinese character card is displayed according to the position information of the target pinyin Chinese character card and the text content of the target pinyin and the text content of the target Chinese character in the target pinyin Chinese character card.

12. The method according to any one of claims 8 to 11, characterized in that After determining the matching result between the target pinyin and the target Chinese character, the method further comprises: In the case where the target pinyin and the target Chinese character do not match correctly, the target pinyin and the target Chinese character will not be displayed.

13. A text processing device, characterized in that: include: The sending and receiving module is used to receive the input courseware files; Recognition module, used to identify the location information and text content of each text in the courseware file; The matching module is used to match the pinyin and Chinese characters in the courseware file according to the location information and text content of each text, obtain the pinyin Chinese character card and display it.

14. An electronic device, characterized in that: The invention comprises a processor and a memory storing program instructions, wherein the processor is configured to execute the text processing method according to any one of claims 1 to 12 when running the program instructions.

15. A storage medium storing program instructions, characterized in that: When the program instructions are executed, the text processing method according to any one of claims 1 to 12 is executed.