Subtitle generation method, device, equipment and storage medium based on artificial intelligence

Through the subtitle generation method based on artificial intelligence, machine learning algorithms are used to extract and process the voice and image information in the video data, and generate easily identifiable translated subtitles, which solves the problem of insufficient subtitle generation speed and accuracy in the existing technology and achieves Fast and accurate subtitle generation.

CN111949805BActive Publication Date: 2024-09-20SHENZHEN QIANHAI ZHIXING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011010403.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-23
Publication Date
2024-09-20
Estimated Expiration
2040-09-23

AI Technical Summary

Technical Problem

Existing subtitle generation technology has deficiencies in processing speed and accuracy. In particular, it is slow in generating easily identifiable translated subtitles in real time and cannot meet the needs of users.

Method used

Using artificial intelligence-based methods, by acquiring voice and image data in video data, using machine learning conversion algorithms to extract voiceprint features, generate string data in the target language, and perform coloring processing according to the voiceprint tag sequence, and finally convert the target language into The subtitles and image data are combined to generate video data with subtitles.

Benefits of technology

It realizes the rapid generation of easily identifiable translated subtitles, improves the accuracy and processing speed of subtitle generation, and meets the needs of real-time generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111949805B
    Figure CN111949805B
Patent Text Reader

Abstract

The present invention relates to the field of artificial intelligence, and discloses a subtitle generation method, device, equipment and storage medium based on artificial intelligence. The method comprises: obtaining video data to be generated with subtitles, wherein the video data comprises: a time series, voice data corresponding to the time series, and image data corresponding to the time series; reading the voice language type and the target language type, and calling the machine learning conversion algorithm corresponding to the voice language type, converting the voice data, and generating character string data of the target language type, wherein the character string data comprises: a text character string, and a voiceprint label sequence corresponding to the text character string; coloring the text character string according to the label type in the voiceprint label sequence, and generating the target language coloring subtitles corresponding to the voiceprint label sequence; merging the target language coloring subtitles with the image data according to the time series, and generating the video data with subtitles.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence, and in particular to an artificial intelligence-based subtitle generation method, device, equipment and storage medium. Background Art

[0002] Since artificial intelligence defeated the strongest human player in the final chess and card game, Go, artificial intelligence has been attracting people's attention, from the initial CNN neural network to the SSD neural network, and then to the GAN neural network. Artificial intelligence technology is constantly applied in various subdivided scenarios, and various different technologies have emerged in different neural networks, and various improved algorithms have contributed to the field of artificial intelligence. In the field of mobile payment, the accuracy and speed of face recognition are constantly improving. Face recognition technology has been migrated to the field of security protection under high precision, which has a wider application scenario than the existing iris recognition. In the field of autonomous driving, artificial intelligence continues to refresh people's understanding of intelligent driving, and science fiction scenes are becoming reality. Traditional driving assistance technology based on statistics and classification is being replaced by artificial intelligence assistance technology based on linear algebra.

[0003] However, in the field of subtitles, existing subtitle generation technologies still process voiceprints based on traditional statistics and probability to generate subtitles. This not only results in insufficient accuracy in the generation of subtitles, but also in the processing method of directly converting voiceprints into text, and then translating the text into the required text. At present, there are also some subtitle generation technologies based on artificial intelligence, but the processing method is also to directly convert voiceprints into text, then translate the text into the target language, and then color the subtitles after translation, which cannot meet people's needs for real-time generation of colored subtitles, and the processing speed is slow. Therefore, there is a need for a technology that can generate easily recognizable translated subtitles more quickly. Summary of the invention

[0004] The main purpose of the present invention is to solve the technical problem that the prior art is slow in generating easily recognizable translated subtitles.

[0005] A first aspect of the present invention provides a subtitle generation method based on artificial intelligence, and the subtitle generation method based on artificial intelligence includes:

[0006] Acquire video data for which subtitles are to be generated, wherein the video data includes: a time series, voice data corresponding to the time series, and image data corresponding to the time series;

[0007] Reading the speech language type and the target language type, and calling the machine learning conversion algorithm corresponding to the speech language type and the target language type, converting the speech data to generate character string data of the target language type, wherein the character string data includes: a text character string and a voiceprint label sequence corresponding to the text character string;

[0008] According to the label type in the voiceprint label sequence, the text string is colorized to generate a target language colored subtitle corresponding to the voiceprint label sequence;

[0009] The target language colored subtitles are merged with the image data according to the time sequence to generate video data with subtitles.

[0010] Optionally, in a first implementation of the first aspect of the present invention, calling the machine learning conversion algorithm corresponding to the speech language type, performing conversion processing on the speech data, and generating character string data of the target language type includes:

[0011] Extracting voiceprint features of the speech data to generate a feature matrix corresponding to the speech data;

[0012] According to the speech language type, calling a recognition algorithm corresponding to the speech language type, and according to the recognition algorithm, performing recognition processing on the feature matrix to obtain a text string;

