Method and apparatus for processing text

Through speech recognition technology, the user's handwritten text and the recognition text are compared, the differential word set is determined and typos verified, which solves the problem of time-consuming and inefficient typos checking in handwritten text, and realizes efficient typos detection.

CN112307748BActive Publication Date: 2024-11-22DOUYIN VISION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010134249.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-03-02
Publication Date
2024-11-22
Estimated Expiration
2040-11-22

AI Technical Summary

Technical Problem

Users are prone to typos when handwriting texts, especially primary and secondary school students are not proficient in writing Chinese characters, which makes typos checking time-consuming and inefficient.

Method used

By obtaining the text handwritten by the user, using the pronunciation features for speech recognition, comparing the words in the recognized text and handwritten text, determining the set of different characters, and judging suspected typos based on the set of different characters, and verifying them in combination with the preset vocabulary and grammatical rules.

Benefits of technology

It realizes convenient detection of typos in user handwritten text, reduces the time-consuming and misjudgment of manual inspection, and improves inspection efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112307748B_ABST
    Figure CN112307748B_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure disclose a method and device for processing text. A specific implementation of the method includes: obtaining text corresponding to the content written by a user as user text; determining the voice features of the voice corresponding to the user text, and performing voice recognition using the voice features to obtain recognized text; selecting characters from the user text that are different from the corresponding characters in the recognized text as difference characters to obtain a difference character set; determining the processing result of the content written by the user based on the difference character set, wherein the processing result is used to indicate suspected typos in the content written by the user. This implementation facilitates the convenient detection of typos in the content written by the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the field of computer technology, and in particular, to a method and device for processing text. Background Art

[0002] With the rapid development and widespread application of computer technology, in daily life, users can directly use the typing, voice, video and other functions provided by the electronic devices they use to communicate with other users, and the opportunities for users to write words by hand are becoming fewer and fewer. This also directly leads to users forgetting the correct way to write many words. Therefore, when users complete some content by handwriting (such as handwritten reports, handwritten manuscripts, etc.), typos are prone to occur.

[0003] In addition, for many students, especially primary and secondary school students, since they may not be proficient in writing Chinese characters, these users will also make typos when writing homework.

[0004] In the above examples, various users are prone to typos when writing. Usually, the user or the user's friends, parents, etc. need to carefully check to find the typos, and it is also easy to miss typos. In some cases, if the content written by the user includes too many words, such checking will also be very time-consuming. Summary of the invention

[0005] Embodiments of the present disclosure provide methods and devices for processing text.

[0006] In a first aspect, an embodiment of the present disclosure provides a method for processing text, the method comprising: obtaining text corresponding to content written by a user as user text; determining speech features of speech corresponding to the user text, and performing speech recognition using the speech features to obtain recognized text; selecting characters from the user text that are different from corresponding characters in the recognized text as difference characters to obtain a difference character set; determining a processing result of the content written by the user based on the difference character set, wherein the processing result is used to indicate suspected typos appearing in the content written by the user.

[0007] In some embodiments, the processing result of the content written by the user is determined based on the difference character set, including: for the difference character in the difference character set, the words containing the difference character are extracted from the user text to form the word set corresponding to the difference character; based on the word set corresponding to the difference character, determining whether the difference character is a suspected typo.

[0008] In some embodiments, determining whether the difference character is a suspected typo based on the word set corresponding to the difference character includes: determining whether a preset word library includes words in the word set corresponding to the difference character; in response to determining that the word library does not include words in the word set corresponding to the difference character, determining the difference character as a suspected typo.

[0009] In some embodiments, the above method also includes: selecting characters and words from a preset library of frequently missed characters from the user text as candidate characters to obtain a candidate character set; for the candidate characters in the candidate character set, determining whether the candidate character is a suspected missed character; in response to determining that the candidate character is a suspected missed character, updating the processing result.

[0010] In some embodiments, determining whether the candidate word is a suspected typo includes: determining whether the candidate word is a suspected typo based on a grammatical rule corresponding to the candidate word.

[0011] In some embodiments, the method further includes: receiving user feedback information regarding the processing result; and updating the vocabulary according to the user feedback information.

[0012] In some embodiments, the above method further includes: updating the set of wrong characters constructed for the user according to user feedback information.

[0013] In a second aspect, an embodiment of the present disclosure provides a device for processing text, the device comprising: an acquisition unit, configured to acquire text corresponding to content written by a user as user text; a recognition unit, configured to determine speech features of speech corresponding to the user text, and perform speech recognition using the speech features to obtain recognized text; a selection unit, configured to select characters from the user text that are different from corresponding characters in the recognized text as difference characters, to obtain a difference character set; a processing unit, configured to determine a processing result of the content written by the user based on the difference character set, wherein the processing result is used to indicate suspected typos appearing in the content written by the user.

