Text labeling method and device and storage medium
By determining the language scene information of speech exercises and marking text, the problem of low accuracy of speech error correction in the prior art is solved, more accurate speech text annotation is achieved, and the need for manual verification is reduced.
Patent Information
- Application Number
- CN202411222578.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2024-12-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art cannot correct word grammar and pronunciation according to different application objects, resulting in low accuracy of speech correction and manual verification is required.
By determining the current language scene information of the pronunciation exercise and annotating the target speech based on the reference speech and/or reference text of the scene information, the annotation information of the target text is generated, including error correction content of word pronunciation and grammar.
It improves the accuracy of text labeling, makes the annotated voice text more in line with the current locale environment, and reduces the need for manual verification.
Smart Images

Figure CN119106102A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electronic data processing, and in particular to a text annotation method, device and storage medium. Background Art
[0002] Text error correction can be applied to many scenarios. For example, in the voice training scenario, the user inputs the voice and generates the corresponding error correction information. Due to the diversity of languages, word grammar and pronunciation vary in different regions, and there is no unified standard. The existing solution segments the text into words and recognizes each word separately. It is impossible to correct the word grammar and pronunciation according to the different application objects, and manual verification is required, resulting in low accuracy of voice error correction. Summary of the invention
[0003] The main purpose of this application is to provide a text annotation method, device and storage medium, aiming to solve the technical problem that the grammar and pronunciation of words cannot be corrected according to different application objects, manual verification is required, resulting in low accuracy of speech correction.
[0004] To achieve the above purpose, the present application proposes a text annotation method, which includes:
[0005] Determine context information of the current language context of the speech practice;
[0006] Upon receiving preset operation information from the user, obtaining the target voice input by the user, and generating a target text corresponding to the target voice;
[0007] Generate annotation information of the target text according to the reference speech and / or reference text corresponding to the scene information.
[0008] In one embodiment, the step of determining the scene information of the current language scene of the speech practice includes:
[0009] Obtain user terminal usage data and / or location data;
[0010] Scenario information of a pre-language scenario of the speech practice is determined according to the terminal usage data and / or the positioning data.
[0011] In one embodiment, the step of generating the annotation information of the target text according to the reference speech and / or reference text corresponding to the scene information includes:
[0012] Generate annotation information of the target text including error correction content of word pronunciation according to the reference speech of the scene information and the target speech;
[0013] Acquire an associated speech corresponding to the target speech, and generate context information of the target text according to the associated speech;
[0014] The tagging information of the target text including the error correction content of the words is generated according to the reference text of the scene information and the context information.
[0015] In one embodiment, the step of generating the annotation information of the target text including the error correction content of the word according to the reference text of the scene information and the context information comprises:
[0016] Inputting the reference text of the scene information, the context information and the target text into a pre-trained language model, and obtaining the error probability of words in the target text output by the model;
[0017] Determine the position of the wrong character in the target text according to the error probability;
[0018] Generate a candidate word set for the word at the wrong word position, and replace the word at the wrong word position with each word in the candidate word set to generate a candidate text set;
[0019] Each text in the candidate text set is scored, a target candidate text is determined according to the score, and error correction content of a word is generated according to the target candidate text.
[0020] In one embodiment, the step of determining the scene information of the current language scene of the speech practice includes:
[0021] Obtaining historical text corresponding to the user's historical speech, and determining high-frequency words corresponding to the scene information of each language scene, wherein the probability of occurrence of the high-frequency words in the speech scene is greater than a preset probability threshold;
[0022] The similarity between the high-frequency vocabulary and the words in the historical text is determined, and the scene information of the current language scene is determined according to the similarity.
[0023] In one embodiment, the step of determining the scene information of the current language scene of the speech practice includes:
[0024] Obtaining a historical text corresponding to the historical speech of the user, and determining a first matching degree according to scene information of each language scene, a relationship between words in the historical text, and a sentence structure;
[0025] Determining a second matching degree according to the scene information of each language scene and the context information of the historical text;
[0026] Determining the degree of matching between the historical text and the scene information of each language scene according to a preset weight parameter, the first matching degree, and the second matching degree;
[0027] According to the matching degree, the scene information of the current language scene is determined.
[0028] In one embodiment, the step of generating the annotation information of the target text according to the reference speech and / or reference text corresponding to the scene information includes:
[0029] Inputting the reference speech and / or reference text of the scene information and the target text into a text extension model to obtain an extended text;
[0030] Determining the relevance between the extended text and the target text, and generating a candidate extended text set according to the relevance;
[0031] Determining a recommendation value for each candidate extended text in the candidate extended text set;
[0032] A target extended text is determined from the candidate extended text set according to the recommendation value, and the target extended text is used as the annotation information.
[0033] In one embodiment, the step of determining the recommendation value of each candidate extended text in the candidate extended text set includes:
[0034] In the candidate extended text set, respectively calculating the text similarity between the current candidate extended text and other candidate extended texts;
[0035] The recommendation value of the current candidate extended text is determined according to the average value of the text similarities.
[0036] In addition, to achieve the above objectives, the present application also proposes a text annotation device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the text annotation method described above.
[0037] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the text annotation method described above are implemented.
[0038] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the text annotation method described above are implemented.
[0039] One or more technical solutions proposed in this application have at least the following technical effects:
[0040] Determine the scene information of the current language scene of the speech practice; upon receiving the preset operation information of the user, obtain the target speech input by the user and generate the target text corresponding to the target speech; generate the annotation information of the target text according to the reference speech and / or reference text corresponding to the scene information. By determining the scene information of the speech practice and annotating the text of the target speech with the reference speech and / or reference text of the scene information, since the speech is recognized and annotated according to different scenes, the annotated speech text is more in line with the current language environment, thereby improving the accuracy of text annotation. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0042] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0043] Figure 1 A flowchart of the first embodiment of the text annotation method of the present application is provided;
[0044] Figure 2 A flowchart of the second embodiment of the text annotation method of this application is provided;
[0045] Figure 3 A flowchart of the third embodiment of the text annotation method of this application is provided;
[0046] Figure 4 A flowchart of the fourth embodiment of the text annotation method of the present application is provided;
[0047] Figure 5 A flowchart of Embodiment 5 of the text annotation method of this application is provided;
[0048] Figure 6 Schematic diagram of the device structure of the hardware operating environment involved in the text annotation method in the embodiment of the present application.
[0049] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0050] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0051] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0052] The main solution of the embodiment of the present application is: determine the scene information of the current language scene of the speech practice; when receiving the user's preset operation information, obtain the target speech input by the user and generate the target text corresponding to the target speech; generate annotation information of the target text according to the reference speech and / or reference text corresponding to the scene information.
[0053] In this embodiment, for the convenience of description, the text annotation device is used as the execution subject for explanation below.
[0054] It is impossible to correct word grammar and pronunciation according to different application objects, and manual verification is required, resulting in low accuracy of speech correction.
[0055] The present application provides a solution by determining the scene information of speech practice and annotating the text of the target speech through the reference speech and / or reference text of the scene information. Since the speech is recognized and annotated according to different scenes, the annotated speech text is more in line with the current language environment, thereby improving the accuracy of text annotation.
[0056] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a text annotation device, etc. The following takes a text annotation device as an example to illustrate this embodiment and the following embodiments.
[0057] Based on this, the present application embodiment provides a text annotation method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the text annotation method of this application.
[0058] In this embodiment, the text annotation method includes steps S10 to S30:
[0059] Step S10, determining the scene information of the current language scene of the speech practice.
[0060] Optionally, this embodiment is applied to terminal devices, such as mobile phones, tablet computers, etc., and can also be applied to wearable devices, such as bracelets, AR glasses, etc.
[0061] It should be noted that the language scene is the scene corresponding to the current target speech, such as an exam scene, a question-and-answer scene, etc. For another example, daily communication scenes include chatting scenes, bargaining scenes, and ordering coffee in a restaurant; travel scenes include taking a train, booking air tickets, etc.; store clerk communication scenes include ordering food in a restaurant, opening a bank account, etc.; workplace communication scenes include looking for a part-time job, arranging meetings, etc.
[0062] Optionally, scene information input by the user or pre-set scene information is obtained. For example, the user needs to practice the content in dialogue scene a and selects dialogue scene a.
[0063] In an optional embodiment, historical text corresponding to the user's historical speech is obtained, and high-frequency words corresponding to the scene information of each language scene are determined, and the probability of occurrence of the high-frequency words in the speech scene is greater than a preset probability threshold; the similarity between the high-frequency words and the words in the historical text is determined, and the scene information of the current language scene is determined based on the similarity, so that the scene information of the language scene is determined according to the user's historical usage data, thereby improving the efficiency of determining the scene information.
[0064] Optionally, high-frequency words corresponding to the scene information of each language scene are determined, and the probability of occurrence of the high-frequency words in the speech scene is greater than a preset probability threshold; the similarity between the high-frequency words and the words in the target text is determined, and the current language scene corresponding to the target text is determined based on the similarity. When the similarity is greater than or equal to the preset similarity threshold, the scene information is determined to be the scene information of the current language scene corresponding to the target text; when the similarity is less than the preset similarity threshold, the scene information is determined not to be the scene information of the current language scene corresponding to the target text.
[0065] Step S20, when receiving the preset operation information of the user, obtaining the target voice input by the user, and generating the target text corresponding to the target voice.
[0066] Optionally, the preset operation information may be a tap operation, a double-click operation, a long-press operation, etc. For example, after the target text is generated, a tap operation is performed on the position where the target text is displayed.
[0067] It should be noted that the target voice is the voice recorded by the user based on a microphone or a terminal device. Optionally, the target voice can be the voice recorded by the user in a free conversation scenario. Optionally, the target voice can be the voice recorded by the user based on text prompt information in a voice training scenario.
[0068] The acquired audio signal of the target speech is preprocessed, including the following: noise reduction, that is, removing background noise to improve the clarity of the speech signal. Normalization, that is, adjusting the volume to ensure that the audio signal is within the appropriate loudness range. Pre-emphasis, that is, enhancing the high-frequency part to compensate for the high-frequency loss during the recording process.
[0069] Feature extraction of audio signals, that is, extracting features from the preprocessed audio. Common features include: Mel-frequency cepstral coefficients, which reflect the human ear's perception of sound; phonemes, which are basic speech units such as consonants and vowels.
[0070] The extracted features are matched with known speech patterns using an acoustic model, and the output of the acoustic model is converted into a text sequence, that is, the target text corresponding to the target speech is generated. The acoustic model includes a hidden Markov model, which is used to model the temporal characteristics of speech signals. Deep learning models, such as recurrent neural networks, long short-term memory networks, or convolutional neural networks, are used to learn the mapping relationship between speech features and text from large amounts of data.
[0071] Optionally, before step S30, the method further includes: comparing keywords in the target text with keywords of a preset language scene, and re-determining the scene information corresponding to the target text according to the comparison result. For example, when the keyword in the target text is shopping, the keyword is compared with keywords of various language scenes, and the scene information corresponding to the target text is determined to be a shopping scene according to the comparison result.
[0072] In an optional embodiment, the degree of match between the target text and the current language scene is generated. The degree of match of the target text indicates the degree of adaptation of the word to the current voice scene. A high degree of match of the target text indicates that it matches the current voice scene, and a low degree of match of the target text indicates that it does not match the current voice scene. When the degree of match is greater than a preset threshold, annotation information of the target text is generated according to the scene information. Optionally, when the degree of match is less than a preset threshold, it indicates that the target text is not suitable in the current language scene, a prompt message is generated, and a suitable language scene is recommended.
[0073] Optionally, a target text corresponding to the user's target speech is obtained, and a first matching degree is determined based on scene information of each language scene, the relationship between words in the target text, and the sentence structure; a second matching degree is determined based on the scene information of each language scene and the context information of the target text; a matching degree between the target text and the scene information of each language scene is determined based on preset weight parameters, the first matching degree, and the second matching degree; based on the matching degree, the scene information of the current language scene is re-determined to improve the accuracy of scene determination.
[0074] Step S30: Generate annotation information of the target text according to the reference speech and / or reference text corresponding to the scene information.
[0075] It should be noted that the annotation information can be the error correction content, replacement content, extended content, etc. of the target text. Among them, the error correction content is the modified content of the erroneous content in the target text. The replacement content is the modified content that is more suitable for the current language scenario. The extended content is the content added to enrich the current dialogue. For example, the target text is "Winter is coming, and I need to buy a pair of pants in the mall", the error correction content is "Winter is coming, and I need to buy a pair of pants in the mall", the replacement content is "Winter is coming, and I need to buy a pair of trousers in the mall", and the extended content is "Winter is coming, and I need to buy a pair of thickened trousers in the mall to keep warm."
[0076] Optionally, different operation information corresponds to different types of annotation information. Exemplarily, when the operation information is a tap operation, the annotation information is determined to be error correction content, when the operation information is a double-click operation, the annotation information is determined to be replacement content; when the operation information is a long press operation, the annotation information is determined to be extended content.
[0077] In the technical solution of this embodiment, the scene information of the current language scene of the speech practice is determined; when the preset operation information of the user is received, the target speech input by the user is obtained, and the target text corresponding to the target speech is generated; and the annotation information of the target text is generated according to the reference speech and / or reference text corresponding to the scene information. By determining the scene information of the speech practice and annotating the text of the target speech with the reference speech and / or reference text of the scene information, since the speech is recognized and annotated according to different scenes, the annotated speech text is more suitable for the current language environment, and the accuracy of text annotation is improved.
[0078] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above embodiment can refer to the above introduction, and will not be repeated later. Figure 2 , step S10 further includes:
[0079] Step S11, obtaining the user's terminal usage data and / or positioning data;
[0080] Step S12: determining the scene information of the pre-language scene of the speech practice according to the terminal usage data and / or the positioning data.
[0081] It should be noted that terminal usage data can be collected through applications on user terminals. For example, applications can record user usage habits, most frequently accessed functions, and other information. These data can be obtained through permissions set within the application, and combined with the user's usage pattern to determine the scene information of the current language scene. Terminal usage data can also include picture or video information, and scene text recognition technology is used to extract scene-related text information from picture or video information to further assist in determining scene information.
[0082] Optionally, the scene information of the language scene may be determined by the positioning data. For example, when the positioning data is at an airport, the scene information of the language scene is an airport conversation scene; when the positioning data is at a shopping mall, the scene information of the language scene is a shopping conversation scene; when the positioning data is at a gym, the scene information of the language scene is a fitness conversation scene.
[0083] Optionally, the scenario information of the language scenario may be determined by the user's terminal usage data. Optionally, the terminal usage data includes browsing records, search records, tagged content, etc. For example, when the user's terminal usage data focuses on shopping, the scenario information of the language scenario may be a shopping conversation scenario. When the user's terminal usage data focuses on travel, the scenario information of the language scenario may be a travel planning conversation scenario.
[0084] Optionally, the scene information can be determined comprehensively based on the positioning data and the user's terminal usage data. The location where the target voice occurs is determined based on the positioning data, the application scenario where the target voice occurs is determined based on the terminal usage data, and the scene information of the language scene is determined based on the location and the application scenario. For example, when the location is determined to be an airport based on the positioning data, the application scenario is determined to be shopping based on the terminal usage data, and then the scene information of the voice scene is determined to be an airport shopping scene. Combining the terminal usage data and positioning data, the environment and scene where the user is located can be judged more accurately.
[0085] In the technical solution of this embodiment, the user's terminal usage data and / or positioning data are obtained; the scene information of the language scene before the voice practice is determined according to the terminal usage data and / or positioning data. The accuracy of the language scene determination is improved by analyzing the collected terminal usage data and / or positioning data.
[0086] Based on the first or second embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the above embodiment can be referred to the above introduction, and will not be repeated in the following. Figure 3 , step S30 comprises:
[0087] Step S31, generating annotation information of the target text including error correction content of word pronunciation according to the reference voice of the scene information and the target voice;
[0088] Step S32, acquiring an associated speech corresponding to the target speech, and generating context information of the target text according to the associated speech;
[0089] Step S33: Generate annotation information of the target text including error correction content of words according to the reference text of the scene information and the context information.
[0090] It should be noted that the pronunciation of words may be different under different scene information, that is, the reference voice is different. In order to make the target voice input by the user more suitable for the current language environment, the pronunciation of the word will be corrected. Using the pronunciation AI training application, English pronunciation is scored and guided based on scene information to help users improve their English pronunciation ability, including recommending appropriate pronunciation exercises based on the user's native language and practice history.
[0091] Optionally, the annotation information of the target text includes error correction content for word pronunciation, which is obtained by comparing the target speech with the pronunciation corresponding to the scene information. When the similarity is greater than or equal to a preset threshold, it indicates that the pronunciation of the target speech is accurate and no correction is required; when the similarity is less than the preset threshold, it indicates that the pronunciation of the target speech is inaccurate. At this time, error correction content for word pronunciation is generated based on the speech associated with the scene information.
[0092] It should be noted that the associated speech can be a speech adjacent to or related to the target speech in a speech segment of the user, and the context information of the target text is generated according to the associated speech, and rich semantic information can be captured through text context analysis.
[0093] Based on the reference text and context information of the scene information, the grammar checker tool or text understanding tool is used to generate annotation information of the target text, including word grammar correction content. The grammar checker tool identifies and corrects complex grammatical errors, basic spelling errors, and grammatical errors such as misuse of tense and subject-verb agreement, providing instant feedback to improve the grammatical quality of the content. The text understanding tool performs lexical, syntactic and semantic analysis on Chinese and English texts, and supports knowledge queries on multiple important relationships of short texts or words.
[0094] In an optional embodiment, step S33 includes: inputting the reference text of the scene information, the context information and the target text into a pre-trained language model to obtain the error probability of words in the target text output by the model; determining the wrong word position in the target text according to the error probability; generating a candidate word set for the word at the wrong word position, and replacing the word at the wrong word position with each word in the candidate word set to generate a candidate text set; scoring each text in the candidate text set, determining the target candidate text according to the score, and generating error correction content for the word according to the target candidate text.
[0095] Optionally, when the error probability of a word is greater than or equal to a preset probability value, it indicates that the word is very likely to be wrong, and the position of the word is determined to be the wrong word position; when the error probability of a word is less than the preset probability value, it indicates that the word is less likely to be wrong, and no processing is required. Optionally, the text with the highest score is used as the target candidate text, and the error correction content of the word is generated based on the target candidate text.
[0096] In the technical solution of this embodiment, the words in the target text are checked through scene information reference speech, reference text and context information, and error correction content for the words is generated. Since the speech is recognized and annotated according to different scenes, the annotated speech text is more in line with the current language environment, thereby improving the accuracy of text annotation.
[0097] Based on any one of the first to third embodiments of the present application, in the fourth embodiment of the present application, the same or similar contents as those in the above embodiments can refer to the above introduction, and will not be repeated later. Figure 4 , step S10 comprises:
[0098] Step S14, obtaining a historical text corresponding to the historical speech of the user, and determining a first matching degree according to scene information of each language scene, the relationship between words in the historical text, and the sentence structure;
[0099] Step S15, determining a second matching degree according to the scene information of each language scene and the context information of the historical text;
[0100] Step S16, determining the degree of matching between the historical text and the scene information of each language scene according to a preset weight parameter, the first matching degree, and the second matching degree;
[0101] Step S17: determining the scene information of the current language scene according to the matching degree.
[0102] Use deep learning models to encode scene information and context information. These models are able to capture semantic relationships and contextual dependencies in text. Use context-aware word embedding technology to generate rich representation vectors for each word in the text. Dependency syntactic analysis and semantic role labeling are used to determine the relationship between words in the text and the deep structure of the sentence.
[0103] Using the results of dependency syntactic analysis and semantic role labeling, evaluate the relationship between words in the historical text and the rationality of the sentence structure, and calculate the sentence structure matching score as the first matching degree. Combined with scene encoding and context-aware word embedding, use cosine similarity or other similarity measurement methods to calculate the similarity score between the historical text and the scene information as the second matching degree. According to the preset weight parameters, the first matching degree and the second matching degree are combined, and the final matching degree of the historical text in the current scene is determined using weighted summation or other comprehensive methods. Optionally, the weight parameters and the representation of context information are automatically adjusted based on user feedback or subsequent changes in the context.
[0104] Optionally, sentiment analysis technology is introduced to evaluate the emotional tendency in historical texts, because emotional color is also an important component of the matching degree. The second matching degree is determined based on the scene information of each language scene, the context information and emotional information of the historical text, wherein the emotional information is generated based on the user's tone or expression, such as anxious, happy, etc.
[0105] Optionally, a real-time updated corpus is constructed from which the system can learn the latest language usage and expressions to maintain the timeliness of the evaluation. The second matching degree is determined based on the scene information of each language scene, the context information, sentiment information and timeliness of the historical text, where the timeliness is the timeliness of the current expression, which is used to generate more novel text.
[0106] In the technical solution of this embodiment, the accuracy of language scene determination is improved by analyzing the scene information and historical texts of each language scene.
[0107] Based on any one of the first to fourth embodiments of the present application, in the fifth embodiment of the present application, the same or similar contents as those in the above embodiments can be referred to the above introduction, and will not be repeated in the following. Figure 5 , step S30 comprises:
[0108] Step S34, inputting the reference speech and / or reference text of the scene information and the target text into a text extension model to obtain an extended text;
[0109] Step S35, determining the relevance between the extended text and the target text, and generating a candidate extended text set according to the relevance;
[0110] Step S36, determining a recommendation value of each candidate extended text in the candidate extended text set;
[0111] Step S37: determining a target extended text from the candidate extended text set according to the recommendation value, and using the target extended text as the annotation information.
[0112] It should be noted that the text expansion model is a pre-trained neural network model, which expands the scene information reference speech and / or reference text and target text to generate extended text.
[0113] In the candidate extended text, it is determined whether the semantics of the candidate extended text matches the semantics of the text information; if the semantics of the candidate extended text matches the semantics of the text information, the candidate extended text is put into a candidate extended text set.
[0114] It should be noted that the correlation between the extended text and the target text may be determined by calculating the similarity between the vector corresponding to the extended text and the vector corresponding to the target text, or by comparing keywords between the extended text and the target text.
[0115] Optionally, determining a recommendation value for each candidate extended text in the candidate extended text set can be determining the recommendation value based on the emotional information of the candidate extended text and the emotional information of the user's preference, and determining a target extended text from the candidate extended text set based on the recommendation value to determine an extended text that fits the user's emotional expression.
[0116] Optionally, the recommendation value of each candidate extended text in the candidate extended text set may be determined based on the usage frequency of the candidate extended text, and a target extended text is determined from the candidate extended text set based on the recommendation value to determine an extended text with greater popularity.
[0117] Optionally, step S36 includes: calculating the text similarity between the current candidate extended text and other candidate extended texts in the candidate extended text set; and determining the recommendation value of the current candidate extended text according to the average value of the text similarity. A larger recommendation value indicates a more accurate recommendation, and a smaller recommendation value indicates an inaccurate recommendation, which is significantly different from other extended texts.
[0118] Optionally, the recommendation values determined according to different dimensions are weighted to obtain a final recommendation value, and the target extended text is determined in the candidate extended text set according to the final recommendation value, wherein the extended text with the largest recommendation value is used as the target extended text, thereby improving the accuracy of determining the target extended text.
[0119] In the technical solution of this embodiment, extended text is generated through scene information and target text, and the extended text is screened to generate extended content of words. Since the speech is recognized and annotated according to different scenes, the annotated speech text is more in line with the current language environment, thereby improving the comprehensiveness of text annotation.
[0120] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the text annotation method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0121] The present application provides a text annotation device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the text annotation method in the above-mentioned embodiment 1.
[0122] Reference below Figure 6 , which shows a schematic diagram of the structure of a text annotation device suitable for implementing the embodiment of the present application. The text annotation device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The text annotation device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0123] like Figure 6As shown, the text annotation device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the text annotation device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the text annotation device to communicate with other devices wirelessly or by wire to exchange data. Although the text annotation device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0124] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include 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, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0125] The text annotation device provided by the present application adopts the text annotation method in the above embodiment, which can solve the technical problem that the grammar and pronunciation of words cannot be corrected according to different application objects, and manual verification is required, resulting in low accuracy of speech correction. Compared with the prior art, the beneficial effects of the text annotation device provided by the present application are the same as the beneficial effects of the text annotation method provided by the above embodiment, and other technical features in the text annotation device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0126] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0127] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0128] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the text annotation method in the above-mentioned embodiment.
[0129] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, 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 this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0130] The computer-readable storage medium may be included in the text annotation device; or may exist independently without being assembled into the text annotation device.
[0131] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the text annotation device, the text annotation device: determines the scene information of the speech practice, and annotates the text of the target speech through the reference speech and / or reference text of the scene information. Since the speech is recognized and annotated according to different scenes, the annotated speech text is more in line with the current language environment, thereby improving the accuracy of text annotation.
[0132] Computer program code for performing the operations of the present application 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 the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through 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).
[0133] 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 application. 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 alternative implementations, 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.
[0134] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0135] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned text annotation method, and can solve the technical problem that it is impossible to correct the grammar and pronunciation of words according to different application objects, and manual verification is required, resulting in low accuracy of speech correction. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the text annotation method provided by the above-mentioned embodiment, and will not be repeated here.
[0136] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned text annotation method when executed by a processor.
[0137] The computer program product provided by the present application can solve the technical problem that it is impossible to correct the grammar and pronunciation of words according to different application objects, and manual verification is required, resulting in low accuracy of speech correction. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the text annotation method provided by the above embodiment, and will not be repeated here.
[0138] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A text annotation method, characterized in that: The method comprises: Determine context information of the current language context of the speech practice; Upon receiving preset operation information from the user, obtaining the target voice input by the user, and generating a target text corresponding to the target voice; Generate annotation information of the target text according to the reference speech and / or reference text corresponding to the scene information.
2. The method according to claim 1, characterized in that The step of determining the scene information of the current language scene of the speech practice comprises: Obtain user terminal usage data and / or location data; Scenario information of a pre-language scenario of the speech practice is determined according to the terminal usage data and / or the positioning data.
3. The method according to claim 1, characterized in that The step of generating the annotation information of the target text according to the reference speech and / or reference text corresponding to the scene information comprises: Generate annotation information of the target text including error correction content of word pronunciation according to the reference speech of the scene information and the target speech; Acquire an associated speech corresponding to the target speech, and generate context information of the target text according to the associated speech; The tagging information of the target text including the error correction content of the words is generated according to the reference text of the scene information and the context information.
4. The method according to claim 3, characterized in that The step of generating the annotation information of the target text including the error correction content of the word according to the reference text of the scene information and the context information comprises: Inputting the reference text of the scene information, the context information and the target text into a pre-trained language model, and obtaining the error probability of words in the target text output by the model; Determine the position of the wrong character in the target text according to the error probability; Generate a candidate word set for the word at the wrong word position, and replace the word at the wrong word position with each word in the candidate word set to generate a candidate text set; Each text in the candidate text set is scored, a target candidate text is determined according to the score, and error correction content of a word is generated according to the target candidate text.
5. The method according to claim 1, characterized in that The step of determining the scene information of the current language scene of the speech practice comprises: Obtaining historical text corresponding to the user's historical speech, and determining high-frequency words corresponding to the scene information of each language scene, wherein the probability of occurrence of the high-frequency words in the speech scene is greater than a preset probability threshold; The similarity between the high-frequency vocabulary and the words in the historical text is determined, and the scene information of the current language scene is determined according to the similarity.
6. The method according to claim 1, characterized in that The step of determining the scene information of the current language scene of the speech practice comprises: Obtaining a historical text corresponding to the historical speech of the user, and determining a first matching degree according to scene information of each language scene, a relationship between words in the historical text, and a sentence structure; Determining a second matching degree according to the scene information of each language scene and the context information of the historical text; Determining the degree of matching between the historical text and the scene information of each language scene according to a preset weight parameter, the first matching degree, and the second matching degree; According to the matching degree, the scene information of the current language scene is determined.
7. The method according to claim 1, characterized in that The step of generating the annotation information of the target text according to the reference speech and / or reference text corresponding to the scene information comprises: Inputting the reference speech and / or reference text of the scene information and the target text into a text extension model to obtain an extended text; Determining the relevance between the extended text and the target text, and generating a candidate extended text set according to the relevance; Determining a recommendation value for each candidate extended text in the candidate extended text set; A target extended text is determined from the candidate extended text set according to the recommendation value, and the target extended text is used as the annotation information.
8. The method according to claim 7, characterized in that The step of determining the recommendation value of each candidate extended text in the candidate extended text set comprises: In the candidate extended text set, respectively calculating the text similarity between the current candidate extended text and other candidate extended texts; The recommendation value of the current candidate extended text is determined according to the average value of the text similarities.
9. A text annotation device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the text annotation method according to any one of claims 1 to 8.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the text annotation method according to any one of claims 1 to 8 are implemented.
