CN112307748B - Method and apparatus for processing text - Google Patents

Method and apparatus for processing text Download PDF

Info

Publication number
CN112307748B
CN112307748B CN202010134249.7A CN202010134249A CN112307748B CN 112307748 B CN112307748 B CN 112307748B CN 202010134249 A CN202010134249 A CN 202010134249A CN 112307748 B CN112307748 B CN 112307748B
Authority
CN
China
Prior art keywords
word
user
text
difference
words
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010134249.7A
Other languages
Chinese (zh)
Other versions
CN112307748A (en
Inventor
请求不公布姓名
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202010134249.7A priority Critical patent/CN112307748B/en
Publication of CN112307748A publication Critical patent/CN112307748A/en
Application granted granted Critical
Publication of CN112307748B publication Critical patent/CN112307748B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Document Processing Apparatus (AREA)

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.

Description

Method and device for processing text
Technical Field
Embodiments of the present disclosure relate to the field of computer technology, and in particular, to a method and apparatus for processing text.
Background
With the rapid development and widespread use of computer technology. In daily life, users can directly communicate with other users by utilizing typing, voice, video and other functions provided by the electronic equipment used, and the less chance the users write some words. This also directly results in the user forgetting the correct writing of many words. Thus, when some contents (such as a handwritten report, a handwritten document, etc.) are completed by handwriting, a user is liable to misplace a word.
In addition, many students, especially students in middle and primary schools, may not be skilled in writing Chinese characters, so that the users can also wrongly write the Chinese characters during writing.
For the situation that the wrongly written characters are easy to appear when various users write in the above examples, the wrongly written characters are usually required to be carefully checked by the users themselves or friends, parents and the like of the users, and missing wrongly written characters are easy to appear. In some cases, this is also time consuming if the user writes content that includes too many words.
Disclosure of Invention
Embodiments of the present disclosure propose methods and apparatus for processing text.
In a first aspect, embodiments of the present disclosure provide a method for processing text, the method comprising: acquiring a text corresponding to content written by a user as a user text; determining voice characteristics of voice corresponding to the user text, and performing voice recognition by utilizing the voice characteristics to obtain a recognition text; selecting words different from the corresponding words in the identification text from the user text as difference words, and obtaining a difference word set; and determining a processing result of the content written by the user according to the difference word set, wherein the processing result is used for indicating suspected wrongly written words in the content written by the user.
In some embodiments, determining a processing result of the content written by the user according to the difference word set comprises: for the difference words in the difference word set, extracting the word set where the difference word is located from the user text to form the word set corresponding to the difference word; and determining whether the difference word is a suspected wrongly written word or not according to the word set corresponding to the difference word.
In some embodiments, determining whether the difference word is a suspected mispronounced word according to the word set corresponding to the difference word includes: determining whether a preset word stock comprises words in a word set corresponding to the difference word; and determining the difference word as a suspected wrongly written word in response to determining that the word stock does not include the word in the word set corresponding to the difference word.
In some embodiments, the above method further comprises: selecting characters and words belonging to a preset frequently-staggered character word library from a user text as candidate words to obtain a candidate word set; for a candidate word in the candidate word set, determining whether the candidate word is a suspected mispronounced word; and updating the processing result in response to determining that the candidate word is a suspected wrongly written word.
In some embodiments, determining whether the candidate word is a suspected mispronounced word includes: and determining whether the candidate word is a suspected wrongly written word according to the grammar rule corresponding to the candidate word.
In some embodiments, the above method further comprises: receiving user feedback information aiming at a processing result; and updating the word stock according to the feedback information of the user.
In some embodiments, the above method further comprises: and updating the wrongly written word set constructed for the user according to the feedback information of the user.
In a second aspect, embodiments of the present disclosure provide an apparatus for processing text, the apparatus comprising: an acquisition unit configured to acquire text corresponding to content written by a user as user text; the recognition unit is configured to determine the voice characteristics of the voice corresponding to the user text and perform voice recognition by utilizing the voice characteristics to obtain a recognition text; a selection unit configured to select a word different from a word corresponding to the recognized text from the user text as a difference word, to obtain a difference word set; and the processing unit is configured to determine a processing result of the content written by the user according to the difference word set, wherein the processing result is used for indicating suspected wrongly written words in the content written by the user.
In some embodiments, the processing unit is further configured to extract, for a difference word in the difference word set, a word in which the difference word is located from the user text to form a word set corresponding to the difference word; and determining whether the difference word is a suspected wrongly written word or not according to the word set corresponding to the difference word.
In some embodiments, the processing unit is further configured to determine whether a word in the word set corresponding to the difference word is included in a preset word stock; and determining the difference word as a suspected wrongly written word in response to determining that the word stock does not include the word in the word set corresponding to the difference word.
In some embodiments, the selecting unit is further configured to select, from the user text, a word and a word in a word bank belonging to a preset frequently-wrong word as the candidate word, so as to obtain a candidate word set; the processing unit is further configured to determine, for a candidate word in the candidate word set, whether the candidate word is a suspected mispronounced word; and updating the processing result in response to determining that the candidate word is a suspected wrongly written word.
In some embodiments, the processing unit is further configured to determine whether the candidate word is a suspected misplaced word according to a grammar rule corresponding to the candidate word.
In some embodiments, the apparatus further comprises: a receiving unit configured to receive user feedback information for a processing result; and the updating unit is configured to update the word stock according to the user feedback information.
In some embodiments, the updating unit is further configured to update the set of misplaced words constructed for the user based on the user feedback information.
In a third aspect, embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage means for storing one or more programs; the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method as described in any of the implementations of the first aspect.
In a fourth aspect, embodiments of the present disclosure provide a computer readable medium having stored thereon a computer program which, when executed by a processor, implements a method as described in any of the implementations of the first aspect.
According to the method and the device for processing the text, the user text corresponding to the content written by the user is obtained, the recognition text is obtained through voice recognition according to the voice characteristics of the user text, and then the difference word set is obtained through comparing the user text with the corresponding words in the recognition text. Since the recognition text through voice recognition can represent the text representation with common and natural voice characteristics, the recognition text can be used as a comparison of the text of the user, a difference word set can be obtained through comparison, and the difference word can indicate that the word is probably not the text representation with common or natural voice characteristics, so that suspected wrongly written words in the content written by the user can be determined according to the obtained difference word set, and the convenience in detecting wrongly written words in the content written by the user can be realized.
Drawings
Other features, objects and advantages of the present disclosure will become more apparent upon reading of the detailed description of non-limiting embodiments, made with reference to the following drawings:
FIG. 1 is an exemplary system architecture diagram in which an embodiment of the present disclosure may be applied;
FIG. 2 is a flow chart of one embodiment of a method for processing text according to the present disclosure;
FIG. 3 is a flow chart of yet another embodiment of a method for processing text according to the present disclosure;
FIG. 4 is a schematic illustration of one application scenario of a method for processing text according to an embodiment of the present disclosure;
FIG. 5 is a flow chart of yet another embodiment of a method for processing text according to the present disclosure;
FIG. 6 is a schematic structural diagram of one embodiment of an apparatus for processing text according to the present disclosure;
Fig. 7 is a schematic structural diagram of an electronic device suitable for use in implementing embodiments of the present disclosure.
Detailed Description
The present disclosure is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings.
It should be noted that, without conflict, the embodiments of the present disclosure and features of the embodiments may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates an exemplary architecture 100 to which embodiments of the methods of the present disclosure for processing text or apparatuses for processing text may be applied.
As shown in fig. 1, a system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium to provide 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 fiber optic cables, among others.
The terminal devices 101, 102, 103 interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have client applications installed thereon. Such as browser-like applications, search-like applications, image processing-like applications, voice processing-like applications, and the like.
The terminal devices 101, 102, 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices including, but not limited to, smartphones, tablet computers, electronic book readers, laptop and desktop computers, and the like. When the terminal devices 101, 102, 103 are software, they can be installed in the above-listed electronic devices. Which may be implemented as multiple software or software modules (e.g., multiple software or software modules for providing distributed services) or as a single software or software module. The present invention is not particularly limited herein.
The server 105 may be a server providing various services, such as a server providing back-end support for client applications installed on the terminal devices 101, 102, 103. The server 105 may analyze the text submitted by the client (such as text corresponding to the content written by the user), and feed back the processing result (such as suspected wrongly written words in the content written by the user) to the terminal devices 101, 102, 103.
Note that, the text submitted by the client (such as text corresponding to the content written by the user) may also be directly stored in the local area of the server 105, and the server 105 may directly extract and process the locally stored data, where the terminal devices 101, 102, 103 and the network 104 may not exist.
It should be noted that, the method for processing text provided by the embodiments of the present disclosure is generally performed by the server 105, and accordingly, the apparatus for processing text is generally disposed in the server 105.
It should also be noted that the text (text corresponding to the content written by the user as described above) may also be processed directly in the terminal device 101, 102, 103, in which case the method for processing text may also be performed by the terminal device 101, 102, 103, and correspondingly the means for processing text may also be provided in the terminal device 101, 102, 103. At this point, the exemplary system architecture 100 may not have the server 105 and network 104 present.
It should be noted that, the server 105 may be hardware, or may be software. When the server is hardware, the server may be implemented as a distributed server cluster formed by a plurality of servers, or may be implemented as a single server. When the server is software, it may be implemented as a plurality of software or software modules (e.g., a plurality of software or software modules for providing distributed services), or as a single software or software module. The present invention is not particularly limited herein. Is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to fig. 2, a flow 200 of one embodiment of a method for processing text according to the present disclosure is shown. The method for processing text comprises the steps of:
in step 201, a text corresponding to the content written by the user is obtained as a user text.
In this embodiment, the execution subject of the method for processing text (such as the server 105 shown in fig. 1) may obtain text corresponding to the content written by the user from a local or other storage device (such as the terminal devices 101, 102, 103 shown in fig. 1), a database, a third party data platform, or the like.
Wherein the content written by the user can be written by the user for various purposes. For example, content written by a user includes, but is not limited to, jobs, reports, articles, lyrics, letters, and the like. It should be appreciated that the content written by a user may be different for different types of users. For example, for students, their written content includes, but is not limited to, classroom jobs, extracurricular jobs, answers written on test paper, and the like. For adults, the content they write includes, but is not limited to, work reports, mail, and the like.
In this embodiment, the user text may be composed of words in the content written by the user in the order of the user's writing. According to different application requirements and application scenes, the text corresponding to the content written by the user can be flexibly set and acquired.
Alternatively, an image for presenting the content written by the user may be acquired first, and then, based on the acquired image, a text corresponding to the content written by the user may be obtained. The mode of acquiring the image can be flexibly set. For example, the image may be obtained by photographing the content written by the user. At this time, text in the image may be extracted based on various existing image processing technologies (such as optical character recognition, etc.), so as to obtain text corresponding to the content written by the user.
It should be understood that the execution body may directly acquire the image for presenting the content written by the user, or may acquire the image for presenting the content written by the user from another storage device and then send the acquired image to the execution body.
Alternatively, the text corresponding to the content written by the user may be obtained according to a scanning result obtained by the user scanning the content written by the user using a scanning device (such as a scanning pen or the like).
It should be appreciated that the execution body described above may be communicatively coupled to a scanning device. At this time, the execution body may directly receive the scan result. Of course, the scanning device may also be communicatively coupled to other storage devices. At this time, the other storage device may receive the scan result and then forward the scan result to the execution body.
It should be noted that, the user in the present disclosure may refer to various types of users. For example, children (e.g., middle and primary school students), elderly people, and the like may be referred to.
Step 202, determining the voice characteristics of the voice corresponding to the user text, and performing voice recognition by using the voice characteristics to obtain a recognized text.
In this embodiment, the speech features may be used to characterize the pronunciation characteristics of individual words in the user text. The speech features may take the form of existing various types of speech features. For example, the speech feature may be pinyin. At this time, the phonetic feature of the corresponding voice of the user text may be used to indicate the pinyin of each word in the user text. As another example, the speech feature may be a phoneme. At this time, the voice characteristics of the voice corresponding to the user text may be used to indicate phonemes of each word in the user text.
In this embodiment, the Speech feature of the Speech corresponding To the user Text may be determined based on various existing TTS (Text To Speech) technologies. Meanwhile, the obtained voice features can be processed by utilizing various existing voice recognition technologies so as to obtain texts corresponding to the recognized voice features as recognition texts.
It should be appreciated that, in general, the resulting recognized text has a correspondence to the user text described above. In particular, the user text may be regarded as a word sequence consisting of words in the user text in sequence, as well as the recognition text may be regarded as a word sequence consisting of words in the recognition text in sequence. Since the user text and the recognition text correspond to the same speech feature, respectively. Thus, words in the word sequence corresponding to the user text are in one-to-one correspondence with words in the word sequence corresponding to the recognition text, and the corresponding two words have the same speech characteristics. Wherein, sequencing may refer to sequencing by reading.
As an example, the user text is "his bundle", the voice feature corresponding to the user text is "ta de bao fu", and the recognition text obtained from the voice feature is "his band". At this time, "he" in the user text corresponds to "he" in the recognition text. "in the user text" corresponds to "in the recognition text". The "package" in the user text corresponds to the "hold" in the identification text. "cloth covering" in the user text corresponds to "negative" in the recognition text.
It should be noted that the above user text is only an example, and the length of the user text may be arbitrary. I.e. the number of words comprised by the user text may be arbitrary. The present disclosure is not limited in this regard.
And 203, selecting words which are different from the corresponding words in the identification text from the user text as difference words, and obtaining a difference word set.
In this embodiment, as described in step 202, for a word in the text of the user, the word in the text corresponding to the word is identified as a word having the same speech characteristics as the word in sequence. Typically, words in the user text correspond one-to-one with words in the recognition text.
Therefore, the words of the user text can be compared with the words in the identification text one by one, and a difference word set is obtained. In other words, for a word of user text, it may be determined whether the word corresponding to the word in the recognition text is identical to the word. If the two words are identical, it is stated that the two words are not different. If the two are not identical, the word may be determined to be a difference word.
Step 204, determining the processing result of the content written by the user according to the difference word set.
In this embodiment, the processing result may be used to indicate suspected wrongly written words that appear in the content written by the user. The suspected wrongly written word may be used to characterize that the word has a certain probability of being a wrongly written word.
Alternatively, each word in the differential word set may be directly determined to be a suspected mispronounced word.
In this embodiment, after the processing result is obtained, the obtained processing result may be displayed to the target user, so that the target user is prompted about the misprinted word that may occur in the content written by the user. The target user may be an associated user of the user corresponding to the user text. Therefore, the user can conveniently check and correct the written content according to the prompt information.
For example, when the user corresponding to the user text is a child, the target user may be a parent or teacher of the child pair, or the like. At this time, parents or teachers can check the content written by children (such as operation and the like) according to the prompt information in a targeted manner, and compared with a checking mode of completely checking wrongly written characters in the content written by children manually by parents or teachers, the checking efficiency can be effectively improved.
According to the method provided by the embodiment of the disclosure, the processing technology such as text-to-speech processing is utilized to obtain the speech features corresponding to the user text corresponding to the content written by the user, then the speech recognition technology is utilized to obtain the recognition text corresponding to the speech features, further the difference word set is obtained by comparing the user text with the recognition text, and the possible wrongly written words in the content written by the user, namely suspected wrongly written words, are determined according to the difference word set, so that the user or the associated user can pertinently check the suspected wrongly written words, and the problems of long time consumption and low efficiency existing in the process of checking the wrongly written words in the content written by the user only in a manual checking mode are effectively solved.
With further reference to fig. 3, a flow 300 of yet another embodiment of a method for processing text is shown. The flow 300 of the method for processing text comprises the steps of:
in step 301, a text corresponding to the content written by the user is obtained as a user text.
Step 302, determining the voice characteristics of the voice corresponding to the user text, and performing voice recognition by using the voice characteristics to obtain a recognized text.
Step 303, selecting a word different from the corresponding word in the identification text from the user text as a difference word, and obtaining a difference word set.
The specific implementation of steps 301, 302 and 303 may refer to the relevant descriptions of steps 201, 202 and 203 in the corresponding embodiment of fig. 2, and will not be repeated here.
Step 304, for the difference word in the difference word set, extracting the word set where the difference word is located from the user text to form the word set corresponding to the difference word, and determining whether the difference word is a suspected wrongly written word according to the word set corresponding to the difference word.
In this embodiment, for each differential word, the word in which the differential word is located may refer to the differential word being composed of a predetermined number of words before and/or after the differential word in a specified reading order. The preset number can be set according to an actual application scene. Words may be composed because of the difference word with its preceding words, with its following words, with the expected preceding words and the following words. Thus, the number of words in which a difference word is located may be plural, i.e., the number of words included in the word set may be plural. And the specific number of words included in the word set may be set according to the actual application requirements.
Alternatively, the word set corresponding to the difference word may be composed of words with a length not less than 2 and not more than 4, where the difference word is located, in the text of the user.
The following examples are given as illustrations: the user text is "speech is the most natural way of human interaction", where the difference word is "get". At this time, the words having a length of not less than 2 and not more than 4 where "get" includes: however, natural get, most natural get, get cross, then get cross, and then natural get cross.
In this embodiment, by using various existing language processing techniques, whether the difference word is a suspected wrongly written word may be determined according to the word set corresponding to the difference word.
Optionally, for the word in the word set corresponding to the difference word, the word can be regarded as a text, and the word is processed by utilizing various existing word segmentation modes to obtain a word segmentation result. Wherein the word segmentation result may be used to characterize whether the word is divided into a target number of words. Wherein the target number is equal to the number of words that the word comprises. And in response to determining that each word in the word set corresponding to the differential word is divided into a target number of words, determining that the differential word is a suspected mispronounced word.
Since a word is divided into the same number of words as it includes, it can be explained that the word is not a word conforming to the natural language rule. Therefore, if each word in which a difference word is located is not a word conforming to the natural language rule, it can be stated that the difference word is likely to be a wrongly written word written by the user.
Optionally, whether the difference word is a suspected wrongly written word may be determined according to a word set corresponding to the difference word by: determining whether a preset word stock comprises words in a word set corresponding to the difference word; and determining the difference word as a suspected wrongly written word in response to determining that the word stock does not include the word in the word set corresponding to the difference word.
The preset word stock can be preset by a technician. For example, a thesaurus may be made up of all words in an existing dictionary. As another example, the thesaurus may be some existing public thesaurus.
If a word exists in the word stock, the word can be indicated to belong to the word conforming to the natural language rule. If a word does not exist in the word stock, it may be indicated that the word does not belong to a word conforming to the natural language rule, i.e., the word may be a wrong word. Based on the above, if the word library does not include each word in the word set corresponding to the differential word, each word in which the differential word is described is not in accordance with the natural language rule, so that the differential word is likely to be a wrongly written word.
Because the word stock can generally cover almost common words, the word stock is used for judging the words where the difference words are in the user text, the accuracy of the determined suspected wrongly written words can be improved, and the situation of excessive misjudgment is avoided.
In some alternative implementations of the present embodiment, after the processing results of the content written by the user are obtained, the processing results may be presented to the user. Furthermore, user feedback information for the processing result can be received, and then a preset word stock is updated according to the user feedback information. The user feedback information may be used to indicate whether each suspected wrongly written word indicated by the processing result is a true wrongly written word.
Based on the method, the preset word stock is updated by using the user feedback information, and the richness and the comprehensiveness of the word stock can be expanded through repeated iterative updating, so that misjudgment can be reduced and the accuracy of a processing result can be improved in the subsequent processing process of the content written by the user.
In some alternative implementations of the present embodiment, the set of misplaced words constructed for the user may be further updated after receiving the user feedback information. Wherein the set of wrongly written words constructed for the user may be used to record wrongly written words that have occurred in the content written by the user.
In this way, a personalized wrongly written word set can be built for each user, and the wrongly written word set is updated continuously and iteratively, so that when the content written by the user is checked later, the wrongly written word set corresponding to the user can be utilized to further check the content written by the user, thereby being beneficial to further reducing the occurrence of the condition that the wrongly written word which is not detected exists, and improving the accuracy of the processing result of the user text
With continued reference to fig. 4, fig. 4 is a schematic diagram 400 of an application scenario of the method for processing text according to the present embodiment. In the application scenario of fig. 4, the job 401 written by the user is "game played with a kick key with a classmate", the job 401 is photographed by the camera 4021 of the mobile phone 402 to obtain a job image, and then the mobile phone 402 can transmit the photographed job image to the server 403.
The server 403 may first identify the job image based on OCR (Optical Character Recognition ) technology to obtain user text 404. The server 403 may then derive the pinyin 405 corresponding to the user text 404 based on TTS technology. Specifically, pinyin 405 is "he tong xue wan le ti jian zi de you xi". The server 403 may then recognize the pinyin 405 using speech recognition techniques to obtain recognized text 406. Specifically, the identification text 406 is "game played with shuttlecock with classmates".
The server 403 may compare the words in the user text 404 and the identification text 406 in the reading order, and may determine that the "key" in the user text 404 is different from the corresponding "shuttlecock" in the identification text 406. Thus, the "key" in the user text 404 may be determined as the difference word 407.
The server 403 may extract a set of phrase components 408 in the user text 404 where the difference word 407 is located. Wherein the length of the word where the extracted difference word 407 is located is not less than 2 and not less than 4. Specifically, the vocabulary 408 includes the following 9 words: a kick, a play of a kick, a key, a play of a key, a kick, a play of a kick.
The server 403 may then look up in the word stock 409 whether each word in the set of words 408 is included, resulting in a lookup result 410. The search result 410 is used to indicate that any word in the vocabulary 408 is not found in the word stock 409. Based on this, the correction result 411 of the job 401 written by the user can be obtained. The correction result 411 is used to indicate that the "key" in the job 401 written by the user may be a wrongly written word. Meanwhile, the server 403 may send the modification result 411 to the terminal device 402, so that the user checks that the "key" in the job 401 is indeed a wrongly written word according to the modification result and modifies it accordingly.
As can be seen from fig. 3, compared with the embodiment corresponding to fig. 2, the process 300 of the method for processing text in this embodiment highlights whether the word of the difference word set where the difference word is located in the user text exists in the word stock after comparing the user text with the recognition text to obtain the difference word set, and determines whether the difference word is a suspected wrongly written word, which is helpful for improving the accuracy of the determined suspected wrongly written word.
With further reference to fig. 5, a flow 500 of yet another embodiment of a method for processing text is shown. The process 500 of the method for processing text comprises the steps of:
in step 501, a text corresponding to the content written by the user is obtained as a user text.
Step 502, determining the voice characteristics of the voice corresponding to the user text, and performing voice recognition by using the voice characteristics to obtain the recognized text.
Step 503, selecting a word different from the corresponding word in the identification text from the user text as a difference word, and obtaining a difference word set.
Step 504, for the difference word in the difference word set, extracting the phrase where the difference word is located from the user text to form the word set corresponding to the difference word; determining whether a preset word stock comprises words in a word set corresponding to the difference word; and determining the difference word as a suspected wrongly written word in response to determining that the word stock does not include the word in the word set corresponding to the difference word.
The specific implementation of steps 501, 502, 503 and 504 may refer to the relevant descriptions of steps 301, 302, 303 and 304 in the corresponding embodiment of fig. 3, which are not repeated herein.
Step 505, selecting the words and the words belonging to the preset word stock of the frequently-wrong word from the user text as the candidate words, and obtaining a candidate word set.
In this embodiment, the frequently-misplaced word stock may be preset by a technician. For example, a word stock of frequently-wrong words may be derived from statistical analysis of the processing results of a large number of user texts. For another example, the frequently misplaced word stock may be provided by a third party. It should be understood that a single word is included in the frequently-misplaced word stock, as well as words.
For each word in the user text, if the word exists in the frequently misplaced word lexicon, it can be stated that the word is easily misplaced.
Step 506, for a candidate word in the candidate word set, determining whether the candidate word is a suspected mispronounced word, and updating the processing result in response to determining that the candidate word is a suspected mispronounced word.
In this embodiment, since the candidate word is easily a misplaced word, the determined candidate word may be further determined, and when the candidate word is determined to be a suspected misplaced word, the processing result may be updated as a supplementary processing result.
It should be understood that if the candidate word determined to be a suspected misplaced word is also a difference word determined to be a suspected misplaced word, then it is recorded only once.
In this embodiment, different methods for judging whether the candidate word is a suspected wrongly written word may be selected according to different application scenarios.
Alternatively, while constructing the frequently-misplaced word thesaurus, the misuse patterns of the individual words in the frequently-misplaced word thesaurus may be recorded. At this time, whether the candidate word is a suspected wrongly written word may be determined by determining whether the usage pattern of the candidate word belongs to the corresponding wrong usage pattern. If the candidate word belongs to the corresponding wrong use mode, the candidate word can be determined to be a suspected wrongly written word. For example, whether the usage mode of the candidate word is correct can be determined by the sentence in which the candidate word is located in the text of the user.
It should be understood that for a word, the word is a mispronounced word, one or more of the words may be characterized as mispronounced words, or each of the words may be characterized as mispronounced words. The specific meaning can be flexibly set according to the actual application requirements.
Optionally, for a candidate word in the candidate word set, determining whether the candidate word is a suspected mispronounced word may include: and determining whether the candidate word is a suspected wrongly written word according to the grammar rule corresponding to the candidate word.
Where grammar rules may refer to rules to which words must adhere when properly used. It should be appreciated that the grammar rules for different words may be different.
For example, "get" and "ground" are words that a user can easily misuse when writing. Therefore, three words "get" and "ground" can be recorded in the frequently-wrong word set. In this case, the grammatical rule corresponding to "may be that, in the order of reading," the part of speech of the word preceding "is an adjective or a pronoun, and the part of speech of the word following" is a noun. The grammar rule corresponding to "get" may be that the part of speech of the word before "get" is a verb and the part of speech of the word after "get" is an adverb according to the reading order. The grammar rule corresponding to "ground" may be that the part of speech of the word preceding "ground" is an adverb and the part of speech of the word following "ground" is a verb in the reading order.
Thus, in this case, if the word of the three words is included in the content written by the user, the word of the three words included in the user text is determined as a candidate word. It may then be determined whether the correct use is made based on the part of speech of the word preceding the candidate word and the part of speech of the word following the candidate word in the order of reading. If the candidate word is incorrectly used, the candidate word may be determined to be a suspected mispronounced word.
As another example, a term is also prone to misuse. Thus, individual adjectives (e.g., individual, seed, piece, bar, etc.) may be recorded in frequently-staggered subsets. At this time, the grammar rule of each term may be that the term and the following terms belong to a fixed collocation according to the reading order.
For example, for each term, various fixed collocations corresponding to the term are constructed, and a fixed collocation set corresponding to the term is obtained. At this time, when the graduated word is detected in the content written by the user, it is judged whether the collocation formed by the graduated word and the word behind the graduated word belongs to the fixed collocation set corresponding to the graduated word according to the reading sequence. If the character does not belong to the character, the character can be determined to be suspected wrongly written.
As can be seen from fig. 5, compared with the embodiments corresponding to fig. 2 and 3, the process 500 of the method for processing text in this embodiment highlights the step of determining whether the words are correctly written by the user by determining the words belonging to the frequently-wrong word appearing in the content written by the user while determining the suspected wrongly written word appearing in the content written by the user by using the speech processing technique. Therefore, the scheme described in the embodiment checks words in the content written by the user from multiple aspects, further improves checking strength, is beneficial to obtaining a more comprehensive processing result, and reduces the missing condition of wrongly written words.
With further reference to fig. 6, as an implementation of the method shown in the above figures, the present disclosure provides an embodiment of an apparatus for processing text, which corresponds to the method embodiment shown in fig. 2, and which is particularly applicable in various electronic devices.
As shown in fig. 6, 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. Wherein, the obtaining unit 601 is configured to obtain text corresponding to content written by a user as user text; the recognition unit 602 is configured to determine speech features of a speech corresponding to the user text, and perform speech recognition using the speech features to obtain a recognized text; the selecting unit 603 is configured to select a word different from a word corresponding to the recognized text from the user text as a difference word, to obtain a difference word set; the processing unit 604 is configured to determine a processing result of the content written by the user based on the set of difference words, wherein the processing result is used to indicate suspected wrongly written words occurring in the content written by the user.
In the present embodiment, in the apparatus 600 for processing text: the specific processes of the obtaining unit 601, the identifying unit 602, the selecting unit 603, and the processing unit 604 and the technical effects thereof may refer to the descriptions related to the steps 201, 202, 203, and 204 in the corresponding embodiment of fig. 2, and are not described herein.
In some optional implementations of this embodiment, the processing unit 604 is further configured to, for a difference word in the difference word set, extract, from the user text, a word in which the difference word is located as a word set corresponding to the difference word; and determining whether the difference word is a suspected wrongly written word or not according to the word set corresponding to the difference word.
In some optional implementations of this embodiment, the processing unit 604 is further configured to determine whether a word in the word set corresponding to the difference word is included in a preset word stock; and determining the difference word as a suspected wrongly written word in response to determining that the word stock does not include the word in the word set corresponding to the difference word.
In some optional implementations of this embodiment, the selecting unit 603 is further configured to select, from the user text, a word and a word in a word library belonging to a preset frequently-wrong word as a candidate word, so as to obtain a candidate word set; the processing unit 604 is further configured to determine, for a candidate word in the candidate word set, whether the candidate word is a suspected mispronounced word; and updating the processing result in response to determining that the candidate word is a suspected wrongly written word.
In some optional implementations of this embodiment, the processing unit 604 is further configured to determine whether the candidate word is a suspected misplaced word according to a grammar rule corresponding to the candidate word.
In some optional implementations of this embodiment, the apparatus 600 for processing text further includes: a receiving unit (not shown in the figure) configured to receive user feedback information for the processing result; an updating unit (not shown in the figure) is configured to update the word stock based on the user feedback information.
In some optional implementations of this embodiment, the updating unit is further configured to update the set of misplaced words constructed for the user according to user feedback information.
According to the device provided by the embodiment of the disclosure, the text corresponding to the content written by the user is obtained as the user text through the obtaining unit; the recognition unit determines the voice characteristics of the voice corresponding to the user text, and performs voice recognition by utilizing the voice characteristics to obtain a recognition text; the selection unit selects words which are different from the corresponding words in the identification text from the user text as difference words, and a difference word set is obtained; the processing unit determines a processing result of the content written by the user according to the difference word set, wherein the processing result is used for indicating suspected wrongly written words in the content written by the user, so that the suspected wrongly written words in the content written by the user can be detected, and further the suspected wrongly written words can be checked by the user or an associated user in a targeted manner, and the problems of long time consumption and low efficiency existing in the process of checking the wrongly written words in the content written by the user only in a manual checking mode are effectively solved.
Referring now to fig. 7, a schematic diagram of an electronic device (e.g., server in fig. 1) 700 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device/server illustrated in fig. 7 is merely an example, and should not impose any limitation on the functionality and scope of use of embodiments of the present disclosure.
As shown in fig. 7, the electronic device 700 may include a processing means (e.g., a central processor, a graphics processor, etc.) 701, which may 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 means 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 through a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
In general, the following devices may be connected to the I/O interface 705: input devices 706 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 707 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 708 including, for example, magnetic tape, hard disk, etc.; and a communication device 709. The communication means 709 may allow the electronic device 700 to communicate wirelessly or by wire with other devices to exchange data. While fig. 7 shows an electronic device 700 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead. Each block shown in fig. 7 may represent one device or a plurality of devices as needed.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via communication device 709, or installed from storage 708, or installed from ROM 702. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 701.
It should be noted that, the computer readable medium according to the embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In an embodiment of the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. Whereas in embodiments of the present disclosure, the computer-readable signal medium may comprise a data signal propagated in baseband or as part of a carrier wave, with computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring a text corresponding to content written by a user as a user text; determining voice characteristics of voice corresponding to the user text, and performing voice recognition by utilizing the voice characteristics to obtain a recognition text; selecting words different from the corresponding words in the identification text from the user text as difference words, and obtaining a difference word set; and determining a processing result of the content written by the user according to the difference word set, wherein the processing result is used for indicating suspected wrongly written words in the content written by the user.
Computer program code for carrying out operations of embodiments of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments described in the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The described units may also be provided in a processor, for example, described as: a processor includes an acquisition unit, an identification unit, a selection unit, and a processing unit. The names of these units do not constitute a limitation on the unit itself in some cases, and for example, the acquisition unit may also be described as "a unit that acquires text corresponding to content written by the user as user text".
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above technical features, but encompasses other technical features formed by any combination of the above technical features or their equivalents without departing from the spirit of the invention. Such as the above-described features, are mutually substituted with (but not limited to) the features having similar functions disclosed in the embodiments of the present disclosure.

Claims (9)

1. A method for processing text, comprising:
acquiring a text corresponding to content written by a user as a user text;
determining voice characteristics of voice corresponding to the user text based on a text-to-voice technology, and performing voice recognition by utilizing the voice characteristics to obtain a recognition text;
selecting words different from the corresponding words in the identification text from the user text as difference words, and obtaining a difference word set;
Determining a processing result of the content written by the user according to the difference word set, wherein the processing result is used for indicating suspected wrongly written words in the content written by the user;
the step of determining the processing result of the content written by the user according to the difference word set comprises the following steps:
For the difference words in the difference word set, extracting the phrase where the difference word is located from the user text to form a word set corresponding to the difference word; and determining whether the difference word is a suspected wrongly written word or not according to the word set corresponding to the difference word, and if all the words of the difference word are not words conforming to the natural language rule, determining that the difference word is a suspected wrongly written word.
2. The method of claim 1, wherein the determining whether the difference word is a suspected mispronounced word according to the word set corresponding to the difference word comprises:
Determining whether a preset word stock comprises words in a word set corresponding to the difference word;
And determining the difference word as a suspected wrongly written word in response to determining that the word stock does not include the word in the word set corresponding to the difference word.
3. The method of claim 1, wherein the method further comprises:
Selecting characters and words belonging to a preset frequently-wrong character word library from the user text as candidate words, and obtaining a candidate word set;
For the candidate words in the candidate word set, determining whether the candidate word is a suspected wrongly written word; and updating the processing result in response to determining that the candidate word is a suspected wrongly written word.
4. The method of claim 3, wherein the determining whether the candidate word is a suspected mispronounced word comprises:
and determining whether the candidate word is a suspected wrongly written word according to the grammar rule corresponding to the candidate word.
5. The method of claim 2, wherein the method further comprises:
receiving user feedback information aiming at the processing result;
and updating the word stock according to the user feedback information.
6. The method according to one of claims 1-5, wherein the method further comprises:
and updating the wrongly written word set constructed for the user according to the user feedback information.
7. An apparatus for processing text, comprising:
an acquisition unit configured to acquire text corresponding to content written by a user as user text;
A recognition unit configured to determine a speech feature of a speech corresponding to the user text based on a text-to-speech technique, and perform speech recognition using the speech feature to obtain a recognized text;
a selection unit configured to select a word different from a word corresponding to the identification text from the user text as a difference word, to obtain a difference word set;
A processing unit configured to determine a processing result of the content written by the user according to the difference word set, wherein the processing result is used for indicating suspected wrongly written words appearing in the content written by the user;
The processing unit is further configured to extract word sets corresponding to the difference words from the user text, wherein the word sets comprise the difference words; and determining whether the difference word is a suspected wrongly written word or not according to the word set corresponding to the difference word, and if all the words of the difference word are not words conforming to the natural language rule, determining that the difference word is a suspected wrongly written word.
8. An electronic device, comprising:
One or more processors;
a storage device having one or more programs stored thereon;
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-6.
9. A computer readable medium having stored thereon a computer program, wherein the program when executed by a processor implements the method of any of claims 1-6.
CN202010134249.7A 2020-03-02 2020-03-02 Method and apparatus for processing text Active CN112307748B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010134249.7A CN112307748B (en) 2020-03-02 2020-03-02 Method and apparatus for processing text

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010134249.7A CN112307748B (en) 2020-03-02 2020-03-02 Method and apparatus for processing text

Publications (2)

Publication Number Publication Date
CN112307748A CN112307748A (en) 2021-02-02
CN112307748B true CN112307748B (en) 2024-11-22

Family

ID=74336350

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010134249.7A Active CN112307748B (en) 2020-03-02 2020-03-02 Method and apparatus for processing text

Country Status (1)

Country Link
CN (1) CN112307748B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113420983B (en) * 2021-06-23 2024-04-12 科大讯飞股份有限公司 Writing evaluation method, device, equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108121455A (en) * 2016-11-29 2018-06-05 渡鸦科技(北京)有限责任公司 Identify method and device for correcting
CN110534100A (en) * 2019-08-27 2019-12-03 北京海天瑞声科技股份有限公司 A kind of Chinese speech proofreading method and device based on speech recognition

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102541837A (en) * 2010-12-22 2012-07-04 张家港市赫图阿拉信息技术有限公司 Method for correcting inputted Chinese characters
CN109065031B (en) * 2018-08-02 2020-05-12 阿里巴巴集团控股有限公司 Voice labeling method, device and equipment
CN110705217B (en) * 2019-09-09 2023-07-21 上海斑马来拉物流科技有限公司 Wrongly written or mispronounced word detection method and device, computer storage medium and electronic equipment
CN110610180B (en) * 2019-09-16 2024-08-20 腾讯科技(深圳)有限公司 Method, device, equipment and storage medium for generating mispronounced word recognition set
CN110807319B (en) * 2019-10-31 2023-07-25 北京奇艺世纪科技有限公司 Text content detection method, detection device, electronic equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108121455A (en) * 2016-11-29 2018-06-05 渡鸦科技(北京)有限责任公司 Identify method and device for correcting
CN110534100A (en) * 2019-08-27 2019-12-03 北京海天瑞声科技股份有限公司 A kind of Chinese speech proofreading method and device based on speech recognition

Also Published As

Publication number Publication date
CN112307748A (en) 2021-02-02

Similar Documents

Publication Publication Date Title
CN111681642B (en) Speech recognition evaluation method, device, storage medium and equipment
US10963760B2 (en) Method and apparatus for processing information
WO2022267353A1 (en) Text error correction method and apparatus, and electronic device and storage medium
US20160012751A1 (en) Comprehension assistance system, comprehension assistance server, comprehension assistance method, and computer-readable recording medium
CN110969012A (en) Text error correction method and device, storage medium and electronic equipment
US20220165172A1 (en) Method and system for interactive learning
CN107608618B (en) Interaction method and device for wearable equipment and wearable equipment
KR101778488B1 (en) Method and system for learning english words through online
CN110750624A (en) Information output method and device
CN111899576A (en) Control method and device for pronunciation test application, storage medium and electronic equipment
US20230386355A1 (en) Method And Device For Providing Learning Service By Using Digital Studying Method
CN111369980A (en) Voice detection method and device, electronic equipment and storage medium
CN112149680A (en) Wrong word detection and identification method and device, electronic equipment and storage medium
CN112307748B (en) Method and apparatus for processing text
CN111079489B (en) Content identification method and electronic equipment
CN112560431A (en) Method, apparatus, device, storage medium, and computer program product for generating test question tutoring information
CN112309389A (en) Information interaction method and device
KR20160106363A (en) Smart lecture system and method
KR20190093439A (en) A method and computer program for inferring genre of a text contents
JP2016091020A (en) Program, processing method, and information processing apparatus
US11935425B2 (en) Electronic device, pronunciation learning method, server apparatus, pronunciation learning processing system, and storage medium
CN112309385A (en) Voice recognition method, device, electronic equipment and medium
KR20190045102A (en) Method and apparatus for learning language using electronic pen
KR102497994B1 (en) Learning device for implementing teachdent study methodology and controlling method thereof
KR20200062910A (en) Improved learning providing system for french pronunciation

Legal Events

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