[0014] In some embodiments, the processing unit is further configured to extract the words containing the difference character from the user text to form the word set corresponding to the difference character in the difference character set; and determine whether the difference character is a suspected typo based on the word set corresponding to the difference character.

[0015] In some embodiments, the processing unit is further configured to determine whether a preset word library includes a word in a word set corresponding to the difference character; in response to determining that the word library does not include a word in a word set corresponding to the difference character, determine the difference character as a suspected typo.

[0016] In some embodiments, the selection unit is further configured to select characters and words from a preset library of frequently missed characters from the user text as candidate characters to obtain a candidate character set; the processing unit is further configured to determine, for a candidate character in the candidate character set, whether the candidate character is a suspected missed character; and in response to determining that the candidate character is a suspected missed character, update the processing result.

[0017] In some embodiments, the processing unit is further configured to determine whether the candidate word is a suspected typo based on a grammatical rule corresponding to the candidate word.

[0018] In some embodiments, the above-mentioned apparatus further includes: a receiving unit configured to receive user feedback information regarding the processing result; and an updating unit configured to update the vocabulary according to the user feedback information.

[0019] In some embodiments, the updating unit is further configured to update the set of wrong characters constructed for the user according to user feedback information.

[0020] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs; when the one or more programs are executed by one or more processors, the one or more processors implement the method described in any implementation manner in the first aspect.

[0021] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any implementation manner in the first aspect.

[0022] The method and device for processing text provided by the embodiments of the present disclosure obtain user text corresponding to the content written by the user, obtain recognized text through voice recognition based on the voice features of the user text, and then obtain a difference character set by comparing the corresponding characters in the user text and the recognized text. Since the recognized text through voice recognition can represent the relatively common and natural text representation of the above-mentioned voice features, the recognized text can be used as a control for the user text, and a difference character set can be obtained through comparison, and the difference character can indicate that the character may not be a common or natural text representation of the above-mentioned voice features, so that suspected typos in the content written by the user can be determined based on the obtained difference character set, which helps to realize convenient detection of typos in the content written by the user. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Other features, objects and advantages of the present disclosure will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:

[0024] Figure 1 is an exemplary system architecture diagram in which an embodiment of the present disclosure may be applied;

[0025] Figure 2 is a flow chart of an embodiment of a method for processing text according to the present disclosure;

[0026] Figure 3is a flowchart of another embodiment of a method for processing text according to the present disclosure;

[0027] Figure 4 is a schematic diagram of an application scenario of a method for processing text according to an embodiment of the present disclosure;

[0028] Figure 5 is a flowchart of another embodiment of a method for processing text according to the present disclosure;

[0029] Figure 6 is a structural schematic diagram of an embodiment of an apparatus for processing text according to the present disclosure;

[0030] Figure 7 It is a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure. DETAILED DESCRIPTION

[0031] The present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.

[0032] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0033] Figure 1 An exemplary architecture 100 is shown to which an embodiment of a method for processing text or an apparatus for processing text of the present disclosure can be applied.

[0034] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0035] The terminal devices 101, 102, 103 interact with the server 105 via the network 104 to receive or send messages, etc. The terminal devices 101, 102, 103 may be installed with client applications, such as browser applications, search applications, image processing applications, voice processing applications, and the like.

[0036] Terminal devices 101, 102, 103 can be hardware or software. When terminal devices 101, 102, 103 are hardware, they can be various electronic devices, including but not limited to smart phones, tablet computers, e-book readers, laptop portable computers and desktop computers, etc. When terminal devices 101, 102, 103 are software, they can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, multiple software or software modules for providing distributed services), or it can be implemented as a single software or software module. No specific limitation is made here.

[0037] The server 105 may be a server that provides various services, such as a server that provides backend support for client applications installed on the terminal devices 101, 102, and 103. The server 105 may analyze and process the text submitted by the client (such as the text corresponding to the content written by the user, etc.), and feed back the processing results (such as suspected typos in the content written by the user, etc.) to the terminal devices 101, 102, and 103.

[0038] It should be noted that the text submitted by the above-mentioned client (such as the text corresponding to the content written by the user, etc.) can also be directly stored locally on the server 105. The server 105 can directly extract the locally stored data and process it. At this time, the terminal devices 101, 102, 103 and the network 104 may not exist.

[0039] It should be noted that the method for processing text provided in the embodiments of the present disclosure is generally executed by the server 105 , and accordingly, the device for processing text is generally disposed in the server 105 .

