Method and apparatus for video translation, electronic device, and medium

By splicing and unified encoding of video embeddings and text embeddings, cross-modal embeddings are formed, which solves the problem of insufficient translation precision and accuracy in existing machine translation technology and achieves more efficient video translation effects.

WO2024199085A1PCT designated stage expired Publication Date: 2024-10-03BEIJING YOUZHUJU NETWORK TECH CO LTD +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/083075
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-29
Filing Date
2024-03-21
Publication Date
2024-10-03

AI Technical Summary

Technical Problem

Existing machine translation technology has not reached human level in translation precision and accuracy, especially the limited translation information of image input, resulting in poor performance of the translation model.

Method used

Video embeddings are obtained through multiple image frames based on the video, and combined with the source language text associated with the video for splicing and unified encoding to form a cross-modal embedding to improve the performance of the translation model.

Benefits of technology

Using video information as visual input to translate text information across modalities significantly improves translation quality and enables the translation model to better understand text and video features, thereby providing accurate translation results that fit specific situations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024083075_03102024_PF_FP_ABST
    Figure CN2024083075_03102024_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure relate to a method and apparatus for video translation, an electronic device, and a medium. The method comprises: on the basis of a plurality of image frames of a video, obtaining video embedding of the video, and on the basis of a source language text associated with the video, obtaining text embedding of the source language text. The method further comprises: splicing the obtained video embedding and the obtained text embedding, and unifiedly encoding the spliced video embedding and text embedding into cross-modal embedding. The method further comprises: decoding the cross-modal embedding to obtain a target language text. In this way, video information can be used as visual input to translate text information in a cross-modal mode. According to the embodiments of the present disclosure, the model capacity of a translation model is improved, so that the translation model is applicable to big data, and time information is modeled, so that alignment of a video and a text in time dimension is enhanced, and the translation quality is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Method, device, electronic device and medium for video translation

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on March 29, 2023, with application number 202310324169.1 and invention name “Methods, devices, electronic devices and media for video translation”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] Embodiments of the present disclosure generally relate to the field of computers, and more particularly, to methods, apparatuses, electronic devices, and media for video translation. Background Art

[0003] Machine translation is the process of converting one natural language into another using computing devices. Machine translation can eliminate language barriers, break down communication barriers, and facilitate communication and collaboration between people from different countries and regions. With the advancement of globalization, machine translation technology has become a vital communication tool in modern society, playing an increasingly important role in various fields.

[0004] Machine translation, as a bridge for cross-language communication, has been continuously improved and developed in recent years. However, there is still a need to improve the translation precision and accuracy of machine translation technology.

[0005] Summary of the Invention

[0006] The embodiments of the present disclosure provide a technical solution for video translation.

[0007] According to a first aspect of the present disclosure, a method for video translation is provided. The method includes obtaining a video embedding of the video based on multiple image frames of the video, and obtaining a text embedding of the source language text based on the source language text associated with the video. The method also includes concatenating the obtained video embedding with the obtained text embedding, and uniformly encoding the concatenated video embedding and text embedding into a cross-modal embedding. The method also includes decoding the cross-modal embedding to obtain the target language text.

[0008] According to a second aspect of the present disclosure, a device for video translation is provided. The device includes a video embedding acquisition module configured to obtain a video embedding of a video based on multiple image frames of a video. The device also includes a text embedding acquisition module configured to obtain a text embedding of a source language text based on a source language text associated with the video. The device also includes a splicing module configured to splice the obtained video embedding with the obtained text embedding. The device also includes a cross-modal encoding module configured to uniformly encode the spliced ​​video embedding and text embedding into a cross-modal embedding. The device also includes a decoding module that decodes the cross-modal embedding to obtain the target language text.

[0009] According to a third aspect of the present disclosure, an electronic device is provided, comprising a processor and a memory coupled to the processor, wherein the memory has instructions stored therein, and when the instructions are executed by the processor, the electronic device executes the method according to the first aspect of the present disclosure.

[0010] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein computer-executable instructions are stored on the computer-readable storage medium, wherein the computer-executable instructions are executed by a processor to implement the method according to the first aspect of the present disclosure.

[0011] Please note that the invention summary is provided to introduce a series of concepts in a simplified form, which will be further described in the detailed description below. The invention summary is not intended to identify key features or essential features of the present disclosure, nor is it intended to limit the scope of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The above and other objects, features and advantages of the present disclosure will become more apparent through a more detailed description of the embodiments of the present disclosure in conjunction with the accompanying drawings, in which:

