Bullet screen text translation method and device, storage medium and electronic equipment
Through the AI model, the real-time translation of barrage text is solved, and the existing technology cannot translate barrage efficiently is achieved, high-quality, multi-language interaction and international video platform experience is achieved, reducing operational costs.
Patent Information
- Application Number
- CN202411042210.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-11-15
AI Technical Summary
Existing translation technologies cannot complete high-quality translation of barrage in a short time, especially because the barrage content is diversified and has strong real-time performance, which makes it difficult to meet the needs of translation accuracy and real-time performance.
Using AI models, such as GPT models, by obtaining the barrage text and target language sent by the user, input them in real time to the translation model, generate the corresponding translated text, and display it in the specified area of the video platform, data preprocessing and model training are carried out to improve Translation accuracy and real-time.
It realizes the automation and real-timeization of barrage translation, improves user experience, supports multi-language interaction, enhances the internationalization and real-timeness of the platform, reduces operating costs, and ensures high-quality translation results.
Smart Images

Figure CN118966241A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of multimedia intelligent processing technology, and in particular to a translation method, device, storage medium and electronic device for bullet text. Background Art
[0002] As an important interactive scene for video playback, barrage also needs to keep up with the pace of international development. Therefore, the translation of massive barrage content requires efficient and automated solutions. At present, machine translation based on text recognition has matured, but the accuracy of translation for the characteristic barrage language needs to be improved. Due to the diversity of languages, frequent use of Internet language and dialects in barrage, it is difficult for existing translation technology to accurately understand and translate. Barrage often contains a lot of relevant plot understanding, background knowledge and cultural information, which makes it impossible for simple language translation to accurately convey its meaning. In addition, the barrage feature is strong real-time, and current translation technology often cannot complete high-quality translation in a short time. Summary of the invention
[0003] The present application provides a translation method, device, storage medium and electronic device for barrage text to solve the technical problem that current translation technology cannot complete high-quality translation of barrage text in a short time.
[0004] In a first aspect, the present application provides a method for translating barrage text, including: obtaining the barrage text sent by a user to a video platform; obtaining the target language into which the barrage text needs to be translated; inputting the barrage text and the target language into a translation model to obtain a translation text corresponding to the barrage text, wherein the language of the translation text is the target language; and displaying the translation text in the target area of the video platform.
[0005] In the second aspect, the present application provides a translation device for barrage text, including: a first acquisition module, used to obtain the barrage text sent by the user to the video platform; a second acquisition module, used to obtain the target language into which the above barrage text needs to be translated; a translation module, used to input the above barrage text and the above target language into a translation model to obtain a translation text corresponding to the above barrage text, wherein the language of the above translation text is the above target language; a display module, used to display the above translation text in the target area of the above video platform.
[0006] As an optional example, the above-mentioned device also includes: a third acquisition module, which is used to obtain barrage data before inputting the above-mentioned barrage text and the above-mentioned target language into the translation model to obtain the translation text corresponding to the above-mentioned barrage text, wherein the above-mentioned barrage data includes multiple groups of barrage data, and one group of barrage data includes original barrage and translation barrages corresponding to multiple languages; a processing module, which is used to pre-process the above-mentioned barrage data; and a training module, which is used to use the pre-processed barrage data to train the initial translation model to obtain the above-mentioned translation model.
[0007] As an optional example, the above-mentioned processing module includes: a deletion unit, used to delete duplicate data, special characters and invalid data in the above-mentioned barrage data; a word segmentation unit, used to perform word segmentation on the above-mentioned barrage data and construct a vocabulary based on the word segmentation results; a segmentation unit, used to segment the barrage data into a training data set and a verification data set.
[0008] As an optional example, the training module includes: a translation unit, used to input the training data set into the initial translation model to obtain a translation result data set, wherein the translation result data set includes translation results corresponding to multiple languages; a calculation unit, used to calculate the difference between the translation result data set and the verification data set using a loss function to obtain a loss value; an adjustment unit, used to adjust the model parameters of the initial translation model according to the loss value, and recalculate the loss value until the recalculated loss value is less than the first threshold, thereby obtaining the translation model.
[0009] As an optional example, the original barrage in the above barrage data comes from multiple video platforms and / or multiple social platforms.
[0010] As an optional example, the above-mentioned device also includes: an extraction module, which is used to input the above-mentioned barrage text and the above-mentioned target language into the translation model to obtain the translation text corresponding to the above-mentioned barrage text, and after each target number of translation texts is obtained, extract a target translation text from the above-mentioned target number of translation texts; a fourth acquisition module, which is used to obtain the target barrage text corresponding to the above-mentioned target translation text; a determination module, which is used to determine the accuracy of the above-mentioned target translation text based on the above-mentioned target barrage text; a modification module, which is used to modify the above-mentioned target translation text when the above-mentioned accuracy is less than a second threshold, so that the accuracy of the modified target translation text is greater than or equal to the above-mentioned second threshold; a first optimization module, which is used to use the above-mentioned target barrage text and the above-mentioned modified target translation text to optimize the above-mentioned translation model.
[0011] As an optional example, the above-mentioned device also includes: a fifth acquisition module, used to obtain the feedback information of the above-mentioned user on the above-mentioned translated text after displaying the above-mentioned translated text in the target area of the above-mentioned video platform; a second optimization module, used to optimize the above-mentioned translation model according to the above-mentioned feedback information.
[0012] In a third aspect, the present application provides a storage medium storing a computer program, wherein the computer program executes the above-mentioned barrage text translation method when executed by a processor.
[0013] In a fourth aspect, the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-mentioned barrage text translation method through the computer program.
[0014] In the embodiment of the present application, the method of obtaining the bullet text sent by the user to the video platform; obtaining the target language to be translated into the bullet text; inputting the bullet text and the target language into the translation model to obtain the translation text corresponding to the bullet text, wherein the language of the translation text is the target language; and displaying the translation text in the target area of the video platform is adopted. Since in the above method, the translation model adopts an AI (Artificial Intelligence) model, by obtaining the bullet text and the target language sent by the user, inputting it into the translation model, generating the corresponding translation text, and displaying it in real time in the target area of the video platform. Thus, the purpose of improving user experience, supporting multilingual interaction, enhancing platform internationalization and real-time performance, and reducing operating costs is achieved, thereby solving the technical problem that the current translation technology cannot complete the high-quality translation of bullets in a short time. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0017] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0018] Figure 1 is a flowchart of an optional method for translating barrage text according to an embodiment of the present application;
[0019] Figure 2 It is a structural schematic diagram of an optional barrage text translation device according to an embodiment of the present application;
[0020] Figure 3 is a schematic diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0021] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0022] The disclosure below provides many different embodiments or examples to realize the different structures of the present application. In order to simplify the disclosure of the present application, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present application. In addition, the present application can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.
[0023] According to a first aspect of an embodiment of the present application, a method for translating a bullet text is provided. Optionally, as follows: Figure 1 As shown, the above method includes:
[0024] S102, obtaining the bullet text sent by the user to the video platform;
[0025] S104, obtaining the target language into which the bullet text needs to be translated;
[0026] S106, inputting the bullet text and the target language into a translation model to obtain a translation text corresponding to the bullet text, wherein the language of the translation text is the target language;
[0027] S108, displaying the translated text in the target area of the video platform.
[0028] Optionally, in this embodiment, the translation model adopts an AI model, such as a GPT (Generative Pretraining Transformer) model, which is a natural language processing model developed by OpenAI based on a powerful Transformer architecture. The real-time translation of bullet screen text based on the AI model can effectively solve the pain point problem of real-time translation of bullet screen, and greatly improve the real-time and accuracy of bullet screen translation. Translation based on the AI model can be performed automatically, and the traditional translation method relies on manual labor to a considerable extent, which greatly saves the labor cost of bullet screen translation and improves the real-time performance of bullet screen translation. The network bullet screen often contains a large amount of network slang and emoticons, which is a major challenge for traditional translation tools, and the AI-based model can better handle such situations and improve the accuracy of translation. In addition, the AI-based model can continue to learn and iterate. Through continuous data input, the performance of the model will get better and better, and the translation results will become more and more accurate.
[0029] Alternatively, since barrage text translation relies more on plot understanding and network culture than ordinary text translation, the translation model needs to understand these contexts in large quantities, and a large amount of multilingual barrage data needs to be collected as training data. These data contain barrages in various languages, types, and contexts, so as to train a robust translation model.
[0030] Optionally, in this embodiment, when the user watches a video on the video platform, the bullet screen text is entered in the bullet screen input box of the video platform, the bullet screen text entered by the user is obtained in real time, and stored on the server side. Next to the bullet screen input box, a drop-down menu or other options are provided, and the user can select the target language (such as English, French, Japanese, etc.), record the target language selected by the user, and associate it with the bullet screen text. The bullet screen text entered by the user and the selected target language are input into a mature translation model that has been trained. The translation model generates a translated text according to the input bullet screen text and the target language. The translation model returns the translated text, and the server receives the translated text and associates it with the original bullet screen text. Finally, according to the design of the video platform, the translated bullet screen text is displayed in a specified position in the video playback area, and the translated bullet screen text can be displayed above the video screen, in the middle or other appropriate positions. It is ensured that the translated bullet screen text is displayed synchronously with the original bullet screen text to maintain consistency in user experience. Through the above method, the automation and real-time translation of bullet screen can be realized, and the user experience and interactivity of the video platform can be improved.
[0031] Optionally, in this embodiment, by obtaining the bullet text and the target language sent by the user, inputting them into the translation model, generating the corresponding translated text, and displaying it in real time in the target area of the video platform. This achieves the purpose of improving user experience, supporting multi-language interaction, enhancing the internationalization and real-time nature of the platform, and reducing operating costs, thereby solving the technical problem that the current translation technology cannot complete high-quality translation of bullet text in a short time.
[0032] As an optional example, before inputting the bullet text and the target language into the translation model to obtain the translation text corresponding to the bullet text, the method further includes:
[0033] Obtaining barrage data, wherein the barrage data includes multiple groups of barrage data, and one group of barrage data includes original barrage and translated barrage corresponding to multiple languages;
[0034] Preprocess the barrage data;
[0035] The preprocessed bullet comment data is used to train the initial translation model to obtain a translation model.
[0036] Optionally, in this embodiment, the bullet screen data is obtained from the database or API (Application Programming Interface) of the video platform, and these data include the original bullet screen sent by the user and the corresponding translated bullet screen, and each group of bullet screen data includes the original bullet screen text and its corresponding translated texts in multiple languages. The original bullet screen in the bullet screen data comes from multiple video platforms and / or multiple social platforms, including but not limited to bullet screens in various languages, types, and contexts.
[0037] Preprocess the bullet comment data, including but not limited to data cleaning, deduplication, word segmentation, serialization, data segmentation and other processes. Specifically, remove irrelevant symbols, special characters and noise data to ensure data quality. Delete duplicate bullet comment data to avoid data redundancy. Segment the original bullet comment and the translated bullet comment. For Chinese bullet comment, use a dedicated Chinese word segmentation tool. Convert the segmented bullet comment text into a vector or tag form acceptable to the translation model, and build a vocabulary and index sequence. Divide the dataset into training, validation and test sets for model training and evaluation.
[0038] Select a suitable translation model architecture, such as the GPT model, initialize the model parameters, use the preprocessed barrage data to train the initial translation model, and after multiple rounds of iterations and hyperparameter tuning, continuously optimize the model performance, and finally obtain the translation model. Specifically, initialize the model parameters of the initial translation model, input the preprocessed barrage data into the model, generate the translation result, use the cross entropy loss function to calculate the difference between the predicted result and the actual result, perform back propagation based on the loss value, update the model parameters, repeat the above steps in multiple rounds of iterations, optimize the model performance, and after each iteration cycle, use the validation set to evaluate the model performance, adjust the hyperparameters to optimize the model until the loss value is less than the first threshold, and obtain the final translation model, so that a robust translation model can be trained. The content of the plot and barrage is very rich, and the translation model needs to be in place in one step. Therefore, the training of the translation model needs to be able to be continuously fine-tuned according to usage to improve recognition accuracy.
[0039] Optionally, in this embodiment, by obtaining bullet comment data containing multilingual translations and performing preprocessing, the initial translation model is trained with the data to ensure data quality and model optimization, so that the translation model can accurately translate multilingual bullet comments, improve translation accuracy and international support for the platform.
[0040] As an optional example, preprocessing the bullet comment data includes:
[0041] Delete duplicate data, special characters and invalid data in the bullet comment data;
[0042] Perform word segmentation on the bullet comment data and build a vocabulary based on the word segmentation results;
[0043] The bullet comment data is divided into a training data set and a validation data set.
[0044] Optionally, in this embodiment, the bullet screen data is preprocessed, including but not limited to data cleaning, deduplication, word segmentation, serialization, data segmentation and other processes. Specifically, irrelevant symbols, special characters and noise data are removed to ensure data quality. Duplicate bullet screen data is deleted to avoid data redundancy. The original bullet screen and the translated bullet screen are segmented. For Chinese bullet screen, a special Chinese word segmentation tool is used. The segmented bullet screen text is converted into a vector or tag form acceptable to the translation model, and a vocabulary and index sequence are constructed. The data set is divided into a training set, a validation set and a test set for model training and evaluation.
[0045] As an optional example, the preprocessed bullet comment data is used to train the initial translation model, and the translation model obtained includes:
[0046] Inputting the training data set into the initial translation model to obtain a translation result data set, wherein the translation result data set includes translation results corresponding to multiple languages;
[0047] Use the loss function to calculate the difference between the translation result dataset and the verification dataset to obtain the loss value;
[0048] The model parameters of the initial translation model are adjusted according to the loss value, and the loss value is recalculated until the recalculated loss value is less than the first threshold, thereby obtaining the translation model.
[0049] Optionally, in this embodiment, a suitable translation model architecture is selected, such as a GPT model, the model parameters are initialized, the initial translation model is trained using the preprocessed bullet screen data, and after multiple rounds of iterations and hyperparameter tuning, the model is continuously optimized, and finally a translation model can be obtained. Specifically, the model parameters of the initial translation model are initialized, the preprocessed bullet screen data is input into the model, the translation result is generated, the cross entropy loss function is used to calculate the difference between the predicted result and the actual result, back propagation is performed according to the loss value, and the model parameters are updated. In multiple rounds of iterations, the above steps are repeated to optimize the model performance. After each iteration cycle, the model performance is evaluated using the validation set, and the hyperparameters are adjusted to optimize the model until the loss value is less than the first threshold value, and the final translation model is obtained, so that a robust translation model can be trained. The content of the plot and bullet screen is very rich, and the translation model needs to be in place in one step. Therefore, the training of the translation model needs to be able to be continuously fine-tuned according to the usage to improve the recognition accuracy.
[0050] As an optional example, the original barrage in the barrage data comes from multiple video platforms and / or multiple social platforms.
[0051] Optionally, in this embodiment, data is obtained from multiple platforms to increase the diversity and representativeness of barrages. The barrage data can cover more content and language scenarios, and improve the generalization ability of the translation model.
[0052] As an optional example, after the bullet text and the target language are input into the translation model to obtain the translation text corresponding to the bullet text, the method further includes:
[0053] After each target number of translation texts is obtained, a target translation text is extracted from the target number of translation texts;
[0054] Get the target bullet text corresponding to the target translation text;
[0055] Determine the accuracy of the target translation text based on the target barrage text;
[0056] When the accuracy is less than the second threshold, modify the target translation text so that the accuracy of the modified target translation text is greater than or equal to the second threshold;
[0057] Use the target bullet text and the modified target translation text to optimize the translation model.
[0058] Optionally, in this embodiment, the translation model may not be able to achieve the optimal translation effect immediately, and the model needs to be evaluated and optimized periodically. A certain proportion of bullet texts can be used for manual review, and a target number (e.g., 10 translation texts) can be set. Whenever a set number of translation texts are collected, a target translation text is randomly selected. The original bullet text corresponding to the target translation text is found from the data set to ensure that the original bullet text and the target translation text exist in pairs for accuracy inspection. The accuracy of the target translation text is evaluated by a language expert or translator based on the target bullet text. The scoring criteria may include language fluency, semantic correctness, and cultural adaptability. Or use an automated evaluation tool to calculate the accuracy of the target translation text. Define a minimum accuracy threshold (e.g., 70 points). When the accuracy of the target translation text is lower than the threshold, it is modified by a language expert or translator, and the modified translation text is then evaluated for accuracy to ensure that its accuracy reaches or exceeds the threshold. Add the target bullet text and the modified target translation text to the training data set, retrain the translation model using the updated training data, and optimize the translation model parameters. Repeat the above steps to continuously optimize the performance of the translation model.
[0059] Optionally, in this embodiment, random sampling is performed to ensure that the extracted target translation text is representative and reflects the overall data quality. Regular sampling of translation text for inspection helps to continuously monitor the performance of the translation model. Through feedback training, the model is continuously optimized to improve translation quality. The translation model can thus be dynamically adjusted according to the latest data and feedback to maintain high performance.
[0060] As an optional example, after displaying the translated text in the target area of the video platform, the method further includes:
[0061] Get user feedback on the translated text;
[0062] Optimize the translation model based on feedback information.
[0063] Optionally, in this embodiment, a feedback button or option is provided to the user on the video platform, and the user can provide feedback for each translated text, so that the user can submit what they think is a better translation, or correct the wrong translation. The feedback type may include: correct, wrong, unclear, culturally incompatible, etc. When the user clicks the feedback button, the specific content of the user's feedback is recorded, and the user's additional comments or suggestions are collected to obtain more detailed feedback information. The user feedback information is stored in the database together with the corresponding translated text and the original barrage text for subsequent analysis and use. The collected user feedback is classified and analyzed to identify common problems and error types. According to the user feedback, the problematic translated text is annotated, and the annotated content includes the problem type and correction suggestions. The annotated feedback data is added to the training data set, including the original barrage text and the translated text corrected by the user. The translation model is retrained using the updated training data set, and the reinforcement learning method is adopted to enable the model to learn from user feedback and gradually improve the translation quality. During the training process, the model parameters and hyperparameters are adjusted to further optimize the model performance. User feedback is collected regularly, the training data is updated, and the model is retrained to form a closed loop of continuous optimization.
[0064] Optionally, in this application, the AI model can translate in real time, improve the translation efficiency and real-time of the barrage, and can also quickly process hundreds of millions of barrage information and maintain a high translation accuracy. Barrages on the Internet often contain a large number of Internet buzzwords and slang. Traditional translation tools cannot accurately understand and translate these languages. The AI model can fully understand these languages through learning and translate them accurately. The AI model can not only perform accurate semantic translation, but also understand the emotions contained in the barrage, and more accurately convey the emotions of the original text by changing the tone or wording of the translation. The AI model can continuously learn from correct and incorrect translations, iteratively update the model, and make the translation effect better and better.
[0065] Optionally, while translating bullet comments, the AI model can also identify and filter out bullet comments containing unhealthy information, making the bullet comment environment healthier and more suitable for all types of users to watch. It can also analyze the content of bullet comments sent by users when watching videos, and recommend content that users may be interested in based on this information, thereby improving the user's viewing experience.
[0066] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, 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 and modules involved are not necessarily required by the present application.
[0067] According to another aspect of the embodiment of the present application, a translation device for bullet text is also provided. Figure 2 As shown, including:
[0068] The first acquisition module 202 is used to acquire the bullet text sent by the user to the video platform;
[0069] The second acquisition module 204 is used to acquire the target language that the bullet text needs to be translated into;
[0070] The translation module 206 is used to input the bullet text and the target language into the translation model to obtain a translation text corresponding to the bullet text, wherein the language of the translation text is the target language;
[0071] The display module 208 is used to display the translated text in the target area of the video platform.
[0072] Optionally, in this embodiment, the translation model adopts an AI model, such as a GPT (Generative Pretraining Transformer) model, which is a natural language processing model developed by OpenAI based on a powerful Transformer architecture. The real-time translation of bullet screen text based on the AI model can effectively solve the pain point problem of real-time translation of bullet screen, and greatly improve the real-time and accuracy of bullet screen translation. Translation based on the AI model can be performed automatically, and the traditional translation method relies on manual labor to a considerable extent, which greatly saves the labor cost of bullet screen translation and improves the real-time performance of bullet screen translation. The network bullet screen often contains a large amount of network slang and emoticons, which is a major challenge for traditional translation tools, and the AI-based model can better handle such situations and improve the accuracy of translation. In addition, the AI-based model can continue to learn and iterate. Through continuous data input, the performance of the model will get better and better, and the translation results will become more and more accurate.
[0073] Alternatively, since barrage text translation relies more on plot understanding and network culture than ordinary text translation, the translation model needs to understand these contexts in large quantities, and a large amount of multilingual barrage data needs to be collected as training data. These data contain barrages in various languages, types, and contexts, so as to train a robust translation model.
[0074] Optionally, in this embodiment, when the user watches a video on the video platform, the bullet screen text is entered in the bullet screen input box of the video platform, the bullet screen text entered by the user is obtained in real time, and stored on the server side. Next to the bullet screen input box, a drop-down menu or other options are provided, and the user can select the target language (such as English, French, Japanese, etc.), record the target language selected by the user, and associate it with the bullet screen text. The bullet screen text entered by the user and the selected target language are input into a mature translation model that has been trained. The translation model generates a translated text according to the input bullet screen text and the target language. The translation model returns the translated text, and the server receives the translated text and associates it with the original bullet screen text. Finally, according to the design of the video platform, the translated bullet screen text is displayed in a specified position in the video playback area, and the translated bullet screen text can be displayed above the video screen, in the middle or other appropriate positions. It is ensured that the translated bullet screen text is displayed synchronously with the original bullet screen text to maintain consistency in user experience. Through the above method, the automation and real-time translation of bullet screen can be realized, and the user experience and interactivity of the video platform can be improved.
[0075] Optionally, in this embodiment, by obtaining the bullet text and the target language sent by the user, inputting them into the translation model, generating the corresponding translated text, and displaying it in real time in the target area of the video platform. This achieves the purpose of improving user experience, supporting multi-language interaction, enhancing the internationalization and real-time nature of the platform, and reducing operating costs, thereby solving the technical problem that the current translation technology cannot complete high-quality translation of bullet text in a short time.
[0076] As an optional example, the above device further includes:
[0077] A third acquisition module is used to obtain barrage data before inputting the barrage text and the target language into the translation model to obtain the translation text corresponding to the barrage text, wherein the barrage data includes multiple groups of barrage data, and one group of barrage data includes the original barrage and the translation barrage corresponding to multiple languages;
[0078] A processing module, used for pre-processing the bullet comment data;
[0079] The training module is used to train the initial translation model using the preprocessed barrage data to obtain a translation model.
[0080] Optionally, in this embodiment, the bullet screen data is obtained from the database or API (Application Programming Interface) of the video platform, and these data include the original bullet screen sent by the user and the corresponding translated bullet screen, and each group of bullet screen data includes the original bullet screen text and its corresponding translated texts in multiple languages. The original bullet screen in the bullet screen data comes from multiple video platforms and / or multiple social platforms, including but not limited to bullet screens in various languages, types, and contexts.
[0081] Preprocess the bullet comment data, including but not limited to data cleaning, deduplication, word segmentation, serialization, data segmentation and other processes. Specifically, remove irrelevant symbols, special characters and noise data to ensure data quality. Delete duplicate bullet comment data to avoid data redundancy. Segment the original bullet comment and the translated bullet comment. For Chinese bullet comment, use a dedicated Chinese word segmentation tool. Convert the segmented bullet comment text into a vector or tag form acceptable to the translation model, and build a vocabulary and index sequence. Divide the dataset into training, validation and test sets for model training and evaluation.
[0082] Select a suitable translation model architecture, such as the GPT model, initialize the model parameters, use the preprocessed barrage data to train the initial translation model, and after multiple rounds of iterations and hyperparameter tuning, continuously optimize the model performance, and finally obtain the translation model. Specifically, initialize the model parameters of the initial translation model, input the preprocessed barrage data into the model, generate the translation result, use the cross entropy loss function to calculate the difference between the predicted result and the actual result, perform back propagation based on the loss value, update the model parameters, repeat the above steps in multiple rounds of iterations, optimize the model performance, and after each iteration cycle, use the validation set to evaluate the model performance, adjust the hyperparameters to optimize the model until the loss value is less than the first threshold, and obtain the final translation model, so that a robust translation model can be trained. The content of the plot and barrage is very rich, and the translation model needs to be in place in one step. Therefore, the training of the translation model needs to be able to be continuously fine-tuned according to usage to improve recognition accuracy.
[0083] Optionally, in this embodiment, by obtaining bullet comment data containing multilingual translations and performing preprocessing, the initial translation model is trained with the data to ensure data quality and model optimization, so that the translation model can accurately translate multilingual bullet comments, improve translation accuracy and international support for the platform.
[0084] As an optional example, the processing module includes:
[0085] A deletion unit, used to delete duplicate data, special characters and invalid data in the bullet comment data;
[0086] The word segmentation unit is used to perform word segmentation on the bullet comment data and build a vocabulary based on the word segmentation results;
[0087] The segmentation unit is used to segment the bullet comment data into a training data set and a validation data set.
[0088] Optionally, in this embodiment, the bullet screen data is preprocessed, including but not limited to data cleaning, deduplication, word segmentation, serialization, data segmentation and other processes. Specifically, irrelevant symbols, special characters and noise data are removed to ensure data quality. Duplicate bullet screen data is deleted to avoid data redundancy. The original bullet screen and the translated bullet screen are segmented. For Chinese bullet screen, a special Chinese word segmentation tool is used. The segmented bullet screen text is converted into a vector or tag form acceptable to the translation model, and a vocabulary and index sequence are constructed. The data set is divided into a training set, a validation set and a test set for model training and evaluation.
[0089] As an optional example, the training module includes:
[0090] A translation unit, used to input the training data set into the initial translation model to obtain a translation result data set, wherein the translation result data set includes translation results corresponding to multiple languages;
[0091] A calculation unit, used to calculate the difference between the translation result data set and the verification data set using a loss function to obtain a loss value;
[0092] The adjustment unit is used to adjust the model parameters of the initial translation model according to the loss value, and recalculate the loss value until the recalculated loss value is less than the first threshold value, so as to obtain the translation model.
[0093] Optionally, in this embodiment, a suitable translation model architecture is selected, such as a GPT model, the model parameters are initialized, the initial translation model is trained using the preprocessed bullet screen data, and after multiple rounds of iterations and hyperparameter tuning, the model is continuously optimized, and finally a translation model can be obtained. Specifically, the model parameters of the initial translation model are initialized, the preprocessed bullet screen data is input into the model, the translation result is generated, the cross entropy loss function is used to calculate the difference between the predicted result and the actual result, back propagation is performed according to the loss value, and the model parameters are updated. In multiple rounds of iterations, the above steps are repeated to optimize the model performance. After each iteration cycle, the model performance is evaluated using the validation set, and the hyperparameters are adjusted to optimize the model until the loss value is less than the first threshold value, and the final translation model is obtained, so that a robust translation model can be trained. The content of the plot and bullet screen is very rich, and the translation model needs to be in place in one step. Therefore, the training of the translation model needs to be able to be continuously fine-tuned according to the usage to improve the recognition accuracy.
[0094] As an optional example, the original barrage in the barrage data comes from multiple video platforms and / or multiple social platforms.
[0095] Optionally, in this embodiment, data is obtained from multiple platforms to increase the diversity and representativeness of barrages. The barrage data can cover more content and language scenarios, and improve the generalization ability of the translation model.
[0096] As an optional example, the above device further includes:
[0097] An extraction module is used to input the bullet text and the target language into the translation model to obtain the translation text corresponding to the bullet text, and after each target number of translation texts is obtained, extract a target translation text from the target number of translation texts;
[0098] A fourth acquisition module is used to acquire a target bullet text corresponding to a target translation text;
[0099] A determination module, used to determine the accuracy of the target translation text according to the target barrage text;
[0100] A modification module, configured to modify the target translation text when the accuracy is less than a second threshold value, so that the accuracy of the modified target translation text is greater than or equal to the second threshold value;
[0101] The first optimization module is used to optimize the translation model using the target barrage text and the modified target translation text.
[0102] Optionally, in this embodiment, the translation model may not be able to achieve the optimal translation effect immediately, and the model needs to be evaluated and optimized periodically. A certain proportion of bullet texts can be used for manual review, and a target number (e.g., 10 translation texts) can be set. Whenever a set number of translation texts are collected, a target translation text is randomly selected. The original bullet text corresponding to the target translation text is found from the data set to ensure that the original bullet text and the target translation text exist in pairs for accuracy inspection. The accuracy of the target translation text is evaluated by a language expert or translator based on the target bullet text. The scoring criteria may include language fluency, semantic correctness, and cultural adaptability. Or use an automated evaluation tool to calculate the accuracy of the target translation text. Define a minimum accuracy threshold (e.g., 70 points). When the accuracy of the target translation text is lower than the threshold, it is modified by a language expert or translator, and the modified translation text is then evaluated for accuracy to ensure that its accuracy reaches or exceeds the threshold. Add the target bullet text and the modified target translation text to the training data set, retrain the translation model using the updated training data, and optimize the translation model parameters. Repeat the above steps to continuously optimize the performance of the translation model.
[0103] Optionally, in this embodiment, random sampling is performed to ensure that the extracted target translation text is representative and reflects the overall data quality. Regular sampling of translation text for inspection helps to continuously monitor the performance of the translation model. Through feedback training, the model is continuously optimized to improve translation quality. The translation model can thus be dynamically adjusted according to the latest data and feedback to maintain high performance.
[0104] As an optional example, the above device further includes:
[0105] A fifth acquisition module, used to obtain user feedback information on the translated text after displaying the translated text in the target area of the video platform;
[0106] The second optimization module is used to optimize the translation model according to the feedback information.
[0107] Optionally, in this embodiment, a feedback button or option is provided to the user on the video platform, and the user can provide feedback for each translated text, so that the user can submit what they think is a better translation, or correct the wrong translation. The feedback type may include: correct, wrong, unclear, culturally incompatible, etc. When the user clicks the feedback button, the specific content of the user's feedback is recorded, and the user's additional comments or suggestions are collected to obtain more detailed feedback information. The user feedback information is stored in the database together with the corresponding translated text and the original barrage text for subsequent analysis and use. The collected user feedback is classified and analyzed to identify common problems and error types. According to the user feedback, the problematic translated text is annotated, and the annotated content includes the problem type and correction suggestions. The annotated feedback data is added to the training data set, including the original barrage text and the translated text corrected by the user. The translation model is retrained using the updated training data set, and the reinforcement learning method is adopted to enable the model to learn from user feedback and gradually improve the translation quality. During the training process, the model parameters and hyperparameters are adjusted to further optimize the model performance. User feedback is collected regularly, the training data is updated, and the model is retrained to form a closed loop of continuous optimization.
[0108] For other examples of this embodiment, please refer to the above examples and will not be repeated here.
[0109] Figure 3 is a schematic diagram of an optional electronic device according to an embodiment of the present application, such as Figure 3 As shown, it includes a processor 302, a communication interface 304, a memory 306 and a communication bus 308, wherein the processor 302, the communication interface 304 and the memory 306 communicate with each other through the communication bus 308, wherein,
[0110] Memory 306, used for storing computer programs;
[0111] The processor 302 is used to implement the following steps when executing the computer program stored in the memory 306:
[0112] Get the bullet text sent by the user to the video platform;
[0113] Get the target language that the barrage text needs to be translated into;
[0114] Input the bullet text and the target language into the translation model to obtain a translation text corresponding to the bullet text, wherein the language of the translation text is the target language;
[0115] Display the translated text in the target area of the video platform.
[0116] Optionally, in this embodiment, the communication bus may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 The communication interface is used for communication between the above electronic device and other devices.
[0117] The memory may include RAM, or may include non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0118] As an example, the memory 306 may include, but is not limited to, the first acquisition module 202, the second acquisition module 204, the translation module 206, and the display module 208 in the translation device for the bullet text. In addition, other module units in the translation device for the bullet text may also be included but are not limited to, which will not be repeated in this example.
[0119] The above-mentioned processor can be a general-purpose processor, which can include but not be limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processing), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0120] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.
[0121] It can be understood by those skilled in the art that Figure 3 The structure shown is for illustration only, and the device for implementing the above-mentioned bullet screen text translation method may be a terminal device, which may be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, and other terminal devices. Figure 3 The structure of the electronic device is not limited. For example, the electronic device may also include Figure 3 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 3 Different configurations shown.
[0122] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which can include: a flash drive, ROM, RAM, a magnetic disk or an optical disk, etc.
[0123] According to another aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program executes the steps in the above-mentioned method for translating barrage text when executed by a processor.
[0124] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0125] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0126] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
[0127] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0128] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0129] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0130] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0131] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for translating bullet text, characterized in that: include: Get the bullet text sent by the user to the video platform; Obtain the target language into which the barrage text needs to be translated; Inputting the bullet text and the target language into a translation model to obtain a translation text corresponding to the bullet text, wherein the language of the translation text is the target language; The translated text is displayed in a target area of the video platform.
2. The method according to claim 1, characterized in that Before inputting the bullet text and the target language into the translation model to obtain the translation text corresponding to the bullet text, the method further includes: Obtaining barrage data, wherein the barrage data includes multiple groups of barrage data, and one group of barrage data includes original barrage and translated barrage corresponding to multiple languages; Preprocessing the barrage data; The initial translation model is trained using the preprocessed bullet comment data to obtain the translation model.
3. The method according to claim 2, characterized in that The preprocessing of the bullet screen data comprises: Deleting duplicate data, special characters and invalid data in the barrage data; Performing word segmentation on the bullet comment data, and constructing a vocabulary table according to the word segmentation results; The bullet comment data is divided into a training data set and a validation data set.
4. The method according to claim 2, characterized in that: The initial translation model is trained using the preprocessed bullet screen data to obtain the translation model, including: Inputting the training data set into the initial translation model to obtain a translation result data set, wherein the translation result data set includes translation results corresponding to multiple languages; Use the loss function to calculate the difference between the translation result dataset and the verification dataset to obtain the loss value; The model parameters of the initial translation model are adjusted according to the loss value, and the loss value is recalculated until the recalculated loss value is less than a first threshold, thereby obtaining the translation model.
5. The method according to claim 2, characterized in that: The original barrage in the barrage data comes from multiple video platforms and / or multiple social platforms.
6. The method according to claim 1, characterized in that After inputting the bullet text and the target language into the translation model to obtain a translation text corresponding to the bullet text, the method further includes: After obtaining a target number of translation texts, extracting a target translation text from the target number of translation texts; Obtain the target bullet text corresponding to the target translation text; Determining the accuracy of the target translation text according to the target bullet text; In the case where the accuracy is less than a second threshold, modifying the target translation text so that the accuracy of the modified target translation text is greater than or equal to the second threshold; The translation model is optimized using the target barrage text and the modified target translation text.
7. The method according to claim 1, characterized in that After displaying the translated text in the target area of the video platform, the method further includes: Obtaining feedback information from the user on the translated text; The translation model is optimized according to the feedback information.
8. A translation device for bullet text, characterized in that: include: The first acquisition module is used to acquire the bullet text sent by the user to the video platform; The second acquisition module is used to acquire the target language into which the barrage text needs to be translated; A translation module, used for inputting the bullet text and the target language into a translation model to obtain a translation text corresponding to the bullet text, wherein the language of the translation text is the target language; A display module is used to display the translated text in a target area of the video platform.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is executed.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.