[0040] It should also be noted that the terminal devices 101, 102, and 103 may also directly process text (such as the text corresponding to the content written by the user mentioned above), and in this case, the method for processing text may also be executed by the terminal devices 101, 102, and 103, and accordingly, the apparatus for processing text may also be set in the terminal devices 101, 102, and 103. In this case, the exemplary system architecture 100 may not have the server 105 and the network 104.

[0041] It should be noted that the server 105 can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server is software, it can be implemented as multiple software or software modules (for example, multiple software or software modules for providing distributed services), or it can be implemented as a single software or software module. No specific limitation is made here. The number is only illustrative. According to the implementation needs, there can be any number of terminal devices, networks and servers.

[0042] Continue to refer Figure 2 , which shows a process 200 of an embodiment of a method for processing text according to the present disclosure. The method for processing text comprises the following steps:

[0043] Step 201: Acquire text corresponding to the content written by the user as user text.

[0044] In this embodiment, the execution body of the method for processing text (such as Figure 1 The server 105 shown in the figure can be accessed from a local or other storage device (such as Figure 1 The terminal devices 101, 102, 103 shown), databases, third-party data platforms, etc. obtain the text corresponding to the content written by the user.

[0045] The content written by the user may be text written by the user for various purposes. For example, the content written by the user includes but is not limited to homework, reports, articles, lyrics, letters, etc. It should be understood that the content written by the user may be different for different types of users. For example, for students, the content written by them includes but is not limited to classwork, homework, answers written on test papers, etc. For adults, the content written by them includes but is not limited to work reports, emails, etc.

[0046] In this embodiment, the user text may be composed of the characters in the content written by the user in the order in which the characters are written by the user. According to different application requirements and application scenarios, the text corresponding to the content written by the user may be flexibly set to be obtained.

[0047] Optionally, an image for presenting the content written by the user may be first obtained, and then the text corresponding to the content written by the user may be obtained based on the obtained image. The method for obtaining the above-mentioned image may be flexibly set. For example, the above-mentioned image may be obtained by photographing the content written by the user. At this time, the text in the image may be extracted based on various existing image processing technologies (such as optical character recognition, etc.), thereby obtaining the text corresponding to the content written by the user.

[0048] It should be understood that the above-mentioned execution entity may directly obtain the image for presenting the content written by the user, or other storage devices may first obtain the image for presenting the content written by the user and then send the obtained image to the above-mentioned execution entity.

[0049] Optionally, the text corresponding to the content written by the user may be acquired based on a scan result obtained by the user using a scanning device (such as a scanning pen, etc.) to scan the content written by the user.

[0050] It should be understood that the above execution entity can be communicatively connected to the scanning device. At this time, the above execution entity can directly receive the above scanning result. Of course, the scanning device can also be communicatively connected to other storage devices. At this time, the other storage devices can receive the above scanning result and then forward the scanning result to the above execution entity.

[0051] It should be noted that the users in this disclosure can refer to various types of users. For example, they can refer to children (such as primary and middle school students), the elderly, and so on.

[0052] Step 202, determine the voice features of the voice corresponding to the user text, and perform voice recognition using the voice features to obtain the recognized text.

[0053] In this embodiment, the voice features can be used to characterize the pronunciation features of each character in the user text. The voice features can adopt various existing types of voice features. For example, the voice features can be pinyin. At this time, the voice features of the voice corresponding to the user text can be used to indicate the pinyin of each character in the user text. Another example is that the voice features can be phonemes. At this time, the voice features of the voice corresponding to the user text can be used to indicate the phonemes of each character in the user text.

[0054] In this embodiment, various existing TTS (Text To Speech) technologies can be used to determine the voice features of the voice corresponding to the user text. At the same time, various existing voice recognition technologies can be used to process the obtained voice features to obtain the text corresponding to the recognized voice features as the recognized text.

[0055] It should be understood that generally, the obtained recognized text has a corresponding relationship with the above user text. Specifically, the user text can be regarded as a character sequence composed of each character in the user text in sequence. Similarly, the recognized text can be regarded as a character sequence composed of each character in the recognized text in sequence. Since the user text and the recognized text respectively correspond to the same voice features. Therefore, the characters in the character sequence corresponding to the user text and the characters in the character sequence corresponding to the recognized text are in one-to-one correspondence in sequence, and the corresponding two characters have the same voice features. Among them, in sequence can refer to the reading order.

[0056] As an example, the user text is "his burden", the voice features corresponding to the user text are "ta de bao fu", and the recognized text obtained according to the voice features is "his aspiration". At this time, "他 (ta)" in the user text corresponds to "他 (ta)" in the recognized text. "的 (de)" in the user text corresponds to "的 (de)" in the recognized text. "包 (bao)" in the user text corresponds to "抱 (bao)" in the recognized text. "袱 (fu)" in the user text corresponds to "负 (fu)" in the recognized text.

[0057] It should be noted that the above user text is only an example, and the length of the user text can be arbitrary. That is, the number of characters included in the user text can be arbitrary. This disclosure does not limit this.

[0058] Step 203: Select characters in the user text that are different from corresponding characters in the recognition text as difference characters to obtain a difference character set.

[0059] In this embodiment, as described in step 202, for a character in the user text, the character in the recognized text corresponding to the character is a character that has the same phonetic features as the character in sequence. Generally, the characters in the user text correspond one-to-one to the characters in the recognized text.

[0060] Therefore, the characters in the user text can be compared with the characters in the recognition text one by one to obtain a difference character set. In other words, for a character in the user text, it can be determined whether the character corresponding to the character in the recognition text is the same as the character. If the two are the same, it means that there is no difference between the two characters. If the two are not the same, the character can be determined as a difference character.

[0061] Step 204: Determine the processing result of the content written by the user according to the difference character set.

[0062] In this embodiment, the processing result can be used to indicate suspected wrong characters in the content written by the user. The suspected wrong characters can be used to indicate that the character has a certain possibility of being a wrong character.

[0063] Optionally, it may be directly determined that each character in the difference character set is a suspected wrong character.

[0064] In this embodiment, after obtaining the processing result, the obtained processing result can be displayed to the target user, so as to prompt the target user of possible typos in the content written by the above user. The target user can be an associated user of the user corresponding to the above user text. In this way, it is convenient for the user to check and correct the written content according to the prompt information.

[0065] For example, when the user corresponding to the user text is a child, the target user may be the child's parent or teacher. At this time, the parent or teacher can check the content written by the child (such as homework) in a targeted manner according to the prompt information, which can effectively improve the checking efficiency compared with the method of manually checking the typos in the content written by the child by the parent or teacher.

[0066] The method provided by the above-mentioned embodiments of the present disclosure utilizes text-to-speech and other processing technologies to obtain the voice features corresponding to the user text corresponding to the content written by the user, and then utilizes the voice recognition technology to obtain the recognized text corresponding to the voice features, and then obtains the difference character set by comparing the user text and the recognized text, and determines the possible typos that may appear in the content written by the user, that is, suspected typos, based on the difference character set, and then the user or its associated users can conduct targeted checks on the suspected typos, effectively alleviating the time-consuming and inefficient problems of checking typos in the content written by the user by relying solely on manual inspection.

[0067] Further references Figure 3 , which shows a process 300 of another embodiment of a method for processing text. The process 300 of the method for processing text includes the following steps:

[0068] Step 301: Acquire text corresponding to the content written by the user as user text.

[0069] Step 302: determine the speech features of the speech corresponding to the user text, and perform speech recognition using the speech features to obtain recognized text.

[0070] Step 303: Select characters in the user text that are different from corresponding characters in the recognition text as difference characters to obtain a difference character set.

[0071] The specific execution process of the above steps 301, 302 and 303 can be referred to Figure 2 The relevant descriptions of steps 201, 202 and 203 in the corresponding embodiment are not repeated here.

[0072] Step 304 , for a difference character in the difference character set, extract the words where the difference character is located from the user text to form a word set corresponding to the difference character, and determine whether the difference character is a suspected wrong character according to the word set corresponding to the difference character.

[0073] In this embodiment, for each difference character, the word in which the difference character is located may refer to the difference character and a preset number of characters before and / or after it in a specified reading order. The preset number can be set according to the actual application scenario. Since the difference character and several characters before it, several characters after it, several characters before it, and several characters after it can all form a word. Therefore, there can be multiple words in which a difference character is located, that is, the number of words included in the word set can be multiple. And the specific number of words included in the word set can be set according to the actual application requirements.

[0074] Optionally, the word set corresponding to the difference character may be composed of each word in the user text where the difference character is located and whose length is not less than 2 and not more than 4.

[0075] The following is an example for illustration: The user text is "Voice is the most natural interaction method for humans", where the different character is "得" (a Chinese character). At this time, the words that contain the character "得" and have a length of not less than 2 and not more than 4 include: 然得, 自然得, 最自然得, 得交, 得交互, 得交互方, 然得交, 然得交互, 自然得交.

[0076] In this embodiment, various existing language processing technologies can be used to determine whether the different character is a suspected misspelled character according to the set of words corresponding to the different character.

[0077] Optionally, for the words in the set of words corresponding to the different character, the word can be regarded as a text, and various existing word segmentation methods can be used to process the word to obtain a word segmentation result. Among them, the word segmentation result can be used to represent whether the word is segmented into a target number of characters. The target number is equal to the number of characters included in the word. In response to determining that each word in the set of words corresponding to the different character is segmented into the target number of characters, it is determined that the different character is a suspected misspelled character.

[0078] Since a word is segmented into the same number of characters as the number of characters it includes, it can be explained that the word is not a word that conforms to the natural language rules. Therefore, if each word where a different character is located is not a word that conforms to the natural language rules, it can be explained that the different character is very likely a misspelled character written by the user.

[0079] Optionally, the following steps can be used to determine whether the different character is a suspected misspelled character according to the set of words corresponding to the different character: Determine whether the words in the set of words corresponding to the different character are included in the preset word library; In response to determining that the word library does not include the words in the set of words corresponding to the different character, determine the different character as a suspected misspelled character.

[0080] Among them, the preset word library can be set by technicians in advance. For example, the word library can be composed of all the words in the existing dictionaries. Another example is that the word library can be some existing public word libraries.

[0081] If a word exists in the word library, it can indicate that the word belongs to a word that conforms to the natural language rules. If a word does not exist in the word library, it can indicate that the word does not belong to a word that conforms to the natural language rules, that is, the word may be a wrong word. Based on this, if the word library does not include each word in the set of words corresponding to the different character, it means that each word where the different character is located does not conform to the natural language rules. Therefore, the different character is very likely a misspelled character.

[0082] Since the word library can usually cover almost all common words, therefore, by using the word library to judge the words where the different characters are located in the user text, the accuracy of the determined suspected misspelled characters can be improved, and the situation of excessive misjudgment can be avoided.

[0083] In some optional implementations of this embodiment, after obtaining the processing result of the content written by the user, the processing result can be displayed to the user. Furthermore, user feedback information for the processing result can also be received, and then the preset word library is updated according to the user feedback information. Among them, the user feedback information can be used to indicate whether each suspected typo indicated by the processing result is a real typo.

[0084] Based on this, the preset vocabulary is updated using user feedback information. Through such repeated iterative updates, the richness and comprehensiveness of the vocabulary can be expanded, so that in the subsequent processing of user-written content, misjudgments can be reduced and the accuracy of processing results can be improved.

[0085] In some optional implementations of this embodiment, after receiving user feedback information, the wrong character set constructed for the user can be further updated. The wrong character set constructed for the user can be used to record wrong characters that have appeared in the content written by the user.

[0086] In this way, a personalized typo set can be built for each user, and the typo set can be updated through continuous iteration. When checking the content written by the user later, the user's corresponding typo set can be used to further check the user's content, which helps to further reduce the occurrence of undetected typos and improve the accuracy of the processing results of the user's text.

[0087] Continue to see Figure 4 , Figure 4 FIG. 4 is a schematic diagram 400 of an application scenario of the method for processing text according to this embodiment. Figure 4 In the application scenario, the homework 401 written by the user is "played a game of kicking keys with classmates", and the homework 401 is photographed by the camera 4021 of the mobile phone 402 to obtain a homework image, and then the mobile phone 402 can send the photographed homework image to the server 403.

[0088] The server 403 may first recognize the homework image based on the OCR (Optical Character Recognition) technology to obtain the user text 404. Then the server 403 may obtain the pinyin 405 corresponding to the user text 404 based on the TTS technology. Specifically, the pinyin 405 is "he tong xue wan le ti jian zi de you xi". Afterwards, the server 403 may recognize the pinyin 405 using the speech recognition technology to obtain the recognized text 406. Specifically, the recognized text 406 is "I played the shuttlecock kicking game with my classmates".

[0089] The server 403 can compare the characters in the user text 404 and the recognized text 406 one by one in the reading order, and can determine that the “ ” in the user text 404 is different from the corresponding “ ” in the recognized text 406. Therefore, the “ ” in the user text 404 can be determined as the difference character 407.

[0090] The server 403 can extract the words where the difference characters 407 are located in the user text 404 to form a word set 408. The length of the words where the extracted difference characters 407 are located is not less than 2 and not less than 4. Specifically, the word set 408 includes the following 9 words: kick key, kick key, play kick key, key, key, key game, key game, kick key, kick key, kick key, play kick key.

[0091] Afterwards, the server 403 can search in the word library 409 whether each word in the word set 408 is included, and obtain a search result 410. The search result 410 is used to indicate that any word in the word set 408 is not found in the word library 409. Based on this, a correction result 411 of the homework 401 written by the user can be obtained. The correction result 411 is used to indicate that the "key" in the homework 401 written by the user may be a typo. At the same time, the server 403 can send the correction result 411 to the terminal device 402, so that the user can check whether the "key" in the homework 401 is indeed a typo according to the correction result and make corresponding corrections.

[0092] from Figure 3 It can be seen that Figure 2 Compared with the corresponding embodiments, the process 300 of the method for processing text in this embodiment highlights that after comparing the user text and the recognized text to obtain a difference character set, it can be determined whether the word where the difference character in the difference character set is located in the user text exists in the vocabulary to determine whether the difference character is a suspected typo, which helps to improve the accuracy of the determined suspected typos.

[0093] Further references Figure 5 , which shows a process 500 of another embodiment of a method for processing text. The process 500 of the method for processing text includes the following steps:

[0094] Step 501: Acquire text corresponding to the content written by the user as user text.

[0095] Step 502: determine the speech features of the speech corresponding to the user text, and perform speech recognition using the speech features to obtain recognized text.

[0096] Step 503: Select characters in the user text that are different from corresponding characters in the recognition text as difference characters to obtain a difference character set.

[0097] Step 504, for the difference character in the difference character set, extract the words in which the difference character is located from the user text to form a word set corresponding to the difference character; determine whether the preset word library includes the words in the word set corresponding to the difference character; in response to determining that the word library does not include the words in the word set corresponding to the difference character, determine the difference character as a suspected typo.

[0098] The specific execution process of the above steps 501, 502, 503 and 504 can be referred to Figure 3 The relevant descriptions of steps 301, 302, 303 and 304 in the corresponding embodiment are not repeated here.

[0099] Step 505, selecting characters and words in a preset frequently-misspelled word library from the user text as candidate words, and obtaining a candidate word set.

[0100] In this embodiment, the frequently-misspelled word word library can be preset by a technician. For example, the frequently-misspelled word word library can be obtained based on the statistical analysis of the processing results of a large number of user texts. For another example, the frequently-misspelled word word library can be provided by a third party. It should be understood that the frequently-misspelled word word library includes both single characters and words.

[0101] For each character in the user text, if the character exists in the frequently-misspelled character database, it can be explained that the character is likely to be a misspelled character.

[0102] Step 506, for a candidate word in the candidate word set, determine whether the candidate word is a suspected typo, and in response to determining that the candidate word is a suspected typo, update the processing result.

[0103] In this embodiment, since the candidate words are likely to be typos, the determined candidate words can be further judged, and when the candidate words are determined to be suspected typos, the above processing results can be updated as supplementary processing results.

[0104] It should be understood that if a candidate word determined to be a suspected typo is also a difference word determined to be a suspected typo, it only needs to be recorded once.

[0105] In this embodiment, different methods for determining whether a candidate word is a suspected typo can be selected according to different application scenarios.

[0106] Optionally, while constructing a frequently used word library, the incorrect usage of each word in the frequently used word library can be recorded. At this time, whether the candidate word is a suspected wrong word can be determined by judging whether the usage of the candidate word belongs to the corresponding incorrect usage. If the candidate word belongs to the corresponding incorrect usage, the candidate word can be determined to be a suspected wrong word. For example, whether the usage of the candidate word is correct can be judged by the sentence in which the candidate word is located in the user text.

[0107] It should be understood that for a word, if the word is a misspelled word, it can indicate that one or more characters in the word are misspelled, or it can indicate that all the characters in the word are misspelled. The specific meaning can be flexibly set according to actual application requirements.

[0108] Optionally, for the candidate words in the candidate word set, the following method can be used to determine whether the candidate word is a suspected misspelled word, including: determining whether the candidate word is a suspected misspelled word according to the grammar rules corresponding to the candidate word.

[0109] Among them, the grammar rules can refer to the rules that must be followed when a word is used correctly. It should be understood that the grammar rules corresponding to different words can be different.

[0110] For example, "的", "得", and "地" are several characters that users are prone to misusing when writing. Therefore, the three characters "的", "得", and "地" can be recorded in the frequently misspelled word set. At this time, the grammar rule corresponding to "的" can be that in the reading order, the part of speech of the word before "的" is an adjective or a pronoun, and the part of speech of the word after "的" is a noun. The grammar rule corresponding to "得" can be that in the reading order, the part of speech of the word before "得" is a verb, and the part of speech of the word after "得" is an adverb. The grammar rule corresponding to "地" can be that in the reading order, the part of speech of the word before "地" is an adverb, and the part of speech of the word after "地" is a verb.

[0111] Therefore, in this case, if the content written by the user includes the characters among these three characters, it is determined that the characters among these three characters included in the user text are candidate characters. Then, in the reading order, it can be judged whether it is used correctly according to the part of speech of the word before and after the candidate character. If the candidate word is used incorrectly, it can be determined that the candidate word is a suspected misspelled word.

[0112] For another example, quantifiers are also prone to incorrect usage. Therefore, each quantifier (such as 个, 棵, 颗, 种, 匹, 条, etc.) can be recorded in the frequently misspelled subset. At this time, the grammar rule for each quantifier can be that in the reading order, the quantifier and the word after it belong to a fixed collocation.

[0113] For example, for each quantifier, various fixed collocations corresponding to the quantifier are constructed to obtain the fixed collocation set corresponding to the quantifier. At this time, when a quantifier is detected in the content written by the user, it is judged in the reading order whether the collocation formed by the quantifier and the word after it belongs to the fixed collocation set corresponding to the quantifier. If not, it can be determined that the quantifier is a suspected misspelled word.

[0114] From Figure 5 it can be seen that compared with Figure 2 and Figure 3Compared with the corresponding embodiment, the process 500 of the method for processing text in this embodiment highlights the step of determining suspected typos in the content written by the user by using voice processing technology, and also determining the words that appear in the content written by the user and are commonly wrong words to determine whether these words are written correctly by the user. Therefore, the scheme described in this embodiment checks the words in the content written by the user from multiple aspects, further improves the inspection strength, helps to obtain more comprehensive processing results, and reduces the situation where typos are missed.

[0115] Further references Figure 6 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a device for processing text, and the device embodiment is Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0116] like Figure 6 As shown, the apparatus 600 for processing text provided in this embodiment includes an acquisition unit 601, a recognition unit 602, a selection unit 603 and a processing unit 604. The acquisition unit 601 is configured to acquire the text corresponding to the content written by the user as the user text; the recognition unit 602 is configured to determine the voice features of the voice corresponding to the user text, and perform voice recognition using the voice features to obtain the recognized text; the selection unit 603 is configured to select characters different from the corresponding characters in the recognized text from the user text as difference characters to obtain a difference character set; the processing unit 604 is configured to determine the processing result of the content written by the user according to the difference character set, wherein the processing result is used to indicate suspected typos appearing in the content written by the user.