[0013] According to the time series, embedding the text string and the feature matrix to obtain a label feature matrix;

[0014] According to the speech language type, calling a voiceprint classification algorithm corresponding to the speech language type, and performing classification and marking processing on the label feature matrix according to the voiceprint classification algorithm to obtain a voiceprint label sequence corresponding to the text string;

[0015] The voiceprint label sequence is combined with the text string to obtain string data.

[0016] Optionally, in a second implementation of the first aspect of the present invention, the recognition processing is performed on the feature matrix according to the recognition algorithm to obtain the text string, which includes:

[0017] Convolution processing is performed on the feature matrix and a preset initial matrix to obtain a first recognition matrix;

[0018] performing batch normalization processing on the first recognition matrix to obtain a second recognition matrix;

[0019] Performing mapping conversion processing on the second identification matrix to obtain a third identification matrix;

[0020] Convolutionally processing the third recognition matrix with a preset depth matrix to obtain a fourth recognition matrix;

[0021] According to the preset activation function, the fourth recognition matrix is ​​activated and judged to obtain a text string.

[0022] Optionally, in a third implementation of the first aspect of the present invention, performing classification and labeling processing on the label feature matrix according to the voiceprint classification algorithm to obtain the voiceprint label sequence corresponding to the text string includes:

[0023] Substituting the label feature matrix into a preset first expected function to obtain a first expected value set, and substituting the label feature matrix into a preset second expected function to obtain a second expected value set;

[0024] According to the order of the text character strings, performing a maximum and minimum operation on the first expected value set and the second expected value set to obtain a maximum and minimum value set;

[0025] The numerical values ​​in the maximum and minimum value sets are compared with the preset classification intervals in sequence to obtain the voiceprint label sequence corresponding to the text string.

[0026] Optionally, in a fourth implementation of the first aspect of the present invention, sequentially comparing the numerical values ​​in the maximum and minimum value sets with preset classification intervals to obtain the voiceprint label sequence corresponding to the text string includes:

[0027] Compare the values ​​in the maximum and minimum value sets with the medians of the preset classification intervals;

[0028] Determine whether the value is greater than the median of the classification interval;

[0029] If it is greater than the median, reassign the classification interval using the median as the minimum value, so as to re-compare the value with the median of the classification interval;

[0030] If it is less than the median, determining whether the value is equal to the median;

[0031] If it is not equal to the median, reassigning the classification interval with the median as the maximum value, so as to re-compare the value with the median of the classification interval;

[0032] If it is equal to the median, then read the voiceprint label of the classification interval where the median is located, mark the voiceprint label to the character of the text string corresponding to the value, and cyclically mark to obtain the voiceprint label sequence corresponding to the text string.

[0033] Optionally, in a fifth implementation of the first aspect of the present invention, the coloring of the text string according to the label type in the voiceprint label sequence to generate a target language colored subtitle corresponding to the voiceprint label sequence includes:

[0034] Read the label type of the voiceprint label sequence;

[0035] Classify and color the characters in the text string according to the label type to obtain a colored string;

[0036] The colored character string is converted into character image data, and the character image data and the time series are marked correspondingly to obtain the target language colored subtitles corresponding to the time series.

[0037] Optionally, in a sixth implementation of the first aspect of the present invention, after merging the target language colored subtitles with the image data according to the time sequence to generate video data with subtitles, the method further includes:

[0038] The video data with subtitles is transmitted to a preset storage port so as to store the video data with subtitles.

[0039] A second aspect of the present invention provides a subtitle generation device based on artificial intelligence, comprising:

[0040] An acquisition module, used for acquiring video data for generating subtitles, wherein the video data includes: a time series, voice data corresponding to the time series, and image data corresponding to the time series;

[0041] a conversion module, configured to read the speech language type and the target language type, and to retrieve the machine learning conversion algorithms corresponding to the speech language type and the target language type, to convert the speech data and generate character string data in the target language type, wherein the character string data includes: a text character string and a voiceprint label sequence corresponding to the text character string;

[0042] A coloring module, used for coloring the text string according to the label type in the voiceprint label sequence, and generating a target language colored subtitle corresponding to the voiceprint label sequence;

[0043] The subtitle generation module is used to merge the target language subtitles with the image data according to the time sequence to generate video data with subtitles.

[0044] The third aspect of the present invention provides an artificial intelligence-based subtitle generation device, comprising: a memory and at least one processor, wherein instructions are stored in the memory, and the memory and the at least one processor are interconnected via a line; the at least one processor calls the instructions in the memory so that the artificial intelligence-based subtitle generation device executes the above-mentioned artificial intelligence-based subtitle generation method.

[0045] A fourth aspect of the present invention provides a computer-readable storage medium, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the above-mentioned artificial intelligence-based subtitle generation method. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 Schematic diagram of a first embodiment of a subtitle generation method based on artificial intelligence in an embodiment of the present invention;