[0013] FIG1 is a schematic diagram illustrating an example environment in which methods and / or processes according to embodiments of the present disclosure may be implemented;

[0014] FIG2 is a flow chart illustrating a method for video translation according to an embodiment of the present disclosure;

[0015] FIG3 is a diagram illustrating a framework of a multimodal translation model according to an embodiment of the present disclosure;

[0016] FIG4 is a flowchart illustrating obtaining video embedding based on position coding according to an embodiment of the present disclosure;

[0017] FIG5 is a diagram illustrating a cross-modal contrastive learning training objective according to an embodiment of the present disclosure;

[0018] FIG6 is a diagram illustrating an example of positive and negative examples in each of a plurality of batches;

[0019] FIG7 is a flow chart illustrating a two-stage training process according to an embodiment of the present disclosure;

[0020] FIG8 is a block diagram illustrating an apparatus for video translation according to an embodiment of the present disclosure; and

[0021] FIG9 is a schematic block diagram illustrating an example device that may be used to implement embodiments according to the present disclosure.

[0022] Throughout the drawings, same or similar reference numbers generally refer to same or similar elements. Specific embodiments

[0023] It should be understood that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information (such as text in a language) involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0024] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly remind the user that the operation requested to be performed will require the acquisition and use of the user's personal information. Thus, the user can independently choose whether to provide personal information to the electronic device, application, server or storage medium and other software or hardware that performs the operation of the technical solution of the present disclosure based on the prompt message. It should be understood that the above notification and user authorization acquisition process are only illustrative and do not constitute a limitation on the implementation method of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation method of the present disclosure.

[0025] It should be understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) must comply with the requirements of relevant laws, regulations and relevant provisions.

[0026] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.

[0027] In the description of the embodiments of the present disclosure, the term "including" and its variations should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. can refer to different or the same objects, unless explicitly indicated to be different.

[0028] In some embodiments of the present disclosure, English to Chinese text translation is described as an example. It should be understood that Chinese to English and other language translations can also be used in conjunction with the embodiments of the present disclosure. In addition, all specific numerical values ​​herein are examples only and are intended only to facilitate understanding and are not intended to limit the scope.

[0029] As discussed above, machine translation is the process of converting one natural language into another. Improving its precision and accuracy is a pressing task for machine translation. However, the accuracy achieved by existing machine learning technologies is insufficient to meet expectations.

[0030] Humans integrate linguistic and visual context to understand the world. For machine translation, leveraging visual information is crucial to achieving near-human-level translation capabilities. Images, as additional visual input, can be used in machine translation to improve the performance of translation models. However, the information that images provide for translation is very limited, causing translation models to fall short of their desired performance. Consequently, image-based machine translation often produces unsatisfactory results.

[0031] Videos provide richer translation information. They can depict objects, actions, and scenes. Compared to images, videos contain more information. This information enables translation models to better understand the text, resulting in accurate translation results that are tailored to the specific context.

[0032] Video-based machine translation is a promising research direction. However, existing video-based machine translation models have limited model capacity and are not suitable for big data. This is because existing video-based machine translation models are based on, for example, long short-term memory. Other existing video-based machine translation models fail to effectively combine the video information from the video input with the text information from the text input, nor can they uniformly encode the features of both video and text.

[0033] To address at least some of the above-mentioned and other potential problems, embodiments of the present disclosure provide a technical solution for video translation. The solution includes obtaining a video embedding of the video based on multiple image frames of the video, and obtaining a text embedding of the source language text based on the source language text associated with the video. The solution also includes splicing the obtained video embedding with the obtained text embedding, and uniformly encoding the spliced ​​video embedding and text embedding into a cross-modal embedding. The solution also includes decoding the cross-modal embedding to obtain the target language text.

[0034] The technical solution for video translation according to embodiments of the present disclosure aims to translate source text in a source language into target text in a target language using video information from a video input. This technical solution concatenates video embeddings with text embeddings and uniformly encodes the concatenated video and text embeddings to better learn both video and text features.

