Translation determination method, device and electronic equipment

By matching the text translation and rhymes of multimedia files in electronic devices, candidate translations that meet the rhyme requirements are determined, and the problem of rigid translation of lyrics in the prior art is solved, and the multimedia file processing effect and user experience are improved.

CN114519359BActive Publication Date: 2024-12-03VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210038608.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-13
Publication Date
2024-12-03
Estimated Expiration
2042-01-13

AI Technical Summary

Technical Problem

When existing electronic devices process multimedia files, the bluntness of the translation lyrics makes users unable to fully understand the language habits of the songs, affecting the user experience and the device's multimedia file processing effect.

Method used

By translating the text in the multimedia file, N candidate translations are obtained, and based on the target rhyme information, K candidate translations are determined so that their meaning is the same as the original N candidate translations, meeting the rhyme needs, thereby improving the degree of rhyme and User experience.

Benefits of technology

It improves the effect of electronic devices in processing multimedia files, making the translated lyrics more in line with users' language habits and rhyme needs, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114519359B_ABST
    Figure CN114519359B_ABST
Patent Text Reader

Abstract

The present application discloses a translation determination method, device and electronic device, belonging to the field of communication technology. The method comprises: translating the first text in a multimedia file to obtain N candidate translations, where N is a positive integer; based on the N candidate translations and target rhyme information, determining K candidate translations, where K is a positive integer; wherein the meanings of the K candidate translations are the same as the meanings of the N candidate translations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of communication technology, and specifically relates to a translation determination method, device and electronic equipment. Background Art

[0002] With the development of communication technology, electronic devices are more and more widely used in users' daily lives. For example, users can enjoy music played by electronic devices.

[0003] Typically, when an electronic device is playing a song (e.g., an English song), if a user wants to view the corresponding lyrics of the song in other languages ​​(e.g., Chinese lyrics), the user can trigger the electronic device to turn on the lyrics translation function, so that the electronic device can input the lyrics of the English song into a translation model to obtain the corresponding Chinese lyrics of the English song, and then the electronic device can display the Chinese lyrics, so that the user can view the Chinese lyrics.

[0004] However, based on the above method, since the lyrics translated by the translation model are usually stiff and do not conform to the user's language habits, the lyrics translated by the translation model can only help users understand the general meaning of the song, resulting in poor effect of electronic devices in processing multimedia files. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide a translation determination method, device and electronic device, which can solve the problem that the electronic device has poor effect in processing multimedia files.

[0006] In a first aspect, an embodiment of the present application provides a method for determining a translation, the method comprising: translating a first text in a multimedia file to obtain N candidate translations, where N is a positive integer; based on the N candidate translations and target rhyme information, determining K candidate translations, where K is a positive integer; wherein the meanings of the K candidate translations are the same as the meanings of the N candidate translations.

[0007] In a second aspect, an embodiment of the present application provides a translation determination device, which includes: a translation module and a determination module. The translation module is used to translate the first text in the multimedia file to obtain N candidate translations, where N is a positive integer. The determination module is used to determine K candidate translations based on the N candidate translations and target rhyme information, where K is a positive integer; wherein the meanings of the K candidate translations are the same as the meanings of the N candidate translations.

[0008] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.

[0009] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0010] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.

[0011] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.

[0012] In an embodiment of the present application, the first text in the multimedia file is translated to obtain N candidate translations, where N is a positive integer; based on the N candidate translations and the target rhyme information, K candidate translations are determined, where K is a positive integer; wherein the meanings of the K candidate translations are the same as the meanings of the N candidate translations. Through this scheme, after translating a text in a multimedia file to obtain at least one candidate translation, the candidate translation to be used can be determined based on the at least one candidate translation and the target rhyme information, so the candidate translation to be used is more in line with the rhyme requirements. In this way, the effect of electronic devices in processing multimedia files is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 A schematic diagram of a translation determination method provided in an embodiment of the present application;

[0014] Figure 2 A schematic diagram of a rhyme withdrawal provided in an embodiment of the present application;

[0015] Figure 3 A schematic diagram of an interface for determining a translation provided in an embodiment of the present application;

[0016] Figure 4 A schematic diagram of the structure of a translation determination device provided in an embodiment of the present application;

[0017] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0018] Figure 6 A hardware schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0019] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0020] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0021] Rhyme: Thirteen common rhymes, specifically including: Fahua, Posuo, Miexie, Yiqi, Gusu, Huailai, Huidui, Yaotiao, Youqiu, Yanqian, Renchen, Jiangyang and Zhongdong. Among them, different rhyme sets determine different rhymes of candidate translations. For example, rhyme can be used to evaluate whether the lyrics rhyme. In the embodiment of the present application, it is used to judge whether the text parameters of the first candidate translation match the target text parameters, that is, whether the rhyme of the first candidate translation matches the target rhyme.

[0022] The method for determining multiple translations provided by the embodiment of the present application is described in detail below through specific embodiments and application scenarios in conjunction with the accompanying drawings.