[0047] Figure 2 Schematic diagram of a second embodiment of a subtitle generation method based on artificial intelligence in an embodiment of the present invention;

[0048] Figure 3 Schematic diagram of a third embodiment of a subtitle generation method based on artificial intelligence in an embodiment of the present invention;

[0049] Figure 4 Schematic diagram of an embodiment of a subtitle generation device based on artificial intelligence in an embodiment of the present invention;

[0050] Figure 5 Schematic diagram of another embodiment of a subtitle generation device based on artificial intelligence in an embodiment of the present invention;

[0051] Figure 6 The figure is a schematic diagram of an embodiment of a subtitle generation device based on artificial intelligence in an embodiment of the present invention. DETAILED DESCRIPTION

[0052] Embodiments of the present invention provide a subtitle generation method, apparatus, device and storage medium based on artificial intelligence.

[0053] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0054] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 The first embodiment of the subtitle generation method based on artificial intelligence in the embodiment of the present invention includes:

[0055] 101. Obtain video data for which subtitles are to be generated, wherein the video data includes: a time series, voice data corresponding to the time series, and image data corresponding to the time series;

[0056] In this embodiment, the video data for generating subtitles is acquired through wired transmission or wireless transmission. During the acquisition process, the user may first cache the video data in a transfer area, obtain an upload instruction operated by the user, and directly capture the cached video data.

[0057] 102. Read the speech language type and the target language type, and call the machine learning conversion algorithm corresponding to the speech language type and the target language type, convert the speech data, and generate character string data of the target language type, wherein the character string data includes: a text character string and a voiceprint label sequence corresponding to the text character string;

[0058] In this embodiment, different target languages ​​have different conversion algorithms. During the conversion process, the user selects the target language. By selecting the target language type, the corresponding machine learning conversion algorithm can be called. Each machine learning conversion algorithm is trained for the corresponding target language type. In terms of calculation, the voice data is first vectorized, the features of the voiceprint are extracted, and the feature matrix of the voice data is generated. The feature matrix is ​​convolved with the trained 3*3 convolution matrix, and then the average value u of all elements is calculated. B , and find the variance σ of all elements B 2 , according to the regression function:

[0059]

[0060] Among them, x i Represents each element, X i ~ Represents the element after mapping, and q is the set deviation constant.

[0061] Then according to the conversion corresponding function:

[0062] Y i =r*X i ~ +c

[0063] Among them, Y i represents the final conversion element, r represents the slope constant, and c represents the intercept constant.

[0064] After conversion, continue to use the Relu6 function for conversion. The Relu6 function represents:

[0065]

[0066] Among them, f(Y i ) is the transformed element.

[0067] The element-converted matrix is ​​then multiplied by the preset 1*1 convolution matrix, and then batch normalization is performed again. The resulting matrix is ​​activated using the ReLu function, which is:

[0068]

[0069] Among them, μ is a variable that can be learned through the back propagation algorithm (Back Propagation), the value range of μ is (0,1), and after activation, the converted text string is generated.

[0070] The above method is to convert the voice data directly into text, and the converted text is marked with a voiceprint label.

[0071] The feature matrix and the generated text string are concatenated in the conversion order to obtain the label feature matrix. The label feature matrix is ​​used as the basic data. The label feature matrix is ​​first convolved and inserted into the first function to obtain the result P. G (x; θ), and then the result of convolution of the label feature matrix is ​​inserted into the second function to obtain P data (x), and then obtain the function:

[0072] V(G,D)=E x~Pd [logD(x)]+E x~PG [log(1-D(x))]

[0073]

[0074] Solve the function F(G, D), where G(z) = x is the abstract function of the convolution of the neural network, x is the output of the neural network, and z is the label feature matrix. The result is the result of the second function of D(x). After maximizing V(G, D), fix G and minimize the value D of V(G, D). Fixed G, max V(G, D) means P G (x;θ) and P data (x), and then find the best G to minimize this maximum value, that is, minimize the difference between the two distributions. According to this classification training, the convolution classification matrix is ​​obtained, and the label feature matrix is ​​directly classified and labeled.

[0075] 103. Perform coloring processing on the text string according to the label type in the voiceprint label sequence to generate a target language colored subtitle corresponding to the voiceprint label sequence;

[0076] In this embodiment, the types of labels are: label 1, label 2, label 3, label 4, label 5. The character strings corresponding to label 1, label 2, label 3, label 4, label 5 in the character string are colored red, green, blue, purple, and black respectively to generate subtitles colored in the target language.

[0077] 104. According to the time series, the target language subtitles are combined with the image data to generate video data with subtitles.

[0078] In this embodiment, the subtitles after coloring are displayed in the image data 1.00-1.20 according to the time sequence, and the character string at the time of 1.00-1.20 is displayed in the image data 1.00-1.20, and the character string at the time of 2.20-2.50 is displayed in the image data 2.20-2.50. According to the time sequence, the subtitles are combined with the image data to perform image merging, and the merged image and the audio data are merged again according to the time sequence to generate video data with subtitles.