[0035] The basic principles and several example implementations of the present disclosure are described below with reference to Figures 1 to 9. It should be understood that these exemplary embodiments are provided only to enable those skilled in the art to better understand and implement the embodiments of the present disclosure, and are not intended to limit the scope of the present disclosure in any way. In addition, in the following description, certain embodiments will be discussed with reference to the translation process between English text and Chinese text. However, it should be understood that this is only to enable those of ordinary skill in the art to better understand the principles and concepts of the embodiments of the present disclosure, and is not intended to limit the scope of the present disclosure in any way.

[0036] FIG1 is a schematic diagram illustrating an example environment 100 in which methods and / or processes according to embodiments of the present disclosure may be implemented. In the example environment 100, a video 111 and a source language text 112 associated with the video 111 are input as input 110 into a multimodal translation model 120 according to embodiments of the present disclosure at a computing device. The multimodal translation model 120 receives the input 110 and performs corresponding calculations (e.g., a video-based translation process described below) at the computing device to translate the source language text 112 into a target language text 122. An application 130 receives the translation results of the multimodal translation model 120 and further utilizes the translated target language text 122.

[0037] As for input 110, input 110 includes video 111 and source language text 112 associated with video 111. According to an embodiment of the present disclosure, video 111 can be a movie, a TV series, a TV program, etc., or a short video. Source language text 112 can be text to be translated. In an exemplary embodiment, source language text 112 can be a paragraph or sentence in English. The video 111 and source language text 112 included in input 100 are interrelated. In an exemplary embodiment, source language text 112 can be text describing video 111, such as subtitles of video 111, a title of video 111, and a hard disk of video 111. Alternatively or additionally, input 110 can also include other additional inputs (e.g., images and audio). It should be noted that the present disclosure does not limit the number of videos 111 and source language text 112 input to multimodal translation model 120. For example, video 111 input to multimodal translation model 120 can be a single video or two or more videos. It should also be understood that the above description of the video 111 and the source language text 112 is exemplary rather than restrictive, and the video 111 and the source language text 112 may also exist in other different forms.

[0038] At a computing device, a multimodal translation model 120 according to an embodiment of the present disclosure receives input 110 and executes a method for video translation according to an embodiment of the present disclosure to translate a source language text 112 based on a video 111. According to an embodiment of the present disclosure, the multimodal translation model 120 may be a transformer-based model. It should be understood that the disclosure is not limited to transformer-based models and may also include other different models. The computing device may be any device with computing capabilities. Examples of computing devices may include smartphones, tablet computers, personal computers, laptop computers, server computers, multiprocessor systems, wearable electronic devices, multimedia players, personal digital assistants (PDAs), smart home devices, consumer electronics, and the like. Examples of computing devices may also include a distributed computing environment including any one of the above-mentioned systems or devices, and the like.

[0039] The translation result of the multimodal translation model 120 according to an embodiment of the present disclosure is transmitted to the application 130. According to an embodiment of the present disclosure, the translation result of the multimodal translation model 120 can be the translated target language text 122. In an exemplary embodiment, the translated target language text 122 can be a paragraph or sentence in Chinese. After receiving the translation result of the multimodal translation model 120, the application 130 can further utilize the translated target language text 122. In an exemplary embodiment, the application 130 can display the translated target language text 122 to the user. In another exemplary embodiment, the application 130 can read the translated target language text 122 to the user in the form of audio. It should be understood that the application 130 and the multimodal translation model 120 according to an embodiment of the present disclosure can be deployed on the same computing device, or can be distributedly deployed on different computing devices.

[0040] A schematic diagram of an example environment 100 in which methods and / or processes according to embodiments of the present disclosure may be implemented is described above in conjunction with FIG1 . A flow chart of a method 200 for video translation according to embodiments of the present disclosure is described below in conjunction with FIG2 . As described above with respect to computing devices, the method 200 for video translation according to embodiments of the present disclosure may be executed on an edge device with computing capabilities or on a cloud server, and the present disclosure does not impose any limitations on this.

[0041] FIG2 is a flow chart illustrating a method 200 for video translation according to an embodiment of the present disclosure. In today's globalized world, machine translation has become an important communication tool in modern society. Compared to human translation, machine translation offers many advantages, including lower translation costs, easier control of the translation process, and faster translation speeds. To further improve the translation quality of machine translation, a method 200 for video translation according to an embodiment of the present disclosure is provided.