[0023] like Figure 1 As shown, an embodiment of the present application provides a method for determining a translation, which includes S101 and S102.

[0024] S101: A translation determination device translates a first text corresponding to a multimedia file to obtain N candidate translations.

[0025] Wherein, N is a positive integer.

[0026] Optionally, the multimedia file may be any of the following: a document file, an audio file, or a video file. That is, the translation determination method provided in the embodiment of the present application may be used in text translation scenarios, such as English-Chinese lyrics translation scenarios; rhythmic audio generation and text matching scenarios; and video translation scenarios, such as MV translation, opera translation, etc.

[0027] Exemplarily, taking the multimedia file as a document file as an example, a word document is displayed on the electronic device, that is, the multimedia file is the word document (for example, lyrics).

[0028] Exemplarily, taking the multimedia file as an audio file as an example, when the electronic device plays a song, the multimedia file may be the song.

[0029] For example, taking the multimedia file as a video file as an example, when the electronic device plays a music video (MV), the multimedia file is the music video.

[0030] Optionally, when the multimedia file is an audio file or a video file, before the above S101, the translation determination method provided in the embodiment of the present application further includes: performing speech recognition on the multimedia file to obtain a target text of the multimedia file. The target file may be the text corresponding to all audios of the multimedia file, which is the text of the audio segment currently being played in the multimedia file.

[0031] For example, assuming that the electronic device is playing the song "If I leave the little castle you gave me" from "Prison Bird", the target text can be the lyrics of the entire song, or the target file can be the lyrics of the currently playing audio clip "If I leave the little castle you gave me".

[0032] Further optionally, when the multimedia file is a document file, the first text is any sentence in the document file; when the multimedia file is an audio file, the first text is the text obtained by performing speech recognition on any audio segment in the audio file; when the multimedia file is a video file, the first text is the text obtained by performing speech recognition on any audio segment in the audio file obtained by parsing the video file. In this way, the first text can be the first sentence text or non-first sentence text in the multimedia file, which is determined according to the usage, and the embodiments of the present application do not limit this.

[0033] S102: The translation determination device determines K candidate translations based on the N candidate translations and the target rhyme information.

[0034] The meanings of the K candidate translations are the same as the meanings of the N candidate translations. K is a positive integer.

[0035] It should be noted that, in the embodiment of the present application, the rhyme information of each candidate translation in the above K candidate translations matches the target rhyme information.

[0036] Optionally, the target rhyme information is related to the rhyme, and different rhymes have different target rhyme information. The rhyme can be set by the manufacturer when the product leaves the factory, or can be customized by the user.

[0037] Optionally, the first text is a non-first sentence text in the multimedia file that meets a preset condition. Before the above S102, the translation determination method provided in the embodiment of the present application further includes the following S103 and S104.

[0038] S103: The translation determination device performs word segmentation processing on the candidate translations of the second text to obtain a word segmentation processing result.

[0039] The second text is the previous text of the first text in the multimedia file.

[0040] Optionally, the above-mentioned preset conditions may include any of the following: when the candidate translations of the even-numbered sentences of the multimedia file rhyme, the first text is the even-numbered sentence text other than the second sentence in the multimedia file; when the candidate translations of the odd-numbered sentences of the multimedia file rhyme, the first text is the odd-numbered sentence text other than the third sentence in the multimedia file; when the candidate translations of each text in the multimedia file rhyme, the first text is any text other than the first sentence in the multimedia file.

[0041] Furthermore, the second text is determined according to the candidate translation rhyme type information. When the candidate translation rhyme type information indicates the candidate translation rhyme of each text in the multimedia file, the second text is the previous text adjacent to the first text in the multimedia file; when the candidate translation rhyme type information indicates the candidate translation rhyme of the even-numbered sentence text in the multimedia file, the second text is the previous text in the multimedia file that is separated from the first text by one text, that is, the second text is also the even-numbered sentence text in the multimedia file; when the rhyme type information indicates the candidate translation rhyme of the odd-numbered sentence text in the multimedia file, the second text is the previous text in the multimedia file that is separated from the first text by one text, that is, the second text is also the odd-numbered sentence text in the multimedia file. It can be determined specifically according to actual usage, and the embodiments of the present application are not limited to this.

[0042] It can be understood that when the candidate translations of the even-numbered sentences of a multimedia file rhyme, if the first text is the odd-numbered sentence text or the second sentence text in the multimedia file, there is no rhyme requirement for the candidate translations of the first text; when the candidate translations of the odd-numbered sentences of a multimedia file rhyme, if the first text is the even-numbered sentence text or the third sentence text in the multimedia file, there is no rhyme requirement for the candidate translations of the first text.

[0043] Optionally, the above-mentioned word segmentation processing of the candidate translation of the second text may specifically include: segmenting the text of the candidate translation of the second text in the form of single words or phrases, so as to obtain multiple words and multiple phrases. For details, reference may be made to the description in the related art, and the embodiments of the present application will not be repeated. It is understandable that the obtained multiple words and multiple phrases are the results of the word segmentation processing.