[0117] In the apparatus 600 for processing text in this embodiment, the specific processing of the acquisition unit 601, the recognition unit 602, the selection unit 603 and the processing unit 604 and the technical effects thereof can be referred to in Figure 2 The relevant descriptions of step 201, step 202, step 203 and step 204 in the corresponding embodiment are not repeated here.

[0118] In some optional implementations of the present embodiment, the processing unit 604 is further configured to extract, for a difference character in the difference character set, the words in which the difference character is located from the user text to form a word set corresponding to the difference character; and determine whether the difference character is a suspected typo based on the word set corresponding to the difference character.

[0119] In some optional implementations of this embodiment, the processing unit 604 is further configured to determine whether a preset vocabulary includes a word in the word set corresponding to the difference character; in response to determining that the vocabulary does not include a word in the word set corresponding to the difference character, the difference character is determined as a suspected typo.

[0120] In some optional implementations of the present embodiment, the selection unit 603 is further configured to select characters and words from a preset library of frequently-misspelled characters from the user text as candidate characters to obtain a candidate character set; the processing unit 604 is further configured to determine, for a candidate character in the candidate character set, whether the candidate character is a suspected typo; and in response to determining that the candidate character is a suspected typo, update the processing result.

[0121] In some optional implementations of this embodiment, the processing unit 604 is further configured to determine whether the candidate word is a suspected typo based on the grammatical rule corresponding to the candidate word.