[0042] At 210, a video embedding of the video is obtained based on multiple image frames of the video. According to an embodiment of the present disclosure, the video 111 included in the input 110 can be represented as multiple image frames for the video 111. By projecting the multiple image frames for the video 111, video features of the video 111 can be obtained. Based on the obtained video features, a video embedding of the video 111 can be obtained. The process of extracting video features and obtaining a video embedding according to an embodiment of the present disclosure will be described in further detail below.

[0043] At 220, a text embedding of the source language text associated with the video is obtained. According to an embodiment of the present disclosure, the source language text 112 included in the input 110 can be represented as a plurality of tokens for the source language text 112. The plurality of tokens for the source language text 112 can be converted into a text embedding of the source language text 112. The process of obtaining a text embedding according to an embodiment of the present disclosure will be described in further detail below.

[0044] At 230 , the obtained video embedding is concatenated with the obtained text embedding. According to an embodiment of the present disclosure, in response to obtaining the video embedding of the video 111 at 210 and obtaining the text embedding of the source language text 112 at 220 , the video embedding of the video 111 and the text embedding of the source language text 112 may be concatenated.

[0045] At 240, the spliced ​​video embedding and text embedding are uniformly encoded into a cross-modal embedding. According to an embodiment of the present disclosure, after the video embedding of the video 111 and the text embedding of the source language text 112 are spliced, the video embedding of the spliced ​​video 111 and the text embedding of the source language text 112 can be uniformly encoded. Uniformly encoding the video embedding of the spliced ​​video 111 and the text embedding of the source language text 112 enables learning both the features of the video and the features of the text. Here, the video embedding of the spliced ​​video 111 and the text embedding of the source language text 112 can be uniformly encoded into a cross-modal embedding. The process of uniform encoding according to an embodiment of the present disclosure will be further described in detail below.

[0046] At 250, the cross-modal embedding is decoded to obtain the target language text. According to an embodiment of the present disclosure, the cross-modal embedding obtained at 240 is decoded to obtain the translated target language text 122. According to an embodiment of the present disclosure, the method for video translation utilizes video information as visual input during the translation process of translating source text in a source language into target text in a target language, thereby improving translation quality.

[0047] FIG3 is a diagram illustrating a framework of a multimodal translation model 120 according to an embodiment of the present disclosure. As shown in FIG3 , the multimodal translation model 120 may include a video feature extractor 310, a video embedder 320, a text embedder 330, a cross-modal encoder 340, and a decoder 350.

[0048] The process of extracting video features according to an embodiment of the present disclosure as described above is performed by the video feature extractor 310 included in the multimodal translation model 120. Video 111 can be represented as a series of consecutive frames for video 111. According to an embodiment of the present disclosure, the video feature extractor 310 can be configured to project (e.g., linearly project) the series of consecutive frames for video 111 to obtain video features having the same dimension as the dimension of the text embedding. The obtained video features can be frame-level features, and the obtained video features can include two-dimensional video features and three-dimensional video features.

[0049] The process of obtaining video embedding according to an embodiment of the present disclosure as described above is performed by the video embedder 320 included in the multimodal translation model 120. According to an embodiment of the present disclosure, the video embedder 320 can be configured to obtain a video embedding 321 for the video 111 based on the video features and position embedding of the video 111 from the video feature extractor 310. The process of obtaining video embedding according to an embodiment of the present disclosure will be described in further detail below.

[0050] The process of obtaining a text embedding according to an embodiment of the present disclosure, as described above, is performed by a text embedder 330 included in the multimodal translation model 120. The source language text 112 can be represented as a series of tokens for the source language text 112. In an example embodiment, the series of tokens for the source language text 112 can be words, sentences, or paragraphs of the source language text 112. According to an embodiment of the present disclosure, the text embedder 330 can be configured to convert the series of tokens for the source language text 112 into a text embedding 331 for the source language text 112.

[0051] According to an embodiment of the present disclosure, upon receiving the video embedding 321 of the video 111 from the video embedder 320 and the text embedding 331 of the source language text 112 from the text embedder 330, the video embedding 321 of the video 111 and the text embedding 331 of the source language text 112 may be spliced. The unified encoding process according to an embodiment of the present disclosure as described above is performed by the cross-modal encoder 340. According to an embodiment of the present disclosure, the cross-modal encoder 340 is a transformer-based encoder and may be configured to uniformly encode the spliced ​​video embedding 321 of the video 111 and the text embedding 331 of the source language text 112 to obtain a cross-modal embedding.

