A subtitle generation method, device and device for generating subtitles

By performing speech recognition and boundary word segmentation processing on audio and video signals, subtitle line files are generated, which solves the problem of recognition inaccuracy in traditional methods, improves the accuracy and fluency of subtitles, and facilitates users to understand audio and video content.

CN113343675BActive Publication Date: 2024-09-06BEIJING SOGOU TECHNOLOGY DEVELOPMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110745554.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-30
Publication Date
2024-09-06
Estimated Expiration
2041-06-30

AI Technical Summary

Technical Problem

Traditional audio and video subtitle generation methods based on silent clips have difficulty distinguishing between expressive pauses in characters' voices and expressive pauses between sentences, resulting in inaccurate recognition results and poor subtitle accuracy and fluency.

Method used

Through speech recognition processing of the audio and video signals to be processed, the boundary segmentation in the text sequence is determined, and the subtitle line file is generated based on the boundary segmentation and timestamp to ensure semantic integrity and rationality.

Benefits of technology

It improves the accuracy and fluency of subtitle lines and enhances users' ability to understand audio and video content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113343675B
    Figure CN113343675B
Patent Text Reader

Abstract

The embodiment of the present invention provides a subtitle generation method, device and device for generating subtitles. The method comprises: performing speech recognition processing on the audio and video signals to be processed, obtaining a text sequence corresponding to the audio and video signals and a timestamp mapping table of the text sequence, wherein the timestamp mapping table includes the timestamps corresponding to each word segment in the text sequence; determining boundary word segments in the text sequence; splitting the text sequence according to the boundary word segments and the timestamps corresponding to the boundary word segments, and generating a subtitle line file corresponding to the audio and video signals. The embodiment of the present invention can improve the accuracy and fluency of the generated subtitle file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a subtitle generation method and device, and a device for generating subtitles. Background Art

[0002] When users watch some audio and video, such as live broadcasts and movies, they can understand the audio and video content through the subtitles displayed on the audio and video display screen.

[0003] In the traditional audio and video subtitle generation method, the audio stream is mainly processed according to the silent segment to generate subtitles. The silent segment can be a segment without voice in the audio stream of the audio and video. The audio stream is divided into multiple voice segments according to the silent segment, and then speech recognition is performed on the segmented voice segments to obtain the subtitles corresponding to the voice segment.

[0004] However, the method of segmenting the audio stream based on a single audio signal feature such as silent segments makes it difficult to distinguish between pauses within a sentence and pauses between sentences in a person's voice. The semantics of the segmented voice segments are often incomplete, and the recognition results of the segmented voice segments are often not accurate enough. The subtitles generated based on this have poor accuracy and fluency, which is not conducive to users' understanding of the audio and video content. Summary of the invention

[0005] The embodiments of the present invention provide a subtitle generation method, a device and a device for generating subtitles, which can improve the accuracy and fluency of the generated subtitle lines and ensure the rationality of the generated subtitle lines, so as to facilitate users to understand audio and video content.

[0006] In order to solve the above problem, an embodiment of the present invention discloses a subtitle generation method, which includes:

[0007] Perform speech recognition processing on the audio and video signals to be processed to obtain a text sequence corresponding to the audio and video signals and a timestamp mapping table of the text sequence, wherein the timestamp mapping table includes timestamps corresponding to each word in the text sequence;

[0008] Determining boundary segmentations in the text sequence;

[0009] The text sequence is split according to the boundary segmentation words and the timestamps corresponding to the boundary segmentation words to generate a subtitle line file corresponding to the audio and video signal.

[0010] Optionally, determining a boundary segmentation word in the text sequence includes:

[0011] Determine the boundary label of each word segment in the text sequence based on a preset boundary detection model or boundary detection rule, and determine the boundary word segment in the text sequence according to the boundary label; or

[0012] Boundary segmentation words in the text sequence are determined according to text semantics of the text sequence.

[0013] Optionally, determining the boundary segmentation words in the text sequence according to the text semantics of the text sequence includes:

[0014] Performing semantic analysis on the text sequence to determine the semantic type corresponding to each word segment in the text sequence;

[0015] Grouping each segmentation word in the text sequence according to the semantic type, and determining that segmentations with the same semantic type belong to the same segmentation word group;

[0016] Determine the last participle in the participle group according to the position of each participle in the participle group in the text sequence;

[0017] The last participle in the text sequence is determined as a boundary participle.

[0018] Optionally, the splitting process of the text sequence according to the boundary segmentation words and the timestamps corresponding to the boundary segmentation words to generate a subtitle line file corresponding to the audio and video signal includes:

[0019] Splitting the text sequence according to the boundary segmentation to obtain subtitle line text corresponding to the audio and video signal;

[0020] Determine the start and end time of each subtitle line text according to the timestamp corresponding to the boundary segmentation word;

[0021] A subtitle line file corresponding to the audio and video signal is generated according to the subtitle line text and the start and end times corresponding to the subtitle line text.

[0022] Optionally, the splitting process of the text sequence according to the boundary segmentation to obtain the subtitle line text corresponding to the audio and video signal includes:

[0023] Determining whether there is a second boundary participle corresponding to the first boundary participle in the text sequence, wherein the second boundary participle is located before the first boundary participle;

[0024] If there is a second boundary segmentation word corresponding to the first boundary segmentation word in the text sequence, extracting each segmentation word between the first boundary segmentation word and the second boundary segmentation word from the text sequence, and merging each extracted segmentation word to obtain a subtitle line text corresponding to the text sequence;

[0025] If there is no second boundary segmentation word corresponding to the first boundary segmentation word in the text sequence, each segmentation word between the starting segmentation word of the text sequence and the first boundary segmentation word is extracted from the text sequence, and each extracted segmentation word is merged to obtain the subtitle line text corresponding to the text sequence.

[0026] Optionally, the method further comprises:

[0027] Merging the source language subtitle line texts contained in the subtitle line file to obtain sentences to be translated;

[0028] Translating the sentence to be translated to obtain a target language sentence;

[0029] Splitting the target language sentence to obtain target language subtitle line text, wherein the target language subtitle line text corresponds to the source language subtitle line text one by one;

[0030] A bilingual subtitle file of the audio and video signal is generated according to the subtitle line and the target subtitle line.

[0031] Optionally, the method further comprises:

[0032] Acquire a training sample set, wherein the training sample set includes a subtitle corpus and a boundary label corresponding to the subtitle corpus;

[0033] Inputting the subtitle corpus into a preset boundary detection model to perform boundary detection, and obtaining a detection result corresponding to the subtitle corpus;

[0034] The loss value of the preset boundary detection model is calculated based on the detection results and boundary labels corresponding to the subtitle corpus, and the model parameters of the preset boundary detection model are adjusted according to the loss value until a convergence condition is met to obtain a trained subtitle boundary detection model.