[0079] In the embodiment of the present invention, by directly converting the audio data into the target language, the process of converting the audio into text and then converting the text into the target language is omitted. When generating a character string in the target language, the character string is colored by the audio tag to increase the recognition of the subtitles, thereby realizing the rapid generation of easily recognizable translated subtitles.

[0080] See also Figure 2 , the second embodiment of the subtitle generation method based on artificial intelligence in the embodiment of the present invention includes:

[0081] 201. Obtain video data for which subtitles are to be generated, wherein the video data includes: a time series, voice data corresponding to the time series, and image data corresponding to the time series;

[0082] The method embodiment described in this embodiment is similar to the first embodiment. You can refer to the corresponding process in the aforementioned method embodiment, which will not be described again.

[0083] 202. Reading voice data and target language type;

[0084] The method embodiment described in this embodiment is similar to the first embodiment. You can refer to the corresponding process in the aforementioned method embodiment, which will not be described again.

[0085] 203. Extract the voiceprint features of the voice data to generate a feature matrix corresponding to the voice data;

[0086] In this embodiment, the voiceprint is first denoised by filtering, and then a matrix of the sound wave is extracted according to the movement of the sound wave, and the matrix is ​​determined as a feature matrix.

[0087] 204. According to the type of speech language, retrieve a recognition algorithm corresponding to the type of speech language;

[0088] In this embodiment, the languages ​​are: Chinese, English, French, Japanese, German, Spanish, Portuguese, and Russian. The corresponding recognition algorithms are: Algorithm 1, Algorithm 2, Algorithm 3, Algorithm 4, Algorithm 5, Algorithm 6, Algorithm 7, and Algorithm 8. Algorithms 1-8 are all the results of training different neural network models. Although the structures are the same, the built-in parameters are different.

[0089] 205. Perform convolution processing on the feature matrix and the preset initial matrix to obtain a first recognition matrix;

[0090] In this embodiment, the feature matrix is ​​multiplied by a 3*3 convolution matrix to obtain a first recognition matrix.

[0091] 206. Perform batch normalization processing on the first recognition matrix to obtain a second recognition matrix;

[0092] In this embodiment, the average value u is calculated for all elements in the first identification matrix. B , and find the variance σ of all elements B 2 , according to the regression function:

[0093]

[0094] Among them, x i Represents each element, X i ~ Represents the element after mapping, and q is the set deviation constant.

[0095] Then according to the conversion corresponding function:

[0096] Y i=r*X i ~ +c

[0097] Among them, Y i represents the final conversion element, r represents the slope constant, and c represents the intercept constant. After the conversion, the second identification matrix is ​​obtained.

[0098] 207. Perform mapping conversion processing on the second identification matrix to obtain a third identification matrix;

[0099] In this embodiment, each element in the second identification matrix is ​​transformed using the ReLu6 function, which represents:

[0100]

[0101] Among them, f(Y i ) are the transformed elements, generating the third recognition matrix.

[0102] 208. Perform convolution processing on the third recognition matrix and the preset depth matrix to obtain a fourth recognition matrix;

[0103] In this embodiment, the third recognition matrix is ​​multiplied by a 1*1 convolution matrix to generate a fourth recognition matrix.

[0104] 209. Perform activation determination on the fourth recognition matrix according to a preset activation function to obtain a text string;

[0105] In this embodiment, the obtained fourth recognition matrix is ​​activated using a ReLu function, and the ReLu function is:

[0106]

[0107] Among them, μ is a variable that can be learned through the back propagation algorithm (Back Propagation), the value range of μ is (0,1), and after activation, the converted text string is generated.

[0108] 210. According to the time series, the text string and the feature matrix are embedded to obtain a label feature matrix;

[0109] In this embodiment, the text string "SQ" is combined with the feature matrix to obtain a label feature matrix of {(S, Q), (2, 6), (26, 96)}.

[0110] 211. According to the type of speech language, retrieve the voiceprint classification algorithm corresponding to the type of speech language;

[0111] In this embodiment, the languages ​​include Chinese, English, French, Japanese, German, Spanish, Portuguese and Russian. The voiceprint classification algorithms are generated in sequence: algorithm q1, algorithm q2, algorithm q3, algorithm q4, algorithm q5, algorithm q6, algorithm q7 and algorithm q8.

[0112] 212. Substitute the label feature matrix into a preset first expected function to obtain a first expected value set, and substitute the label feature matrix into a preset second expected function to obtain a second expected value set;

[0113] In this embodiment, the first expected function, the label feature matrix z is first convolved Q(z)=x, and then the convolution result is substituted into D(x), and the first expected value set E is obtained according to D(x) x~Pd [logD(x)], and similarly use the second expectation function to get the second expected value E x~PG [log(1-D(x))].