[0052] The cross-modal encoder 340 uniformly encodes the video embedding 321 of the video 111 and the text embedding 331 of the source language text 112, enabling the multimodal translation model 120 according to embodiments of the present disclosure to learn both the features of the video 111 and the features of the source language text 112. Furthermore, the cross-modal encoder 340 is a transformer-based encoder that can increase the model capacity of the multimodal translation model 120 according to embodiments of the present disclosure, making it applicable to big data.

[0053] According to an embodiment of the present disclosure, the decoder 350 can be configured to decode the cross-modal embedding from the cross-modal encoder 340 to obtain the translated target language text 122. In this way, the multimodal translation model 120 according to an embodiment of the present disclosure translates the source language text 112 into the target language text 122 based on the video information from the video.

[0054] Figure 4 is a flowchart 400 illustrating a process for obtaining a video embedding based on position coding according to an embodiment of the present disclosure. Here, the process for obtaining a video embedding according to an embodiment of the present disclosure is described in detail. The video embedder 320 according to an embodiment of the present disclosure may be configured to position-code the video features of the video 111 from the video feature extractor 310 to obtain position-coded video features. The video embedder 320 may also be configured to normalize the position-coded video features (e.g., by layer normalization) to obtain the normalized video features as the video embedding 321 of the video 111. In this way, the process for obtaining a video embedding based on position coding according to an embodiment of the present disclosure is able to model temporal information.

[0055] To learn the shared semantics between video and text, a contrastive learning training objective is also introduced in the training of the multimodal translation model 120 according to an embodiment of the present disclosure. FIG5 is a diagram 500 illustrating a cross-modal contrastive learning training objective according to an embodiment of the present disclosure. According to an embodiment of the present disclosure, the video embedding 321 of the video 111 from the video embedder 320 and the text embedding 331 of the source language text 112 from the text embedder 330 can be transmitted to the pooler 510.

[0056] According to an embodiment of the present disclosure, the pooler 510 may be configured to average the video embedding 321 of the video 111 and the text embedding 331 of the source language text 112 over the time dimension. In an exemplary embodiment, the pooler 510 may be configured to average pool the video embedding 321 of the video 111 and the text embedding 331 of the source language text 112 over the time dimension.

[0057] According to an embodiment of the present disclosure, based on the averaged video embedding 321 and text embedding 331, a video representation of the video 111 and a text representation of the source language text 112 can be obtained. In an exemplary embodiment, the averaged video embedding 321 and text embedding 331 can be passed through a trainable linear layer (such as, but not limited to, two layers) to obtain a video representation of the video 111 and a text representation of the source language text 112. As shown in FIG5 , the multi-layer perceptron 520 for video and the multi-layer perceptron 530 for text can be configured to map the video representation of the video 111 and the text representation of the source language text 112 to the same semantic space.

[0058] According to an embodiment of the present disclosure, after obtaining the video representation of video 111 and the text representation of source language text 112, the similarity between the video representation of video 111 and the text representation of source language text 112 can be determined. The cross-modal contrastive learning training objective according to an embodiment of the present disclosure can bring associated video representations and text representations closer to each other, and move unassociated video representations and text representations further away from each other, so that the semantic representations of video embedding and text embedding are aligned. Through the above-mentioned cross-modal contrastive learning training objective, the model performance of the multimodal translation model 120 according to an embodiment of the present disclosure can be improved, thereby improving the translation quality.

[0059] According to an embodiment of the present disclosure, determining the similarity between the video representation of the video 111 and the textual representation of the source language text 112 may include determining a distance (such as a Euclidean distance) between the video representation of the video 111 and the textual representation of the source language text 112, and calculating a similarity score for the video representation-text representation pair based on the determined distance. The calculated similarity score for the video representation-text representation pair indicates the similarity between the video representation of the video 111 and the textual representation of the source language text 112.

[0060] According to an embodiment of the present disclosure, a similarity score threshold for a similarity score can be determined. After determining the similarity score threshold for a similarity score, a video representation-text representation pair having a similarity score higher than the determined similarity score threshold can be selected from each of a plurality of batches. In a training sample set for training the multimodal translation model 120 according to an embodiment of the present disclosure, the training sample set is divided into a plurality of batches. Each of the plurality of batches includes positive examples and negative examples. It should be understood that the present disclosure does not limit the number of samples included in each of the plurality of batches. In an exemplary embodiment, the number of samples included in each of the plurality of batches can be 32. In another exemplary embodiment, each of the plurality of batches can also include more or fewer samples. The positive examples and negative examples in each of the plurality of batches will be described in further detail below.