[0122] In some optional implementations of this embodiment, the above-mentioned device 600 for processing text also includes: a receiving unit (not shown in the figure) is configured to receive user feedback information on the processing results; an updating unit (not shown in the figure) is configured to update the vocabulary based on the user feedback information.

[0123] In some optional implementations of this embodiment, the updating unit is further configured to update the wrong character set constructed for the user according to user feedback information.

[0124] The device provided by the above-mentioned embodiments of the present disclosure obtains the text corresponding to the content written by the user as the user text through the acquisition unit; the recognition unit determines the voice features of the voice corresponding to the user text, and uses the voice features to perform voice recognition to obtain the recognized text; the selection unit selects characters different from the corresponding characters in the recognized text from the user text as difference characters to obtain a difference character set; the processing unit determines the processing result of the content written by the user according to the difference character set, wherein the processing result is used to indicate suspected typos appearing in the content written by the user, thereby realizing the detection of suspected typos in the content written by the user, and then the user or its associated users can check the suspected typos in a targeted manner, effectively alleviating the problem of long time consumption and low efficiency in checking typos in the content written by the user only by relying on manual inspection.

[0125] Reference below Figure 7 , which shows an electronic device (eg, Figure 1 A schematic diagram of the structure of the server 700. Figure 7The terminal device / server shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0126] like Figure 7 As shown, the electronic device 700 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 are also stored. The processing device 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0127] Typically, the following devices may be connected to the I / O interface 705: an input device 706 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 708 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 709. The communication device 709 may allow the electronic device 700 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 7 The electronic device 700 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 7 Each block shown in the figure may represent one device, or may represent multiple devices as required.