[0044] S104: The translation determination device determines target rhyme information based on the word segmentation processing result.

[0045] The target rhyme information includes at least one of the following: the target rhyme, the text length of the target rhyme. The target rhyme includes: a preset number of characters at the end of the candidate translation of the second text.

[0046] Optionally, the target rhyme specifically refers to: a rhyme of a preset number of characters at the end of the candidate translation of the second text, for example, the rhyme of the last character at the end of the candidate translation of the second text.

[0047] Exemplarily, the preset number may be 1, and the rhyme type of the candidate text is a single rhyme type; the preset number may be 2, and the rhyme type of the candidate text is a double rhyme type.

[0048] It should be noted that, since a preset number of characters at the end of the candidate translation of the second text can be obtained according to the word segmentation result, the preset number of characters can be used as the target rhyme, and the length of the preset number of characters is the text length of the target rhyme.

[0049] In an embodiment of the present application, since the candidate translations of the second text can be segmented to obtain a segmentation result, and the target rhyme information can be determined based on the segmentation result, K candidate translations can be determined based on the giant target rhyme information and N candidate translations.

[0050] Optionally, the above S102 may be specifically implemented through the following S102A and S102B; or, implemented through the following S102A, S102C and S102D.

[0051] S102A: The translation determination device determines whether the first character string of the first candidate translation among the N candidate translations matches the target rhyme information.

[0052] The first character string includes a preset number of characters at the end of the first candidate translation.

[0053] Optionally, the first candidate translation is any one of the N candidate translations. The first character string is the rhyme of the first candidate translation.

[0054] Exemplarily, if the N candidate translations are Chinese candidate translations, then the characters or character strings (eg, the first character string) involved in the embodiments of the present application may include any of the following: a single Chinese character, a phrase.

[0055] It can be understood that by determining whether the first character string of the first candidate translation matches the target rhyme information, a part of candidate translations can be selected from the N candidate translations, the rhyme of which matches the target rhyme information; further, another part of the N candidate translations is processed.

[0056] S102B: If the first character string of the first candidate translation among the N candidate translations matches the target rhyme information, the translation determination device determines the first candidate translation as a candidate translation among the K candidate translations.

[0057] Optionally, the first character string and the target rhyme match may include the following two possible situations:

[0058] (1) The first character string and the target rhyme belong to the same rhyme group.

[0059] (2) The rhyme of the first character string is the same as the target rhyme.

[0060] It can be understood that if the first character string of the first candidate translation matches the target rhyme information, the rhyme of the first candidate translation meets the rhyme requirement, so the first candidate translation can be directly determined as a candidate translation among the K candidate translations.

[0061] S102C: If the first character string of the first candidate translation does not match the target rhyme information, the translation determination device replaces the first character string in the first candidate translation to obtain a second candidate translation.

[0062] Optionally, when the first character string does not match the target rhyme information, there may be the following two possible situations:

[0063] (1) The first character string and the target rhyme belong to different rhyme groups.

[0064] (2) The rhyme of the first character string is different from the target rhyme.

[0065] It can be understood that, since the first character string in the first candidate translation is replaced according to the target rhyme information, the rhyme of the obtained second candidate translation matches the target rhyme information.

[0066] like Figure 2 As shown, when the rhyme is fahua rhyme (a, ua, ia), the last character of the Chinese candidate translation is sha (sha), and when the rhyme is renchen rhyme (en, in, uen, un, ün), the last character of the Chinese candidate translation is chun (chun).

[0067] Exemplarily, for the "Fa Hua" rhyme, its finals include a, ua, and ia. Suppose the first candidate translation output by the translation model is "I don't want to grow up, there will be no fairy tales in the world after growing up. I don't want to grow up, I'd rather be stupid forever". When selecting the end-rhyme method and single-rhyme setting for each sentence, it is determined that the last character of the first candidate translation is a single character "stupid", but "stupid" does not belong to the "Fa Hua" rhyme. Through the synonym replacement method and rhyme matching, it can be found that "silly" (sha) matches the target rhyme information. Therefore, replacing "stupid" with "silly" can improve the rhyming degree of the translation, and thus the first candidate translation can be adjusted to "I'd rather be stupid and silly forever" (i.e., the second candidate translation).

[0068] In the embodiments of the present application, on the one hand, since when the first string of the first candidate translation matches the target rhyme information, the first candidate translation can be directly determined as the candidate translation among the K candidate translations, so the candidate translation that meets the user's rhyming requirements can be selected from the N candidate translations; on the other hand, since when the first string of the first candidate translation does not match the target rhyme information, the first string in the first candidate translation can be replaced to obtain the second candidate translation, and the second candidate translation is determined as the candidate translation among the target candidate translations, so the candidate translation that does not meet the rhyming requirements can be processed again to obtain the candidate translation that meets the user's rhyming requirements. In this way, both the ability to process multimedia files is improved and the user experience is enhanced.

[0069] Optionally, the translation determination device in the above S102C replaces the first string in the first candidate translation to obtain the second candidate translation, which can be specifically implemented by the following S102C1 and S102C2.

