Method, device and storage medium for screening least pronounced text
By using a predefined bag-of-words and confusion matrix filtering method, the problem of high algorithm complexity in TTS training data acquisition is solved, and the pronunciation texts with high coverage and small quantity are quickly filtered out, thereby improving training speed and efficiency.
Patent Information
- Application Number
- CN202210699472.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-20
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2042-06-20
AI Technical Summary
In the current TTS training data collection process, a brute-force search method is used to find the data. This method has high algorithm complexity, takes a long time to filter training data, and is difficult to quickly find the text with the fewest pronunciations that cover all pronunciations.
Using a predefined bag-of-words and confusion matrix, the pronunciation texts containing the largest number of similar syllables in the predefined bag-of-words are selected. Similar syllables are removed during the selection process until the number of remaining syllables is less than a threshold. These texts are then used as training data.
It enables the rapid filtering of pronunciation texts with the highest pronunciation coverage and the smallest quantity, improving the efficiency and speed of TTS training.
Smart Images

Figure CN117312536B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of text filtering technology, and in particular to a method, apparatus, device, and storage medium for filtering text with minimal pronunciation. Background Technology
[0002] When training TTS (Text To Speech), the collection of training data is of great importance. If the minimum amount of training text can be collected, yet still cover all pronunciations, it can save a significant amount of data collection time and greatly improve the training speed of TTS.
[0003] The current method for collecting TTS training data is usually through brute-force retrieval, which has high algorithm complexity and takes a long time to filter training data. Summary of the Invention
[0004] The purpose of this disclosure is to provide a method, apparatus, device, and storage medium for filtering text with minimal pronunciation, which can quickly filter the text with the most complete pronunciation and the smallest amount of data from a candidate corpus.
[0005] To achieve the above objectives, this disclosure adopts the following technical solution: a method for filtering text with minimal pronunciation, comprising:
[0006] Obtain candidate corpus and predefined syllable bag-of-words. The candidate corpus includes multiple candidate texts, and the predefined syllable bag-of-words contains a preset number of pronunciation syllables. The predefined syllable bag-of-words represents the set of pronunciation syllables to be collected in the current iteration.
[0007] Obtain all similar syllables corresponding to each of the candidate texts;
[0008] Iterate through each candidate text, and successively select the pronunciation text with the largest number of similar syllables contained in the predefined syllable bag from each candidate text. When a pronunciation text is selected each time, remove the pronunciation syllables corresponding to each of the similar syllables of the pronunciation text from the predefined syllable bag, until the number of remaining pronunciation syllables in the predefined syllable bag is less than the number threshold.
[0009] The selected pronunciation texts are used as training data.
[0010] This disclosure also provides a filtering device for text with minimal pronunciation, comprising:
[0011] The first acquisition module is used to acquire candidate corpus and predefined syllable bag-of-words. The candidate corpus includes multiple candidate texts, and the predefined syllable bag-of-words contains a preset number of pronunciation syllables. The predefined syllable bag-of-words represents the set of pronunciation syllables that need to be collected in the current time.
[0012] The second acquisition module is used to acquire all similar syllables corresponding to each of the candidate texts respectively;
[0013] The filtering module is used to traverse each candidate text, and successively filter out the pronunciation text with the largest number of similar syllables contained in the predefined syllable bag from each candidate text. When a pronunciation text is selected, the pronunciation syllables corresponding to each of the similar syllables of the pronunciation text are removed from the predefined syllable bag until the number of remaining pronunciation syllables in the predefined syllable bag is less than the number threshold.
[0014] The setting module is used to use the selected pronunciation texts as training data.
[0015] This disclosure also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of any of the methods described above.
[0016] This disclosure also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods described above.
[0017] This disclosure provides a method, apparatus, device, and storage medium for selecting texts with minimal pronunciation. First, it acquires a candidate corpus and a predefined bag-of-syllables. The candidate corpus includes multiple candidate texts, and the predefined bag-of-syllables contains a preset number of pronunciation syllables, representing the set of pronunciation syllables to be collected in the current iteration. Then, it acquires all similar syllables corresponding to each candidate text, and iterates through each candidate text, successively selecting the pronunciation text with the largest number of similar syllables contained in the predefined bag-of-syllables. Each time a pronunciation text is selected, the pronunciation syllables corresponding to each similar syllable of the selected text are removed from the predefined bag-of-syllables until the number of remaining pronunciation syllables in the predefined bag-of-syllables is less than a threshold. Finally, the selected pronunciation texts are used as training data for the current TTS training. This disclosure performs a descending-order selection based on the coverage rate of all similar syllables of each candidate text in the predefined bag-of-syllables, thereby quickly selecting the pronunciation text with the highest pronunciation coverage and the fewest similar syllables. Attached Figure Description
[0018] Figure 1This is a schematic diagram illustrating the steps of a method for filtering text with the fewest pronunciations in one embodiment of this disclosure;
[0019] Figure 2 This is an overall structural block diagram of a screening device for the least spoken text in one embodiment of this disclosure;
[0020] Figure 3 This is a schematic block diagram of the structure of a computer device according to an embodiment of the present disclosure.
[0021] The realization of the purpose, functional features and advantages of this disclosure will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of this disclosure clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this disclosure.
[0023] Reference Figure 1 One embodiment of this disclosure provides a method for filtering text with minimal pronunciation, including:
[0024] S1: Obtain candidate corpus and predefined syllable bag-of-words. The candidate corpus includes multiple candidate texts, and the predefined syllable bag-of-words contains a preset number of pronunciation syllables. The predefined syllable bag-of-words represents the set of pronunciation syllables to be collected in the current iteration.
[0025] S2: Obtain all similar syllables corresponding to each of the candidate texts;
[0026] S3: Iterate through each candidate text, and successively select the pronunciation text with the largest number of similar syllables contained in the predefined syllable bag from each candidate text. When a pronunciation text is selected each time, remove the pronunciation syllables corresponding to each of the similar syllables of the pronunciation text from the predefined syllable bag until the number of remaining pronunciation syllables in the predefined syllable bag is less than the number threshold.
[0027] S4: Use the selected pronunciation texts as training data.
[0028] In this embodiment, the filtering system first obtains candidate corpus and predefined syllable bag-of-words. The candidate corpus includes multiple candidate texts, and the predefined syllable bag-of-words contains a preset number of pronunciation syllables. The predefined syllable bag-of-words represents the set of pronunciation syllables that need to be used in the current time. That is, the current filtering system needs to filter out candidate texts that cover each pronunciation syllable of the predefined syllable bag-of-words from the candidate corpus. These candidate texts can be used as training data for TTS training.
[0029] The filtering system pre-constructs a confusion matrix. It collects a common TTS dictionary containing w distinct, toned syllables. Based on this dictionary, the system constructs a confusion matrix of size w*w, where values represent the similarity between two common syllables. The system uses the confusion matrix to find all similar syllables for each candidate text. It then iterates through the candidate texts, selecting the text with the largest number of similar syllables contained in a predefined bag-of-syllables. Each time a text is selected, it removes the corresponding similar syllables from the bag-of-syllables until the number of remaining syllables in the bag-of-syllables is less than a threshold. Specifically, the filtering system iterates through each candidate text, successively selecting several first candidate texts from each candidate text whose similar syllables are included in a predefined bag of syllables. Each time a first candidate text is selected, the system removes the syllables corresponding to the similar syllables of the first candidate text from the predefined bag of syllables (indicating that the syllables in the predefined bag of syllables already have corresponding candidate texts, i.e., first candidate texts, and there is no need to repeatedly filter candidate texts with the same syllables). After filtering out the first candidate texts from the candidate corpus whose similar syllables are included in the predefined bag of syllables, the filtering system determines whether the number of the first remaining syllables in the predefined bag of syllables is less than a threshold. The first remaining syllables are the syllables in the predefined bag of syllables that are different from the similar syllables of each first candidate text (i.e., the number of syllables in the predefined bag of syllables that currently have no corresponding candidate texts). If the number of remaining first-order syllables in the predefined syllable bag-of-words is less than a threshold, no further text filtering is needed, and all first-order candidate texts can be used as training data for TTS training. If the number of remaining first-order syllables in the predefined syllable bag-of-words is greater than the threshold, then the system iterates through each second-order candidate text again, successively filtering out several third-order candidate texts with the largest number of similar syllables from each second-order candidate text. Each time a second-order candidate text is selected, the syllables corresponding to the similar syllables of the second-order candidate text are removed from the predefined syllable bag-of-words until the number of remaining second-order syllables in the predefined syllable bag-of-words is less than the threshold. Here, each second-order candidate text is the candidate text remaining after removing each first-order candidate text from the candidate corpus, and the largest number of similar syllables indicates that the second-order candidate text has the largest number of similar syllables included in the predefined syllable bag-of-words in a single filtering. Finally, the filtering system combines each first-order candidate text and each third-order candidate text to obtain the syllable texts required for the current TTS training as training data.
[0030] In this embodiment, the filtering system performs a step-by-step descending filtering based on the coverage rate of all similar syllables of each candidate text in a predefined bag of words, thereby quickly filtering out the pronunciation text with the highest pronunciation coverage and the fewest number of similar syllables.
[0031] Further, the step of traversing each candidate text, successively filtering out the pronunciation text with the largest number of similar syllables contained in the predefined syllable bag-of-words, and removing the pronunciation syllables corresponding to each of the similar syllables of the pronunciation text from the predefined syllable bag-of-words each time a pronunciation text is selected, until the number of remaining pronunciation syllables in the predefined syllable bag-of-words is less than a threshold, includes:
[0032] S301: Traverse each candidate text, and successively filter out several first candidate texts from each candidate text whose similar syllables are contained in the predefined syllable bag. When a first candidate text is selected each time, remove the pronunciation syllables corresponding to each of the similar syllables of the first candidate text from the predefined syllable bag.
[0033] S302: Determine whether the number of the first remaining syllables in the predefined syllable bag is less than a number threshold, wherein the first remaining syllables are the syllables in the predefined syllable bag that are different from the similar syllables of each of the first candidate texts;
[0034] S303: If the number of the first remaining syllables in the predefined syllable bag is greater than the number threshold, then each second candidate text is traversed again, and several third candidate texts with the largest number of similar syllables are selected from each second candidate text. When a second candidate text is selected each time, the syllables corresponding to each of the similar syllables of the second candidate text are removed from the predefined syllable bag until the number of the second remaining syllables in the predefined syllable bag is less than the number threshold. Each second candidate text is the candidate text remaining after removing each first candidate text from the candidate corpus. The largest number of similar syllables indicates that the second candidate text has the largest number of similar syllables included in the predefined syllable bag during a single selection.
[0035] S304: Combine each of the first candidate texts and each of the third candidate texts to obtain each of the pronunciation texts.
[0036] In this embodiment, the filtering system selects a first candidate text from each candidate text in a single instance, where all similar syllables of the candidate text are contained in a predefined bag of syllables. (That is, when filtering candidate texts in a single instance, the filtering system first determines whether all similar syllables of the candidate text are contained in the predefined bag of syllables. If all similar syllables of the candidate text are contained in the predefined bag of syllables, then the candidate text is selected as the first candidate text; if not all similar syllables of the candidate text are contained in the predefined bag of syllables, then the candidate text is skipped, and the next candidate text in the candidate corpus is filtered.) Each time a first candidate text is selected, the pronunciation syllables corresponding to each similar syllable of the first candidate text are removed from the predefined bag of syllables. (That is, since the predefined bag of syllables already contains the pronunciation syllables of the candidate text, there is no need to filter pronunciation texts as training data.) The filtering system iterates through all candidate texts in the candidate corpus according to the above rules until all first candidate texts are filtered out. Then, it determines whether the number of remaining first syllables in the predefined syllable bag-of-words is less than a threshold. The first remaining syllables are the syllables in the predefined syllable bag-of-words that are different from the similar syllables of each first candidate text. If the number of remaining first syllables in the predefined syllable bag-of-words is greater than the threshold, the system iterates through the second candidate texts again, successively filtering out several third candidate texts with the largest number of similar syllables. Each time a second candidate text is selected, the syllables corresponding to the similar syllables of the second candidate text are removed from the predefined syllable bag-of-words until the number of remaining second syllables in the predefined syllable bag-of-words is less than the threshold. Each second candidate text is the candidate text remaining after removing the first candidate texts from the candidate corpus. The largest number of similar syllables indicates that the second candidate text has the largest number of displayed syllables in the predefined syllable bag-of-words in a single filtering iteration.
[0037] For example, among all the second candidate texts, each second candidate text contains n syllables and has m similar syllables. p syllables among the m similar syllables are included in a predefined bag-of-words system. Since p is less than m for all second candidate texts (p equals m for the first candidate text), the filtering system iterates through each second candidate text. First, it selects the third candidate text A with the largest p, and removes all similar syllables corresponding to the pronunciations of third candidate text A from the predefined bag-of-words system. Then, it selects the third candidate text B with the largest p again, and removes all similar syllables corresponding to the pronunciations of third candidate text B from the predefined bag-of-words system. This process continues until the number of remaining second pronunciations in the predefined bag-of-words system is less than a threshold.
[0038] Furthermore, before the step of obtaining all similar syllables corresponding to each of the candidate texts, the following steps are included:
[0039] S5: Obtain a common dictionary, where the common dictionary contains w different common syllables;
[0040] S6: Construct a confusion matrix based on the common dictionary. The size of the confusion matrix is w*w, and the values in the confusion matrix represent the similarity between two common syllables.
[0041] In this embodiment, the screening system collects a common dictionary of a TTS, which contains w different common syllables with tones. The screening system constructs a confusion matrix with a size of w*w based on this common dictionary, and the values in the confusion matrix represent the similarity between two common syllables. Specifically, the screening system has pre-defined a pronunciation coding table and a tone coding table according to the pronunciation methods of Chinese pinyin initials and finals. A syllable can find its corresponding digital code according to the pronunciation coding table and the tone coding table. In the confusion matrix, the calculation steps for the similarity between two common syllables are as follows: Through the pronunciation coding table and the tone coding table, respectively find the first pronunciation code corresponding to the first common syllable and the second pronunciation code corresponding to the second common syllable (the pronunciation code is a string of numbers, for example, the syllable of "帮" is
bang1
ba3
[0042] Further, the common syllables carry tones. In the step of constructing the confusion matrix according to the common dictionary, the calculation steps for the similarity between two common syllables include:
[0043] S601: According to the pre-constructed pronunciation coding table and tone coding table, respectively find the first pronunciation code corresponding to the first common syllable and the second pronunciation code corresponding to the second common syllable;
[0044] S602: Calculate the similarity between the first pronunciation code and the second pronunciation code according to the consistency of the values at the corresponding positions of the first pronunciation code and the second pronunciation code.
[0045] In this embodiment, the developers pre-define a pronunciation encoding table based on the initials and finals tables in the Mandarin Pinyin system. The first encoding value is determined by the column order of the syllables in the initials table, the second by the row order, the third by the row order, and the fourth by the column order. Simultaneously, the developers use the values 1, 2, 3, 4, and 5 to sequentially represent the tone marks in the Pinyin scheme: high level tone (ˉ), rising tone (ˊ), falling-rising tone (ˇ), falling tone (ˋ), and neutral tone (no tone mark) (e.g., high level tone corresponds to value 1, rising tone to value 2, and so on), thus defining the tone encoding table.
[0046] The filtering system uses the predefined pronunciation coding table and tone coding table to find the first pronunciation code corresponding to the first commonly used syllable and the second pronunciation code corresponding to the second commonly used syllable. Then, it calculates the similarity between the first and second pronunciation codes based on the consistency of their values at each corresponding position. Specifically, the filtering system determines whether the values at each position of the first and second pronunciation codes are consistent. If the values at each position are consistent, the similarity is calculated based on the unit score and the total number of positions. If the values at each position are partially the same, the system obtains the numerical sequence with the same value and calculates the similarity between the first and second pronunciation codes based on the unit score and each numerical sequence.
[0047] Furthermore, both the first pronunciation code and the second pronunciation code have 5 values. The step of calculating the similarity between the first pronunciation code and the second pronunciation code based on the consistency of the values at each corresponding position includes:
[0048] S60201: Determine whether the values at each position of the first pronunciation code and the second pronunciation code are consistent;
[0049] S60202: If the values at each position of the first pronunciation code and the second pronunciation code are consistent, then the similarity between the first pronunciation code and the second pronunciation code is calculated based on the unit score and the total number of positions.
[0050] S60203: If the numerical portions at each position of the first pronunciation code and the second pronunciation code are the same, then obtain the numerical sequence with the same value, and calculate the similarity between the first pronunciation code and the second pronunciation code based on the unit score and each numerical sequence.
[0051] In this embodiment, both the first and second pronunciation codes have 5 values (according to the embodiments corresponding to steps S601 and S602 above, the first 4 digits of the pronunciation code can be determined according to the pronunciation code table, and the 5th digit of the pronunciation code can be determined according to the tone code table, that is, the pronunciation code corresponding to each pronunciation syllable consists of 5 digits). The screening system first judges whether the values at each corresponding position of the first and second pronunciation codes are consistent (for example, comparing the first digit of the first pronunciation code with the first digit of the second pronunciation code, comparing the second digit of the first pronunciation code with the second digit of the second pronunciation code, and so on). If the values at each position of the first and second pronunciation codes are consistent, the similarity between the first and second pronunciation codes is calculated by multiplying the unit score by the total number of positions. For example, if the unit score is 0.5 and the total number of positions is 5, the similarity obtained after multiplication is 2.5.
[0052] If the first and second pronunciation codes share only some numerical values, the specific similarity needs to be determined based on the order of the numerical values (i.e., the order of the values in the pronunciation codes). Specifically, if the first and second pronunciation codes share the same values in positions 1, 2, 3, and 5, then the similarity is calculated by multiplying the number of positions with the same value by a unit score. For example, if the first and second pronunciation codes share the same values only in positions 1, 3, and 5, then the number of positions with the same value is 3, the unit score is 0.5, and therefore the similarity between the first and second pronunciation codes is 1.5. If the first and second pronunciation codes share the same value in position 4, then it is also necessary to check if their values in position 3 are the same. If their values in position 3 are the same, then the same value in position 4 can obtain one unit score; if their values in position 3 are different, then the same value in position 4 cannot obtain one unit score. The unit scores for other numerical positions are calculated according to the normal rules. That is, for other numerical positions, as long as the values in that position are the same, that position can obtain a unit score. The sum of the unit scores obtained by all numerical positions is the similarity between the first pronunciation code and the second pronunciation code.
[0053] Further, in the step of respectively obtaining all similar syllables corresponding to each of the candidate texts, the step of obtaining all the similar syllables corresponding to a single candidate text includes:
[0054] S201: Obtain the candidate syllables of the candidate text;
[0055] S202: From the confusion matrix, find all the common syllables whose similarity to the candidate syllable is greater than the similarity threshold;
[0056] S203: Use each of the common syllables as all the similar syllables corresponding to the candidate text.
[0057] In this embodiment, the screening system first obtains the candidate syllables corresponding to a candidate text (simply understood as the pinyin and tone of the candidate text, for example, the syllable of the candidate text "bang" is [bang, first tone]). Then, from the confusion matrix, it finds all the common syllables whose similarity to the candidate syllable is greater than the similarity threshold (for example, defining the similarity threshold as 1.5, then all the common syllables whose similarity to the candidate syllable is greater than 1.5 can be selected). Finally, the screening system uses the selected common syllables as all the similar syllables corresponding to the current candidate text.
[0058] Refer to Figure 2 , the present disclosure also provides a screening device for the least pronounced text, including:
[0059] The first acquisition module 1 is used to acquire a candidate corpus and a predefined syllable bag, the candidate corpus includes multiple candidate texts, the predefined syllable bag contains a preset number of pronounced syllables, and the predefined syllable bag represents a set of pronounced syllables that need to be collected for the current time;
[0060] The second acquisition module 2 is used to respectively obtain all the similar syllables corresponding to each of the candidate texts;
[0061] The screening module 3 is used to traverse each of the candidate texts, and successively screen out the pronunciation text with the largest number of similar syllables included in the predefined syllable bag from each of the candidate texts, and when selecting one pronunciation text each time, eliminate the pronunciation syllables corresponding to the similar syllables of the pronunciation text from the predefined syllable bag until the number of remaining pronunciation syllables in the predefined syllable bag is less than the quantity threshold;
[0062] The setting module 4 is used to use the selected pronunciation texts as training data.
[0063] Further, the screening module 3 includes:
[0064] The first filtering unit is used to traverse each candidate text, and successively filter out a number of first candidate texts from each candidate text whose similar syllables are contained in the predefined syllable bag, and when each first candidate text is selected, remove the pronunciation syllables corresponding to each of the similar syllables of the first candidate text from the predefined syllable bag.
[0065] The judgment unit is used to determine whether the number of the first remaining syllables in the predefined syllable bag is less than the number threshold, wherein the first remaining syllables are the syllables in the predefined syllable bag that are different from the similar syllables of each of the first candidate texts;
[0066] The second filtering unit is configured to, if the number of the first remaining syllables in the predefined syllable bag-of-words is greater than the number threshold, then traverse each second candidate text again, and successively filter out several third candidate texts with the largest number of similar syllables from each second candidate text. Each time a second candidate text is selected, the syllables corresponding to each of the similar syllables of the second candidate text are removed from the predefined syllable bag-of-words until the number of the second remaining syllables in the predefined syllable bag-of-words is less than the number threshold. Each second candidate text is a candidate text remaining after removing each first candidate text from the candidate corpus. The largest number of similar syllables indicates that the second candidate text has the largest number of similar syllables included in the predefined syllable bag-of-words in a single filtering.
[0067] The integration unit is used to integrate each of the first candidate texts and each of the third candidate texts to obtain each of the pronunciation texts.
[0068] Furthermore, the screening device also includes:
[0069] The third acquisition module 5 is used to acquire a common dictionary, which contains w different common syllables;
[0070] Module 6 is used to construct a confusion matrix based on the commonly used dictionary. The size of the confusion matrix is w*w, and the values in the confusion matrix represent the similarity between two commonly used syllables.
[0071] Furthermore, the commonly used syllables carry tones, and the construction module 6 includes:
[0072] The first search unit is used to search for the first pronunciation code corresponding to the first commonly used syllable and the second pronunciation code corresponding to the second commonly used syllable, respectively, based on the pre-constructed pronunciation code table and tone code table.
[0073] The calculation unit is used to calculate the similarity between the first pronunciation code and the second pronunciation code based on the consistency of the values at each corresponding position.
[0074] Furthermore, both the first pronunciation code and the second pronunciation code have 5 values, and the calculation unit includes:
[0075] The judgment subunit is used to determine whether the values at each position of the first pronunciation code and the second pronunciation code are consistent;
[0076] The first calculation subunit is used to calculate the similarity between the first pronunciation code and the second pronunciation code based on the unit score and the total number of positions if the values at each position of the first pronunciation code and the second pronunciation code are consistent.
[0077] The second calculation subunit is configured to, if the numerical portions at each position of the first pronunciation code and the second pronunciation code are the same, obtain the numerical sequence with the same value, and calculate the similarity between the first pronunciation code and the second pronunciation code based on the unit score and each numerical sequence.
[0078] Furthermore, the second acquisition module 2 includes:
[0079] The acquisition unit is used to acquire the candidate syllables of the candidate text;
[0080] The second search unit is used to search the confusion matrix for all commonly used syllables whose similarity to the candidate syllable is greater than a similarity threshold.
[0081] The setting unit is used to set each of the commonly used syllables as all the similar syllables corresponding to the candidate text.
[0082] In this embodiment, each module, unit, and subunit in the least pronounced text filtering device is used to perform each step in the least pronounced text filtering method described above, and the specific implementation process is not described in detail here.
[0083] This embodiment provides a minimum number of pronunciation texts selection device. First, it acquires candidate texts and a predefined bag-of-syllables. The candidate texts include multiple candidate texts, and the predefined bag-of-syllables contains a preset number of pronunciation syllables, representing the set of pronunciation syllables to be collected in the current iteration. Then, it acquires all similar syllables corresponding to each candidate text, and iterates through each candidate text, successively selecting the pronunciation text with the largest number of similar syllables contained in the predefined bag-of-syllables. Each time a pronunciation text is selected, the pronunciation syllables corresponding to each similar syllable of the selected text are removed from the predefined bag-of-syllables until the number of remaining pronunciation syllables in the predefined bag-of-syllables is less than a threshold. Finally, the selected pronunciation texts are used as training data for the current TTS training. This disclosure performs a descending-order selection based on the coverage rate of all similar syllables of each candidate text in the predefined bag-of-syllables, thereby quickly selecting the pronunciation text with the highest pronunciation coverage and the fewest similar syllables.
[0084] Reference Figure 3 This disclosure also provides a computer device, which may be a server, and its internal structure may be as follows: Figure 3 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides the environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores data such as candidate corpora. The network interface allows communication with external terminals via a network connection. When executed by the processor, the computer program implements a method for filtering text with minimal pronunciation.
[0085] The processor described above performs the following steps in the method for filtering text with the fewest pronunciations:
[0086] S1: Obtain candidate corpus and predefined syllable bag-of-words. The candidate corpus includes multiple candidate texts, and the predefined syllable bag-of-words contains a preset number of pronunciation syllables. The predefined syllable bag-of-words represents the set of pronunciation syllables to be collected in the current iteration.
[0087] S2: Obtain all similar syllables corresponding to each of the candidate texts;
[0088] S3: Iterate through each candidate text, and successively select the pronunciation text with the largest number of similar syllables contained in the predefined syllable bag from each candidate text. When a pronunciation text is selected each time, remove the pronunciation syllables corresponding to each of the similar syllables of the pronunciation text from the predefined syllable bag until the number of remaining pronunciation syllables in the predefined syllable bag is less than the number threshold.
[0089] S4: Use the selected pronunciation texts as training data.
[0090] Further, the step of traversing each candidate text, successively filtering out the pronunciation text with the largest number of similar syllables contained in the predefined syllable bag-of-words, and removing the pronunciation syllables corresponding to each of the similar syllables of the pronunciation text from the predefined syllable bag-of-words each time a pronunciation text is selected, until the number of remaining pronunciation syllables in the predefined syllable bag-of-words is less than a threshold, includes:
[0091] S301: Traverse each candidate text, and successively filter out several first candidate texts from each candidate text whose similar syllables are contained in the predefined syllable bag. When a first candidate text is selected each time, remove the pronunciation syllables corresponding to each of the similar syllables of the first candidate text from the predefined syllable bag.
[0092] S302: Determine whether the number of the first remaining syllables in the predefined syllable bag is less than a number threshold, wherein the first remaining syllables are the syllables in the predefined syllable bag that are different from the similar syllables of each of the first candidate texts;
[0093] S303: If the number of the first remaining syllables in the predefined syllable bag is greater than the number threshold, then each second candidate text is traversed again, and several third candidate texts with the largest number of similar syllables are selected from each second candidate text. When a second candidate text is selected each time, the syllables corresponding to each of the similar syllables of the second candidate text are removed from the predefined syllable bag until the number of the second remaining syllables in the predefined syllable bag is less than the number threshold. Each second candidate text is the candidate text remaining after removing each first candidate text from the candidate corpus. The largest number of similar syllables indicates that the second candidate text has the largest number of similar syllables included in the predefined syllable bag during a single selection.
[0094] S304: Combine each of the first candidate texts and each of the third candidate texts to obtain each of the pronunciation texts.
[0095] Furthermore, before the step of obtaining all similar syllables corresponding to each of the candidate texts, the following steps are included:
[0096] S5: Obtain a commonly used dictionary, which contains w different commonly used syllables;
[0097] S6: Construct a confusion matrix based on the commonly used dictionary. The size of the confusion matrix is w*w, and the values in the confusion matrix represent the similarity between two commonly used syllables.
[0098] Furthermore, since the commonly used syllables carry tones, the step of calculating the similarity between two commonly used syllables in the step of constructing a confusion matrix based on the commonly used dictionary includes:
[0099] S601: Based on the pre-constructed pronunciation coding table and tone coding table, find the first pronunciation code corresponding to the first commonly used syllable and the second pronunciation code corresponding to the second commonly used syllable, respectively;
[0100] S602: Based on the consistency of the values of the first pronunciation code and the second pronunciation code at each corresponding position, the similarity between the first pronunciation code and the second pronunciation code is calculated.
[0101] Furthermore, both the first pronunciation code and the second pronunciation code have 5 values. The step of calculating the similarity between the first pronunciation code and the second pronunciation code based on the consistency of the values at each corresponding position includes:
[0102] S60201: Determine whether the values at each position of the first pronunciation code and the second pronunciation code are consistent;
[0103] S60202: If the values at each position of the first pronunciation code and the second pronunciation code are consistent, then the similarity between the first pronunciation code and the second pronunciation code is calculated based on the unit score and the total number of positions.
[0104] S60203: If the numerical portions at each position of the first pronunciation code and the second pronunciation code are the same, then obtain the numerical sequence with the same value, and calculate the similarity between the first pronunciation code and the second pronunciation code based on the unit score and each numerical sequence.
[0105] Furthermore, in the step of obtaining all similar syllables corresponding to each of the candidate texts, the step of obtaining all similar syllables corresponding to a single candidate text includes:
[0106] S201: Obtain the candidate syllables of the candidate text;
[0107] S202: From the confusion matrix, find all the commonly used syllables whose similarity to the candidate syllable is greater than the similarity threshold;
[0108] S203: Use each of the commonly used syllables as all the similar syllables corresponding to the candidate text.
[0109] An embodiment of this disclosure also provides a computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements a method for filtering text with minimal pronunciation. The method for filtering text with minimal pronunciation specifically includes:
[0110] S1: Obtain candidate corpus and predefined syllable bag-of-words. The candidate corpus includes multiple candidate texts, and the predefined syllable bag-of-words contains a preset number of pronunciation syllables. The predefined syllable bag-of-words represents the set of pronunciation syllables to be collected in the current iteration.
[0111] S2: Obtain all similar syllables corresponding to each of the candidate texts;
[0112] S3: Iterate through each candidate text, and successively select the pronunciation text with the largest number of similar syllables contained in the predefined syllable bag from each candidate text. When a pronunciation text is selected each time, remove the pronunciation syllables corresponding to each of the similar syllables of the pronunciation text from the predefined syllable bag until the number of remaining pronunciation syllables in the predefined syllable bag is less than the number threshold.
[0113] S4: Use the selected pronunciation texts as training data.
[0114] Further, the step of traversing each candidate text, successively filtering out the pronunciation text with the largest number of similar syllables contained in the predefined syllable bag-of-words, and removing the pronunciation syllables corresponding to each of the similar syllables of the pronunciation text from the predefined syllable bag-of-words each time a pronunciation text is selected, until the number of remaining pronunciation syllables in the predefined syllable bag-of-words is less than a threshold, includes:
[0115] S301: Traverse each candidate text, and successively filter out several first candidate texts from each candidate text whose similar syllables are contained in the predefined syllable bag. When a first candidate text is selected each time, remove the pronunciation syllables corresponding to each of the similar syllables of the first candidate text from the predefined syllable bag.
[0116] S302: Determine whether the number of the first remaining syllables in the predefined syllable bag is less than a number threshold, wherein the first remaining syllables are the syllables in the predefined syllable bag that are different from the similar syllables of each of the first candidate texts;
[0117] S303: If the number of the first remaining syllables in the predefined syllable bag is greater than the number threshold, then each second candidate text is traversed again, and several third candidate texts with the largest number of similar syllables are selected from each second candidate text. When a second candidate text is selected each time, the syllables corresponding to each of the similar syllables of the second candidate text are removed from the predefined syllable bag until the number of the second remaining syllables in the predefined syllable bag is less than the number threshold. Each second candidate text is the candidate text remaining after removing each first candidate text from the candidate corpus. The largest number of similar syllables indicates that the second candidate text has the largest number of similar syllables included in the predefined syllable bag during a single selection.
[0118] S304: Combine each of the first candidate texts and each of the third candidate texts to obtain each of the pronunciation texts.
[0119] Furthermore, before the step of obtaining all similar syllables corresponding to each of the candidate texts, the following steps are included:
[0120] S5: Obtain a commonly used dictionary, which contains w different commonly used syllables;
[0121] S6: Construct a confusion matrix based on the commonly used dictionary. The size of the confusion matrix is w*w, and the values in the confusion matrix represent the similarity between two commonly used syllables.
[0122] Furthermore, since the commonly used syllables carry tones, the step of calculating the similarity between two commonly used syllables in the step of constructing a confusion matrix based on the commonly used dictionary includes:
[0123] S601: Based on the pre-constructed pronunciation coding table and tone coding table, find the first pronunciation code corresponding to the first commonly used syllable and the second pronunciation code corresponding to the second commonly used syllable, respectively;
[0124] S602: Based on the consistency of the values of the first pronunciation code and the second pronunciation code at each corresponding position, the similarity between the first pronunciation code and the second pronunciation code is calculated.
[0125] Furthermore, both the first pronunciation code and the second pronunciation code have 5 values. The step of calculating the similarity between the first pronunciation code and the second pronunciation code based on the consistency of the values at each corresponding position includes:
[0126] S60201: Determine whether the values at each position of the first pronunciation code and the second pronunciation code are consistent;
[0127] S60202: If the values at each position of the first pronunciation code and the second pronunciation code are consistent, then the similarity between the first pronunciation code and the second pronunciation code is calculated based on the unit score and the total number of positions.
[0128] S60203: If the numerical portions at each position of the first pronunciation code and the second pronunciation code are the same, then obtain the numerical sequence with the same value, and calculate the similarity between the first pronunciation code and the second pronunciation code based on the unit score and each numerical sequence.
[0129] Furthermore, in the step of obtaining all similar syllables corresponding to each of the candidate texts, the step of obtaining all similar syllables corresponding to a single candidate text includes:
[0130] S201: Obtain the candidate syllables of the candidate text;
[0131] S202: From the confusion matrix, find all the commonly used syllables whose similarity to the candidate syllable is greater than the similarity threshold;
[0132] S203: Use each of the commonly used syllables as all the similar syllables corresponding to the candidate text.
[0133] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media provided in this disclosure and used in the embodiments can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-speed SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0134] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, first object, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, apparatus, first object, or method. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, first object, or method that includes that element.
[0135] The above description is only a preferred embodiment of this disclosure and does not limit the patent scope of this disclosure. Any equivalent structural or procedural changes made based on the content of this disclosure and its drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this disclosure.
Claims
1. A method of filtering minimal-pair text, characterized by, The method comprises the following steps: obtaining candidate corpus and a pre-defined syllable bag, the candidate corpus comprising a plurality of candidate texts, the pre-defined syllable bag containing a preset number of pronunciation syllables, the pre-defined syllable bag representing a set of pronunciation syllables to be collected in the current time; obtaining all similar syllables corresponding to each of the candidate texts respectively; traversing each of the candidate texts, and selecting a pronunciation text containing the maximum number of similar syllables in the pre-defined syllable bag from each of the candidate texts in turn, and removing the pronunciation syllables corresponding to the similar syllables of the pronunciation text from the pre-defined syllable bag each time a pronunciation text is selected, until the number of pronunciation syllables remaining in the pre-defined syllable bag is less than a number threshold; using the selected pronunciation texts as training data.
2. The method of claim 1, wherein, The step of traversing each of the candidate texts, and selecting a pronunciation text containing the maximum number of similar syllables in the pre-defined syllable bag from each of the candidate texts in turn, and removing the pronunciation syllables corresponding to the similar syllables of the pronunciation text from the pre-defined syllable bag each time a pronunciation text is selected, until the number of pronunciation syllables remaining in the pre-defined syllable bag is less than a number threshold, comprises: traversing each of the candidate texts, and selecting a plurality of first candidate texts containing all similar syllables in the pre-defined syllable bag from each of the candidate texts in turn, and removing the pronunciation syllables corresponding to the similar syllables of the first candidate text from the pre-defined syllable bag each time a first candidate text is selected; determining whether the number of first remaining pronunciation syllables in the pre-defined syllable bag is less than a number threshold, wherein the first remaining pronunciation syllables are pronunciation syllables in the pre-defined syllable bag that are different from the similar syllables of each of the first candidate texts; if the number of first remaining pronunciation syllables in the pre-defined syllable bag is greater than the number threshold, traversing each of the second candidate texts again, and selecting a plurality of third candidate texts containing the maximum number of similar syllables from each of the second candidate texts in turn, and removing the pronunciation syllables corresponding to the similar syllables of the second candidate text from the pre-defined syllable bag each time a second candidate text is selected, until the number of second remaining pronunciation syllables in the pre-defined syllable bag is less than the number threshold, wherein each of the second candidate texts is a candidate text remaining in the candidate corpus after each of the first candidate texts is removed, and the maximum number of similar syllables represents the maximum number of similar syllables contained in the pre-defined syllable bag in a single selection of the second candidate text; combing each of the first candidate texts and each of the third candidate texts to obtain each of the pronunciation texts.
3. The method of claim 1, wherein the minimum pronunciation text filtering method is characterized by, Before the step of obtaining all similar syllables corresponding to each of the candidate texts respectively, the method comprises the following steps: obtaining a commonly used dictionary, the commonly used dictionary containing w different commonly used syllables; A confusion matrix is constructed according to the common dictionary, the size of the confusion matrix is w*w, and the value in the confusion matrix represents the similarity between two common syllables.
4. The method of claim 3, wherein, The common syllable carries a tone, and in the step of constructing a confusion matrix according to the common dictionary, the calculation step of the similarity between two common syllables includes: According to the pre-constructed pronunciation coding table and the tone coding table, the first pronunciation coding corresponding to the first common syllable and the second pronunciation coding corresponding to the second common syllable are found respectively; According to the consistency of the numerical values of the first pronunciation coding and the second pronunciation coding at the corresponding positions, the similarity of the first pronunciation coding and the second pronunciation coding is calculated.
5. The method of claim 3, wherein the minimum pronunciation text filtering method is characterized by, In the step of obtaining all similar syllables corresponding to each of the candidate texts respectively, the step of obtaining all similar syllables corresponding to a single candidate text includes: Obtaining a candidate syllable of the candidate text; From the confusion matrix, find all common syllables with a similarity greater than a similarity threshold value with the candidate syllable; Each of the common syllables is used as all similar syllables corresponding to the candidate text.
6. An apparatus for filtering minimal-pair text, characterized by: It includes: The first obtaining module is used for obtaining a candidate corpus and a predefined syllable bag, the candidate corpus includes a plurality of candidate texts, and the predefined syllable bag contains a preset number of pronunciation syllables, the predefined syllable bag represents a set of pronunciation syllables to be collected this time; The second obtaining module is used for obtaining all similar syllables corresponding to each of the candidate texts respectively; The screening module is used for traversing each of the candidate texts, and sequentially screening out a pronunciation text with the maximum number of similar syllables contained in the predefined syllable bag from each of the candidate texts, and when each pronunciation text is selected, the pronunciation syllables corresponding to the similar syllables of the pronunciation text are removed from the predefined syllable bag, until the number of pronunciation syllables remaining in the predefined syllable bag is less than a number threshold value; The setting module is used for setting each of the selected pronunciation texts as training data.
7. The minimal-paired text screening apparatus according to claim 6, wherein The screening module includes: The first screening unit is used for traversing each of the candidate texts, and sequentially screening out a plurality of first candidate texts from each of the candidate texts, in which all similar syllables are contained in the predefined syllable bag, and when each first candidate text is selected, the pronunciation syllables corresponding to the similar syllables of the first candidate text are removed from the predefined syllable bag; The judgment unit is used for judging whether the number of first remaining pronunciation syllables in the predefined syllable bag is less than a number threshold value, wherein the first remaining pronunciation syllables are pronunciation syllables in the predefined syllable bag different from the similar syllables of each of the first candidate texts; The second screening unit is configured to, if the current number of the first remaining pronunciation syllables in the predefined syllable bag is greater than the number threshold, traverse each second candidate text again, and successively screen a plurality of third candidate texts with a maximum number of similar syllables from each second candidate text, and each time a second candidate text is selected, remove the pronunciation syllables corresponding to each similar syllable of the second candidate text from the predefined syllable bag until the current number of second remaining pronunciation syllables in the predefined syllable bag is less than the number threshold, wherein each second candidate text is a remaining candidate text in the candidate corpus after each first candidate text is removed, and the maximum number of similar syllables represents a maximum number of similar syllables of the second candidate text contained in the predefined syllable bag in a single screening; The comprehensive unit is configured to comprehensively combine each first candidate text and each third candidate text to obtain each pronunciation text.
8. A computer device comprising a memory and a processor, the memory having stored therein a computer program, wherein, The computer program is executed by the processor to implement the steps of the method of any one of claims 1-5.
9. A computer readable storage medium having stored thereon a computer program, wherein, The computer program is executed by the processor to implement the steps of the method of any one of claims 1-5.
Citation Information
Patent Citations
Text similarity determination method and device, electronic equipment and storage medium
CN111382562A
Voice training set minimization method based on word coverage rate
CN112185359A