[0061] FIG6 is a diagram 600 illustrating an example of positive and negative examples in each of a plurality of batches. It should be understood that FIG6 is illustrative of one of the plurality of batches, and that other batches in the plurality of batches may have the same or similar arrangement. It should also be understood that the association and number of positive and negative examples illustrated in FIG6 are merely exemplary and non-limiting.

[0062] As shown in FIG6 , according to an embodiment of the present disclosure, a positive example may be a video representation-text representation pair associated with video 610 and text 611, and a video representation-text representation pair associated with text 620 and video 621 (these are also referred to as positive pairs). In other words, video 610 and text 611, as well as text 620 and video 621, match or have a high degree of match (reaching a predetermined matching degree threshold).

[0063] 6 , according to an embodiment of the present disclosure, negative examples may be video representation-text representation pairs in which video 610 is not associated with text 611′, and video representation-text representation pairs in which text 620 is not associated with video 621′ (these are also referred to as negative pairs). In other words, video 610 and text 611′, as well as text 620 and video 621′, do not match or have a low degree of match (does not meet a predetermined matching degree threshold).

[0064] According to an embodiment of the present disclosure, a multimodal translation model 120 according to an embodiment of the present disclosure may be trained using a first loss function based on the difference between the translated target language text 122 and the true translation result and a second loss function based on the similarity between the video representation of the video 111 and the text representation of the source language text 112.

[0065] In an exemplary embodiment, the first loss function based on the difference between the translated target language text 122 and the true translation result may be a cross entropy loss function. The following formula (1) shows the first loss function based on the difference between the translated target language text 122 and the true translation result:

[0066] where v i , x i represents the i-th video-text pair in one of the batches, and y i represents the text sequence of the target language for the i-th video-text pair in the batch.

[0067] According to an embodiment of the present disclosure, a second loss function based on the similarity between the video representation of the video 111 and the text representation of the source language text 112 is It can be shown by the following formula (2):

[0068] in and is the representation for text and video, sim(·) is the cosine similarity function, and the parameter It is used to control the strength of the penalty for hard negative samples.

[0069] In an exemplary embodiment, the parameter set of the multimodal translation model 120 according to an embodiment of the present disclosure is adjusted by minimizing a first loss function (shown by formula (1)) based on the difference between the translated target language text 122 and the true translation result and a second loss function (shown by formula (2)) based on the similarity between the video representation of the video 111 and the text representation of the source language text 112. As shown in the following formula (3), the loss of the first loss function is The loss with the second loss function By adding them together, we can get the final loss. By minimizing the final loss, we can adjust the parameters of the multimodal translation model 120, thereby improving the performance of the multimodal translation model 120 and thus improving the translation quality. Formula (3) shows:

[0070] Where α is used to balance the two loss terms and hyperparameters.

[0071] Alternatively or additionally, during training of the multimodal translation model 120 according to an embodiment of the present disclosure, the cross-modal encoder 340 and decoder 350 included in the multimodal translation model 120 may be pre-trained using only text input, and then trained using both text input and video input. The two-stage training process according to an embodiment of the present disclosure will be further described below with reference to FIG.

[0072] FIG7 is a flowchart 700 illustrating a two-stage training process according to an embodiment of the present disclosure. At 710, the cross-modal encoder 340 and decoder 350 included in the multimodal translation model 120 according to an embodiment of the present disclosure are pre-trained using only text input. According to an exemplary embodiment of the present disclosure, the text input includes bilingual predictions, such as, but not limited to, English to Chinese text translation. In an exemplary embodiment, the text input can be source language text 112 associated with video 111.

[0073] After pre-training the cross-modal encoder 340 and decoder 350 using only text input at 710, according to an embodiment of the present disclosure, the cross-modal encoder 340 and decoder 350 are retrained using both text input and video input at 720. This can further improve the performance and effectiveness of the multimodal translation model 120 according to an embodiment of the present disclosure, thereby improving translation quality.