[0114] 213. According to the order of the character strings, perform a maximum and minimum operation on the first expected value set and the second expected value set to obtain a maximum and minimum value set;

[0115] In this embodiment, V(G, D)=Ex~Pd[logD(x)]+Ex~PG[log(1-D(x))],

[0116]

[0117] Solve the function F(G, D), where G(z) = x is the abstract function of the convolution of the neural network, x is the output of the neural network, and z is the label feature matrix. The result is the result of the second function processing of D(x). After maximizing V(G, D), fix G and minimize the value D of V(G, D). Fix G, max V(G, D) represents the difference between PG(x; θ) and Pdata(x), and then find the best G to minimize this maximum value, that is, minimize the difference between the two distributions.

[0118] 214. Compare the values ​​in the maximum and minimum value sets with the median of the preset classification interval;

[0119] In this embodiment, the maximum and minimum value set {1233, 4531, 9561, 5000} is compared with the total interval [1,9999] of the classification intervals A, B, and C.

[0120] 215. Determine whether the value is greater than the median of the classification interval;

[0121] In this embodiment, it is determined whether 1233 is greater than 5000, whether 4531 is greater than 5000, whether 9561 is greater than 5000, and whether 5000 is greater than 5000.

[0122] 216. If it is greater than the median, the median is used as the minimum value to reassign the classification interval so that the value can be re-compared with the median of the classification interval;

[0123] In this embodiment, 9561 is greater than 5000, so the comparison is performed within the interval [5000, 9999], and the number of digits of the convergence of the floating point number is set to 2 digits.

[0124] 217. If it is less than the median, determine whether the value is equal to the median;

[0125] In this embodiment, it is determined whether 1233 is greater than 5000, whether 4531 is greater than 5000, and whether 5000 is greater than 5000.

[0126] 218. If it is not equal to the median, the median is used as the maximum value to re-assign the classification interval so that the value can be re-compared with the median of the classification interval;

[0127] In this embodiment, 1233 and 4531 are compared with the median of the interval [1, 5000], and the convergence digit of the floating point number is set to 2 digits.

[0128] 219. If it is equal to the median, read the voiceprint label of the classification interval where the median is located, mark the voiceprint label to the character of the text string corresponding to the value, and cyclically mark to obtain the voiceprint label sequence corresponding to the text string;

[0129] In this embodiment, 5000 is equal to 5000, so the tag with 5000 digits is directly read, and the tag class is Class A.

[0130] 220. Combine the voiceprint label sequence and the text string to obtain string data;

[0131] In this embodiment, the A-type label is combined with the text string corresponding to 5000 to obtain the string data with the label.

[0132] 221. Perform coloring processing on the text string according to the label type in the voiceprint label sequence to generate a target language colored subtitle corresponding to the voiceprint label sequence;

[0133] The method embodiment described in this embodiment is similar to the first embodiment. You can refer to the corresponding process in the aforementioned method embodiment, which will not be described again.

[0134] 222. According to the time series, the target language colored subtitles are combined with the image data to generate video data with subtitles.

[0135] The method embodiment described in this embodiment is similar to the first embodiment. You can refer to the corresponding process in the aforementioned method embodiment, which will not be described again.

[0136] In the embodiment of the present invention, by directly converting the audio data into the target language, the process of converting the audio into text and then converting the text into the target language is omitted. When generating a character string in the target language, the character string is colored by the audio tag to increase the recognition of the subtitles, thereby realizing the rapid generation of easily recognizable translated subtitles.

[0137] See also Figure 3 , a third embodiment of the subtitle generation method based on artificial intelligence in the embodiment of the present invention includes:

[0138] 301. Obtain video data for generating subtitles, wherein the video data includes: a time series, voice data corresponding to the time series, and image data corresponding to the time series;

[0139] The method embodiment described in this embodiment is similar to the first embodiment. You can refer to the corresponding process in the aforementioned method embodiment, which will not be described again.

[0140] 302. Read the voice data and the target language, and retrieve the machine learning conversion algorithm corresponding to the voice language and the target language, convert the voice data, and generate character string data in the target language, wherein the character string data includes: a text character string and a voiceprint label sequence corresponding to the text character string;

[0141] The method embodiment described in this embodiment is similar to the first embodiment. You can refer to the corresponding process in the aforementioned method embodiment, which will not be described again.

[0142] 303. Read the tag type of the voiceprint tag sequence;

[0143] In this embodiment, the settings of the character string of the tags A, B, and C are read.

[0144] 304. Classify and color the characters in the text string according to the label type to obtain a colored string;

[0145] In this embodiment, the labels of category A, category B, and category C are colored red, white, and black, respectively, to obtain a colored character string.

[0146] 305. Convert the colored character string into character image data, and perform corresponding marking processing on the character image data and the time series to obtain the target language colored subtitles corresponding to the time series;

[0147] In this embodiment, the colored character string is electronic data, the electronic data is converted into character image data, and the converted character image data is merged with the time series to obtain the colored subtitles in the target language.