[0128] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 709, or installed from a storage device 708, or installed from a ROM 702. When the computer program is executed by the processing device 701, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0129] It should be noted that the computer-readable medium described in the embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the embodiments of the present disclosure, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device. In the embodiments of the present disclosure, the computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0130] The computer-readable medium may be included in the electronic device; or it may exist independently without being installed in the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: obtains the text corresponding to the content written by the user as the user text; determines the voice features of the speech corresponding to the user text, and uses the voice features to perform speech recognition to obtain the recognized text; selects characters from the user text that are different from the corresponding characters in the recognized text as difference characters to obtain a difference character set; determines the processing result of the content written by the user based on the difference character set, wherein the processing result is used to indicate suspected typos in the content written by the user.

[0131] Computer program code for performing the operations of embodiments of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on a user's computer, partially on a user's computer, as a separate software package, partially on a user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0132] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a 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. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0133] The units involved in the embodiments described in the present disclosure may be implemented by software or by hardware. The described units may also be provided in a processor, for example, may be described as: a processor including an acquisition unit, an identification unit, a selection unit, and a processing unit. The names of these units do not, in some cases, constitute limitations on the units themselves, for example, the acquisition unit may also be described as "a unit for acquiring text corresponding to the content written by a user as user text".

[0134] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with the technical features with similar functions disclosed in the embodiments of the present disclosure (but not limited to) to form a technical solution.