[0070] S102C1. If the first difference is less than the first preset threshold and greater than or equal to the second preset threshold, the translation determination device replaces Q strings in the first candidate translation to obtain the second candidate translation.

[0071] Wherein, the above first difference is the absolute value of the difference between the first text length of the first candidate translation and the second text length of the first text; the third text length of the second candidate translation is equal to the second text length, and the second string in the second candidate translation matches the target rhyme information, and the second string includes a preset number of characters at the end of the second candidate translation. The Q strings include the first string, and Q is a positive integer.

[0072] Optionally, the above first preset threshold and second preset threshold can be set by the manufacturer at the factory or customized by the user. The embodiments of the present application do not limit this. It can be understood that the second preset threshold is less than or equal to the first preset threshold, and both are positive integers.

[0073] Optionally, the first text length may be determined according to the number of characters included in the first candidate translation.

[0074] Optionally, in an embodiment of the present application, the length of the second text may be determined according to the number of text pronunciations of the first text, wherein the number of text pronunciations is obtained by a text pronunciation feature of the first text, and the text pronunciation feature may include at least one of the following: a syllable, a phoneme.

[0075] Exemplarily, assuming that the first text is a Chinese text, since Chinese is written in units of characters, and each character corresponds to a pronunciation, the number of characters included in the first text is the second text length.

[0076] For example, assuming that the first text is an English text, since English is based on words, one English word may correspond to multiple Chinese characters, so it is necessary to identify the pronunciation features of the English text, such as syllables and phonemes, to determine the number of pronunciations of the English text, so that the number of pronunciations can be determined as the second text length.

[0077] It is understandable that, in the case where the multimedia file is lyrics, the second text length of the first text can determine the rhythm of the first text in the multimedia file. In this way, when the first text length of the first candidate translation is not equal to the second text length, the first candidate translation is processed according to the second text length to obtain a second candidate translation, and the music rhythm of the second candidate translation is equivalent to that of the first text, so that it is convenient for users to use the second candidate translation (for example, it is convenient for users to hum the Chinese translation of English songs and it is not easy to be out of tune).

[0078] For example, when the first preset threshold is 2 and the second preset threshold is 1, if the first difference is 1, the first text length of the first candidate translation is longer than the second text length of the first text; or, if the first difference is negative 1, the first text length of the first candidate translation is shorter than the second text length of the first text.

[0079] In view of the above situation, specifically, in S102C1, replacing Q character strings in the first candidate translation to obtain the second candidate translation may include the following two possible implementations:

[0080] (1) When the first text length of the first candidate translation is shorter, the Q character strings are at least one character string with shorter character length in the first candidate translation and include the first character string, that is, the at least one character string can be replaced with a character string with longer character length through a synonym dictionary.

[0081] (2) When the first text length of the first candidate translation is longer, the Q character strings are at least one character string with a longer character length in the first candidate translation and include the first character string, that is, the at least one character string can be replaced with a character string with a shorter character length through a synonym dictionary.

[0082] It should be noted that, in the above-mentioned embodiment of the present application, the first character string is replaced with a target character string having the same meaning as the first character string, and the rhyme information of the target character string matches the target rhyme information.

[0083] S102b2: If the first difference is greater than or equal to the first preset threshold, the translation determination device converts the first candidate translation into a third candidate translation, and replaces S character strings in the third candidate translation to obtain a second candidate translation.

[0084] The first difference is the difference between the first text length of the first candidate translation and the second text length of the first text. The third text length of the second candidate translation is equal to the second text length, and the second character string in the second candidate translation matches the target rhyme information, and the second character string includes a preset number of characters at the end of the second candidate translation. S is a positive integer.

[0085] Exemplarily, when the first preset threshold is 3, if the first difference is 5, it means that the first text length of the first candidate translation is much larger than the second text length of the first text; or, if the first difference is negative 4, it means that the first text length of the first candidate translation is much smaller than the second text length of the first text.

[0086] Optionally, the conversion of the first candidate translation into the third candidate translation may include the following two possible implementations:

[0087] (1) When the third text length of the second candidate translation is much longer than the first text length, the first candidate translation is converted into a summary text, i.e., the third candidate translation, through a text summary model.

[0088] (2) When the third text length of the second candidate translation is much shorter than the first text length, the first candidate translation is converted into a paraphrase text, i.e., the third candidate translation, through a text paraphrase model.

[0089] In an embodiment of the present application, if the absolute value of the first difference between the first text length and the second text length is less than the first preset threshold and greater than or equal to the second preset threshold, then the Q character strings in the first candidate translation are replaced to obtain the second candidate translation; or, if the absolute value of the first difference is greater than or equal to the first preset threshold, the first candidate translation is converted into a third candidate translation, and the S character strings in the third candidate translation are replaced to obtain the second candidate translation. In this way, on the basis of ensuring that the meaning of the second candidate translation is the same as that of the first candidate translation, not only can the third text length of the second candidate translation be equal to the first text length, but also the rhyme information of the second candidate translation can be ensured to match the target rhyme information.