[0035] On the other hand, an embodiment of the present invention discloses a subtitle generating device, the device comprising:

[0036] A speech recognition module is used to perform speech recognition processing on the audio and video signals to be processed, and obtain a text sequence corresponding to the audio and video signals and a timestamp mapping table of the text sequence, wherein the timestamp mapping table includes timestamps corresponding to each word in the text sequence;

[0037] A boundary segmentation determination module, used for determining boundary segmentations in the text sequence;

[0038] The subtitle generation module is used to split the text sequence according to the boundary segmentation words and the timestamps corresponding to the boundary segmentation words to generate a subtitle line file corresponding to the audio and video signal.

[0039] Optionally, the boundary segmentation determination module includes:

[0040] A boundary detection submodule, used to determine the boundary labels of each word segment in the text sequence based on a preset boundary detection model or boundary detection rule, and determine the boundary word segment in the text sequence according to the boundary label; or

[0041] The semantic analysis submodule is used to determine the boundary segmentation words in the text sequence according to the text semantics of the text sequence.

[0042] Optionally, the semantic analysis submodule includes:

[0043] A semantic type determination unit, used to perform semantic analysis on the text sequence to determine the semantic type corresponding to each word segment in the text sequence;

[0044] A phrase determination unit, used to group each word in the text sequence according to the semantic type, and determine that the words with the same semantic type belong to the same word group;

[0045] A last participle determining unit, configured to determine the last participle in the participle group according to the position of each participle in the participle group in the text sequence;

[0046] The boundary segmentation determining unit is used to determine the last segmentation in the text sequence as a boundary segmentation.

[0047] Optionally, the subtitle generation module includes:

[0048] A boundary segmentation determination submodule, used to determine the boundary segmentation whose boundary label in the text sequence is identified as a subtitle boundary;

[0049] A subtitle line text determination submodule, used to split the text sequence according to the boundary segmentation to obtain the subtitle line text corresponding to the audio and video signal;

[0050] A start and end time determination submodule, used to determine the start and end time corresponding to each subtitle line text according to the timestamp corresponding to the boundary segmentation word;

[0051] The subtitle line generation submodule is used to generate a subtitle line file corresponding to the audio and video signal according to the subtitle line text and the start and end times corresponding to the subtitle line text.

[0052] Optionally, the subtitle line text determination submodule includes:

[0053] a boundary participle judging unit, configured to judge whether there is a second boundary participle corresponding to the first boundary participle in the text sequence, wherein the second boundary participle is located before the first boundary participle;

[0054] A first subtitle line text determination unit is configured to extract each segmentation word between the first boundary segmentation word and the second boundary segmentation word from the text sequence if a second boundary segmentation word corresponding to the first boundary segmentation word exists in the text sequence, and merge the extracted segmentation words to obtain a subtitle line text corresponding to the text sequence;

[0055] The second subtitle line text determination unit extracts each segmentation between the start segmentation of the text sequence and the first boundary segmentation from the text sequence if there is no second boundary segmentation corresponding to the first boundary segmentation in the text sequence, and merges the extracted segmentations to obtain the subtitle line text corresponding to the text sequence.

[0056] Optionally, the device further comprises:

[0057] A subtitle line merging module, used for merging the source language subtitle line texts contained in the subtitle line file to obtain sentences to be translated;

[0058] A translation processing module, used for translating the sentence to be translated to obtain a target language sentence;

[0059] A sentence splitting module, used for splitting the target language sentence to obtain target language subtitle line text, wherein the target language subtitle line text corresponds to the source language subtitle line text one by one;

[0060] A bilingual subtitle generation module is used to generate a bilingual subtitle file of the audio and video signal according to the subtitle line and the target subtitle line.

[0061] Optionally, the device further comprises:

[0062] A sample set acquisition module, used to acquire a training sample set, wherein the training sample set includes a subtitle corpus and a boundary label corresponding to the subtitle corpus;

[0063] A boundary detection module, used for inputting the subtitle corpus into a preset boundary detection model to perform boundary detection and obtain a detection result corresponding to the subtitle corpus;

[0064] The model adjustment module is used to calculate the loss value of the preset boundary detection model based on the detection results and boundary labels corresponding to the subtitle corpus, and adjust the model parameters of the preset boundary detection model according to the loss value until the convergence condition is met to obtain a trained subtitle boundary detection model.

[0065] On the other hand, an embodiment of the present invention discloses a device for generating subtitles, the device comprising a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, wherein the one or more programs include instructions for executing one or more of the subtitle generation methods described above.

[0066] In yet another aspect, an embodiment of the present invention discloses a machine-readable medium having instructions stored thereon, which, when executed by one or more processors, enables a device to perform one or more of the above-described subtitle generation methods.

[0067] The embodiments of the present invention include the following advantages:

[0068] The embodiment of the present invention performs speech recognition processing on the audio and video signal to be processed, obtains a text sequence corresponding to the audio and video signal and a timestamp mapping table of the text sequence, wherein the timestamp mapping table includes the timestamps corresponding to each word segment in the text sequence, and then determines the boundary word segment in the text sequence, splits the text sequence according to the boundary word segment and the timestamp corresponding to the boundary word segment, and generates a subtitle line file corresponding to the audio and video signal. In the process of generating the subtitle line file corresponding to the audio and video signal, the embodiment of the present invention performs speech recognition processing on the entire audio and video signal to be processed. Compared with the traditional method of dividing the audio and video signal into multiple voice segments according to the silent segment, and then performing speech recognition processing on each voice segment, the embodiment of the present invention can ensure the semantic integrity of the speech recognition object, which is conducive to improving the accuracy and fluency of speech recognition, thereby improving the accuracy and fluency of the generated subtitle line file; and after the embodiment of the present invention determines the text sequence corresponding to the audio and video signal through speech recognition, it further determines the boundary word segment in the text sequence, and generates the subtitle line file based on the boundary word segment and the timestamp corresponding to the boundary word segment, further ensuring the semantic integrity and rationality of the generated subtitle line file, which is convenient for users to understand the audio and video content. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0070] Figure 1 is a flowchart of a subtitle generation method embodiment of the present invention;

[0071] Figure 2 is a structural block diagram of an embodiment of a subtitle generating device of the present invention;

[0072] Figure 3 is a block diagram of an apparatus 800 for generating subtitles according to the present invention;

[0073] Figure 4 It is a schematic diagram of the structure of the server in some embodiments of the present invention. DETAILED DESCRIPTION

[0074] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. 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.

[0075] Method Embodiment

[0076] Reference Figure 1 , shows a flowchart of a subtitle generation method embodiment of the present invention, the method may specifically include the following steps:

[0077] Step 101: Perform speech recognition processing on the audio and video signals to be processed to obtain a text sequence corresponding to the audio and video signals and a timestamp mapping table of the text sequence, wherein the timestamp mapping table includes timestamps corresponding to each word in the text sequence.