Claims

1. A method for processing text, comprising: Obtain the text corresponding to the content written by the user as the user text; Determining speech features of speech corresponding to the user text based on text-to-speech technology, and performing speech recognition using the speech features to obtain recognized text; Selecting characters from the user text that are different from corresponding characters in the recognition text as difference characters to obtain a difference character set; Determining a processing result of the content written by the user according to the difference character set, wherein the processing result is used to indicate suspected typos in the content written by the user; The determining, according to the difference character set, a processing result of the content written by the user includes: For the difference characters in the difference character set, the words where the difference characters are located are extracted from the user text to form a word set corresponding to the difference characters; based on the word set corresponding to the difference characters, it is determined whether the difference characters are suspected typos; if all the words where the difference characters are located are not words that conform to the rules of natural language, the difference characters are determined to be suspected typos.

2. The method according to claim 1, wherein: The step of determining whether the different character is a suspected wrong character according to the word set corresponding to the different character comprises: Determine whether the preset word library includes the word in the word set corresponding to the difference character; In response to determining that the word library does not include a word in the word set corresponding to the difference character, the difference character is determined as a suspected wrong character.

3. The method according to claim 1, wherein: The method further comprises: Selecting characters and words in a preset frequently-misspelled word library from the user text as candidate words to obtain a candidate word set; For a candidate word in the candidate word set, determine whether the candidate word is a suspected typo; in response to determining that the candidate word is a suspected typo, update the processing result.