[0148] 306. According to the time sequence, the target language colored subtitles are combined with the image data to generate video data with subtitles;

[0149] The method embodiment described in this embodiment is similar to the first embodiment. You can refer to the corresponding process in the aforementioned method embodiment, which will not be described again.

[0150] 307. Transmit the video data with subtitles to a preset storage port so as to store the video data with subtitles.

[0151] In this embodiment, the obtained video data is transmitted to the port of the local storage medium and the storage process is performed by the interface API.

[0152] In the embodiment of the present invention, by directly converting the audio data into the target language, the process of converting the audio into text and then converting the text into the target language is omitted. When generating a character string in the target language, the character string is colored by the audio tag to increase the recognition of the subtitles, thereby realizing the rapid generation of easily recognizable translated subtitles.

[0153] The above describes the subtitle generation method based on artificial intelligence in the embodiment of the present invention. The following describes the subtitle generation device based on artificial intelligence in the embodiment of the present invention. Figure 4 In one embodiment of the present invention, a subtitle generation device based on artificial intelligence includes:

[0154] The acquisition module 401 is used to acquire video data for generating subtitles, wherein the video data includes: a time series, voice data corresponding to the time series, and image data corresponding to the time series;

[0155] The conversion module 402 is used to read the speech language type and the target language type, and call the machine learning conversion algorithm corresponding to the speech language type, convert the speech data, and generate the string data of the target language type, wherein the string data includes: a text string and a voiceprint label sequence corresponding to the text string;

[0156] The coloring module 403 is used to perform coloring processing on the text string according to the label type in the voiceprint label sequence, and generate a target language colored subtitle corresponding to the voiceprint label sequence;

[0157] The subtitle generation module 404 is used to merge the target language subtitles with the image data according to the time sequence to generate video data with subtitles.

[0158] In the embodiment of the present invention, by directly converting the audio data into the target language, the process of converting the audio into text and then converting the text into the target language is omitted. When generating a character string in the target language, the character string is colored by the audio tag to increase the recognition of the subtitles, thereby realizing the rapid generation of easily recognizable translated subtitles.

[0159] See also Figure 5 Another embodiment of the subtitle generation device based on artificial intelligence in the embodiment of the present invention includes:

[0160] The acquisition module 401 is used to acquire video data for generating subtitles, wherein the video data includes: a time series, voice data corresponding to the time series, and image data corresponding to the time series;

[0161] The conversion module 402 is used to read the speech language type and the target language type, and call the machine learning conversion algorithm corresponding to the speech language type, convert the speech data, and generate the string data of the target language type, wherein the string data includes: a text string and a voiceprint label sequence corresponding to the text string;

[0162] The coloring module 403 is used to perform coloring processing on the text string according to the label type in the voiceprint label sequence, and generate a target language colored subtitle corresponding to the voiceprint label sequence;

[0163] The subtitle generation module 404 is used to merge the target language subtitles with the image data according to the time sequence to generate video data with subtitles.

[0164] The conversion module 402 includes:

[0165] A generating unit 4021 is used to extract the voiceprint features of the speech data and generate a feature matrix corresponding to the speech data;

[0166] The recognition unit 4022 is used to call a recognition algorithm corresponding to the speech language type according to the speech language type, and perform recognition processing on the feature matrix according to the recognition algorithm to obtain a text string;

[0167] An embedding unit 4023, configured to embed the text string and the feature matrix according to the time series to obtain a label feature matrix;

[0168] The classification unit 4024 is used to call a voiceprint classification algorithm corresponding to the voice language type according to the voice language type, and classify and label the label feature matrix according to the voiceprint classification algorithm to obtain a voiceprint label sequence corresponding to the text string;

[0169] The combining unit 4025 is used to combine the voiceprint label sequence with the text string to obtain string data.

[0170] The identification unit 4022 is specifically used for:

[0171] Convolution processing is performed on the feature matrix and a preset initial matrix to obtain a first recognition matrix;

[0172] performing batch normalization processing on the first recognition matrix to obtain a second recognition matrix;

[0173] Performing mapping conversion processing on the second identification matrix to obtain a third identification matrix;

[0174] Convolutionally processing the third recognition matrix with a preset depth matrix to obtain a fourth recognition matrix;

[0175] According to the preset activation function, the fourth recognition matrix is ​​activated and judged to obtain a text string.

[0176] The classification unit 4024 is specifically used for:

[0177] Substituting the label feature matrix into a preset first expected function to obtain a first expected value set, and substituting the label feature matrix into a preset second expected function to obtain a second expected value set;

[0178] According to the order of the text character strings, performing a maximum and minimum operation on the first expected value set and the second expected value set to obtain a maximum and minimum value set;

[0179] The numerical values ​​in the maximum and minimum value sets are compared with the preset classification intervals in sequence to obtain the voiceprint label sequence corresponding to the text string.