[0078] Step 102: Determine boundary segmentation words in the text sequence.

[0079] Step 103: split the text sequence according to the boundary segmentation words and the timestamps corresponding to the boundary segmentation words to generate a subtitle line file corresponding to the audio and video signal.

[0080] It should be noted that the subtitle generation method provided in the embodiment of the present invention can be applied to real-time scenarios such as live video, video chat, and games, and can also be applied to non-real-time scenarios. For example, a corresponding subtitle line file can be generated for the audio and video files of the recording number.

[0081] The subtitle generation method provided in the embodiment of the present invention can be applied to an audio and video processing device with subtitle generation capability, and the audio and video processing device can be a terminal device or a server. The terminal device can be, for example, an intelligent terminal, a computer, a personal digital assistant (PDA), a tablet computer, etc.

[0082] If the audio and video processing device is a server, the server can be an independent server or a cluster server. When the server obtains the subtitle text using the subtitle generation method, the subtitle text is displayed on the user's corresponding terminal device as the subtitle of the corresponding audio and video stream time axis interval, thereby realizing the real-time display of subtitle line text during the live video broadcast.

[0083] The audio and video signals to be processed may be audio and video signals generated based on real-time scenes, or audio signals corresponding to determined audio and video files, such as recorded or downloaded audio and video files. The audio and video signals to be processed include voices emitted by characters, which may be the live broadcaster speaking in a live broadcast scene, or audio files including character voices played, such as recordings, songs, etc.

[0084] In the embodiment of the present invention, the text sequence can be identified based on the language in the audio and video signal to be processed, but the subtitle line file finally generated is not limited to the language in the audio and video signal. The language of the subtitle line file finally generated can be determined based on user needs, and can be the language in the audio and video signal, or other languages, or can include multiple languages. For example, if the text sequence is in English, then the subtitle line file finally generated can be English subtitles, Chinese subtitles, or Chinese and English subtitles, etc.

[0085] The timestamp mapping table of the text sequence contains the timestamp corresponding to each word segment in the text sequence. It should be noted that the word segment in the text sequence is a collective term for words and phrases, including words (including single words and compound words) and phrases (also known as phrases), which are the smallest word group structure units that make up sentences and articles. If the language of the text sequence is Chinese, the word segment can be a character, word, phrase, etc.; if the language of the text sequence is English, the word segment can be an English word, etc.

[0086] In the embodiment of the present invention, when generating the subtitle line corresponding to the audio and video signal, the entire audio and video signal to be processed is firstly subjected to speech recognition processing to obtain the text sequence corresponding to the audio and video signal and the timestamp mapping table of the text sequence. Among them, a speech recognition model can be used to perform speech recognition processing on the audio and video signal to be processed.

[0087] After obtaining the text sequence corresponding to the audio and video signal, the boundary segmentation words in the text sequence are further determined so as to segment the text sequence based on the boundary segmentation words and generate the subtitle lines corresponding to the audio and video signal. Specifically, the boundary label corresponding to the text sequence can be determined based on the pre-trained boundary detection model, and the segmentation words whose boundary labels in the text sequence are marked as subtitle boundaries can be determined as boundary segmentation words; or the semantic type of each segmentation word in the text sequence can be determined by performing semantic analysis on the text sequence, and the boundary segmentation words can be determined based on the segmentation word type.

[0088] Finally, according to the timestamp mapping table of the text sequence, the boundary segmentation in the text sequence and the timestamp corresponding to the boundary segmentation, a subtitle line file corresponding to the audio and video signal is generated. Specifically, the determined boundary segmentation can be used as the left boundary or right boundary of the subtitle line text to be generated, each subtitle line text contains a boundary segmentation, and the start and end time corresponding to the subtitle line text is determined based on the timestamp of the boundary segmentation.

[0089] It should be noted that in the traditional subtitle generation method, the audio and video signals are mainly processed according to the silent segments to generate subtitles. The silent segments can reflect the pauses between sentences when the speaker is expressing to a certain extent, but different speakers have different expression habits. Some speakers may have pauses in a sentence. For example, in the sentence "I was followed today and had no place to go, so I had to come to your house", due to the speaker's expression habits or the need to think when expressing a sentence, there is an expression pause between "forced" and "had to".

[0090] If segmentation is performed by silent segments, the audio signal corresponding to "I was followed today and I really have nowhere to go" may be segmented into a voice segment, and the audio signal corresponding to "I had no choice but to come to your house" may be segmented into a voice segment, and then speech recognition is performed on each voice segment and the corresponding subtitle line is generated, so that "I was followed today and I really have nowhere to go" will be used as one subtitle line, and "I had no choice but to come to your house" will be used as another subtitle line. When the subtitles are displayed, the user first sees the subtitle "I was followed today and I really have no place to go", and then sees the subtitle line "I had no choice but to come to your house", which may affect the user's understanding and cause a bad experience. In addition, when performing speech recognition based on the segmented voice segments, since the voice segments are not complete, it is easy to cause inaccurate recognition results, and the subtitle lines generated based on the speech recognition results are naturally inaccurate.

[0091] Compared with the traditional subtitle generation method, the embodiment of the present invention does not segment the audio and video signals to be processed, but performs speech recognition on the audio and video signals as a whole, which can ensure the semantic integrity of the speech recognition object, which is conducive to improving the accuracy and fluency of speech recognition, thereby improving the accuracy and fluency of the generated subtitle lines; and, after the embodiment of the present invention determines the text sequence corresponding to the audio and video signal through speech recognition, it further determines the boundary segmentation in the text sequence, and generates a subtitle line file based on the boundary segmentation and the timestamp of the boundary segmentation, further ensuring the rationality of the generated subtitle line file, and facilitating users to understand the audio and video content.

[0092] In an optional embodiment of the present invention, the step 102 of determining boundary segmentation words in the text sequence includes:

[0093] Step S11: Determine the boundary labels of each word segment in the text sequence based on a preset boundary detection model or boundary detection rules, and determine the boundary word segments in the text sequence according to the boundary labels; or,

[0094] Step S12: Determine the boundary word segments in the text sequence according to the text semantics of the text sequence.

[0095] In the embodiments of the present invention, the boundary labels of each word segment in the text sequence can be determined based on a boundary detection model, and the word segments with boundary labels marked as subtitle boundaries are determined as boundary word segments. For example, assume that the boundary labels include two types, "True" and "False", where "True" is used to indicate that the corresponding word segment is a subtitle boundary, and "False" is used to indicate that the corresponding word segment is not a subtitle boundary. For the text sequence "你怎么进来的我今天被人跟踪实在没地方可去迫不得已才来你家的" (How did you get in? I was followed today. I really had nowhere to go and had to come to your house.), the boundary labels corresponding to the word segments "的", "跟踪", "去", "你家的" are all "True", then it can be determined that the word segments "的", "跟踪", "去", "你家的" are all boundary word segments. Based on these boundary word segments, the finally generated subtitle lines are respectively:

[0096] Subtitle line 1: 你怎么进来的 (How did you get in?)

[0097] Subtitle line 2: 我今天被人跟踪 (I was followed today.)

[0098] Subtitle line 3: 实在没地方可去 (I really had nowhere to go)

[0099] Subtitle line 4: 迫不得已才来你家的 (I had to come to your house.)

[0100] Then, based on the timestamp mapping table, determine the timestamps corresponding to the first word segment and the last word segment of subtitle lines 1 to 4 respectively, and further determine the start and end times of each subtitle line. After generating the subtitle lines, the corresponding subtitle lines can be displayed to the user according to the start and end times of the subtitle lines during the audio-video playback, facilitating the user to understand the audio-video content.

[0101] Among them, before determining the boundary labels corresponding to the text sequence based on the pre-trained boundary detection model, the boundary detection model can be first constructed based on the neural network, and then a large amount of annotated corpus can be used to train the constructed boundary detection model; or when the corpus is insufficient, the subtitle corpus can be used to iteratively train the sequence annotation target on the basis of the general sequence annotation model, adjust the model parameters, and obtain a sequence annotation model that meets the convergence conditions, and use the sequence annotation model that meets the convergence conditions as the boundary detection model in the embodiment of the present invention. Among them, the sequence annotation model can use the BERT (Bidirectional Encoder Representations from Transformers, a bidirectional encoder based on a multi-layer attention mechanism) model, or other neural network models that are good at sequence annotation.

[0102] In addition to determining the boundary labels of the text sequence based on the boundary detection model, the boundary detection rules can also be pre-set, and then the boundary labels corresponding to each word segment in the text sequence can be determined based on the pre-set boundary detection rules. For example, the boundary detection rules are set according to punctuation, word count, duration, etc., and the boundary labels corresponding to each word segment in the text sequence are determined. However, the boundary labels of each word segment in the text sequence determined based on the pre-set boundary detection rules are often unable to flexibly meet the needs of different scenarios, and the generalization ability is poor. If the boundary detection rules are set based on the word count, duration, etc., the generated subtitle lines often cannot contain complete semantics, which is not conducive to the user's understanding of the audio and video content. Therefore, in practical applications, the method based on the boundary detection model or the semantic analysis method to determine the boundary labels of the text sequence can better meet the diversified scenario requirements, and there is no need to set different boundary detection rules according to different scenarios, which is conducive to improving the efficiency of determining boundary labels and improving the generation effect of subtitle lines.

[0103] In addition, the boundary segmentation words in the text sequence can also be determined by performing semantic segmentation on the text sequence. In an optional embodiment of the present invention, the step S12 of determining the boundary segmentation words in the text sequence according to the text semantics of the text sequence includes:

[0104] Sub-step S121, performing semantic analysis on the text sequence to determine the semantic type corresponding to each word segment in the text sequence;

[0105] Sub-step S122, grouping each segmentation in the text sequence according to the semantic type, and determining that segmentations with the same semantic type belong to the same segmentation group;

[0106] Sub-step S123, determining the last participle in the participle group according to the position of each participle in the participle group in the text sequence;

[0107] Sub-step S124: determining the last participle in the text sequence as a boundary participle.

[0108] When determining the boundary labels corresponding to each analysis in a text sequence based on semantic analysis, the semantic types corresponding to each word in the text sequence can be determined in sequence, and the word segments expressing the same complete semantics correspond to the same semantic type. Then, the word segments in the text sequence are grouped according to the semantic type, so that the word segments expressing the same complete semantics belong to a word segment group, that is, a word segment group corresponds to a semantic type, and each word segment in a word segment group can express a complete semantics.

[0109] According to the position of each word in each word group in the text sequence, the last word of the word group can be determined. One word group corresponds to one last word, and the number of last words in the text sequence is the same as the number of word groups corresponding to the text sequence. Each last word in the text sequence is determined as a boundary word. According to the boundary word, the subtitle line text corresponding to the text sequence can be determined. Among them, each subtitle line text contains a boundary word, and the last word in step S123 is the right boundary of the subtitle line.

[0110] Of course, the first segmented word in the segmented word group can also be determined according to the position of each segmented word in the text sequence, and the boundary label corresponding to the first analysis in the text sequence is marked as the subtitle boundary. Among them, the first segmented word is the left boundary of the subtitle line.

[0111] In an optional embodiment of the present invention, the step 103 of splitting the text sequence according to the boundary segmentation words and the timestamps corresponding to the boundary segmentation words to generate a subtitle line file corresponding to the audio and video signal includes:

[0112] Step S21, splitting the text sequence according to the boundary segmentation to obtain subtitle line text corresponding to the audio and video signal;

[0113] Step S22, determining the start and end time corresponding to each subtitle line text according to the timestamp corresponding to the boundary segmentation;

[0114] Step S23: Generate a subtitle line file corresponding to the audio and video signal according to the subtitle line text and the start and end times corresponding to the subtitle line text.

[0115] The boundary segmentation may be the last segmentation determined in sub-steps S121 to S124, or the first segmentation of each segmentation group, or a boundary segmentation identified as a subtitle boundary by a boundary label determined based on a boundary detection model.

[0116] In an embodiment of the present invention, a subtitle line file includes subtitle line text and the start and end times corresponding to the subtitle line text. The text sequence can be split into multiple subtitle line texts according to the boundary segmentation. Then, the start and end times of each subtitle line text can be determined based on the timestamp of the boundary segmentation. When playing the audio and video signal, the subtitle line text is displayed according to the start and end times of the subtitle line text so that the user can understand the expression content of the audio and video signal.

[0117] In an optional embodiment of the present invention, the step S21 of splitting the text sequence according to the boundary segmentation to obtain the subtitle line text corresponding to the audio and video signal includes:

[0118] Sub-step S211, determining whether there is a second boundary participle corresponding to the first boundary participle in the text sequence, wherein the second boundary participle is located before the first boundary participle;

[0119] Sub-step S212: if there is a second boundary segmentation word corresponding to the first boundary segmentation word in the text sequence, extracting each segmentation word between the first boundary segmentation word and the second boundary segmentation word from the text sequence, and merging each extracted segmentation word to obtain a subtitle line text corresponding to the text sequence;

[0120] Sub-step S213: If there is no second boundary participle corresponding to the first boundary participle in the text sequence, extract the participles between the starting participle of the text sequence and the first boundary participle from the text sequence, and merge the extracted participles to obtain the subtitle line text corresponding to the text sequence.