[0090] Further, if the end character string of the third candidate translation matches the target rhyme information, the S character strings do not include the end character string; if the end character string of the third candidate translation does not match the target rhyme information, the S character strings include the end character string. The specific determination is based on actual conditions, and the embodiment of the present application does not limit this.

[0091] In addition, for replacing S character strings in the third candidate translation to obtain the second candidate translation, reference may be made to the detailed description of replacing Q character strings in the first candidate translation to obtain the second candidate translation in the above embodiment, which will not be repeated in detail in the embodiment of the present application.

[0092] It should be noted that the above Figure 2 The content in is only used to show the specific processing process of the first candidate translation, so that users can better understand it. Figure 2 The content in can be used as the process of content realization and is not specifically displayed in the interface.

[0093] S102D: The translation determination device determines the second candidate translation as a candidate translation among target candidate translations.

[0094] The first character string includes a preset number of characters at the end of the first candidate translation.

[0095] For example, the translation determination device is a mobile phone, and N=1. Figure 3 As shown in (a) of FIG, the mobile phone is playing an English song. If the user wants to view the Chinese lyrics of this song, the user can click the translation button, so that the mobile phone can start the translation function and translate the English song. Figure 3As shown in (a) in FIG. 1 , the mobile phone translates "On a balcony in summer air" (i.e., the first text) in the English lyrics (i.e., the multimedia file) and obtains candidate translation 01 "Xiang xi jing jiu ... Figure 3 The candidate translation 02 shown in (b) in FIG. 1 is “Standing on the summer balcony and meeting”. Thus, the meaning of the candidate translation 02 is the same as that of the candidate translation 01, and the rhyme information of the candidate translation 02 matches the target rhyme information.

[0096] The embodiment of the present application provides a translation determination method, which, after translating a text in a multimedia file and obtaining at least one candidate translation, can determine a candidate translation to be used based on the at least one candidate translation and target rhyme information, so that the candidate translation to be used is more in line with the rhyme requirement. In this way, the effect of processing multimedia files by the electronic device is improved.

[0097] Optionally, after the above S102, the translation determination method provided in the embodiment of the present application may further include the following S105.

[0098] S104: The translation determination device displays the target candidate translation among the K candidate translations.

[0099] The target candidate translation is determined based on candidate translation evaluation information, which may include at least one of the following: fluency of the candidate translation, relevance of the candidate translation to the first text, relevance of the current candidate translation to other candidate translations, and rhyme degree of the candidate translation.

[0100] For example, the candidate translation evaluation information is taken as the fluency of the candidate translation. The perplexity of the candidate translation is calculated by the algorithm of text coherence detection in the language model. The perplexity is used to evaluate the fluency of the candidate translation obtained by translation.

[0101] It should be noted that the higher the perplexity, the worse the fluency; the lower the perplexity, the higher the fluency. In this way, the perplexity can be used as a basis for judging the fluency of candidate translations.

[0102] Exemplarily, the candidate translation evaluation information is taken as the correlation between the candidate translation and the first text. The quality of the candidate translation (i.e., the correlation between the candidate translation and the first text) is evaluated according to the method of automatic evaluation without reference answers. For example, after extracting features such as words, phrases, sentences, etc. from the candidate translation through a learning model, a classification or regression algorithm is used to predict the quality of the translation result, and the result of whether the quality of the candidate translation is good or bad is output. For example, the probability corresponding to the quality of the candidate translation can be output through a regression algorithm. When the value of the probability is closer to 1, the quality of the candidate translation is better, that is, the correlation between the candidate translation and the first text is higher; when the value of the probability is closer to 0, the quality of the candidate translation is worse, that is, the correlation between the candidate translation and the first text is lower.

[0103] For example, the candidate translation evaluation information is taken as the correlation between the current candidate translation and other candidate translations. In the scenario of translating lyrics, the lyrics corpus is added to the pre-trained model for training, and the correlation between the current candidate translation and other candidate translations is calculated by the trained model. The correlation can be expressed as probability. When the probability value is closer to 1, the correlation is higher; when the probability value is closer to 0, the correlation is lower.

[0104] It should be noted that when the candidate translation is the candidate translation of the first sentence in the multimedia file, there is no need to calculate the correlation between the candidate translation and other candidate translations.

[0105] For example, the candidate translation evaluation information is taken as the rhyme degree of the candidate translation. The algorithm strategy is used to calculate the rhyme degree of the current candidate translation and the candidate translation that has been translated before. When the multimedia file is a four-sentence paragraph, usually the second sentence candidate translation and the fourth sentence rhyme candidate translation, at this time, it can be determined whether the rhyme part of the last word of the second sentence candidate translation and the rhyme part of the last word of the fourth sentence candidate translation belong to the same rhyme.

[0106] For example, the candidate translation of the second sentence is "There are no fairy tales in the world when you grow up", and the candidate translation of the fourth sentence is "I would rather be stupid and foolish forever". At this time, the rhyme parts of the last characters of the candidate translations of these two sentences belong to the same rhyme, so the rhyme degree is 1.