4. The method according to claim 3, wherein: The step of determining whether the candidate word is a suspected typo includes: According to the grammatical rules corresponding to the candidate word, determine whether the candidate word is a suspected typo.

5. The method according to claim 2, wherein: The method further comprises: receiving user feedback information regarding the processing result; The word library is updated according to the user feedback information.

6. The method according to any one of claims 1 to 5, wherein: The method further comprises: According to the user feedback information, a set of wrong characters constructed for the user is updated.

7. A device for processing text, comprising: An acquisition unit is configured to acquire text corresponding to the content written by the user as user text; A recognition unit, configured to determine speech features of the speech corresponding to the user text based on a text-to-speech technology, and perform speech recognition using the speech features to obtain a recognized text; a selection unit configured to select characters different from corresponding characters in the recognition text from the user text as difference characters to obtain a difference character set; a processing unit configured to determine a processing result of the content written by the user according to the difference character set, wherein the processing result is used to indicate suspected typos appearing in the content written by the user; The processing unit is further configured to extract, for a difference character in the difference character set, the words in which the difference character is located from the user text to form a word set corresponding to the difference character; determine whether the difference character is a suspected typo based on the word set corresponding to the difference character, and if all the words in which the difference character is located are not words that conform to the rules of natural language, determine that the difference character is a suspected typo.

8. An electronic device comprising: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.

9. A computer readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.