[0121] In the embodiment of the present invention, according to the boundary segmentation determination rule, the boundary segmentation can be the right boundary of the subtitle line or the left boundary of the subtitle line. For example, if the boundary segmentation is determined according to substeps S121 to S124, the boundary segmentation is the right boundary of the subtitle line; if the first segmentation in each segmentation group is determined as the boundary segmentation, the boundary segmentation finally determined is the left boundary of the subtitle line.

[0122] Taking the boundary segmentation as the right boundary of the subtitle line as an example, the text sequence contains two types of boundary segmentations: those with a corresponding second boundary segmentation and those without a corresponding second boundary segmentation. Assuming that boundary segmentation A has a corresponding second boundary segmentation, recorded as boundary segmentation B, each segmentation between boundary segmentation B and boundary segmentation A is extracted from the text sequence, and then each extracted segmentation is merged according to the position of each segmentation in the text sequence, and the subtitle line text corresponding to boundary segmentation A can be obtained. Among them, the extracted segmentation contains boundary segmentation A but does not contain boundary segmentation B, that is, the boundary segmentation corresponds to the subtitle line text one by one, and the subtitle line text corresponding to boundary segmentation A only contains boundary segmentation A.

[0123] Assuming that there is no second boundary segmentation corresponding to boundary segmentation A, there are also two cases: 1) there is only one boundary segmentation A in the text sequence, and no other boundary segmentation; 2) there are at least two boundary segmentations in the text sequence, but boundary segmentation A is the first boundary segmentation in the text sequence. In the case where there is only one boundary segmentation in the text sequence, the text sequence can be directly used as the subtitle line text; in the case where there are at least two boundary segmentations in the text sequence, each segmentation between the starting segmentation of the text sequence and boundary segmentation A is extracted from the text sequence, and each extracted segmentation is merged according to the position of each segmentation in the text sequence, and the subtitle line text corresponding to boundary segmentation A can be obtained.

[0124] If the determined boundary segmentation word is the left boundary of the subtitle line, it is also determined whether there is a fourth boundary segmentation word corresponding to the third boundary segmentation word in the text sequence, and the fourth boundary segmentation word is located after the third boundary segmentation word; if there is a fourth boundary segmentation word corresponding to the third boundary segmentation word in the text sequence, each segmentation word between the third boundary segmentation word and the fourth boundary segmentation word is extracted from the text sequence, and each extracted segmentation word is merged to obtain the subtitle line text corresponding to the third boundary segmentation word; if there is no fourth boundary segmentation word corresponding to the third boundary segmentation word in the text sequence, each segmentation word between the third boundary segmentation word and the last segmentation word of the text sequence is extracted from the text sequence, and each extracted segmentation word is merged to obtain the subtitle line text corresponding to the third boundary segmentation word.

[0125] In an embodiment of the present invention, boundary segmentation is used as the basis for splitting a text sequence. Since boundary segmentation is determined by semantic analysis of the text sequence or boundary detection of the text sequence based on a boundary detection model, the segmentation between boundary segmentations can reflect reasonable semantics. Therefore, by splitting the text sequence through boundary segmentation to obtain subtitle line text, the possibility of incomplete sentences appearing in the subtitle line text can be reduced, which is conducive to helping users understand the audio and video content.

[0126] In an optional embodiment of the present invention, the method further includes:

[0127] Step S31, merging the source language subtitle line texts contained in the subtitle line file to obtain sentences to be translated;

[0128] Step S32, translating the sentence to be translated to obtain a target language sentence;

[0129] Step S33, splitting the target language sentence to obtain target language subtitle line text, wherein the target language subtitle line text corresponds to the source language subtitle line text one by one;

[0130] Step S34: Generate a bilingual subtitle file of the audio and video signal according to the subtitle line and the target subtitle line.

[0131] In the embodiment of the present invention, if the generated subtitle line text is in a single language, the subtitle line text may be further translated to generate a bilingual subtitle file corresponding to the audio and video signal.

[0132] Since in the embodiment of the present invention, the source language subtitle line text in the subtitle line file is based on the semantic recognition result of the audio and video signal, that is, the short sentence obtained by splitting the text sequence, a single source language subtitle line text often has a semantic association relationship with other source language subtitle line texts. If the source language subtitle line text is directly translated to obtain the target language subtitle line text corresponding to the source language subtitle line text, the accuracy of the translation result obtained is not high, and the coherence between the target language subtitle line texts is not high, which is not conducive to the user's understanding of the audio and video content. Therefore, in order to ensure the accuracy and coherence of the translation result, when the audio and video signal contains less voice information, the voice recognition result of the audio and video signal, that is, the text sequence, can be directly translated to obtain the target sentence. When the audio and video signal contains more voice information, while ensuring the accuracy and coherence of the translation result, in order to improve the translation efficiency, the source language subtitle line text of the audio and video signal can be merged to obtain the sentence to be translated, and the sentence to be translated is translated to obtain the target language sentence. Among them, the sentence to be translated is a whole sentence, containing complete semantics.

[0133] When finally presenting the subtitle line of the audio and video signal, it is necessary to ensure that the source language subtitle line text is aligned with the target language subtitle line text. Therefore, in the embodiment of the present invention, after obtaining the target language sentence, the target language sentence is further split and processed to obtain the target language subtitle line text aligned with the source language subtitle line text. It should be noted that, since it is necessary to ensure the synchronous output of the source language subtitle line text and the target language subtitle line text when presenting the subtitle line corresponding to the audio and video signal, the start and end time of the source language subtitle line text can be directly used as the start and end time of the target language subtitle line text.

[0134] Finally, according to the source language subtitle line text, the target language subtitle line text and the start and end time of the source language subtitle line text generated in the embodiment of the present invention, a bilingual subtitle file corresponding to the audio and video signal can be generated.

[0135] In an optional embodiment of the present invention, the method further includes:

[0136] Step S41, obtaining a training sample set, wherein the training sample set includes a subtitle corpus and boundary labels corresponding to the subtitle corpus;

[0137] Step S42: input the subtitle corpus into a preset boundary detection model to perform boundary detection, and obtain a detection result corresponding to the subtitle corpus;

[0138] Step S43: Calculate the loss value of the preset boundary detection model based on the detection results and boundary labels corresponding to the subtitle corpus, and adjust the model parameters of the preset boundary detection model according to the loss value until the convergence condition is met to obtain a trained subtitle boundary detection model.

[0139] In an embodiment of the present invention, in order to improve the training efficiency of the boundary detection model, the model parameters of the preset boundary detection model can be adjusted based on the acquired training sample set to obtain a boundary detection model that meets the requirements of the embodiment of the present invention. Among them, the preset boundary detection model can use the BERT model, or other neural network models that are good at sequence labeling. In specific implementation, the various parameters of the preset boundary detection model can be initialized first, and the loss value of the boundary detection model is calculated based on the detection results of the subtitle corpus and the boundary labels of the subtitle corpus in the training sample set in each round of training, and the gradient of the node in the boundary detection model is calculated based on the loss value, and then the model parameters of the corresponding node in the boundary detection model are adjusted according to the gradient. After the parameters are adjusted, the next round of training is entered until the loss value meets the convergence condition to obtain a trained boundary detection model.