[0180] The classification unit 4024 may also be specifically used for:

[0181] Compare the values ​​in the maximum and minimum value sets with the medians of the preset classification intervals;

[0182] Determine whether the value is greater than the median of the classification interval;

[0183] If it is greater than the median, reassign the classification interval using the median as the minimum value, so as to re-compare the value with the median of the classification interval;

[0184] If it is less than the median, determining whether the value is equal to the median;

[0185] If it is not equal to the median, reassigning the classification interval with the median as the maximum value, so as to re-compare the value with the median of the classification interval;

[0186] If it is equal to the median, then read the voiceprint label of the classification interval where the median is located, mark the voiceprint label to the character of the text string corresponding to the value, and cyclically mark to obtain the voiceprint label sequence corresponding to the text string.

[0187] The subtitle generation module 404 is specifically used for:

[0188] Read the label type of the voiceprint label sequence;

[0189] Classify and color the characters in the text string according to the label type to obtain a colored string;

[0190] The colored character string is converted into character image data, and the character image data and the time series are marked correspondingly to obtain the target language colored subtitles corresponding to the time series.

[0191] The artificial intelligence-based subtitle generation device further includes a storage module 405, which is specifically used for:

[0192] The video data with subtitles is transmitted to a preset storage port so as to store the video data with subtitles.

[0193] In the embodiment of the present invention, by directly converting the audio data into the target language, the process of converting the audio into text and then converting the text into the target language is omitted. When generating a character string in the target language, the character string is colored by the audio tag to increase the recognition of the subtitles, thereby realizing the rapid generation of easily recognizable translated subtitles.

[0194] above Figure 4 and Figure 5 The subtitle generation device based on artificial intelligence in the embodiment of the present invention is described in detail from the perspective of modular functional entities. The subtitle generation device based on artificial intelligence in the embodiment of the present invention is described in detail from the perspective of hardware processing.

[0195] Figure 66 is a schematic diagram of the structure of a subtitle generating device based on artificial intelligence provided by an embodiment of the present invention. The subtitle generating device based on artificial intelligence 600 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 610 (for example, one or more processors) and a memory 620, and one or more storage media 630 (for example, one or more mass storage devices) storing application programs 633 or data 632. Among them, the memory 620 and the storage medium 630 may be short-term storage or permanent storage. The program stored in the storage medium 630 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the subtitle generating device based on artificial intelligence 600. Furthermore, the processor 610 may be configured to communicate with the storage medium 630 to execute a series of instruction operations in the storage medium 630 on the subtitle generating device based on artificial intelligence 600.

[0196] The subtitle generating device 600 based on artificial intelligence may further include one or more power supplies 640, one or more wired or wireless network interfaces 650, one or more input and output interfaces 660, and / or one or more operating systems 631, such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, etc. It will be appreciated by those skilled in the art that Figure 6 The structure of the artificial intelligence-based subtitle generation device shown does not constitute a limitation on the artificial intelligence-based subtitle generation device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0197] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of the artificial intelligence-based subtitle generation method.

[0198] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described system, device, or unit can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.

[0199] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.

[0200] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A subtitle generation method based on artificial intelligence, characterized in that: Includes steps: Acquire video data for which subtitles are to be generated, wherein the video data includes: a time series, voice data corresponding to the time series, and image data corresponding to the time series; Reading the speech language type and the target language type, and calling the machine learning conversion algorithm corresponding to the speech language type and the target language type, converting the speech data to generate character string data of the target language type, wherein the character string data includes: a text character string and a voiceprint label sequence corresponding to the text character string; According to the label type in the voiceprint label sequence, the text string is colorized to generate a target language colored subtitle corresponding to the voiceprint label sequence; According to the time sequence, the target language colored subtitles are combined with the image data to generate video data with subtitles; The step of calling the machine learning conversion algorithm corresponding to the speech language type, converting the speech data, and generating the character string data of the target language type includes: Extracting voiceprint features of the speech data to generate a feature matrix corresponding to the speech data; According to the speech language type, calling a recognition algorithm corresponding to the speech language type, and according to the recognition algorithm, performing recognition processing on the feature matrix to obtain a text string; According to the time series, embedding the text string and the feature matrix to obtain a label feature matrix; According to the speech language type, calling a voiceprint classification algorithm corresponding to the speech language type, and performing classification and marking processing on the label feature matrix according to the voiceprint classification algorithm to obtain a voiceprint label sequence corresponding to the text string; Combining the voiceprint tag sequence with the text string to obtain string data; The character string obtained by performing recognition processing on the feature matrix according to the recognition algorithm includes: Convolution processing is performed on the feature matrix and a preset initial matrix to obtain a first recognition matrix; performing batch normalization processing on the first recognition matrix to obtain a second recognition matrix; Performing mapping conversion processing on the second identification matrix to obtain a third identification matrix; Convolutionally processing the third recognition matrix with a preset depth matrix to obtain a fourth recognition matrix; According to the preset activation function, the fourth recognition matrix is ​​activated and judged to obtain a text string.