[0074] Figure 8 is a block diagram illustrating an apparatus 800 for video translation according to an embodiment of the present disclosure. As shown in Figure 8, the apparatus 800 includes a video embedding acquisition module 810, which is configured to obtain a video embedding of a video based on multiple image frames of a video. The apparatus 800 also includes a text embedding acquisition module, which is configured to obtain a text embedding of a source language text based on a source language text associated with the video. The apparatus 800 also includes a splicing module 830, which is configured to splice the obtained video embedding with the obtained text embedding. The apparatus 800 also includes a cross-modal encoding module 840, which is configured to uniformly encode the spliced ​​video embedding and text embedding into a cross-modal embedding. The apparatus 800 also includes a decoding module 850, which decodes the cross-modal embedding to obtain the target language text. The apparatus 800 may also include other modules to implement the method and / or process according to the embodiment of the present disclosure, which will not be described here for the sake of brevity.

[0075] It should be understood that the apparatus 800 of the present disclosure can achieve at least some of the advantages achievable by the methods or processes described above. For example, it can utilize video information as visual input to perform cross-modal translation of text information. Furthermore, it increases the model capacity of the translation model, making it applicable to big data, while also modeling temporal information, strengthening the temporal alignment of video and text.

[0076] Figure 9 shows a block diagram of an electronic device 900 according to certain embodiments of the present disclosure, and device 900 may be the device or apparatus described in an embodiment of the present disclosure. As shown in Figure 9, device 900 includes a central processing unit (CPU) and / or a graphics processing unit (GPU) 901, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 902 or computer program instructions loaded from a storage unit 908 into a random access memory (RAM) 903. In RAM 903, various programs and data required for the operation of device 900 can also be stored. CPU / GPU 901, ROM 902, and RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to bus 904. Although not shown in Figure 9, device 900 may also include a coprocessor.

[0077] Various components in device 900 are connected to I / O interface 905, including an input unit 906, such as a keyboard, mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a magnetic disk, optical disk, etc.; and a communication unit 909, such as a network card, modem, wireless communication transceiver, etc. The communication unit 909 allows device 900 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0078] The various methods or processes described above may be performed by the CPU / GPU 901. For example, in some embodiments, the methods may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed onto the device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded into the RAM 903 and executed by the CPU / GPU 901, one or more steps or actions in the methods or processes described above may be performed.

[0079] In some embodiments, the methods and processes described above may be implemented as a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present disclosure.

[0080] Computer-readable storage medium can be a tangible device that can keep and store the instructions used by the instruction execution device.Computer-readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device or any suitable combination thereof.More specific examples (non-exhaustive list) of computer-readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a convex structure in a groove having instructions stored thereon, and any suitable combination thereof.Computer-readable storage medium used herein is not interpreted as a transient signal itself, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagated by waveguides or other transmission media (for example, light pulses by fiber optic cables), or electrical signals transmitted by wires.

[0081] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions to be stored in the computer-readable storage medium in each computing / processing device.

[0082] The computer program instructions for performing the disclosed operation can be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data or source code or the object code written in any combination of one or more programming languages, programming languages ​​include object-oriented programming languages, and conventional procedural programming languages.Computer-readable program instructions can be performed completely on a user's computer, partially on a user's computer, performed as an independent software package, partly on a user's computer and partly on a remote computer, or performed completely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer by any type of network-including local area network (LAN) or wide area network (WAN), or can be connected to an external computer (such as utilizing an internet service provider to connect by the internet). In certain embodiments, by utilizing the state information of computer-readable program instructions to carry out personalized customization electronic circuits, such as programmable logic circuits, field programmable gate arrays (FPGAs) or programmable logic arrays (PLA), This electronic circuit can perform computer-readable program instructions, thereby realizing various aspects of the present disclosure.

[0083] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device is generated that implements the functions / actions specified in one or more blocks in the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, where these instructions cause the computer, programmable data processing device, and / or other device to operate in a specific manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing various aspects of the functions / actions specified in one or more blocks in the flowchart and / or block diagram.

[0084] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device, so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0085] The flow charts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and the part of the module, program segment or instruction contains one or more executable instructions for realizing the prescribed logical function. In some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart, can be implemented by a special hardware-based system that performs the prescribed function or action, or can be implemented by a combination of special hardware and computer instructions.