[0140] Determining the boundary labels of text sequences based on the trained boundary detection model can better meet the needs of diversified scenarios. There is no need to set different boundary detection rules according to different scenarios, which is conducive to improving the efficiency of determining boundary labels and improving the generation effect of subtitle lines.

[0141] In summary, in the process of generating subtitle lines corresponding to audio and video signals, the embodiments of the present invention perform speech recognition processing on the entire audio and video signal to be processed. Compared with the traditional method of dividing the audio and video signal into multiple voice segments according to the silent segments, and then performing speech recognition on each voice segment to obtain the subtitles corresponding to the voice segment, the embodiments of the present invention can ensure the semantic integrity of the voice recognition object, which is conducive to improving the accuracy and fluency of speech recognition, thereby improving the accuracy and fluency of the generated subtitle line file; and, after the embodiments of the present invention determine the text sequence corresponding to the audio and video signal through speech recognition, the boundary segmentation in the text sequence is further determined, and the subtitle line file is generated based on the boundary segmentation and the timestamp corresponding to the boundary segmentation, so as to further ensure the rationality of the generated subtitle line file and facilitate users to understand the audio and video content.

[0142] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0143] Device Embodiment

[0144] Reference Figure 2 , shows a structural block diagram of an embodiment of a subtitle generating device of the present invention, the device may include:

[0145] The speech recognition module 201 is used to perform speech recognition processing on the audio and video signals to be processed, and obtain a text sequence corresponding to the audio and video signals and a timestamp mapping table of the text sequence, wherein the timestamp mapping table includes timestamps corresponding to each word in the text sequence;

[0146] A boundary segmentation determination module 202, used to determine boundary segmentations in the text sequence;

[0147] The subtitle generation module 203 is used to split the text sequence according to the boundary segmentation words and the timestamps corresponding to the boundary segmentation words to generate a subtitle line file corresponding to the audio and video signal.

[0148] Optionally, the boundary segmentation determination module includes:

[0149] A boundary detection submodule, used to determine the boundary labels of each word segment in the text sequence based on a preset boundary detection model or boundary detection rule, and determine the boundary word segment in the text sequence according to the boundary label; or

[0150] The semantic analysis submodule is used to determine the boundary segmentation words in the text sequence according to the text semantics of the text sequence.

[0151] Optionally, the semantic analysis submodule includes:

[0152] A semantic type determination unit, used to perform semantic analysis on the text sequence to determine the semantic type corresponding to each word segment in the text sequence;

[0153] A phrase determination unit, used to group each word in the text sequence according to the semantic type, and determine that the words with the same semantic type belong to the same word group;

[0154] A last participle determining unit, configured to determine the last participle in the participle group according to the position of each participle in the participle group in the text sequence;

[0155] The boundary segmentation determining unit is used to determine the last segmentation in the text sequence as a boundary segmentation.

[0156] Optionally, the subtitle generation module includes:

[0157] A subtitle line text determination submodule, used to split the text sequence according to the boundary segmentation to obtain the subtitle line text corresponding to the audio and video signal;

[0158] A start and end time determination submodule, used to determine the start and end time corresponding to each subtitle line text according to the timestamp corresponding to the boundary segmentation word;

[0159] The subtitle line generation submodule is used to generate a subtitle line file corresponding to the audio and video signal according to the subtitle line text and the start and end times corresponding to the subtitle line text.

[0160] Optionally, the subtitle line text determination submodule includes:

[0161] a boundary participle judging unit, configured to judge whether there is a second boundary participle corresponding to the first boundary participle in the text sequence, wherein the second boundary participle is located before the first boundary participle;

[0162] A first subtitle line text determination unit is configured to extract each segmentation word between the first boundary segmentation word and the second boundary segmentation word from the text sequence if a second boundary segmentation word corresponding to the first boundary segmentation word exists in the text sequence, and merge the extracted segmentation words to obtain a subtitle line text corresponding to the text sequence;

[0163] The second subtitle line text determination unit extracts each segmentation between the start segmentation of the text sequence and the first boundary segmentation from the text sequence if there is no second boundary segmentation corresponding to the first boundary segmentation in the text sequence, and merges the extracted segmentations to obtain the subtitle line text corresponding to the text sequence.

[0164] Optionally, the device further comprises:

[0165] A subtitle line merging module, used for merging the source language subtitle line texts contained in the subtitle line file to obtain sentences to be translated;

[0166] A translation processing module, used for translating the sentence to be translated to obtain a target language sentence;

[0167] A sentence splitting module, used for splitting the target language sentence to obtain target language subtitle line text, wherein the target language subtitle line text corresponds to the source language subtitle line text one by one;

[0168] A bilingual subtitle generation module is used to generate a bilingual subtitle file of the audio and video signal according to the subtitle line and the target subtitle line.

[0169] Optionally, the device further comprises:

[0170] A sample set acquisition module, used to acquire a training sample set, wherein the training sample set includes a subtitle corpus and a boundary label corresponding to the subtitle corpus;

[0171] A boundary detection module, used for inputting the subtitle corpus into a preset boundary detection model to perform boundary detection and obtain a detection result corresponding to the subtitle corpus;

[0172] The model adjustment module is used to calculate the loss value of the preset boundary detection model based on the detection results and boundary labels corresponding to the subtitle corpus, and adjust the model parameters of the preset boundary detection model according to the loss value until the convergence condition is met to obtain a trained subtitle boundary detection model.

[0173] In summary, in the process of generating subtitle lines corresponding to audio and video signals, the embodiments of the present invention perform speech recognition processing on the entire audio and video signal to be processed. Compared with the traditional method of dividing the audio and video signal into multiple voice segments according to the silent segments, and then performing speech recognition on each voice segment to obtain the subtitles corresponding to the voice segment, the embodiments of the present invention can ensure the semantic integrity of the voice recognition object, which is conducive to improving the accuracy and fluency of speech recognition, thereby improving the accuracy and fluency of the generated subtitle line file; and, after the embodiments of the present invention determine the text sequence corresponding to the audio and video signal through speech recognition, the boundary segmentation in the text sequence is further determined, and the subtitle line file is generated based on the boundary segmentation and the timestamp corresponding to the boundary segmentation, so as to further ensure the rationality of the generated subtitle line file and facilitate users to understand the audio and video content.

[0174] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0175] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0176] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0177] An embodiment of the present invention provides a device for generating subtitles, the device comprising a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors. The one or more programs include instructions for performing the following operations:

[0178] A11, performing speech recognition processing on the audio and video signal to be processed, obtaining a text sequence corresponding to the audio and video signal and a timestamp mapping table of the text sequence, wherein the timestamp mapping table includes timestamps corresponding to each word in the text sequence;