[0107] Optionally, the above S105 may specifically include: the translation determination device displays the target candidate translation among the K candidate translations in the target area corresponding to the first text, so that the user can view the original text and the translation at the same time.

[0108] Optionally, after S102 and before S105, the translation determination method provided in the embodiment of the present application may further include: the translation determination device calculates the score of each candidate translation among the K candidate translations according to the candidate translation evaluation information; and selects the candidate translation with the highest score as the target candidate translation.

[0109] Optionally, the candidate translation evaluation information is used as an evaluation indicator for each candidate translation among the K candidate translations.

[0110] Specifically, in one possible case, when the K candidate translations are candidate translations of the first sentence text in a multimedia file, the scores of the two dimensions, namely, the fluency of the candidate translation and the relevance of the candidate translation to the first text, included in the candidate translation evaluation information are calculated, and then a weighted average of the scores of the two dimensions is calculated; in another possible case, when the K candidate translations are candidate translations of non-first sentence text in a multimedia file, the scores of the four dimensions included in the candidate translation evaluation information are calculated, and then a weighted average of the scores of the four dimensions is calculated.

[0111] Optionally, the weights of the evaluation information of each dimension in the candidate translation evaluation information may be the same or different. In actual use, the user can adjust the weights of the evaluation information of the four dimensions as needed.

[0112] Optionally, the above embodiment is exemplified by selecting a target candidate translation from K candidate translations according to candidate translation evaluation information. Of course, it is also possible to select any one of the K candidate translations as the target candidate translation, or to select the first candidate translation of the K candidate translations as the target candidate translation. The specific selection can be determined according to actual conditions, and the embodiment of the present application does not limit this.

[0113] The translation determination method in the embodiment of the present application, after determining K candidate translations, can display the target candidate translation among the K candidate translations determined based on the candidate translation evaluation information, thereby providing users with better candidate translations, which is easier for users to use and understand. For example, when playing foreign songs, users can view in real time a translation that is more in line with language habits and more rhythmic.

[0114] The translation determination method provided in the embodiment of the present application can be performed by a translation determination device (for example, the translation determination device is an electronic device). The method of performing translation determination by the translation determination device in the embodiment of the present application is taken as an example to illustrate the translation determination device provided in the embodiment of the present application.

[0115] Figure 4 A possible structural schematic diagram of a translation determination device 200 involved in an embodiment of the present application is shown. The translation determination device 200 may include a translation module 201 and a determination module 202. The translation module 201 may be used to translate the first text in the multimedia file to obtain N candidate translations, where N is a positive integer. The determination module 202 may be used to determine K candidate translations based on the N candidate translations and target rhyme information, where K is a positive integer; wherein the meanings of the K candidate translations are the same as the meanings of the N candidate translations.

[0116] Optionally, the first text is a non-first sentence text in a multimedia file that meets preset conditions; the translation determination device also includes a processing module. The processing module can be used to perform word segmentation processing on the candidate translation of the second text to obtain a word segmentation processing result, and the second text is the previous text of the first text in the multimedia file. The determination module can also be used to determine the target rhyme information based on the word segmentation processing result; wherein the target rhyme information includes at least one of the following: a target rhyme, a text length of the target rhyme, and the target rhyme includes a preset number of characters at the end of the candidate translation of the second text.

[0117] Optionally, the determination module can be specifically used to determine the first candidate translation as a candidate translation among the K candidate translations if the first character string of the first candidate translation among the N candidate translations matches the target rhyme information; or, if the first character string of the first candidate translation does not match the target rhyme information, replace the first character string in the first candidate translation according to the target rhyme information to obtain a second candidate translation; and determine the second candidate translation as a candidate translation among the target candidate translations. The first character string includes a preset number of characters at the end of the first candidate translation.

[0118] Optionally, the determination module can be specifically used to replace Q character strings in the first candidate translation to obtain a second candidate translation if the first difference is less than a first preset threshold and greater than or equal to a second preset threshold, wherein the Q character strings include the first character string, and Q is a positive integer; or, if the first difference is greater than or equal to the first preset threshold, convert the first candidate translation into a third candidate translation, and replace S character strings in the third candidate translation to obtain a second candidate translation, and S is a positive integer. The first difference is the difference between the first text length of the first candidate translation and the second text length of the first text; the third text length of the second candidate translation is equal to the second text length, and the second character string in the second candidate translation matches the target rhyme information, and the second character string includes a preset number of characters at the end of the second candidate translation.

[0119] Optionally, the translation determination device may further include a display module. The display module may be used to display a target candidate translation among the K candidate translations, and the target candidate translation is determined according to the candidate translation evaluation information. The candidate translation evaluation information includes at least one of the following: the fluency of the candidate translation, the relevance of the candidate translation to the first text, the relevance of the current candidate translation to other candidate translations, and the rhyme degree of the candidate translation.

