A method and system for processing text units
Through the semantic recognition model, the intent classification and text unit extraction of speech content is solved, and the problem of modifying homophones or homophones in speech interactions is achieved, accurate editing of homophone text units is achieved, and user experience is improved.
Patent Information
- Application Number
- CN202110539425.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-18
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2041-05-18
AI Technical Summary
It is difficult to accurately modify the visually impaired people encounter error recognition of homophones or homophones during voice interaction, and it is difficult for the prior art to provide effective auxiliary solutions.
The pre-trained semantic recognition model uses the pre-trained semantic recognition model to classify the user's voice content to be determined whether the format of the text to be analyzed is a homophone text unit group word group. If it is a homophone text unit group word group, the last text unit is extracted as the pending unit, and Edit the target text based on the intent classification results.
The accuracy of auxiliary input of homophones or homophones to visually impaired people is achieved, improving user experience and simplifying the modification process.
Smart Images

Figure CN113191157B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of voice interaction technology, and in particular to a method and system for processing text units. Background Art
[0002] With the development of speech recognition technology, the application scenarios of speech interaction are becoming more and more extensive. In the process of speech interaction, homophones or homophones are often misrecognized, and users need to modify the misrecognized homophones or homophones manually. However, for the visually impaired, it is very difficult to modify the misrecognized homophones or homophones. Therefore, there is an urgent need for a method that can assist the visually impaired to accurately input homophones or homophones. Summary of the invention
[0003] In view of this, an embodiment of the present invention provides a method and system for processing a text unit to assist visually impaired people in accurately inputting homophones or homophones.
[0004] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0005] A first aspect of an embodiment of the present invention discloses a method for processing a text unit, the method comprising:
[0006] Using the pre-trained semantic recognition model, the user's voice content used to edit the target text is classified for intent, and the text to be analyzed and the intent classification result are obtained, where the intent classification result is text input intent, replacement intent, insertion intent, or deletion intent;
[0007] Based on the content of the text to be analyzed, determining whether the format of the text to be analyzed is a format of homophonetic text unit word grouping;
[0008] If the format of the text to be analyzed is a format of homophonetic text unit word grouping, extract the last text unit in the text to be analyzed and use it as the text unit to be processed, wherein the text unit includes at least one continuous Chinese character;
[0009] The target text is edited according to the intention classification result and the text unit to be processed.
[0010] Preferably, the semantic recognition model obtained by pre-training is used to perform intent classification on the speech content of the user for editing the target text to obtain the text to be analyzed and the intent classification result, including:
[0011] Using the pre-trained semantic recognition model, the user's voice content used to edit the target text is classified to obtain the intent classification result;
[0012] If the intention classification result is a text input intention, the speech content is used as the text to be analyzed;
[0013] If the intention classification result is replacement intention, insertion intention or deletion intention, the semantic recognition model is used to extract key information in the voice content, and the key information is used as the text to be analyzed.
[0014] Preferably, if the intention classification result is replacement intention, insertion intention or deletion intention, using the semantic recognition model to extract key information in the speech content, and using the key information as the text to be analyzed, includes:
[0015] If the intention classification result is a replacement intention, extracting a replacement text unit and a replaced text unit in the voice content by using the semantic recognition model, taking a phrase in the voice content containing the replacement text unit as a first text to be analyzed, and taking a phrase in the voice content containing the replaced text unit as a second text to be analyzed;
[0016] If the intention classification result is an insertion intention, extracting the positioning text unit and the to-be-inserted text unit in the voice content by using the semantic recognition model, and taking the phrases in the voice content containing the positioning text unit and the to-be-inserted text unit as the third text to be analyzed;
[0017] If the intention classification result is a deletion intention, the semantic recognition model is used to extract the text unit to be deleted in the voice content, and the phrase containing the text unit to be deleted in the voice content is used as the fourth text to be analyzed.
[0018] Preferably, the editing of the target text according to the intention classification result and the text unit to be processed includes:
[0019] If the intention classification result is a text input intention, inputting the to-be-processed text unit into the target text;
[0020] If the intention classification result is a replacement intention, the replaced text unit in the target text is replaced with the replacement text unit, wherein the to-be-processed text unit of the first to-be-analyzed text is the replacement text unit, and the to-be-processed text unit of the second to-be-analyzed text is the replaced text unit;
[0021] If the intention classification result is an insertion intention, inserting the to-be-inserted text unit at the location text unit in the target text, wherein the to-be-processed text unit of the third to-be-analyzed text is the to-be-inserted text unit;
[0022] If the intention classification result is a deletion intention, the to-be-deleted text unit in the target text is deleted, wherein the to-be-processed text unit of the fourth to-be-analyzed text is the to-be-deleted text unit.
[0023] Preferably, the determining whether the format of the text to be analyzed is a format of homophonetic text unit word grouping based on the content of the text to be analyzed includes:
[0024] Determine whether the second to last character in the text to be analyzed is a specified character;
[0025] If the penultimate character in the text to be analyzed is a designated character, determining whether the text unit before the penultimate character in the text to be analyzed is a word, wherein the text unit includes at least one continuous Chinese character;
[0026] If the text unit before the second to last character is a word, determining whether the text unit before the second to last character contains the last text unit in the text to be analyzed;
[0027] If the text unit before the penultimate character contains the last text unit in the text to be analyzed, it is determined that the format of the text to be analyzed is a format of homophonic text unit word grouping.
[0028] Preferably, it also includes:
[0029] If the format of the text to be analyzed is not a format of homophonetic text unit word grouping, the target text is edited according to the intention classification result and the text to be analyzed.
[0030] A second aspect of an embodiment of the present invention discloses a system for processing a text unit, the system comprising:
[0031] A classification unit is used to classify the intent of the speech content used by the user to edit the target text by using a pre-trained semantic recognition model, and obtain the text to be analyzed and the intent classification result, wherein the intent classification result is text input intent, replacement intent, insertion intent or deletion intent;
[0032] A determination unit, configured to determine whether the format of the text to be analyzed is a format of homophonetic text unit word combination based on the content of the text to be analyzed;
[0033] An extraction unit, for extracting the last text unit in the text to be analyzed and using it as a text unit to be processed if the format of the text to be analyzed is a format of homophonetic text unit word combination, wherein the text unit includes at least one continuous Chinese character;
[0034] A processing unit is used to edit the target text according to the intention classification result and the text unit to be processed.
[0035] Preferably, the classification unit includes:
[0036] A classification module is used to classify the intent of the speech content used by the user to edit the target text by using the pre-trained semantic recognition model to obtain the intent classification result;
[0037] A first processing module, configured to use the speech content as text to be analyzed if the intention classification result is a text input intention;
[0038] The second processing module is used to extract key information from the speech content using the semantic recognition model if the intention classification result is a replacement intention, an insertion intention or a deletion intention, and use the key information as the text to be analyzed.
[0039] Preferably, the second processing module is specifically used to: if the intention classification result is a replacement intention, use the semantic recognition model to extract the replacement text unit and the replaced text unit in the voice content, use the phrase containing the replacement text unit in the voice content as the first text to be analyzed, and use the phrase containing the replaced text unit in the voice content as the second text to be analyzed;
[0040] If the intention classification result is an insertion intention, extracting the positioning text unit and the to-be-inserted text unit in the voice content by using the semantic recognition model, and taking the phrases in the voice content containing the positioning text unit and the to-be-inserted text unit as the third text to be analyzed;
[0041] If the intention classification result is a deletion intention, the semantic recognition model is used to extract the text unit to be deleted in the voice content, and the phrase containing the text unit to be deleted in the voice content is used as the fourth text to be analyzed.
[0042] Preferably, the processing unit for editing the target text according to the intention classification result and the text unit to be processed is specifically used to: if the intention classification result is a text input intention, input the text unit to be processed into the target text;
[0043] If the intention classification result is a replacement intention, the replaced text unit in the target text is replaced with the replacement text unit, wherein the to-be-processed text unit of the first to-be-analyzed text is the replacement text unit, and the to-be-processed text unit of the second to-be-analyzed text is the replaced text unit;
[0044] If the intention classification result is an insertion intention, inserting the to-be-inserted text unit at the location text unit in the target text, wherein the to-be-processed text unit of the third to-be-analyzed text is the to-be-inserted text unit;
[0045] If the intention classification result is a deletion intention, the to-be-deleted text unit in the target text is deleted, wherein the to-be-processed text unit of the fourth to-be-analyzed text is the to-be-deleted text unit.
[0046] Based on the above-mentioned embodiment of the present invention, a method and system for processing text units are provided. The method is as follows: using a pre-trained semantic recognition model, the user's voice content used to edit the target text is classified by intent, and the text to be analyzed and the intent classification result are obtained; based on the content in the text to be analyzed, it is determined whether the format of the text to be analyzed is the format of homophonic text unit word combination; if the format of the text to be analyzed is the format of homophonic text unit word combination, the last text unit in the text to be analyzed is extracted and used as the text unit to be processed; according to the intent classification result and the text unit to be processed, the target text is edited. In this scheme, the semantic recognition model is used to classify the user's voice input content by intent to obtain the corresponding text to be analyzed and the intent classification result. If it is determined that the format of the text to be analyzed is the format of homophonic text unit word combination, the last text unit in the text to be analyzed is extracted and used as the text unit to be processed, and the text unit to be processed is the homophonic text unit that needs to be processed. According to the intent classification result and the text unit to be processed, the target text is edited to achieve the purpose of assisting the visually impaired to accurately input homophonic text units and improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present invention 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, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0048] Figure 1 A flowchart of a method for processing a text unit provided by an embodiment of the present invention;
[0049] Figure 2 A flowchart for determining the format of a text to be analyzed provided by an embodiment of the present invention;
[0050] Figure 3 A structural block diagram of a system for processing text units provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0051] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0052] In this application, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, such that a process, method, article or device including a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the phrase "including a..." does not exclude the presence of additional identical elements in the process, method, article or device including the element.
[0053] As can be seen from the background art, during voice interaction, there are often situations where homophonic characters or words are misrecognized. For visually impaired people, it is quite difficult to correct misrecognized homophonic characters or words. Therefore, there is an urgent need for a method that can assist visually impaired people in accurately inputting homophonic characters or words.
[0054] Therefore, the embodiments of the present invention provide a method and system for processing text units, which use a semantic recognition model to classify the intent of the user's voice input content to obtain corresponding text to be analyzed and an intent classification result. If it is determined that the format of the text to be analyzed is the format of forming words with homophonic text units, the last text unit in the text to be analyzed is extracted and used as the text unit to be processed, and this text unit to be processed is the homophonic text unit that needs to be processed. According to the intent classification result and the text unit to be processed, the target text is edited to assist visually impaired people in accurately inputting homophonic text units, thereby improving the user experience.
[0055] It can be understood that when visually impaired people perform voice interaction and set to read characters unit by unit, the characters will be grouped into words and read out, so that visually impaired people can know which specific character it is. For example, when reading the character "yin", it is read out as "yin, cloudy day", so that visually impaired people can know that the character "yin" is the "yin" in "cloudy day".
[0056] It should be noted that the method for processing text units provided in the embodiments of the present invention is specifically applied to the processing of homophonic characters or words. Similarly, this method for processing text units can also be applied to the processing of homophonic characters or words. For the detailed content of this method for processing text units, please refer to the description of the following embodiments.
[0057] See Figure 1, shows a flowchart of a method for processing a text unit provided by an embodiment of the present invention, the method comprising:
[0058] Step S101: using the pre-trained semantic recognition model, the user's voice content used to edit the target text is classified according to intent, and the text to be analyzed and the intent classification result are obtained.
[0059] It should be noted that the intent classification result is text input intent, replacement intent, insertion intent or deletion intent.
[0060] In the specific implementation step S101, when the user edits the target text by voice, the user's voice content is obtained, and the pre-trained semantic recognition model is used to perform intent classification on the user's voice content used to edit the target text to obtain an intent classification result.
[0061] That is to say, the semantic recognition model can be used to recognize the intent of the speech content and classify the recognition results to obtain the intent classification results corresponding to the speech content.
[0062] It can be understood that the intent classification results corresponding to the user's voice content are text input intent, replacement intent, insertion intent (which can be divided into forward insertion and backward insertion) or deletion intent. Among them, text input intent refers to: inputting voice content into the target text; replacement intent refers to: replacing a text unit (i.e., a word or phrase) in the voice content with a text unit in the target text; insertion intent refers to: inserting a text unit in the voice content into a certain position in the target text; deletion intent refers to: using the voice content to delete certain text units in the target text.
[0063] It is understandable that when a user edits a target text through voice content, the purpose is usually divided into two types. One purpose is to input the voice content into the target text; the other purpose is to use the voice content to modify the target text (the voice content at this time can be regarded as a modification instruction). For example: the voice content is "change sunny to cloudy", at this time, "sunny" in the target text is replaced with "cloudy".
[0064] After obtaining the intent classification result of the user's voice content used to edit the target text, if the intent classification result is a text input intention, the voice content is used as the text to be analyzed.
[0065] If the intent classification result is replacement intent, insertion intent or deletion intent, the semantic recognition model is used to extract key information in the speech content, and the extracted key information is used as the text to be analyzed.
[0066] It can be understood that in the process of extracting key information from speech content using a semantic recognition model, the sequence labeling algorithm is first used to label each part of the speech content (label the corresponding labels), and then the labels of each part of the speech content are combined with the intent classification results to extract the key information from the speech content.
[0067] For example: when the intent classification result of the speech content is deletion intent, the key information extracted is the deleted object (the label of the object is the deletion label); when the intent classification result of the speech content is replacement intent, the key information extracted is the replaced object (the label is the replaced label) and the replacement object (the label is the replacement label), that is, the replaced object in the target text is replaced by the replacement object; when the intent classification result of the speech content is insertion intent, the key information extracted is the positioning word used as a reference (the label is the positioning label) and the target word to be inserted (the label is the insertion label).
[0068] In combination with the above examples, in some specific embodiments, the aforementioned “using the extracted key information as the text to be analyzed” mainly includes three situations.
[0069] The first case: If the intention classification result of the user's voice content used to edit the target text is replacement intention, the semantic recognition model is used to extract the replacement text unit and the replaced text unit in the voice content, and the phrase containing the replacement text unit in the voice content is used as the first text to be analyzed, and the phrase containing the replaced text unit in the voice content is used as the second text to be analyzed.
[0070] For example: assuming the speech content is "change the yin of a cloudy day into the sound of music", the extracted replacement text unit is "sound", and the replaced text unit is "cloudy". At this time, the phrase "the sound of music" is used as the first text to be analyzed, and the phrase "the yin of a cloudy day" is used as the second text to be analyzed.
[0071] It should be noted that a text unit includes at least one continuous Chinese character, that is, a text unit can be specifically used to represent a word or a phrase.
[0072] The second case: If the intention classification result of the user's voice content used to edit the target text is insertion intention, the semantic recognition model is used to extract the positioning text unit and the text unit to be inserted in the voice content, and the phrase containing the positioning text unit and the text unit to be inserted in the voice content is used as the third text to be analyzed.
[0073] The third case: If the user's intention classification result of the voice content used to edit the target text is deletion intention, the semantic recognition model is used to extract the text unit to be deleted in the voice content, and the phrase containing the text unit to be deleted in the voice content is used as the fourth text to be analyzed.
[0074] Step S102: Based on the content in the text to be analyzed, determine whether the format of the text to be analyzed is the format of forming words with homophonic text units. If the format of the text to be analyzed is the format of forming words with homophonic text units, execute Step S103; if the format of the text to be analyzed is not the format of forming words with homophonic text units, execute Step S105.
[0075] It should be noted that the specific composition content of the format of forming words with homophonic text units is: "forming words with homophonic text units" + "of" + "homophonic text unit".
[0076] Through the format of forming words with homophonic text units, it can be judged whether a certain phrase is in the format of forming words with homophonic text units. For example, the phrase "yin of cloudy day" is in the format of forming words with homophonic text units.
[0077] In the specific process of implementing Step S102, compare the penultimate character in the text to be analyzed with a specified character (this specified character can be the character "of"). If the penultimate character in the text to be analyzed is this specified character, then determine whether the format of the text to be analyzed is the format of forming words with homophonic text units through the text unit before the penultimate character in the text to be analyzed and the last text unit in the text to be analyzed.
[0078] If it is determined that the format of the text to be analyzed is the format of forming words with homophonic text units, then execute Step S103; if it is determined that the format of the text to be analyzed is not the format of forming words with homophonic text units, then execute Step S105.
[0079] It should be noted that according to the content in the above Step S101, when determining the text to be analyzed, due to the different intention classification results of the voice content used by the user to edit the target text, the determined text to be analyzed is also different, so the judgment of the format of the text to be analyzed is also different.
[0080] If the intention classification result is the text input intention, then judge whether the format of the text to be analyzed (that is, the voice content) is the format of forming words with homophonic text units.
[0081] If the intention classification result is the replacement intention, then judge whether the formats of the first text to be analyzed and the second text to be analyzed are the formats of forming words with homophonic text units.
[0082] If the intention classification result is the insertion intention, then judge whether the format of the third text to be analyzed is the format of forming words with homophonic text units.
[0083] If the intention classification result is the deletion intention, then judge whether the format of the fourth text to be analyzed is the format of forming words with homophonic text units.
[0084] Step S103: extract the last text unit in the text to be analyzed and use it as the text unit to be processed, and execute step S104.
[0085] It should be noted that a text unit includes at least one continuous Chinese character.
[0086] In the process of implementing step S103, if it is determined that the format of the text to be analyzed is the format of homophone text unit word grouping, the last text unit in the text to be analyzed is extracted and used as the text unit to be processed. The text unit to be processed is the homophone text unit used to edit the target text, and step S104 is executed.
[0087] It can be understood that, according to the content of the above step S101, when determining the text to be analyzed, the text to be analyzed is determined to be different depending on the intention classification result of the user's voice content for editing the target text. The details are as follows:
[0088] If the intent classification result is a text input intent, the speech content is used as the text to be analyzed. At this time, the last text unit in the text to be analyzed is extracted and used as the text unit to be processed.
[0089] It is understandable that, when the format of the text to be analyzed is determined to be a format of homophone text unit word grouping, the last text unit of the text to be analyzed is the text unit to be input (the text unit that needs to input the target text). For example: for the voice content "smartphone's mobile phone" (i.e., the text to be analyzed), the last text unit in the text to be analyzed is the word "mobile phone" in the text unit to be input.
[0090] If the intent classification result is a replacement intention, the phrase containing the replacement text unit in the speech content is used as the first text to be analyzed, and the phrase containing the replaced text unit in the speech content is used as the second text to be analyzed. At this time, the last text unit in the first text to be analyzed is extracted and used as the text unit to be processed, and the last text unit in the second text to be analyzed is extracted and used as the text unit to be processed.
[0091] It can be understood that, in the case where the format of the text to be analyzed is determined to be a format of homophone text unit word combination, the last text unit in the first text to be analyzed is the replacement text unit, and the last text unit in the second text to be analyzed is the replaced text unit. For example: for the speech content of "change the cloudy day's yin to the music's sound", the first text to be analyzed is "music's sound", the second text to be analyzed is "the cloudy day's sound", the last text unit in the first text to be analyzed is the replacement text unit "sound", and the last text unit in the second text to be analyzed is the replaced text unit "yin".
[0092] If the intention classification result is an insertion intention, then the phrase in the speech content that contains the positioning text unit and the text unit to be inserted is used as the third text to be analyzed. At this time, the last text unit in the third text to be analyzed is extracted and used as the text unit to be processed.
[0093] It can be understood that in the case where it is determined that the format of the text to be analyzed is the format of forming words with homophonic text units, the last text unit in the third text to be analyzed is the text unit to be inserted. For example, for the third text to be analyzed "Insert'ming' of tomorrow behind us", the last text unit in this third text to be analyzed is the text unit to be inserted, the character'ming'.
[0094] If the intention classification result is a deletion intention, then the phrase in the speech content that contains the text unit to be deleted is used as the fourth text to be analyzed. At this time, the last text unit in the fourth text to be analyzed is extracted and used as the text unit to be processed.
[0095] It can be understood that in the case where it is determined that the format of the text to be analyzed is the format of forming words with homophonic text units, the last text unit in the fourth text to be analyzed is the text unit to be deleted. For example, for the fourth text to be analyzed "Delete 'ping' of apple", the last text unit in this fourth text to be analyzed is the text unit to be deleted, the character 'ping'.
[0096] Step S104: Edit the target text according to the intention classification result and the text unit to be processed.
[0097] In the specific process of implementing step S104, after determining that the format of the text to be analyzed is the format of forming words with homophonic text units and extracting the text unit to be processed, according to the intention classification result of the speech content used by the user to edit the target text, combined with the extracted text unit to be processed, the target text is edited. According to the different intention classification results, the specific ways to edit the target text are mainly divided into the following four editing methods. See the following description for details.
[0098] The first editing method: If the intention classification result is a text input intention, as can be seen from the above content, the speech content is used as the text to be analyzed, and the text unit to be processed of this text to be analyzed is input into the target text. That is to say, if the intention classification result of the speech content is a text input intention, the last text unit (i.e., the text unit to be processed) in the determined text to be analyzed is input into the target text.
[0099] It should be noted that the above steps can also be considered as: replacing the text to be analyzed with the text unit to be processed and inputting the text unit to be processed into the target text.
[0100] For example: If the intent classification result is a text input intent, the speech content (which is the text to be analyzed at this time) is "the sound of music", and the text unit to be processed is the word "sound", then "sound" will be input into the target text.
[0101] The second editing method: If the intention classification result is a replacement intention, it can be seen from the above content that the first text to be analyzed and the second text to be analyzed can be determined, the to-be-processed text unit of the first text to be analyzed (that is, the last text unit) is the replacement text unit, and the to-be-processed text unit of the second text to be analyzed is the replaced text unit (that is, the last text unit), and the replaced text unit in the target text is replaced with the replacement text unit.
[0102] For example: if the intent classification result is a replacement intention, and the speech content is "change the yin in a cloudy day to the yin in music", the first text to be analyzed is determined to be "the yin in music", and the second text to be analyzed is "the yin in a cloudy day", the text unit to be processed of the first text to be analyzed is the word "yin" (replacement text unit), and the text unit to be processed of the second text to be analyzed is the word "yin" (replaced text unit), then the word "yin" in the target text will be changed to the word "yin".
[0103] The third editing method: If the intention classification result is an insertion intention, it can be seen from the above content that the third text to be analyzed can be determined, and the text unit to be processed of the third text to be analyzed is the text unit to be inserted (that is, the last text unit), and the text unit to be inserted is inserted at the positioning text unit in the target text.
[0104] For example: If the intention classification result is insertion intention, the third text to be analyzed is "Insert the teacher's teaching after us". At this time, the text unit to be processed of the third text to be analyzed is the word "teaching" (text unit to be inserted), and the positioning text unit is the word "we". The word "teaching" is inserted after "we" in the target text.
[0105] The fourth editing method: If the intention classification result is a deletion intention, it can be seen from the above content that the fourth text to be analyzed can be determined, and the text unit to be processed of the fourth text to be analyzed is the text unit to be deleted (that is, the last text unit), and the text unit to be deleted in the target text is deleted.
[0106] For example: if the intent classification result is deletion intent, the fourth text to be analyzed is "delete the yin of cloudy day", then the text unit to be processed of the fourth text to be analyzed is "yin" (text unit to be deleted), and the word "yin" is deleted in the target text.
[0107] It should be noted that the example contents in the above four editing methods are illustrated by taking the text unit as a character. Similarly, the text unit can also be a word. When the text unit is a word, the method of editing the target text can be referred to the above content and will not be repeated here.
[0108] Step S105: Edit the target text according to the intention classification result and the text to be analyzed.
[0109] In the specific implementation of step S105, if it is determined that the format of the text to be analyzed is not the format of homophonetic text unit word grouping, the user's intention classification result for editing the voice content of the target text is combined with the text to be analyzed to edit the target text.
[0110] If the intent classification result is a text input intent, the text to be analyzed (that is, the voice content in this case) is input into the target text.
[0111] If the intention classification result is a replacement intention, it can be seen from the above content that the first text to be analyzed and the second text to be analyzed can be determined, as well as the replacement text unit in the first text to be analyzed and the replaced text unit in the second text to be analyzed, and the replaced text unit in the target text is replaced with the replacement text unit.
[0112] If the intention classification result is an insertion intention, it can be seen from the above content that the third text to be analyzed can be determined, and the positioning text unit and the text unit to be inserted in the third text to be analyzed can be determined, and the text unit to be inserted is inserted at the positioning text unit in the target text.
[0113] If the intention classification result is a deletion intention, it can be known from the above content that a fourth text to be analyzed can be determined, and a text unit to be deleted in the fourth text to be analyzed can be determined, and the text unit to be deleted in the target text can be deleted.
[0114] In an embodiment of the present invention, a semantic recognition model is used to perform intent classification on the user's voice input content to obtain the corresponding text to be analyzed and the intent classification result. If it is determined that the format of the text to be analyzed is the format of homophone text unit word grouping, the last text unit in the text to be analyzed is extracted and used as the text unit to be processed, and the text unit to be processed is the homophone text unit that needs to be processed. According to the intent classification result and the text unit to be processed, the target text is edited to assist the visually impaired to accurately input homophone text units, thereby improving the user experience.
[0115] The above embodiments of the present invention Figure 1 The process of determining the format of the text to be analyzed in step S102 is described in detail in Figure 2 , shows a flowchart of determining the format of a text to be analyzed provided by an embodiment of the present invention, including:
[0116] Step S201: Determine whether the penultimate character in the text to be analyzed is a specified character. If the penultimate character in the text to be analyzed is the specified character, execute Step S202; if the penultimate character in the text to be analyzed is not the specified character, execute Step S205.
[0117] In the specific process of implementing Step S201, determine whether the penultimate character in the text to be analyzed is a specified character. If it is determined that the penultimate character is the specified character, then execute Step S202 to continue the subsequent judgment. If it is determined that the penultimate character is not the specified character, then execute Step S205 to determine that the format of the text to be analyzed is not the format of forming words with homophonic text units.
[0118] For example: Determine whether the penultimate character in the text to be analyzed is the character '的' (the specified character). If it is determined that the penultimate character is the character '的', execute Step S202; if it is determined that the penultimate character is not the character '的', execute Step S205.
[0119] Step S202: Judge whether the text unit before the penultimate character in the text to be analyzed is a word. If the text unit before the penultimate character in the text to be analyzed is a word, execute Step S203; if the text unit before the penultimate character in the text to be analyzed is not a word, execute Step S205.
[0120] In the specific process of executing Step S202, after determining that the penultimate character in the text to be analyzed is the specified character, use the pre-constructed Chinese word library to judge whether the text unit before the penultimate character in the text to be analyzed is a word. If the text unit before the penultimate character in the text to be analyzed is a word, then execute Step S203 to continue the subsequent judgment. If the text unit before the penultimate character in the text to be analyzed is not a word, then execute Step S205 to determine that the format of the text to be analyzed is not the format of forming words with homophonic text units.
[0121] Step S203: Judge whether the text unit before the penultimate character in the text to be analyzed contains the last text unit in the text to be analyzed. If the text unit before the penultimate character contains the last text unit in the text to be analyzed, execute Step S204; if the text unit before the penultimate character does not contain the last text unit in the text to be analyzed, execute Step S205.
[0122] In the specific implementation process of step S203, after determining that the text unit before the second-to-last character in the text to be analyzed is a word, it is determined whether the text unit before the second-to-last character in the text to be analyzed contains the last text unit in the text to be analyzed, for example: it is determined whether the word before the second-to-last character in the text to be analyzed contains the last word in the text to be analyzed.
[0123] If the text unit before the second-to-last character contains the last text unit in the text to be analyzed, step S204 is executed to determine that the format of the text to be analyzed is the format of homophonetic text unit word combination; if the text unit before the second-to-last character does not contain the last text unit in the text to be analyzed, step S205 is executed to determine that the format of the text to be analyzed is not the format of homophonetic text unit word combination.
[0124] Step S204: Determine that the format of the text to be analyzed is a format of homophonetic text unit word grouping.
[0125] Step S205: Determine that the format of the text to be analyzed is not a format of homophonetic text unit word grouping.
[0126] In an embodiment of the present invention, the penultimate character in the text to be analyzed is compared with the specified character (, and combined with the text unit before the penultimate character in the text to be analyzed and the last text unit in the text to be analyzed, it is determined whether the format of the text to be analyzed is the format of homophonic text unit word combination. If it is determined that the format of the text to be analyzed is the format of homophonic text unit word combination, the target text is edited according to the intention classification result and the text unit to be processed, so as to assist the visually impaired people to accurately input the homophonic text unit, thereby improving the user experience.
[0127] Corresponding to the method for processing a text unit provided by the above embodiment of the present invention, see Figure 3 , the embodiment of the present invention also provides a structural block diagram of a system for processing text units, the system comprising: a classification unit 301, a determination unit 302, an extraction unit 303 and a processing unit 304;
[0128] The classification unit 301 is used to use the pre-trained semantic recognition model to classify the intent of the voice content used by the user to edit the target text, and obtain the text to be analyzed and the intent classification result. The intent classification result is text input intent, replacement intent, insertion intent or deletion intent.
[0129] The determination unit 302 is used to determine whether the format of the text to be analyzed is a format of homophonetic text unit word combination based on the content of the text to be analyzed.
[0130] The extraction unit 303 is used to extract the last text unit in the text to be analyzed and use it as the text unit to be processed if the format of the text to be analyzed is a format of homophonetic text unit word combination, and the text unit includes at least one continuous Chinese character.
[0131] The processing unit 304 is used to edit the target text according to the intention classification result and the text unit to be processed.
[0132] Preferably, the processing unit 304 is further used for: if the format of the text to be analyzed is not a format of homophonetic text unit word grouping, editing the target text according to the intention classification result and the text to be analyzed.
[0133] Preferably, combined Figure 3 The content shown, the classification unit 301 includes: a classification module, a first processing module and a second processing module, and the execution principle of each module is as follows:
[0134] The classification module is used to use the pre-trained semantic recognition model to classify the intent of the voice content used by the user to edit the target text and obtain the intent classification result.
[0135] The first processing module is used to use the speech content as the text to be analyzed if the intent classification result is a text input intent.
[0136] The second processing module is used to extract key information from the speech content using a semantic recognition model if the intent classification result is a replacement intent, an insertion intent, or a deletion intent, and use the key information as the text to be analyzed.
[0137] In a specific implementation, the second processing module is specifically used for: if the intention classification result is a replacement intention, using a semantic recognition model to extract replacement text units and replaced text units in the speech content, and taking the phrase containing the replacement text unit in the speech content as the first text to be analyzed, and taking the phrase containing the replaced text unit in the speech content as the second text to be analyzed; if the intention classification result is an insertion intention, using a semantic recognition model to extract positioning text units and text units to be inserted in the speech content, and taking the phrase containing the positioning text unit and text units to be inserted in the speech content as the third text to be analyzed; if the intention classification result is a deletion intention, using a semantic recognition model to extract text units to be deleted in the speech content, and taking the phrase containing the text unit to be deleted in the speech content as the fourth text to be analyzed.
[0138] Correspondingly, the processing unit 304 for editing the target text according to the intention classification result and the text unit to be processed is specifically used for: if the intention classification result is a text input intention, inputting the text unit to be processed into the target text; if the intention classification result is a replacement intention, replacing the replaced text unit in the target text with a replacement text unit, wherein the text unit to be processed of the first text to be analyzed is the replacement text unit, and the text unit to be processed of the second text to be analyzed is the replaced text unit; if the intention classification result is an insertion intention, inserting the text unit to be inserted at the positioning text unit in the target text, wherein the text unit to be processed of the third text to be analyzed is the text unit to be inserted; if the intention classification result is a deletion intention, deleting the text unit to be deleted in the target text, wherein the text unit to be processed of the fourth text to be analyzed is the text unit to be deleted.
[0139] In an embodiment of the present invention, a semantic recognition model is used to perform intent classification on the user's voice input content to obtain the corresponding text to be analyzed and the intent classification result. If it is determined that the format of the text to be analyzed is the format of homophone text unit word grouping, the last text unit in the text to be analyzed is extracted and used as the text unit to be processed, and the text unit to be processed is the homophone text unit that needs to be processed. According to the intent classification result and the text unit to be processed, the target text is edited to assist the visually impaired to accurately input homophone text units, thereby improving the user experience.
[0140] Preferably, combined Figure 3 The content shown, the determination unit 302 includes: a first determination module, a first judgment module, a second judgment module and a second determination module, and the execution principle of each module is as follows:
[0141] The first determination module is used to determine whether the second to last character in the text to be analyzed is a designated character.
[0142] The first judgment module is used to judge whether the text unit before the penultimate character in the text to be analyzed is a word if the penultimate character in the text to be analyzed is a designated character, and the text unit includes at least one continuous Chinese character.
[0143] The second judgment module is used to judge whether the text unit before the second-to-last character contains the last text unit in the text to be analyzed if the text unit before the second-to-last character is a word.
[0144] The second determination module is used for determining that the format of the text to be analyzed is a format of homophonic text unit grouping if the text unit before the second to last character contains the last text unit in the text to be analyzed.
[0145] In an embodiment of the present invention, the penultimate character in the text to be analyzed is compared with the specified character (, and combined with the text unit before the penultimate character in the text to be analyzed and the last text unit in the text to be analyzed, it is determined whether the format of the text to be analyzed is the format of homophonic text unit word combination. If it is determined that the format of the text to be analyzed is the format of homophonic text unit word combination, the target text is edited according to the intention classification result and the text unit to be processed, so as to assist the visually impaired people to accurately input the homophonic text unit, thereby improving the user experience.
[0146] In summary, the embodiments of the present invention provide a method and system for processing text units, which utilize a semantic recognition model to perform intent classification on the user's voice input content to obtain corresponding text to be analyzed and intent classification results. If it is determined that the format of the text to be analyzed is the format of homophone text unit word grouping, the last text unit in the text to be analyzed is extracted and used as the text unit to be processed, and the text unit to be processed is the homophone text unit that needs to be processed. According to the intent classification results and the text units to be processed, the target text is edited to assist the visually impaired to accurately input homophone text units, thereby improving the user experience.
[0147] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.
[0148] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0149] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for processing a text unit, characterized in that: The method comprises: Using the pre-trained semantic recognition model, the user's voice content used to edit the target text is classified for intent, and the text to be analyzed and the intent classification result are obtained, where the intent classification result is text input intent, replacement intent, insertion intent, or deletion intent; Based on the content of the text to be analyzed, determining whether the format of the text to be analyzed is a format of homophonetic text unit word grouping; If the format of the text to be analyzed is a format of homophonetic text unit word grouping, extract the last text unit in the text to be analyzed and use it as the text unit to be processed, wherein the text unit includes at least one continuous Chinese character; Editing the target text according to the intention classification result and the text unit to be processed; The step of determining whether the format of the text to be analyzed is a format of homophonetic text unit word grouping based on the content of the text to be analyzed includes: Determine whether the second to last character in the text to be analyzed is a specified character; If the penultimate character in the text to be analyzed is a designated character, determining whether the text unit before the penultimate character in the text to be analyzed is a word, wherein the text unit includes at least one continuous Chinese character; If the text unit before the second-to-last character is a word, determining whether the text unit before the second-to-last character contains the last text unit in the text to be analyzed; If the text unit before the penultimate character contains the last text unit in the text to be analyzed, it is determined that the format of the text to be analyzed is a format of homophonic text unit word grouping.
2. The method according to claim 1, characterized in that The semantic recognition model obtained by pre-training is used to perform intent classification on the speech content used by the user to edit the target text, and the text to be analyzed and the intent classification result are obtained, including: Using the pre-trained semantic recognition model, the user's voice content used to edit the target text is classified to obtain the intent classification result; If the intention classification result is a text input intention, the speech content is used as the text to be analyzed; If the intention classification result is replacement intention, insertion intention or deletion intention, the semantic recognition model is used to extract key information in the voice content, and the key information is used as the text to be analyzed.
3. The method according to claim 2, characterized in that If the intention classification result is replacement intention, insertion intention or deletion intention, extracting key information in the speech content by using the semantic recognition model, and using the key information as text to be analyzed, including: If the intention classification result is a replacement intention, extracting a replacement text unit and a replaced text unit in the voice content by using the semantic recognition model, taking a phrase in the voice content containing the replacement text unit as a first text to be analyzed, and taking a phrase in the voice content containing the replaced text unit as a second text to be analyzed; If the intention classification result is an insertion intention, extracting the positioning text unit and the to-be-inserted text unit in the voice content by using the semantic recognition model, and taking the phrases in the voice content containing the positioning text unit and the to-be-inserted text unit as the third text to be analyzed; If the intention classification result is a deletion intention, the semantic recognition model is used to extract the text unit to be deleted in the voice content, and the phrase containing the text unit to be deleted in the voice content is used as the fourth text to be analyzed.
4. The method according to claim 3, characterized in that The editing of the target text according to the intention classification result and the text unit to be processed includes: If the intention classification result is a text input intention, inputting the to-be-processed text unit into the target text; If the intention classification result is a replacement intention, the replaced text unit in the target text is replaced with the replacement text unit, wherein the to-be-processed text unit of the first to-be-analyzed text is the replacement text unit, and the to-be-processed text unit of the second to-be-analyzed text is the replaced text unit; If the intention classification result is an insertion intention, inserting the to-be-inserted text unit at the location text unit in the target text, wherein the to-be-processed text unit of the third to-be-analyzed text is the to-be-inserted text unit; If the intention classification result is a deletion intention, the to-be-deleted text unit in the target text is deleted, wherein the to-be-processed text unit of the fourth to-be-analyzed text is the to-be-deleted text unit.
5. The method according to claim 1, characterized in that Also includes: If the format of the text to be analyzed is not a format of homophonetic text unit word grouping, the target text is edited according to the intention classification result and the text to be analyzed.
6. A system for processing text units, characterized in that: The system comprises: A classification unit is used to classify the intent of the speech content used by the user to edit the target text by using a pre-trained semantic recognition model, and obtain the text to be analyzed and the intent classification result, wherein the intent classification result is text input intent, replacement intent, insertion intent or deletion intent; A determination unit, configured to determine whether the format of the text to be analyzed is a format of homophonetic text unit word combination based on the content of the text to be analyzed; An extraction unit, for extracting the last text unit in the text to be analyzed and using it as a text unit to be processed if the format of the text to be analyzed is a format of homophonetic text unit word combination, wherein the text unit includes at least one continuous Chinese character; A processing unit, configured to edit the target text according to the intention classification result and the text unit to be processed; The determining unit comprises: A first determination module, used to determine whether the second to last character in the text to be analyzed is a designated character; A first judgment module, configured to judge whether a text unit before the penultimate character in the text to be analyzed is a word if the penultimate character in the text to be analyzed is a designated character, wherein the text unit includes at least one continuous Chinese character; A second judgment module is used to judge whether the text unit before the second-to-last character contains the last text unit in the text to be analyzed if the text unit before the second-to-last character is a word; The second determination module is configured to determine that the format of the text to be analyzed is a format of homophonic text unit word grouping if the text unit before the penultimate character contains the last text unit in the text to be analyzed.
7. The system according to claim 6, characterized in that The taxonomic units include: A classification module is used to classify the intent of the speech content used by the user to edit the target text by using the pre-trained semantic recognition model to obtain the intent classification result; A first processing module, configured to use the speech content as text to be analyzed if the intention classification result is a text input intention; The second processing module is used to extract key information from the speech content using the semantic recognition model if the intention classification result is a replacement intention, an insertion intention or a deletion intention, and use the key information as the text to be analyzed.
8. The system according to claim 7, characterized in that The second processing module is specifically configured to: if the intention classification result is a replacement intention, extract the replacement text unit and the replaced text unit in the voice content by using the semantic recognition model, take the phrase containing the replacement text unit in the voice content as the first text to be analyzed, and take the phrase containing the replaced text unit in the voice content as the second text to be analyzed; If the intention classification result is an insertion intention, extracting the positioning text unit and the to-be-inserted text unit in the voice content by using the semantic recognition model, and taking the phrases in the voice content containing the positioning text unit and the to-be-inserted text unit as the third text to be analyzed; If the intention classification result is a deletion intention, the semantic recognition model is used to extract the text unit to be deleted in the voice content, and the phrase containing the text unit to be deleted in the voice content is used as the fourth text to be analyzed.
9. The system according to claim 8, characterized in that The processing unit for editing the target text according to the intention classification result and the text unit to be processed is specifically used to: if the intention classification result is a text input intention, input the text unit to be processed into the target text; If the intention classification result is a replacement intention, the replaced text unit in the target text is replaced with the replacement text unit, wherein the to-be-processed text unit of the first to-be-analyzed text is the replacement text unit, and the to-be-processed text unit of the second to-be-analyzed text is the replaced text unit; If the intention classification result is an insertion intention, inserting the to-be-inserted text unit at the location text unit in the target text, wherein the to-be-processed text unit of the third to-be-analyzed text is the to-be-inserted text unit; If the intention classification result is a deletion intention, the to-be-deleted text unit in the target text is deleted, wherein the to-be-processed text unit of the fourth to-be-analyzed text is the to-be-deleted text unit.