[0179] A12. Determine boundary segmentation words in the text sequence;

[0180] A13. Split the text sequence according to the boundary segmentation words and the timestamps corresponding to the boundary segmentation words to generate a subtitle line file corresponding to the audio and video signal.

[0181] Optionally, determining a boundary segmentation word in the text sequence includes:

[0182] Determine the boundary label of each word segment in the text sequence based on a preset boundary detection model or boundary detection rule, and determine the boundary word segment in the text sequence according to the boundary label; or

[0183] Boundary segmentation words in the text sequence are determined according to text semantics of the text sequence.

[0184] Optionally, determining the boundary segmentation words in the text sequence according to the text semantics of the text sequence includes:

[0185] Performing semantic analysis on the text sequence to determine the semantic type corresponding to each word segment in the text sequence;

[0186] Grouping each segmentation word in the text sequence according to the semantic type, and determining that segmentations with the same semantic type belong to the same segmentation word group;

[0187] Determine the last participle in the participle group according to the position of each participle in the participle group in the text sequence;

[0188] The last participle in the text sequence is determined as a boundary participle.

[0189] Optionally, the splitting process of the text sequence according to the boundary segmentation words and the timestamps corresponding to the boundary segmentation words to generate a subtitle line file corresponding to the audio and video signal includes:

[0190] Splitting the text sequence according to the boundary segmentation to obtain subtitle line text corresponding to the audio and video signal;

[0191] Determine the start and end time of each subtitle line text according to the timestamp corresponding to the boundary segmentation word;

[0192] A subtitle line file corresponding to the audio and video signal is generated according to the subtitle line text and the start and end times corresponding to the subtitle line text.

[0193] Optionally, the splitting process of the text sequence according to the boundary segmentation to obtain the subtitle line text corresponding to the audio and video signal includes:

[0194] Determining whether there is a second boundary participle corresponding to the first boundary participle in the text sequence, wherein the second boundary participle is located before the first boundary participle;

[0195] If there is a second boundary segmentation word corresponding to the first boundary segmentation word in the text sequence, extracting each segmentation word between the first boundary segmentation word and the second boundary segmentation word from the text sequence, and merging each extracted segmentation word to obtain a subtitle line text corresponding to the text sequence;

[0196] If there is no second boundary segmentation word corresponding to the first boundary segmentation word in the text sequence, each segmentation word between the starting segmentation word of the text sequence and the first boundary segmentation word is extracted from the text sequence, and each extracted segmentation word is merged to obtain the subtitle line text corresponding to the text sequence.

[0197] Optionally, the device is further configured to execute, by one or more processors, the one or more programs including instructions for performing the following operations:

[0198] Merging the source language subtitle line texts contained in the subtitle line file to obtain sentences to be translated;

[0199] Translating the sentence to be translated to obtain a target language sentence;

[0200] Splitting the target language sentence to obtain target language subtitle line text, wherein the target language subtitle line text corresponds to the source language subtitle line text one by one;

[0201] A bilingual subtitle file of the audio and video signal is generated according to the subtitle line and the target subtitle line.

[0202] Optionally, the device is further configured to execute, by one or more processors, the one or more programs including instructions for performing the following operations:

[0203] Acquire a training sample set, wherein the training sample set includes a subtitle corpus and a boundary label corresponding to the subtitle corpus;

[0204] Inputting the subtitle corpus into a preset boundary detection model to perform boundary detection, and obtaining a detection result corresponding to the subtitle corpus;

[0205] The loss value of the preset boundary detection model is calculated based on the detection results and boundary labels corresponding to the subtitle corpus, and the model parameters of the preset boundary detection model are adjusted according to the loss value until a convergence condition is met to obtain a trained subtitle boundary detection model.

[0206] Figure 3 8 is a block diagram of an apparatus 800 for generating subtitles according to an exemplary embodiment. For example, the apparatus 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0207] Reference Figure 3, the device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .

[0208] The processing component 802 generally controls the overall operation of the device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0209] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0210] The power supply component 806 provides power to the various components of the device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.

[0211] The multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0212] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the device 800 is in an operating mode, such as a call mode, a recording mode, and a voice information processing mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.

[0213] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.

[0214] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the device 800, the sensor assembly 814 can also detect the position change of the voice processing device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration / deceleration of the device 800, and the temperature change of the device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0215] The communication component 816 is configured to facilitate wired or wireless communication between the device 800 and other devices. The device 800 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency information processing (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0216] In an exemplary embodiment, the apparatus 800 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.

[0217] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by the processor 820 of the device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0218] Figure 4 1 is a schematic diagram of the structure of the server in some embodiments of the present invention. The server 1900 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1922 (for example, one or more processors) and memory 1932, and one or more storage media 1930 (for example, one or more mass storage devices) storing application programs 1942 or data 1944. Among them, the memory 1932 and the storage medium 1930 can be short-term storage or permanent storage. The program stored in the storage medium 1930 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the server. Furthermore, the central processing unit 1922 can be configured to communicate with the storage medium 1930 and execute a series of instruction operations in the storage medium 1930 on the server 1900.

[0219] The server 1900 may also include one or more power supplies 1926, one or more wired or wireless network interfaces 1950, one or more input and output interfaces 1958, one or more keyboards 1956, and / or, one or more operating systems 1941, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0220] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of a device (server or terminal), enables the device to perform Figure 1 The subtitle generation method shown.

[0221] A non-temporary computer-readable storage medium, when the instructions in the storage medium are executed by a processor of a device (server or terminal), enables the device to execute a subtitle generation method, the method comprising: performing speech recognition processing on an audio and video signal to be processed, obtaining a text sequence corresponding to the audio and video signal and a timestamp mapping table of the text sequence, the timestamp mapping table including timestamps corresponding to each word segment in the text sequence; determining boundary word segments in the text sequence; splitting the text sequence according to the boundary word segments and the timestamps corresponding to the boundary word segments, and generating a subtitle line file corresponding to the audio and video signal.

[0222] Those skilled in the art will readily appreciate other embodiments of the invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in this disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.

[0223] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

[0224] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

[0225] The above is a detailed introduction to a subtitle generating method, a subtitle generating device and a device for generating subtitles provided by the present invention. Specific examples are used in this article to illustrate the principle and implementation mode of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation mode and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A subtitle generation method, characterized in that: The method comprises: Perform speech recognition processing on the audio and video signals to be processed to obtain a text sequence corresponding to the audio and video signals and a timestamp mapping table of the text sequence, wherein the timestamp mapping table includes timestamps corresponding to each word in the text sequence; Determining boundary segmentations in the text sequence; Splitting the text sequence according to the boundary segmentation words and the timestamps corresponding to the boundary segmentation words to generate a subtitle line file corresponding to the audio and video signal; wherein, based on a preset boundary detection model or boundary detection rule, the boundary labels of each word segment in the text sequence are determined, and the boundary word segment in the text sequence is determined according to the boundary labels; or, Boundary segmentation words in the text sequence are determined according to text semantics of the text sequence.