[0120] The embodiment of the present application provides a translation determination device, which, after translating a text in a multimedia file and obtaining at least one candidate translation, can determine a candidate translation to be used based on the at least one candidate translation and target rhyme information, so that the candidate translation to be used is more in line with the rhyme requirement. In this way, the effect of processing multimedia files by the electronic device is improved.

[0121] The translation determination device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a car electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0122] The translation determination device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0123] The translation determination device provided in the embodiment of the present application can achieve Figures 1 to 3 To avoid repetition, the various processes implemented by the method embodiment are not described here.

[0124] Alternatively, if Figure 5 As shown, an embodiment of the present application further provides an electronic device 300, including a processor 301 and a memory 302, wherein the memory 302 stores a program or instruction that can be executed on the processor 301, and when the program or instruction is executed by the processor 301, each step of the above-mentioned translation determination method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0125] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0126] Figure 6 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.

[0127] The electronic device 400 includes but is not limited to components such as a radio frequency unit 401 , a network module 402 , an audio output unit 403 , an input unit 404 , a sensor 405 , a display unit 406 , a user input unit 407 , an interface unit 408 , a memory 409 , and a processor 410 .

[0128] Those skilled in the art will appreciate that the electronic device 400 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 410 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 6 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0129] Among them, the processor 410 can be used to translate the first text in the multimedia file to obtain N candidate translations, where N is a positive integer; and based on the N candidate translations and the target rhyme information, determine K candidate translations, where K is a positive integer; wherein the meanings of the K candidate translations are the same as the meanings of the N candidate translations.

[0130] Optionally, the first text is a non-first sentence text in a multimedia file that meets a preset condition; the translation determination device also includes a processing module. The processor 410 can be used to perform word segmentation processing on the candidate translation of the second text to obtain a word segmentation processing result, and the second text is the previous text of the first text in the multimedia file; and based on the word segmentation processing result, determine the target rhyme information; wherein the target rhyme information includes at least one of the following: a target rhyme, a text length of the target rhyme, and the target rhyme includes a preset number of characters at the end of the candidate translation of the second text.

[0131] Optionally, the processor 410 may be specifically configured to determine the first candidate translation as a candidate translation among the K candidate translations if the first character string of the first candidate translation among the N candidate translations matches the target rhyme information; or, if the first character string of the first candidate translation does not match the target rhyme information, replace the first character string in the first candidate translation according to the target rhyme information to obtain a second candidate translation; and determine the second candidate translation as a candidate translation among the target candidate translations. The first character string includes a preset number of characters at the end of the first candidate translation.

[0132] Optionally, the processor 410 can be specifically used to replace Q strings in the first candidate translation to obtain a second candidate translation if the first difference is less than a first preset threshold and greater than or equal to a second preset threshold, where the Q strings include the first string, and Q is a positive integer; or, if the first difference is greater than or equal to the first preset threshold, convert the first candidate translation into a third candidate translation, and replace S strings in the third candidate translation to obtain a second candidate translation, where S is a positive integer. The first difference is the difference between the first text length of the first candidate translation and the second text length of the first text; the third text length of the second candidate translation is equal to the second text length, and the second string in the second candidate translation matches the target rhyme information, and the second string includes a preset number of characters at the end of the second candidate translation.

[0133] Optionally, the display unit 406 can be used to display a target candidate translation among the K candidate translations, where the target candidate translation is determined based on the candidate translation evaluation information. The candidate translation evaluation information includes at least one of the following: fluency of the candidate translation, relevance of the candidate translation to the first text, relevance of the current candidate translation to other candidate translations, and rhyme degree of the candidate translation.

[0134] The embodiment of the present application provides an electronic device, which, after translating a text in a multimedia file and obtaining at least one candidate translation, can determine a candidate translation to be used based on the at least one candidate translation and target rhyme information, so that the candidate translation to be used is more in line with the rhyme requirement. In this way, the effect of the electronic device in processing multimedia files is improved.

[0135] It should be understood that in the embodiment of the present application, the input unit 404 may include a graphics processing unit (GPU) 4041 and a microphone 4042, and the graphics processor 4041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 406 may include a display panel 4061, and the display panel 4061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 407 includes a touch panel 4071 and at least one of other input devices 4072. The touch panel 4071 is also called a touch screen. The touch panel 4071 may include two parts: a touch detection device and a touch controller. Other input devices 4072 may include, but are not limited to, a physical keyboard, function keys (such as a volume control button, a switch button, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0136] The memory 409 can be used to store software programs and various data. The memory 409 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 409 may include a volatile memory or a non-volatile memory, or the memory 409 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 409 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0137] The processor 410 may include one or more processing units; optionally, the processor 410 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 410.