[0086] The embodiments of the present disclosure have been described above. The above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is selected to best explain the principles of the embodiments, practical applications, or technical improvements to existing technologies, or to enable other persons skilled in the art to understand the embodiments disclosed herein.

Claims

1. A method for video translation, include: Based on a plurality of image frames of the video, obtaining a video embedding of the video; Based on a source language text associated with the video, obtaining a text embedding of the source language text; Concatenating the obtained video embedding with the obtained text embedding; Unifying the concatenated video embedding and text embedding into a cross-modal embedding; and The cross-modal embedding is decoded to obtain the target language text.

2. The method of claim 1, wherein obtaining the video embedding of the video include: extracting video features from the plurality of image frames of the video; as well as The video embedding is obtained based on the video features and the position embedding.

3. The method according to claim 2, wherein obtaining the video embedding include: By performing position encoding on the video feature, obtaining the position-encoded video feature; as well as By normalizing the position-encoded video features, normalized video features are obtained as the video embedding.

4. The method according to claim 2, in: Unifying the concatenated video embedding and text embedding into the cross-modal embedding is performed by a cross-modal encoder; Obtaining the video embedding based on the video features and the position embedding is performed by a video embedder; and The cross-modal encoder and the video embedder are included in a translation model.

5. The method according to claim 4, further comprising: include: Averaging the video embedding and the text embedding in a time dimension; Based on the averaged video embedding and the text embedding, obtain a video representation of the video and a text representation of the source language text; as well as A similarity between the video representation and the textual representation is determined.

6. The method of claim 5, wherein determining the similarity between the video representation and the text representation include: determining a distance between the video representation and the text representation; as well as Based on the distance, a similarity score for the video representation-text representation pair is calculated, the similarity score indicating the similarity.

7. The method according to claim 6, further comprising: include: determining a similarity score threshold for the similarity score; as well as The video representation-text representation pairs having the similarity score above the similarity score threshold are selected from each batch of the plurality of batches.

8. The method of claim 7, wherein each batch in the plurality of batches comprises positive examples and negative examples, the positive examples comprising video representation-text representation pairs in which videos are associated with text, and the negative examples comprising video representation-text representation pairs in which videos are not associated with text.

9. The method according to claim 5, further comprising: include: training the translation model using a first loss function based on the difference between the obtained target language text and a true translation result and a second loss function based on the similarity between the video representation and the text representation; as well as The parameter set of the translation model is adjusted by minimizing the first loss function and the second loss function.

10. The method according to claim 4, further comprising: include: Training the cross-modal encoder and decoder included in the translation model using text input, the text input including bilingual corpus; as well as The cross-modal encoder and the decoder are trained using the text input and the video input.

11. The method according to claim 2, wherein the video features are extracted include: representing the video as a series of consecutive frames for the video; as well as By projecting the series of consecutive frames for the video, the video feature having the same dimension as the text embedding is obtained, The video features are frame-level features, and the video features include two-dimensional video features and three-dimensional video features.

12. The method according to claim 1, wherein the text embedding of the source language text is obtained include: representing the source language text as a series of tokens for the source language text; as well as The series of tokens for the source language text are converted into the text embedding by a text embedder included in a translation model.

13. A device for video translation, include: A video embedding obtaining module, configured to obtain a video embedding of the video based on a plurality of image frames of the video; A text embedding obtaining module, configured to obtain a text embedding of a source language text based on a source language text associated with the video; a splicing module configured to splice the obtained video embedding with the obtained text embedding; A cross-modal encoding module configured to uniformly encode the concatenated video embedding and the text embedding into a cross-modal embedding; as well as A decoding module decodes the cross-modal embedding to obtain a target language text.

14. An electronic device, include: processor; as well as A memory coupled to the processor, the memory having instructions stored therein, wherein when the instructions are executed by the processor, the electronic device executes the method according to any one of claims 1 to 12.

15. A computer-readable storage medium having computer-executable instructions stored thereon, wherein the computer-executable instructions are executed by a processor to implement the method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Emotion recognition method, intelligent device and computer readable storage medium

    CN111164601A

  • Neural network machine translation model training method, machine translation method and device

    CN113065496A

  • Neural network machine translation model training method, machine translation method and device

    CN113435216A

  • Multi-modal neural machine translation method based on image-text feature two-stage fusion

    CN115545050A

  • Method and device for video translation, electronic equipment and medium

    CN116522962A