Sample determination method, device and electronic equipment
By segmenting speech and adjusting index values, the problem of speech data noise in non-quiet environments is solved, the effect of model training is improved, and higher quality training data is provided.
Patent Information
- Application Number
- CN202210922148.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-02
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2042-08-02
AI Technical Summary
Existing speech model training methods cannot effectively process speech data recorded in non-quiet environments, resulting in poor model training results.
By segmenting speech, determining the index values of speech segments and non-speech segments, adjusting parameters to reduce noise and improve the cleanliness of speech, thereby improving the effect of model training.
It improves the cleanliness of speech data, provides higher quality label data, and improves the effect of model training.
Smart Images

Figure CN115295013B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a sample determination method, device and electronic equipment. Background Art
[0002] Among the current model training methods for speech, supervised training is usually used. The selection of clean data in supervised training plays a very important role in the effect of the model and can directly affect the effect of the model. Clean data refers to speech data that is theoretically noise-free. At present, speech is usually recorded in a quiet environment to obtain clean data. However, since an absolutely quiet environment cannot be guaranteed, speech recorded in a quiet environment may contain a lot of noise, resulting in poor model training results. Summary of the invention
[0003] The embodiments of the present disclosure provide a sample determination method, device and electronic device to solve the problem of poor model training effect in the prior art.
[0004] In order to solve the above-mentioned technical problems, the present invention is achieved as follows:
[0005] In a first aspect, an embodiment of the present disclosure provides a sample determination method, the method comprising:
[0006] Performing speech segmentation on the first speech to obtain a first speech segment and a first non-speech segment corresponding to the first speech;
[0007] Determine a first index value of the first speech based on the first speech segment and / or the first non-speech segment, wherein the first index value is used to indicate the speech cleanliness of the first speech;
[0008] Determining a target adjustment parameter based on the first indicator value and a preset indicator value;
[0009] The first speech is adjusted based on the target adjustment parameter, and the adjusted first speech is determined as a training sample for model training.
[0010] In a second aspect, an embodiment of the present disclosure provides a sample determination device, the device comprising:
[0011] A segmentation module, used to perform speech segmentation on the first speech to obtain a first speech segment and a first non-speech segment corresponding to the first speech;
[0012] A first determination module, used to determine a first index value of the first speech based on the first speech segment and / or the first non-speech segment, wherein the first index value is used to indicate the speech cleanliness of the first speech;
[0013] A second determination module, configured to determine a target adjustment parameter based on the first indicator value and a preset indicator value;
[0014] The third determination module is used to adjust the first speech based on the target adjustment parameter, and determine the adjusted first speech as a training sample for model training.
[0015] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising: a memory, a processor, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps in the sample determination method described in the first aspect.
[0016] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the sample determination method described in the first aspect are implemented.
[0017] In the disclosed embodiment, the first speech is segmented to obtain the first speech segment and the first non-speech segment corresponding to the first speech; the first index value of the first speech is determined based on the first speech segment and / or the first non-speech segment, and the first index value is used to indicate the speech cleanliness of the first speech; the target adjustment parameter is determined based on the first index value and the preset index value; the first speech is adjusted based on the target adjustment parameter, and the adjusted first speech is determined as a training sample for model training. In this way, by adjusting the first speech through the first index value and the preset index value, the noise in the first speech can be reduced, thereby improving the effect of model training. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the description of the embodiments of the present disclosure will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0019] Figure 1 is a flow chart of a speech evaluation method provided by an embodiment of the present disclosure;
[0020] Figure 2 is a structural schematic diagram of a speech evaluation device provided by an embodiment of the present disclosure;
[0021] Figure 3 It is a structural schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0022] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0023] In the embodiments of the present disclosure, electronic devices include but are not limited to mobile phones, tablet computers, laptop computers, PDAs, vehicle-mounted mobile terminals, wearable devices, and pedometers.
[0024] See also Figure 1 , Figure 1 is a flow chart of a sample determination method provided by an embodiment of the present disclosure, such as Figure 1 As shown, the following steps are included:
[0025] Step 101: perform speech segmentation on a first speech to obtain a first speech segment and a first non-speech segment corresponding to the first speech.
[0026] The first speech may be a speech recorded in a quiet environment, or may be a speech with less noise obtained by other means. The first speech segment corresponding to the first speech may include at least one speech segment obtained by performing speech segmentation on the first speech. The first non-speech segment corresponding to the first speech may include at least one non-speech segment obtained by performing speech segmentation on the first speech.
[0027] In one implementation, the first speech segment corresponding to the first speech may include all speech segments obtained by speech segmentation of the first speech. The first non-speech segment corresponding to the first speech may include all non-speech segments obtained by speech segmentation of the first speech.
[0028] In one implementation, the frame length and frame shift of the first speech can be determined, and the first speech can be framed. After framing, a voice activity detection (VAD) algorithm can be used to perform speech segmentation on the first speech to obtain a first speech segment and a first non-speech segment corresponding to the first speech.
[0029] Step 102: determine a first index value of the first speech based on the first speech segment and / or the first non-speech segment, wherein the first index value is used to indicate the speech cleanliness of the first speech.
[0030] The first indicator value may be positively correlated with at least one of the following: a first ratio, a second ratio, a third ratio, and a fourth ratio.
[0031] In one embodiment, the first ratio is the ratio of the energy mean of the second speech segment to the energy mean of the third speech segment, the second speech segment is obtained after low-pass filtering based on the first speech segment, and the third speech segment is obtained after high-pass filtering based on the first speech segment; the second ratio is the ratio of the energy mean of the second non-speech segment to the energy mean of the third non-speech segment, the second non-speech segment is obtained after low-pass filtering based on the first non-speech segment, and the third non-speech segment is obtained after high-pass filtering based on the first non-speech segment; the third ratio is the ratio of the energy mean of the first data point to the energy mean of the second data point, the first data point is the data point corresponding to the fundamental frequency of the first speech segment and the data point corresponding to the multiple of the fundamental frequency, and the second data point is the data point in the first speech segment other than the first data point; the fourth ratio is the ratio of the energy mean of the first speech segment to the energy mean of the first non-speech segment.
[0032] In another embodiment, the first ratio is the ratio of the energy value of the second speech segment to the energy value of the third speech segment; the second ratio is the ratio of the energy value of the second non-speech segment to the energy value of the third non-speech segment; the third ratio is the ratio of the energy value of the first data point to the energy value of the second data point; the fourth ratio is the ratio of the energy value of the first speech segment to the energy value of the first non-speech segment.
[0033] Step 103: Determine a target adjustment parameter based on the first indicator value and a preset indicator value.
[0034] Among them, the target adjustment parameter can be the ratio of the preset indicator value to the first indicator value; or the target adjustment parameter can be the ratio of the first indicator value to the preset indicator value; or the target adjustment parameter can be the product of the ratio of the preset indicator value to the first indicator value and a preset coefficient; and so on, which is not limited in this embodiment.
[0035] Step 104: Adjust the first speech based on the target adjustment parameter, and determine the adjusted first speech as a training sample for model training.
[0036] Among them, the amplitude of the data point of the first speech can be adjusted based on the target adjustment parameter so that the speech cleanliness of the first speech meets the preset indicator value.
[0037] In one embodiment, the first indicator value is positively correlated with the first ratio, the second ratio, the third ratio and the fourth ratio, respectively, and the adjustment of the first speech based on the target adjustment parameter includes: determining the first adjustment parameter based on the target adjustment parameter and the energy mean of the second speech segment, and adjusting the amplitude of each data point in the data points corresponding to the second speech segment based on the first adjustment parameter; determining the third adjustment parameter based on the target adjustment parameter and the energy mean of the second non-speech segment, and adjusting the amplitude of each data point in the data points corresponding to the second non-speech segment based on the third adjustment parameter; determining the fifth adjustment parameter based on the target adjustment parameter and the energy mean of the first data point, and adjusting the amplitude of the first data point based on the fifth adjustment parameter; determining the seventh adjustment parameter based on the target adjustment parameter and the energy mean of the first speech segment, and adjusting the amplitude of each data point in the data points corresponding to the first speech segment based on the seventh adjustment parameter.
[0038] It should be noted that the adjusted first speech may be smoothed, and the smoothed first speech may be determined as a training sample for model training.
[0039] It should be noted that the voice data can be adjusted based on the results of model training. For example, when a certain voice sample is used to train the model, if the loss value after less than a preset number of trainings is less than a preset threshold, the voice cleanliness of the voice sample is considered to be good. The preset index value can be adjusted and the preset index value can be set as the first index value of the voice sample. When the training sample is subsequently obtained, the first voice is adjusted based on the preset index value, so that the model can be trained well when the number of trainings is less than or equal to the preset number of times.
[0040] This embodiment can improve the cleanliness of speech data and provide higher-quality label data for model training, thereby improving the effect of the trained model.
[0041] In the disclosed embodiment, the first speech is segmented to obtain the first speech segment and the first non-speech segment corresponding to the first speech; the first index value of the first speech is determined based on the first speech segment and / or the first non-speech segment, and the first index value is used to indicate the speech cleanliness of the first speech; the target adjustment parameter is determined based on the first index value and the preset index value; the first speech is adjusted based on the target adjustment parameter, and the adjusted first speech is determined as a training sample for model training. In this way, by adjusting the first speech through the first index value and the preset index value, the noise in the first speech can be reduced, thereby improving the effect of model training.
[0042] Optionally, the first indicator value is positively correlated with at least one of the following:
[0043] first ratio, second ratio, third ratio, fourth ratio;
[0044] Wherein, the first ratio is the ratio of the energy mean of the second speech segment to the energy mean of the third speech segment, the second speech segment is obtained after low-pass filtering based on the first speech segment, and the third speech segment is obtained after high-pass filtering based on the first speech segment;
[0045] The second ratio is a ratio of an energy mean of a second non-speech segment to an energy mean of a third non-speech segment, the second non-speech segment is obtained by low-pass filtering the first non-speech segment, and the third non-speech segment is obtained by high-pass filtering the first non-speech segment;
[0046] The third ratio is a ratio of the energy mean of a first data point to the energy mean of a second data point, the first data point being a data point corresponding to the fundamental frequency of the first speech segment and a data point corresponding to a multiple of the fundamental frequency, and the second data point being a data point in the first speech segment other than the first data point;
[0047] The fourth ratio is the ratio of the energy mean of the first speech segment to the energy mean of the first non-speech segment.
[0048] In one embodiment, the second speech segment may include multiple third data points. The energy mean of the second speech segment may be the mean of the squares of the amplitudes of the multiple third data points; or the energy mean of the second speech segment may be obtained as follows: determine the difference between the amplitude of each third data point and the first amplitude mean, calculate the square value of the difference corresponding to each third data point, and use the mean of the square values corresponding to the multiple third data points as the energy mean of the second speech segment, where the first amplitude mean is the mean of the amplitudes of the multiple third data points. For example, the energy mean Lspeech of the second speech segment may be obtained by the following calculation formula:
[0049]
[0050] Among them, X i is the difference between the amplitude of the ith third data point and the mean of the first amplitudes, and m is the number of third data points included in the second speech segment.
[0051] In addition, the third speech segment may include multiple fourth data points. The energy mean of the third speech segment may be the mean of the squares of the amplitudes of the multiple fourth data points; or the energy mean of the third speech segment may be obtained as follows: determine the difference between the amplitude of each fourth data point and the second amplitude mean, calculate the square value of the difference corresponding to each fourth data point, and use the mean of the square values corresponding to the multiple fourth data points as the energy mean of the third speech segment, and the second amplitude mean is the mean of the amplitudes of the multiple fourth data points. For example, the energy mean Hspeech of the third speech segment may be obtained by the following calculation formula:
[0052]
[0053] Among them, X i is the difference between the amplitude of the ith fourth data point and the mean of the second amplitudes, and m is the number of fourth data points included in the third speech segment.
[0054] It should be noted that this embodiment does not limit the filter cutoff frequency of high-pass filtering and low-pass filtering. For example, the filter cutoff frequency may be 3KHZ, and high-pass filtering filters out signals below 3KHZ, and low-pass filtering filters out signals above 3KHZ.
[0055] In one embodiment, the second non-speech segment may include multiple fifth data points. The energy mean of the second non-speech segment may be the mean of the squares of the amplitudes of the multiple fifth data points; or the energy mean of the second non-speech segment may be obtained as follows: determine the difference between the amplitude of each fifth data point and the third amplitude mean, calculate the square value of the difference corresponding to each fifth data point, and use the mean of the square values corresponding to the multiple fifth data points as the energy mean of the second non-speech segment, and the third amplitude mean is the mean of the amplitudes of the multiple fifth data points. For example, the energy mean Lnoise of the second non-speech segment may be obtained by the following calculation formula:
[0056]
[0057] Among them, X i is the difference between the amplitude of the ith fifth data point and the third amplitude mean, and m is the number of fifth data points included in the second non-speech segment.
[0058] In addition, the third non-speech segment may include multiple sixth data points. The energy mean of the third non-speech segment may be the mean of the squares of the amplitudes of the multiple sixth data points; or the energy mean of the third non-speech segment may be obtained as follows: determine the difference between the amplitude of each sixth data point and the fourth amplitude mean, calculate the square value of the difference corresponding to each sixth data point, and use the mean of the square values corresponding to the multiple sixth data points as the energy mean of the third non-speech segment, and the fourth amplitude mean is the mean of the amplitudes of the multiple sixth data points. For example, the energy mean Hnoise of the third non-speech segment may be obtained by the following calculation formula:
[0059]
[0060] Among them, X i is the difference between the amplitude of the ith sixth data point and the fourth amplitude mean, and m is the number of sixth data points included in the third non-speech segment.
[0061] In one embodiment, the number of data points of the first data point can be multiple. The energy mean of the first data point can be the mean of the squares of the amplitudes of the first data points in the first speech segment; or the energy mean of the first data point can be obtained as follows: determine the difference between the amplitude of each first data point and the fifth amplitude mean, calculate the square value of the difference corresponding to each first data point, and use the mean of the square values corresponding to the first data points in the first speech segment as the energy mean of the first data point, and the fifth amplitude mean is the mean of the amplitudes of the first data points in the first speech segment. For example, the energy mean Eb of the first data point can be obtained by the following calculation formula:
[0062]
[0063] Among them, X i is the difference between the amplitude of the ith first data point and the fifth amplitude mean, and m is the number of first data points included in the first speech segment.
[0064] In addition, the number of data points of the second data point can be multiple. The energy mean of the second data point can be the mean of the squares of the amplitudes of the second data points in the first speech segment; or the energy mean of the second data point can be obtained as follows: determine the difference between the amplitude of each second data point and the sixth amplitude mean, calculate the square value of the difference corresponding to each second data point, and use the mean of the square values corresponding to the second data points in the first speech segment as the energy mean of the second data point, and the sixth amplitude mean is the mean of the amplitudes of the second data points in the first speech segment. For example, the energy mean Eo of the second data point can be obtained by the following calculation formula:
[0065]
[0066] Among them, Xi is the difference between the amplitude of the ith second data point and the sixth amplitude mean, and m is the number of second data points included in the first speech segment.
[0067] Taking the fundamental frequency of the first speech segment as 65Hz as an example, the multiples of the fundamental frequency are 2*65Hz, 3*65Hz, 4*65Hz...; and so on. The first data point is the data point where the frequencies of 65Hz, 2*65Hz, 3*65Hz, 4*65Hz,... are located in the first speech segment.
[0068] It should be noted that the method for determining the first data point can be as follows: the spectrum of the first speech segment can be obtained, and the clef of the spectrum is: 0, 1, 2, 3, 4, ..., 256. The frequencies corresponding to the clef of the spectrum are: 0*32.5, 1*32.5, ..., 256*32.5Hz. Assuming that the fundamental frequency is 65Hz, the multiples are: 2*65, 3*65, ..., etc., then the corresponding clefs can be obtained as: 65 / 32.5=2, 2*65 / 32.5=4, 3*65 / 32.5=6, ..., etc. The points at the clefs are taken as the first data points.
[0069] In one embodiment, the first speech segment may include multiple seventh data points. The energy mean of the first speech segment may be the mean of the squares of the amplitudes of the multiple seventh data points; or the energy mean of the first speech segment may be obtained as follows: determine the difference between the amplitude of each seventh data point and the mean of the seventh amplitude, calculate the square value of the difference corresponding to each seventh data point, and use the mean of the square values corresponding to the multiple seventh data points as the energy mean of the first speech segment, and the seventh amplitude mean is the mean of the amplitudes of the multiple seventh data points. For example, the energy mean Espeech of the first speech segment may be obtained by the following calculation formula:
[0070]
[0071] Among them, X i is the difference between the amplitude of the ith seventh data point and the mean of the seventh amplitudes, and m is the number of seventh data points included in the first speech segment.
[0072] In addition, the first non-speech segment may include multiple eighth data points. The energy mean of the first non-speech segment may be the mean of the squares of the amplitudes of multiple eighth data points; or the energy mean of the first non-speech segment may be obtained as follows: determine the difference between the amplitude of each eighth data point and the mean of the eighth amplitude, calculate the square value of the difference corresponding to each eighth data point, and use the mean of the square values corresponding to multiple eighth data points as the energy mean of the first non-speech segment, and the eighth amplitude mean is the mean of the amplitudes of the multiple eighth data points. For example, the energy mean Enoise of the first non-speech segment may be obtained by the following calculation formula:
[0073]
[0074] Among them, X i is the difference between the amplitude of the ith eighth data point and the eighth amplitude mean, and m is the number of eighth data points included in the first non-speech segment.
[0075] In this implementation, the first index value is positively correlated with at least one of the following: a first ratio, a second ratio, a third ratio, and a fourth ratio. In this way, the cleanliness of the first speech can be determined from one or more dimensions, so that when adjusting the first speech, the first speech can be adjusted from one or more dimensions, thereby better reducing the noise in the first speech, thereby improving the effect of model training.
[0076] Optionally, determining a first indicator value of the first speech based on the first speech segment and / or the first non-speech segment includes:
[0077] respectively obtaining a first product, a second product, a third product and a fourth product, wherein the first product is a product of a first weight coefficient and the first ratio, the second product is a product of a second weight coefficient and the second ratio, the third product is a product of a third weight coefficient and the third ratio, and the fourth product is a product of a fourth weight coefficient and the fourth ratio;
[0078] A first index value of the first speech is determined based on the first product, the second product, the third product and the fourth product.
[0079] Among them, the first index value can be the sum of the first product, the second product, the third product and the fourth product. The first weight coefficient, the second weight coefficient, the third weight coefficient and the fourth weight coefficient can all be preset. For example, the first weight coefficient can be set to 0.5, the second weight coefficient can be set to 0.2, the third weight coefficient can be set to 0.3, and the fourth weight coefficient can be set to 0.2; or, the first weight coefficient can be set to 5, the second weight coefficient can be set to 3, the third weight coefficient can be set to 2, and the fourth weight coefficient can be set to 2; or, the first weight coefficient can be set to 50, the second weight coefficient can be set to 30, the third weight coefficient can be set to 20, and the fourth weight coefficient can be set to 10; etc., this embodiment does not limit this.
[0080] In one implementation, the sum of the first weight coefficient, the second weight coefficient, the third weight coefficient, and the fourth weight coefficient may be 1.
[0081] In one implementation, the first indicator value Q=a*Js+b*Jn+c*Jf+d*Je, wherein Js is the first ratio, Jn is the second ratio, Jf is the third ratio, Je is the fourth ratio, a is the first weight coefficient, b is the second weight coefficient, c is the third weight coefficient, and d is the fourth weight coefficient.
[0082] In this implementation, the first index value of the first speech is determined by multiplying the first product, the second product, the third product, and the fourth product, so that the speech cleanliness of the first speech can be comprehensively determined from multiple dimensions.
[0083] Optionally, the adjusting the first voice based on the target adjustment parameter includes:
[0084] Determine a first adjustment parameter based on the target adjustment parameter and the energy mean of the second speech segment, and adjust the amplitude of each data point in the data points corresponding to the second speech segment based on the first adjustment parameter;
[0085] and / or
[0086] A second adjustment parameter is determined based on the target adjustment parameter and the energy mean of the third speech segment, and the amplitude of each data point in the data points corresponding to the third speech segment is adjusted based on the second adjustment parameter.
[0087] Among them, taking the target adjustment parameter as the ratio of the preset index value to the first index value as an example, the data point corresponding to the second speech segment can be the third data point, and the first adjustment parameter can be the square root of the product of the target adjustment parameter, the energy mean of the second speech segment and the number of data points of the third data point included in the second speech segment. For example, the first adjustment parameter a 1 Can be:
[0088]
[0089] Among them, scale is the target adjustment parameter, Lspeech is the energy mean of the second speech segment, and m is the number of data points of the third data point included in the second speech segment.
[0090] It should be noted that, based on the first adjustment parameter, the amplitude of each data point in the data points corresponding to the second speech segment is adjusted, which may be, for each third data point, multiplying the amplitude of each third data point by the first adjustment parameter a. 1 . In passing When the energy mean Lspeech of the second speech segment is calculated, the X of the third data point is obtained for the i-th third data point. i With the first adjustment parameter a eThe product of , and the sum of the product and the first amplitude mean is determined as the amplitude of the adjusted i-th third data point.
[0091] In addition, taking the target adjustment parameter as the ratio of the preset index value to the first index value as an example, the data point corresponding to the third speech segment may be the fourth data point, and the second adjustment parameter may be the square root of the product of the target adjustment parameter, the energy mean of the third speech segment, and the number of data points of the fourth data point included in the third speech segment. For example, the second adjustment parameter a 2 Can be:
[0092]
[0093] Wherein, scale is the target adjustment parameter, Hspeech is the energy mean of the third speech segment, and m is the number of data points of the fourth data point included in the third speech segment.
[0094] It should be noted that, based on the second adjustment parameter, the amplitude of each data point in the data points corresponding to the third speech segment is adjusted, which may be, for each fourth data point, dividing the amplitude of each fourth data point by the second adjustment parameter a 2 . In passing When the energy mean Hspeech of the third speech segment is calculated, the X of the fourth data point is obtained for the i-th fourth data point. i and the second adjustment parameter a 2 The quotient of , and the sum of the quotient and the second amplitude mean are determined as the amplitude of the adjusted i-th fourth data point.
[0095] In this implementation, the amplitude of each data point in the data points corresponding to the second speech segment is adjusted based on the first adjustment parameter, or the amplitude of each data point in the data points corresponding to the third speech segment is adjusted based on the second adjustment parameter. In this way, from the dimension of the speech segment of the first speech, the amplitude of the data point corresponding to the second speech segment or the data point corresponding to the third speech segment is adjusted so that the speech cleanliness of the first speech meets the preset index value, thereby obtaining a training sample with a high speech cleanliness.
[0096] Optionally, the adjusting the first voice based on the target adjustment parameter includes:
[0097] Determine a third adjustment parameter based on the target adjustment parameter and the energy mean of the second non-speech segment, and adjust the amplitude of each data point in the data points corresponding to the second non-speech segment based on the third adjustment parameter;
[0098] and / or
[0099] A fourth adjustment parameter is determined based on the target adjustment parameter and the energy mean of the third non-speech segment, and the amplitude of each data point in the data points corresponding to the third non-speech segment is adjusted based on the fourth adjustment parameter.
[0100] Wherein, taking the target adjustment parameter as the ratio of the preset index value to the first index value as an example, the data point corresponding to the second non-speech segment may be the fifth data point, and the third adjustment parameter may be the square root of the product of the target adjustment parameter, the energy mean of the second non-speech segment and the number of data points of the fifth data point included in the second non-speech segment. For example, the third adjustment parameter a 3 Can be:
[0101]
[0102] Wherein, scale is the target adjustment parameter, Lnoise is the energy mean of the second non-speech segment, and m is the number of data points of the fifth data point included in the second non-speech segment.
[0103] It should be noted that the amplitude of each data point in the data points corresponding to the second non-speech segment is adjusted based on the third adjustment parameter, which may be, for each fifth data point, multiplying the amplitude of each fifth data point by the third adjustment parameter a 3 . In passing When the energy mean Lnoise of the second non-speech segment is calculated, the X value of the fifth data point is obtained for the i-th fifth data point. i and the third adjustment parameter a 3 The product of , and the sum of the product and the third amplitude mean is determined as the amplitude of the adjusted i-th fifth data point.
[0104] In addition, taking the target adjustment parameter as the ratio of the preset index value to the first index value as an example, the data point corresponding to the third non-speech segment may be the sixth data point, and the fourth adjustment parameter may be the square root of the product of the target adjustment parameter, the energy mean of the third non-speech segment, and the number of data points of the sixth data point included in the third non-speech segment. For example, the fourth adjustment parameter a 4 Can be:
[0105]
[0106] Wherein, scale is the target adjustment parameter, Hnoise is the energy mean of the third non-speech segment, and m is the number of data points of the sixth data point included in the third non-speech segment.
[0107] It should be noted that, based on the fourth adjustment parameter, the amplitude of each data point in the data points corresponding to the third non-speech segment is adjusted, which may be, for each sixth data point, dividing the amplitude of each sixth data point by the fourth adjustment parameter a 4 . In passing When the energy mean Hnoise of the third non-speech segment is calculated, the X of the sixth data point is obtained for the i-th sixth data point. i With the fourth adjustment parameter a 4 The quotient of , and the sum of the quotient and the fourth amplitude mean are determined as the amplitude of the adjusted i-th sixth data point.
[0108] In this implementation, the amplitude of each data point in the data points corresponding to the second non-speech segment is adjusted based on the third adjustment parameter, or the amplitude of each data point in the data points corresponding to the third non-speech segment is adjusted based on the fourth adjustment parameter. In this way, from the dimension of the non-speech segment of the first speech, the amplitude of the data point corresponding to the second non-speech segment or the data point corresponding to the third non-speech segment is adjusted so that the speech cleanliness of the first speech meets the preset index value, thereby obtaining a training sample with a high speech cleanliness.
[0109] Optionally, the adjusting the first voice based on the target adjustment parameter includes:
[0110] Determine a fifth adjustment parameter based on the target adjustment parameter and the energy mean of the first data point, and adjust the amplitude of the first data point based on the fifth adjustment parameter;
[0111] and / or
[0112] A sixth adjustment parameter is determined based on the target adjustment parameter and the energy mean of the second data point, and the amplitude of the second data point is adjusted based on the sixth adjustment parameter.
[0113] Wherein, taking the target adjustment parameter as the ratio of the preset index value to the first index value as an example, the fifth adjustment parameter may be the square root of the product of the target adjustment parameter, the energy mean of the first data point and the number of data points of the first data point included in the first speech segment. For example, the fifth adjustment parameter a 5 Can be:
[0114]
[0115] Among them, scale is the target adjustment parameter, Eb is the energy mean of the first data point, and m is the number of data points of the first data point included in the first speech segment.
[0116] It should be noted that the amplitude of the first data point is adjusted based on the fifth adjustment parameter, which may be, for each first data point, multiplying the amplitude of each first data point by the fifth adjustment parameter a. 5 . In passing When the energy mean Eb of the first data point is calculated, for the i-th first data point, the X of the first data point is obtained. i With the fifth adjustment parameter a 5 The product of , and the sum of the product and the fifth amplitude mean is determined as the amplitude of the adjusted i-th first data point.
[0117] In addition, taking the target adjustment parameter as the ratio of the preset index value to the first index value as an example, the sixth adjustment parameter can be the square root of the product of the target adjustment parameter, the energy mean of the second data point and the number of data points of the second data point included in the first speech segment. For example, the sixth adjustment parameter a 6 Can be:
[0118]
[0119] Among them, scale is the target adjustment parameter, Eo is the energy mean of the second data point, and m is the number of data points of the second data point included in the third speech segment.
[0120] It should be noted that the amplitude of the second data point is adjusted based on the sixth adjustment parameter, which may be, for each second data point, dividing the amplitude of each second data point by the sixth adjustment parameter a. 6 . In passing When the energy mean Hspeech of the second data point is calculated, the X of the second data point is obtained for the i-th second data point. i and the sixth adjustment parameter a 6 The quotient of , and the sum of the quotient and the sixth amplitude mean are determined as the amplitude of the adjusted i-th second data point.
[0121] In this implementation, the amplitude of the first data point is adjusted based on the fifth adjustment parameter, or the amplitude of the second data point is adjusted based on the sixth adjustment parameter. In this way, the amplitude of the first data point or the second data point is adjusted from the frequency dimension of the first speech, so that the speech cleanliness of the first speech meets the preset indicator value, thereby obtaining a training sample with a high speech cleanliness.
[0122] Optionally, the adjusting the first voice based on the target adjustment parameter includes:
[0123] Determine a seventh adjustment parameter based on the target adjustment parameter and the energy mean of the first speech segment, and adjust the amplitude of each data point in the data points corresponding to the first speech segment based on the seventh adjustment parameter;
[0124] and / or
[0125] An eighth adjustment parameter is determined based on the target adjustment parameter and the energy mean of the first non-speech segment, and the amplitude of each data point corresponding to the first non-speech segment is adjusted based on the eighth adjustment parameter.
[0126] Among them, taking the target adjustment parameter as the ratio of the preset index value to the first index value as an example, the data point corresponding to the first speech segment may be the seventh data point, and the seventh adjustment parameter may be the square root of the product of the target adjustment parameter, the energy mean of the first speech segment, and the number of data points of the seventh data point included in the first speech segment. For example, the seventh adjustment parameter a 7 Can be:
[0127]
[0128] Among them, scale is the target adjustment parameter, Espeech is the energy mean of the first speech segment, and m is the number of data points of the seventh data point included in the first speech segment.
[0129] It should be noted that, based on the seventh adjustment parameter, the amplitude of each data point in the data points corresponding to the first speech segment is adjusted, which may be, for each seventh data point, multiplying the amplitude of each seventh data point by the seventh adjustment parameter a. 7 . In passing When the energy mean Espeech of the first speech segment is calculated, for the seventh data point of the i-th segment, the X value of the seventh data point is obtained. i and the seventh adjustment parameter a 7 The product of , and the sum of the product and the seventh amplitude mean is determined as the amplitude of the adjusted i-th seventh data point.
[0130] In addition, taking the target adjustment parameter as the ratio of the preset index value to the first index value as an example, the data point corresponding to the first non-speech segment may be the eighth data point, and the eighth adjustment parameter may be the square root of the product of the target adjustment parameter, the energy mean of the first non-speech segment, and the number of data points of the eighth data point included in the first non-speech segment. For example, the eighth adjustment parameter a 8 Can be:
[0131]
[0132] Wherein, scale is the target adjustment parameter, Enoise is the energy mean of the first non-speech segment, and m is the number of data points of the eighth data point included in the first non-speech segment.
[0133] It should be noted that, based on the eighth adjustment parameter, the amplitude of each data point in the data points corresponding to the first non-speech segment is adjusted, which may be, for each eighth data point, dividing the amplitude of each eighth data point by the eighth adjustment parameter a. 8 . In passing When the energy mean Enoise of the first non-speech segment is calculated, the X of the eighth data point is obtained for the eighth data point i i With the eighth adjustment parameter a 8 The quotient of , and the sum of the quotient and the second amplitude mean are determined as the amplitude of the adjusted i-th eighth data point.
[0134] In this implementation, the amplitude of each data point in the data points corresponding to the first speech segment is adjusted based on the seventh adjustment parameter, or the amplitude of each data point in the data points corresponding to the first non-speech segment is adjusted based on the eighth adjustment parameter. In this way, from the dimensions of the speech segment and the non-speech segment of the first speech, the amplitude of the data point corresponding to the first speech segment or the data point corresponding to the first non-speech segment is adjusted so that the speech cleanliness of the first speech meets the preset index value, thereby obtaining a training sample with a high speech cleanliness.
[0135] See also Figure 2 , Figure 2 is a schematic diagram of a sample determination device provided by an embodiment of the present disclosure, such as Figure 2 As shown, the sample determination device 200 includes:
[0136] The segmentation module 201 is used to perform speech segmentation on the first speech to obtain a first speech segment and a first non-speech segment corresponding to the first speech;
[0137] A first determination module 202, configured to determine a first index value of the first speech based on the first speech segment and / or the first non-speech segment, wherein the first index value is used to indicate a speech cleanliness of the first speech;
[0138] A second determination module 203, configured to determine a target adjustment parameter based on the first indicator value and a preset indicator value;
[0139] The third determination module 204 is used to adjust the first speech based on the target adjustment parameter, and determine the adjusted first speech as a training sample for model training.
[0140] Optionally, the first indicator value is positively correlated with at least one of the following:
[0141] first ratio, second ratio, third ratio, fourth ratio;
[0142] Wherein, the first ratio is the ratio of the energy mean of the second speech segment to the energy mean of the third speech segment, the second speech segment is obtained after low-pass filtering based on the first speech segment, and the third speech segment is obtained after high-pass filtering based on the first speech segment;
[0143] The second ratio is a ratio of an energy mean of a second non-speech segment to an energy mean of a third non-speech segment, the second non-speech segment is obtained by low-pass filtering the first non-speech segment, and the third non-speech segment is obtained by high-pass filtering the first non-speech segment;
[0144] The third ratio is a ratio of the energy mean of a first data point to the energy mean of a second data point, the first data point being a data point corresponding to the fundamental frequency of the first speech segment and a data point corresponding to a multiple of the fundamental frequency, and the second data point being a data point in the first speech segment other than the first data point;
[0145] The fourth ratio is the ratio of the energy mean of the first speech segment to the energy mean of the first non-speech segment.
[0146] Optionally, the first determining module is specifically configured to:
[0147] respectively obtaining a first product, a second product, a third product and a fourth product, wherein the first product is a product of a first weight coefficient and the first ratio, the second product is a product of a second weight coefficient and the second ratio, the third product is a product of a third weight coefficient and the third ratio, and the fourth product is a product of a fourth weight coefficient and the fourth ratio;
[0148] A first index value of the first speech is determined based on the first product, the second product, the third product and the fourth product.
[0149] Optionally, the third determining module is specifically configured to:
[0150] Determine a first adjustment parameter based on the target adjustment parameter and the energy mean of the second speech segment, and adjust the amplitude of each data point in the data points corresponding to the second speech segment based on the first adjustment parameter;
[0151] and / or, determining a second adjustment parameter based on the target adjustment parameter and the energy mean of the third speech segment, and adjusting the amplitude of each data point in the data points corresponding to the third speech segment based on the second adjustment parameter;
[0152] The adjusted first speech is determined as a training sample for model training.
[0153] Optionally, the third determining module is specifically configured to:
[0154] Determine a third adjustment parameter based on the target adjustment parameter and the energy mean of the second non-speech segment, and adjust the amplitude of each data point in the data points corresponding to the second non-speech segment based on the third adjustment parameter;
[0155] and / or, determining a fourth adjustment parameter based on the target adjustment parameter and the energy mean of the third non-speech segment, and adjusting the amplitude of each data point in the data points corresponding to the third non-speech segment based on the fourth adjustment parameter;
[0156] The adjusted first speech is determined as a training sample for model training.
[0157] Optionally, the third determining module is specifically configured to:
[0158] Determine a fifth adjustment parameter based on the target adjustment parameter and the energy mean of the first data point, and adjust the amplitude of the first data point based on the fifth adjustment parameter;
[0159] and / or, determining a sixth adjustment parameter based on the target adjustment parameter and the energy mean of the second data point, and adjusting the amplitude of the second data point based on the sixth adjustment parameter;
[0160] The adjusted first speech is determined as a training sample for model training.
[0161] Optionally, the third determining module is specifically configured to:
[0162] Determine a seventh adjustment parameter based on the target adjustment parameter and the energy mean of the first speech segment, and adjust the amplitude of each data point in the data points corresponding to the first speech segment based on the seventh adjustment parameter;
[0163] and / or, determining an eighth adjustment parameter based on the target adjustment parameter and the energy mean of the first non-speech segment, and adjusting the amplitude of each data point in the data points corresponding to the first non-speech segment based on the eighth adjustment parameter;
[0164] The adjusted first speech is determined as a training sample for model training.
[0165] The speech evaluation device enables Figure 1 The various processes implemented in the method embodiment can achieve the same technical effect, and to avoid repetition, they will not be described again here.
[0166] like Figure 3As shown, the embodiment of the present disclosure further provides an electronic device 300, including: a memory 302, a processor 301, and a program stored in the memory 302 and executable on the processor 301. When the program is executed by the processor 301, each process of the above-mentioned sample determination method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0167] The embodiment of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above-mentioned sample determination method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0168] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0169] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in the various embodiments of the present disclosure.
[0170] The embodiments of the present disclosure are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the purpose of the present invention and the claims, all of which are within the protection of the present invention.
Claims
1. A sample determination method, characterized in that: The method comprises: Performing speech segmentation on the first speech to obtain a first speech segment and a first non-speech segment corresponding to the first speech; Determine a first index value of the first speech based on the first speech segment and / or the first non-speech segment, wherein the first index value is used to indicate the speech cleanliness of the first speech; Determining a target adjustment parameter based on the first indicator value and a preset indicator value; Adjusting the first speech based on the target adjustment parameter, and determining the adjusted first speech as a training sample for model training; The first indicator value is positively correlated with the third ratio, and the third ratio is the ratio of the energy mean of the first data point to the energy mean of the second data point. The first data point is the data point corresponding to the fundamental frequency of the first speech segment and the data point corresponding to the multiple of the fundamental frequency. The second data point is the data point in the first speech segment other than the first data point.
2. The method according to claim 1, characterized in that The first indicator value is also positively correlated with at least one of the following: first ratio, second ratio, fourth ratio; Wherein, the first ratio is the ratio of the energy mean of the second speech segment to the energy mean of the third speech segment, the second speech segment is obtained after low-pass filtering based on the first speech segment, and the third speech segment is obtained after high-pass filtering based on the first speech segment; The second ratio is a ratio of an energy mean of a second non-speech segment to an energy mean of a third non-speech segment, the second non-speech segment is obtained by low-pass filtering the first non-speech segment, and the third non-speech segment is obtained by high-pass filtering the first non-speech segment; The fourth ratio is the ratio of the energy mean of the first speech segment to the energy mean of the first non-speech segment.
3. The method according to claim 2, characterized in that The determining a first indicator value of the first speech based on the first speech segment and / or the first non-speech segment includes: respectively obtaining a first product, a second product, a third product and a fourth product, wherein the first product is a product of a first weight coefficient and the first ratio, the second product is a product of a second weight coefficient and the second ratio, the third product is a product of a third weight coefficient and the third ratio, and the fourth product is a product of a fourth weight coefficient and the fourth ratio; A first index value of the first speech is determined based on the first product, the second product, the third product and the fourth product.
4. The method according to claim 2 or 3, characterized in that: The adjusting the first voice based on the target adjustment parameter includes: Determine a first adjustment parameter based on the target adjustment parameter and the energy mean of the second speech segment, and adjust the amplitude of each data point in the data points corresponding to the second speech segment based on the first adjustment parameter; and / or A second adjustment parameter is determined based on the target adjustment parameter and the energy mean of the third speech segment, and the amplitude of each data point in the data points corresponding to the third speech segment is adjusted based on the second adjustment parameter.
5. The method according to claim 2 or 3, characterized in that: The adjusting the first voice based on the target adjustment parameter includes: Determine a third adjustment parameter based on the target adjustment parameter and the energy mean of the second non-speech segment, and adjust the amplitude of each data point in the data points corresponding to the second non-speech segment based on the third adjustment parameter; and / or A fourth adjustment parameter is determined based on the target adjustment parameter and the energy mean of the third non-speech segment, and the amplitude of each data point in the data points corresponding to the third non-speech segment is adjusted based on the fourth adjustment parameter.
6. The method according to claim 2 or 3, characterized in that: The adjusting the first voice based on the target adjustment parameter includes: Determine a fifth adjustment parameter based on the target adjustment parameter and the energy mean of the first data point, and adjust the amplitude of the first data point based on the fifth adjustment parameter; and / or A sixth adjustment parameter is determined based on the target adjustment parameter and the energy mean of the second data point, and the amplitude of the second data point is adjusted based on the sixth adjustment parameter.
7. The method according to claim 2 or 3, characterized in that: The adjusting the first voice based on the target adjustment parameter includes: Determine a seventh adjustment parameter based on the target adjustment parameter and the energy mean of the first speech segment, and adjust the amplitude of each data point in the data points corresponding to the first speech segment based on the seventh adjustment parameter; and / or An eighth adjustment parameter is determined based on the target adjustment parameter and the energy mean of the first non-speech segment, and the amplitude of each data point in the data points corresponding to the first non-speech segment is adjusted based on the eighth adjustment parameter.
8. A sample determination device, characterized in that: The device comprises: A segmentation module, used to perform speech segmentation on the first speech to obtain a first speech segment and a first non-speech segment corresponding to the first speech; A first determination module, used to determine a first index value of the first speech based on the first speech segment and / or the first non-speech segment, wherein the first index value is used to indicate the speech cleanliness of the first speech; A second determination module, configured to determine a target adjustment parameter based on the first indicator value and a preset indicator value; a third determination module, configured to adjust the first speech based on the target adjustment parameter, and determine the adjusted first speech as a training sample for model training; The first indicator value is positively correlated with the third ratio, and the third ratio is the ratio of the energy mean of the first data point to the energy mean of the second data point. The first data point is the data point corresponding to the fundamental frequency of the first speech segment and the data point corresponding to the multiple of the fundamental frequency. The second data point is the data point in the first speech segment other than the first data point.
9. An electronic device, characterized in that: include: A memory, a processor, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the steps in the sample determination method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the sample determination method according to any one of claims 1 to 7 are implemented.