[0138] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned translation determination method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0139] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0140] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned translation determination method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0141] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0142] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned translation determination method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0143] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0144] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0145] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A method for determining a translation, characterized in that: The method comprises: Translate the first text in the multimedia file to obtain N candidate translations, where N is a positive integer; Based on the N candidate translations and the target rhyme information, determine K candidate translations, where K is a positive integer; The meanings of the K candidate translations are the same as the meanings of the N candidate translations; The first text is a non-first sentence text in the multimedia file that meets a preset condition; Before determining K candidate translations based on the N candidate translations and the target rhyme information, the method further includes: Performing word segmentation processing on a candidate translation of a second text to obtain a word segmentation processing result, wherein the second text is a text preceding the first text in the multimedia file; Based on the word segmentation processing result, determining the target rhyme information; The target rhyme information is that the target rhyme includes a preset number of characters at the end of the candidate translation of the second text.

2. The method according to claim 1, characterized in that The step of determining K candidate translations based on the N candidate translations and the target rhyme information includes: If the first character string of the first candidate translation among the N candidate translations matches the target rhyme information, the first candidate translation is determined as the candidate translation among the K candidate translations; or, If the first character string of the first candidate translation does not match the target rhyme information, replacing the first character string in the first candidate translation to obtain a second candidate translation, and determining the second candidate translation as a candidate translation in the target candidate translation; The first character string includes a preset number of characters at the end of the first candidate translation.

3. The method according to claim 2, characterized in that The replacing the first character string in the first candidate translation to obtain a second candidate translation includes: If the first difference is less than a first preset threshold and greater than or equal to a second preset threshold, then Q character strings in the first candidate translation are replaced to obtain the second candidate translation, where the Q character strings include the first character string, and Q is a positive integer; or If the first difference is greater than or equal to a first preset threshold, converting the first candidate translation into a third candidate translation, and replacing S character strings in the third candidate translation to obtain the second candidate translation, where S is a positive integer; The first difference is the absolute value of the difference between the first text length of the first candidate translation and the second text length of the first text; the third text length of the second candidate translation is equal to the second text length, and the second character string in the second candidate translation matches the target rhyme information, and the second character string includes a preset number of characters at the end of the second candidate translation.

4. The method according to claim 1, characterized in that After determining K candidate translations based on the N candidate translations and the target rhyme information, the method further includes: Displaying a target candidate translation among the K candidate translations, wherein the target candidate translation is determined according to the candidate translation evaluation information; The translation evaluation information includes at least one of the following: fluency of the candidate translation, relevance of the candidate translation to the first text, relevance of the current candidate translation to other candidate translations, and rhyme degree of the candidate translation.

5. A translation determination device, characterized in that: The translation determination device comprises a translation module and a determination module; The translation module is used to translate the first text in the multimedia file to obtain N candidate translations, where N is a positive integer; The determination module is used to determine K candidate translations based on the N candidate translations and target rhyme information, where K is a positive integer; The meanings of the K candidate translations are the same as the meanings of the N candidate translations; The first text is a non-first sentence text in the multimedia file that meets a preset condition; the translation determination device also includes a processing module; The processing module is used to perform word segmentation processing on the candidate translation of the second text to obtain a word segmentation processing result, wherein the second text is a text preceding the first text in the multimedia file; The determination module is further used to determine the target rhyme information based on the word segmentation processing result; The target rhyme information is that the target rhyme includes a preset number of characters at the end of the candidate translation of the second text.

6. The device according to claim 5, characterized in that The determination module is specifically configured to determine a first candidate translation among the N candidate translations as a candidate translation among the K candidate translations if a first character string of the first candidate translation among the N candidate translations matches the target rhyme information; or, If the first character string of the first candidate translation does not match the target rhyme information, then replacing the first character string in the first candidate translation according to the target rhyme information to obtain a second candidate translation; and determining the second candidate translation as a candidate translation among target candidate translations; The first character string includes a preset number of characters at the end of the first candidate translation.

7. The device according to claim 6, characterized in that The determination module is specifically configured to replace Q character strings in the first candidate translation to obtain the second candidate translation if the first difference is less than a first preset threshold and greater than or equal to a second preset threshold, wherein the Q character strings include the first character string, and Q is a positive integer; or, If the first difference is greater than or equal to a first preset threshold, converting the first candidate translation into a third candidate translation, and replacing S character strings in the third candidate translation to obtain the second candidate translation, where S is a positive integer; The first difference is the absolute value of the difference between the first text length of the first candidate translation and the second text length of the first text; the third text length of the second candidate translation is equal to the second text length, and the second character string in the second candidate translation matches the target rhyme information, and the second character string includes a preset number of characters at the end of the second candidate translation.

8. The device according to claim 5, characterized in that The translation determination device also includes a display module; The display module is used to display a target candidate translation among the K candidate translations, wherein the target candidate translation is determined according to the candidate translation evaluation information; The candidate translation evaluation information includes at least one of the following: fluency of the candidate translation, relevance of the candidate translation to the first text, relevance of the current candidate translation to other candidate translations, and rhyme degree of the candidate translation.

9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the method for determining a translation according to any one of claims 1 to 4 are implemented.

10. A readable storage medium, characterized in that: The readable storage medium stores a program or an instruction, and when the program or the instruction is executed by the processor, the steps of the method for determining a translation according to any one of claims 1 to 4 are implemented.