2. The method according to claim 1, characterized in that The step of determining the boundary segmentation words in the text sequence according to the text semantics of the text sequence includes: Performing semantic analysis on the text sequence to determine the semantic type corresponding to each word segment in the text sequence; Grouping each segmentation word in the text sequence according to the semantic type, and determining that segmentations with the same semantic type belong to the same segmentation word group; Determine the last participle in the participle group according to the position of each participle in the participle group in the text sequence; The last participle in the text sequence is determined as a boundary participle.

3. The method according to claim 1, characterized in that The step of splitting the text sequence according to the boundary segmentation words and the timestamps corresponding to the boundary segmentation words to generate a subtitle line file corresponding to the audio and video signal includes: Splitting the text sequence according to the boundary segmentation to obtain subtitle line text corresponding to the audio and video signal; Determine the start and end time of each subtitle line text according to the timestamp corresponding to the boundary segmentation word; A subtitle line file corresponding to the audio and video signal is generated according to the subtitle line text and the start and end times corresponding to the subtitle line text.

4. The method according to claim 3, characterized in that: The step of splitting the text sequence according to the boundary segmentation to obtain the subtitle line text corresponding to the audio and video signal includes: Determining whether there is a second boundary participle corresponding to the first boundary participle in the text sequence, wherein the second boundary participle is located before the first boundary participle; If there is a second boundary segmentation word corresponding to the first boundary segmentation word in the text sequence, extracting each segmentation word between the first boundary segmentation word and the second boundary segmentation word from the text sequence, and merging each extracted segmentation word to obtain a subtitle line text corresponding to the text sequence; If there is no second boundary segmentation word corresponding to the first boundary segmentation word in the text sequence, each segmentation word between the starting segmentation word of the text sequence and the first boundary segmentation word is extracted from the text sequence, and each extracted segmentation word is merged to obtain the subtitle line text corresponding to the text sequence.

5. The method according to claim 1, characterized in that The method further comprises: Merging the source language subtitle line texts contained in the subtitle line file to obtain sentences to be translated; Translating the sentence to be translated to obtain a target language sentence; Splitting the target language sentence to obtain target language subtitle line text, wherein the target language subtitle line text corresponds to the source language subtitle line text one by one; A bilingual subtitle file of the audio and video signal is generated according to the source language subtitle line text, the target language subtitle line text, and the start and end time of the source language subtitle line text.

6. The method according to claim 1, characterized in that The method further comprises: Acquire a training sample set, wherein the training sample set includes a subtitle corpus and a boundary label corresponding to the subtitle corpus; Inputting the subtitle corpus into a preset boundary detection model to perform boundary detection, and obtaining a detection result corresponding to the subtitle corpus; The loss value of the preset boundary detection model is calculated based on the detection results and boundary labels corresponding to the subtitle corpus, and the model parameters of the preset boundary detection model are adjusted according to the loss value until a convergence condition is met to obtain a trained subtitle boundary detection model.

7. A subtitle generating device, characterized in that: The device comprises: A speech recognition module is used to perform speech recognition processing on the audio and video signals to be processed, and obtain a text sequence corresponding to the audio and video signals and a timestamp mapping table of the text sequence, wherein the timestamp mapping table includes timestamps corresponding to each word in the text sequence; A boundary segmentation determination module, used for determining boundary segmentations in the text sequence; A subtitle generation module, configured to split the text sequence according to the boundary segmentation words and the timestamps corresponding to the boundary segmentation words, and generate a subtitle line file corresponding to the audio and video signal; The boundary detection submodule is used to determine the boundary labels of each word segment in the text sequence based on a preset boundary detection model or boundary detection rule, and determine the boundary word segment in the text sequence according to the boundary label; or The semantic analysis submodule is used to determine the boundary segmentation words in the text sequence according to the text semantics of the text sequence.

8. The device according to claim 7, characterized in that The semantic analysis submodule includes: A semantic type determination unit, used to perform semantic analysis on the text sequence to determine the semantic type corresponding to each word segment in the text sequence; A phrase determination unit, used to group each word in the text sequence according to the semantic type, and determine that the words with the same semantic type belong to the same word group; A last participle determining unit, configured to determine the last participle in the participle group according to the position of each participle in the participle group in the text sequence; The boundary segmentation determining unit is used to determine the last segmentation in the text sequence as a boundary segmentation.

9. The device according to claim 7, characterized in that The subtitle generation module comprises: A subtitle line text determination submodule, used to split the text sequence according to the boundary segmentation to obtain the subtitle line text corresponding to the audio and video signal; A start and end time determination submodule, used to determine the start and end time corresponding to each subtitle line text according to the timestamp corresponding to the boundary segmentation word; The subtitle line generation submodule is used to generate a subtitle line file corresponding to the audio and video signal according to the subtitle line text and the start and end times corresponding to the subtitle line text.

10. The device according to claim 9, characterized in that The subtitle line text determination submodule includes: a boundary participle judging unit, configured to judge whether there is a second boundary participle corresponding to the first boundary participle in the text sequence, wherein the second boundary participle is located before the first boundary participle; A first subtitle line text determination unit is configured to extract each segmentation word between the first boundary segmentation word and the second boundary segmentation word from the text sequence if a second boundary segmentation word corresponding to the first boundary segmentation word exists in the text sequence, and merge the extracted segmentation words to obtain a subtitle line text corresponding to the text sequence; The second subtitle line text determination unit extracts each segmentation between the start segmentation of the text sequence and the first boundary segmentation from the text sequence if there is no second boundary segmentation corresponding to the first boundary segmentation in the text sequence, and merges the extracted segmentations to obtain the subtitle line text corresponding to the text sequence.

11. The device according to claim 7, characterized in that The device also includes: A subtitle line merging module, used for merging the source language subtitle line texts contained in the subtitle line file to obtain sentences to be translated; A translation processing module, used for translating the sentence to be translated to obtain a target language sentence; A sentence splitting module, used for splitting the target language sentence to obtain target language subtitle line text, wherein the target language subtitle line text corresponds to the source language subtitle line text one by one; The bilingual subtitle generation module is used to generate a bilingual subtitle file of the audio and video signal according to the source language subtitle line text, the target language subtitle line text, and the start and end time of the source language subtitle line text.

12. A device for generating subtitles, characterized in that: The device includes a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors. The one or more programs include instructions for executing the subtitle generation method according to any one of claims 1 to 6.

13. A machine-readable medium having instructions stored thereon, which, when executed by one or more processors, causes a device to execute the subtitle generation method according to any one of claims 1 to 6.