2. The subtitle generation method based on artificial intelligence according to claim 1, characterized in that: The step of performing classification and labeling processing on the label feature matrix according to the voiceprint classification algorithm to obtain the voiceprint label sequence corresponding to the text string includes: Substituting the label feature matrix into a preset first expected function to obtain a first expected value set, and substituting the label feature matrix into a preset second expected function to obtain a second expected value set; According to the order of the text character strings, performing a maximum and minimum operation on the first expected value set and the second expected value set to obtain a maximum and minimum value set; The numerical values ​​in the maximum and minimum value sets are compared with the preset classification intervals in sequence to obtain the voiceprint label sequence corresponding to the text string.

3. The subtitle generation method based on artificial intelligence according to claim 2 is characterized in that: The step of sequentially comparing the values ​​in the maximum and minimum value sets with the preset classification intervals to obtain the voiceprint label sequence corresponding to the text string includes: Compare the values ​​in the maximum and minimum value sets with the medians of the preset classification intervals; Determine whether the value is greater than the median of the classification interval; If it is greater than the median, reassign the classification interval using the median as the minimum value, so as to re-compare the value with the median of the classification interval; If it is less than the median, determining whether the value is equal to the median; If it is not equal to the median, reassigning the classification interval with the median as the maximum value, so as to re-compare the value with the median of the classification interval; If it is equal to the median, then read the voiceprint label of the classification interval where the median is located, mark the voiceprint label to the character of the text string corresponding to the value, and cyclically mark to obtain the voiceprint label sequence corresponding to the text string.

4. The subtitle generation method based on artificial intelligence according to claim 1 is characterized in that: The coloring process of the text string according to the label type in the voiceprint label sequence to generate the target language colored subtitles corresponding to the voiceprint label sequence includes: Read the type of the voiceprint tag sequence; Classify and color the characters in the text string according to the label type to obtain a colored string; The colored character string is converted into character image data, and the character image data and the time series are marked correspondingly to obtain the target language colored subtitles corresponding to the time series.

5. The subtitle generation method based on artificial intelligence according to claim 1 is characterized in that: After merging the target language colored subtitles with the image data according to the time sequence to generate video data with subtitles, the method further includes: The video data with subtitles is transmitted to a preset storage port so as to store the video data with subtitles.

6. A subtitle generation device based on artificial intelligence, characterized in that: The subtitle generating device based on artificial intelligence comprises: An acquisition module, used for acquiring video data for generating subtitles, wherein the video data includes: a time series, voice data corresponding to the time series, and image data corresponding to the time series; a conversion module, configured to read the speech language type and the target language type, and to retrieve the machine learning conversion algorithms corresponding to the speech language type and the target language type, to convert the speech data and generate character string data in the target language type, wherein the character string data includes: a text character string and a voiceprint label sequence corresponding to the text character string; A coloring module, used for coloring the text string according to the label type in the voiceprint label sequence, and generating a target language colored subtitle corresponding to the voiceprint label sequence; A subtitle generation module, used for merging the target language subtitles with the image data according to the time sequence to generate video data with subtitles; Wherein, the conversion module includes: A generating unit, configured to extract voiceprint features of the speech data and generate a feature matrix corresponding to the speech data; A recognition unit, configured to retrieve a recognition algorithm corresponding to the speech language type according to the speech language type, and perform recognition processing on the feature matrix according to the recognition algorithm to obtain a text string; An embedding unit, used for embedding the text string and the feature matrix according to the time series to obtain a label feature matrix; a classification unit, configured to retrieve a voiceprint classification algorithm corresponding to the voice language type according to the voice language type, and to perform classification and labeling processing on the label feature matrix according to the voiceprint classification algorithm to obtain a voiceprint label sequence corresponding to the text string; A combining unit, used for combining the voiceprint label sequence with the text string to obtain string data; Wherein, the identification unit is specifically used for: Convolution processing is performed on the feature matrix and a preset initial matrix to obtain a first recognition matrix; performing batch normalization processing on the first recognition matrix to obtain a second recognition matrix; Performing mapping conversion processing on the second identification matrix to obtain a third identification matrix; Convolutionally processing the third recognition matrix with a preset depth matrix to obtain a fourth recognition matrix; According to the preset activation function, the fourth recognition matrix is ​​activated and judged to obtain a text string.

7. A subtitle generation device based on artificial intelligence, characterized in that: The artificial intelligence-based subtitle generation device comprises: a memory and at least one processor, the memory stores instructions, and the memory and the at least one processor are interconnected via a line; The at least one processor calls the instructions in the memory so that the artificial intelligence-based subtitle generation device executes the artificial intelligence-based subtitle generation method as described in any one of claims 1-5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the subtitle generation method based on artificial intelligence as described in any one of claims 1 to 5 is implemented.