CN112115726A - Machine translation method, device, electronic equipment and readable storage medium - Google Patents

Machine translation method, device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN112115726A
CN112115726A CN202010988225.8A CN202010988225A CN112115726A CN 112115726 A CN112115726 A CN 112115726A CN 202010988225 A CN202010988225 A CN 202010988225A CN 112115726 A CN112115726 A CN 112115726A
Authority
CN
China
Prior art keywords
text
translation
language
stored
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010988225.8A
Other languages
Chinese (zh)
Inventor
张辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Didi Infinity Technology and Development Co Ltd
Original Assignee
Beijing Didi Infinity Technology and Development Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Didi Infinity Technology and Development Co Ltd filed Critical Beijing Didi Infinity Technology and Development Co Ltd
Priority to CN202010988225.8A priority Critical patent/CN112115726A/en
Publication of CN112115726A publication Critical patent/CN112115726A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/40Processing or translation of natural language
    • G06F40/58Use of machine translation, e.g. for multi-lingual retrieval, for server-side translation for client devices or for real-time translation

Abstract

The embodiment of the invention provides a machine translation method, a device, electronic equipment and a readable storage medium, and relates to the technical field of computers, wherein the method comprises the following steps: receiving a voice recognition text; translating the voice recognition text, and determining a translation text of at least one language of the voice recognition text; writing the translation text into a message device channel of a corresponding language according to the language of the translation text; receiving a target subscription message sent by a target terminal, wherein the target subscription message comprises target language information; determining a target message device channel corresponding to the target subscription message, wherein the translated text in the target message device channel is the translated text of the language corresponding to the target language information; and accessing the target terminal to the target message device channel so that the target terminal acquires the translation text in the target message device channel. Therefore, the translation cost can be reduced, and the translation pressure of the server side can be reduced.

Description

Machine translation method, device, electronic equipment and readable storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a machine translation method and apparatus, an electronic device, and a readable storage medium.
Background
At present, with the development of internet technology, online live broadcast is applied more and more, such as video conference, live program or video call, and in the process of online live broadcast, if languages used by participants of online live broadcast are different, information exchange is greatly hindered.
In the prior art, a server is provided with a real-time translation service, and during the real-time translation service, the server establishes a long connection with a client and translates a speech of language a into a caption of language B for the user to watch.
However, when the number of viewers increases, the Query Per Second (QPS) of the service end increases, and further, the capacity of the service end needs to be expanded, which increases the cost, and when the number of viewers increases, translation from one language to multiple languages is often needed, so that translation services for different languages need to be deployed, and the pressure of the service end increases.
Disclosure of Invention
In view of this, embodiments of the present invention provide a machine translation method, an apparatus, an electronic device, and a readable storage medium, so as to reduce translation cost and reduce translation pressure of a server.
In a first aspect, a machine translation method is provided, where the method is applied to an electronic device, and the method includes:
receiving a voice recognition text;
translating the voice recognition text, and determining a translation text of at least one language of the voice recognition text;
writing the translation text into a message device channel of a corresponding language according to the language of the translation text;
receiving a target subscription message sent by a target terminal, wherein the target subscription message comprises target language information;
determining a target message device channel corresponding to the target subscription message, wherein the translated text in the target message device channel is the translated text of the language corresponding to the target language information; and
and accessing the target terminal to the target message device channel so that the target terminal acquires the translation text in the target message device channel.
Optionally, the translating the speech recognition text and determining a translated text of at least one language of the speech recognition text includes:
based on the long stop symbols in the voice recognition text, segmenting the voice recognition text to determine a plurality of segmentation short sentences;
determining translation sub-texts of at least one language of each segmentation short sentence; and
based on each translated sub-text, at least one language of translated text is determined.
Optionally, the determining the translated sub-text of at least one language of each segmented short sentence includes:
aiming at each segmentation short sentence, responding to that the segmentation short sentence comprises at least one pre-stored text segment on the basis of one or more pre-stored text segments and the pre-stored translation text corresponding to each pre-stored text segment, and taking the pre-stored translation text of the at least one pre-stored text segment as a first translation text;
translating the part of the segmented short sentence except the at least one pre-stored text segment to determine at least one second translation text; and
determining a translated sub-text of at least one language of the segmented phrase based on the first translated text and the second translated text.
Optionally, the translating the speech recognition text includes:
responding to the voice recognition text comprising at least one pre-stored text segment on the basis of one or more pre-stored text segments and the pre-stored translation text corresponding to each pre-stored text segment, and taking the pre-stored translation text of the at least one pre-stored text segment as a third translation text;
translating the part of the voice recognition text except the at least one pre-stored text segment, and determining at least one fourth translation result; and
determining a translated text of at least one language of the speech recognition text based on the third translated text and the fourth translated text.
Optionally, the speech recognition text is a streaming speech recognition text, and the streaming speech recognition text includes: the ending part is used for representing a recognition result after the last long stop symbol in the streaming voice recognition text;
the translating the speech recognition text comprises:
translating the non-ending part; and
when the ending part meets a preset condition, translating the ending part;
the preset condition comprises at least one of the following conditions:
the number of the characters or words at the ending part reaches a preset counting threshold value; and
and the time length from the last translation operation of the ending part reaches a first preset time length threshold value.
Optionally, the target subscription message includes language information, software information, and live broadcast room information;
each message device channel corresponds to combined information consisting of language information, software information and live room information.
Optionally, the writing the translation text into a message device channel of a corresponding language includes:
and writing the translation text into the message device channel of the corresponding language in response to the fact that the time length from the last writing of the translation text into the message device channel is larger than or equal to a second time length threshold value.
In a second aspect, a machine translation apparatus is provided, the apparatus being applied to an electronic device, and the apparatus including:
the first receiving module is used for receiving the voice recognition text;
the translation module is used for translating the voice recognition text and determining a translation text of at least one language of the voice recognition text;
the writing module is used for writing the translation text into a message device channel of a corresponding language according to the language of the translation text;
the second receiving module is used for receiving a target subscription message sent by a target terminal, wherein the target subscription message comprises target language information;
a determining module, configured to determine a target message device channel corresponding to the target subscription message, where a translation text in the target message device channel is a translation text of a language corresponding to the target language information; and
and the access module is used for accessing the target terminal into the target message device channel so that the target terminal acquires the translation text in the target message device channel.
Optionally, the translation module is specifically configured to:
based on the long stop symbols in the voice recognition text, segmenting the voice recognition text to determine a plurality of segmentation short sentences;
determining translation sub-texts of at least one language of each segmentation short sentence; and
based on each translated sub-text, at least one language of translated text is determined.
Optionally, the translation module is further specifically configured to:
aiming at each segmentation short sentence, responding to that the segmentation short sentence comprises at least one pre-stored text segment on the basis of one or more pre-stored text segments and the pre-stored translation text corresponding to each pre-stored text segment, and taking the pre-stored translation text of the at least one pre-stored text segment as a first translation text;
translating the part of the segmented short sentence except the at least one pre-stored text segment to determine at least one second translation text; and
determining a translated sub-text of at least one language of the segmented phrase based on the first translated text and the second translated text.
Optionally, the translation module is further specifically configured to:
responding to the voice recognition text comprising at least one pre-stored text segment on the basis of one or more pre-stored text segments and the pre-stored translation text corresponding to each pre-stored text segment, and taking the pre-stored translation text of the at least one pre-stored text segment as a third translation text;
translating the part of the voice recognition text except the at least one pre-stored text segment, and determining at least one fourth translation result; and
determining a translated text of at least one language of the speech recognition text based on the third translated text and the fourth translated text.
Optionally, the speech recognition text is a streaming speech recognition text, and the streaming speech recognition text includes: the ending part is used for representing a recognition result after the last long stop symbol in the streaming voice recognition text;
the translation module is further specifically configured to:
translating the non-ending part; and
when the ending part meets a preset condition, translating the ending part;
the preset condition comprises at least one of the following conditions:
the number of the characters or words at the ending part reaches a preset counting threshold value; and
and the time length from the last translation operation of the ending part reaches a first preset time length threshold value.
Optionally, the target subscription message includes language information, software information, and live broadcast room information;
each message device channel corresponds to combined information consisting of language information, software information and live room information.
Optionally, the writing module is specifically configured to:
and writing the translation text into the message device channel of the corresponding language in response to the fact that the time length from the last writing of the translation text into the message device channel is larger than or equal to a second time length threshold value.
In a third aspect, an embodiment of the present invention provides an electronic device, including a memory and a processor, where the memory is used to store one or more computer program instructions, where the one or more computer program instructions are executed by the processor to implement the method according to the first aspect.
In a fourth aspect, embodiments of the present invention provide a computer-readable storage medium on which computer program instructions are stored, which when executed by a processor implement the method according to the first aspect.
Through the embodiment of the invention, the electronic equipment can translate the voice recognition text into the translation texts of a plurality of languages and write the translation texts into the message device channel corresponding to the languages, if the target terminal subscribes the message device channel, the electronic equipment can access the target terminal into the message device channel, so that the target terminal can acquire the translation texts in the message device channel.
Drawings
The above and other objects, features and advantages of the embodiments of the present invention will become more apparent from the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:
FIG. 1 is a schematic diagram of a machine translation system according to an embodiment of the present disclosure;
FIG. 2 is a flowchart of a machine translation method according to an embodiment of the present invention;
FIG. 3 is a flow chart of another method for machine translation according to an embodiment of the present invention;
FIG. 4 is a flow chart of another method for machine translation according to an embodiment of the present invention;
FIG. 5 is a flow chart of another method of machine translation provided by embodiments of the present invention;
FIG. 6 is a flow chart of another method of machine translation provided by embodiments of the present invention;
FIG. 7 is a schematic structural diagram of a machine translation device according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The present invention will be described below based on examples, but the present invention is not limited to only these examples. In the following detailed description of the present invention, certain specific details are set forth. It will be apparent to one skilled in the art that the present invention may be practiced without these specific details. Well-known methods, procedures, components and circuits have not been described in detail so as not to obscure the present invention.
Further, those of ordinary skill in the art will appreciate that the drawings provided herein are for illustrative purposes and are not necessarily drawn to scale.
Unless the context clearly requires otherwise, throughout the description, the words "comprise", "comprising", and the like are to be construed in an inclusive sense as opposed to an exclusive or exhaustive sense; that is, what is meant is "including, but not limited to".
In the description of the present invention, it is to be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In addition, in the description of the present invention, "a plurality" means two or more unless otherwise specified.
The embodiment of the invention provides a machine translation method, which is applied to electronic equipment, wherein the electronic equipment can be a terminal or a server, the terminal can be a general data processing terminal which can run an application program and has a communication function, for example, a smart phone, a tablet Computer or a Personal Computer (PC), and the like, and the server can be a single server or a server cluster configured in a distributed manner.
As shown in fig. 1, fig. 1 is a schematic diagram of a machine translation system according to an embodiment of the present invention, where the schematic diagram includes: a translation device 11, a message device 12 and a target terminal 13.
The translation apparatus 11 is a program for providing a translation service, the message apparatus 12 is a program for providing a translation distribution service, and the translation apparatus 11 and the message apparatus 12 may be operated in an electronic device (a server, a server cluster, a cloud virtual server, or a terminal).
Specifically, the translation means 11 may receive the speech recognition text and translate the speech recognition text into a translated text of a different language.
The message device 12 includes a message device channel a, a message device channel b, and a message device channel c.
The electronic device may establish a communication connection with the target terminal 13 through the internet or a local area network, and the message device 12 may construct a message device channel capable of continuously transmitting information streams on the basis of the underlying connection of the communication connection.
In the embodiment of the present invention, each message device channel corresponds to one language, and after the translation device 11 determines the translated text through translation, the translation device 11 may write the translated text of each language into the message device channel corresponding to the language according to the language of the translated text.
The target terminal 13 may have an application program with an online real-time translation function (e.g., online live broadcast software with a simultaneous interpretation function) installed therein, and when the target terminal 13 runs the application program with the online real-time translation function and subscribes to a certain message device channel, the target terminal 13 may establish a long connection with the message device and obtain a translation text in the subscribed message device channel.
For example, the message device channel a is a chinese channel, the message device channel b is a japanese channel, the message device channel c is a french channel, and the speech recognition text received by the translation device 11 is in english.
After the speech recognition text received by the translation device 11 is translated into translated texts of three versions of chinese, japanese and french, the translated text of chinese is written into the message device channel a, the translated text of japanese is written into the message device channel b, and the translated text of french is written into the message device channel c.
And when the target terminal accesses the corresponding message device channel, the translation text in the message device channel can be obtained.
The following will describe a machine translation method provided by an embodiment of the present invention in detail with reference to a specific implementation manner, as shown in fig. 2, the specific steps are as follows:
step 100, receiving a speech recognition text.
Step 200, translating the voice recognition text, and determining a translation text of at least one language of the voice recognition text.
And 300, writing the translation text into the message device channel of the corresponding language according to the language of the translation text.
Step 400, receiving a target subscription message sent by a target terminal.
The target subscription message comprises target language information.
Step 500, determining a target message device channel corresponding to the target subscription message.
The translated text in the target message device channel is the translated text of the language corresponding to the target language information.
Step 600, the target terminal is accessed to the target message device channel, so that the target terminal obtains the translation text in the target message device channel.
Through the embodiment of the invention, the electronic equipment can translate the voice recognition text into the translation texts of a plurality of languages and write the translation texts into the message device channel corresponding to the languages, if the target terminal subscribes the message device channel, the electronic equipment can access the target terminal into the message device channel, so that the target terminal can acquire the translation texts in the message device channel.
Still further to step 600, the target message device channel may be a message queue facility, such as Kafka, RabbitMQ, or the like.
Kafka is a high-throughput distributed publish-subscribe message system, and is suitable for the case where the embodiment of the present invention needs to distribute translated texts to a large number of terminals through a target message device channel.
The RabbitMQ is an open source Message agent software (also called Message-oriented middleware) that implements Advanced Message Queuing Protocol (AMQP), has higher performance, and is also applicable to a case where translation texts need to be distributed to a large number of terminals through a target Message device channel in the embodiment of the present invention.
In another implementation, the target message device channel may also be a real-time computing framework spark streaming built on a computing engine spark.
spark streaming has the capability of processing large-scale streaming data, has high-throughput and high-fault-tolerance stream computing capability, and is also suitable for the case that translation texts need to be distributed to a large number of terminals through a target message device channel in the embodiment of the invention.
It should be noted that, in the above steps 100 to 300, if the language of the speech recognition text received by the electronic device is language a and the electronic device includes a message device channel corresponding to language a, the electronic device may directly write the speech recognition text into the message device channel corresponding to language a after receiving the speech recognition text.
Alternatively, as shown in fig. 3, step 200 may be performed as the following steps:
and step 210, segmenting the voice recognition text based on the long stop symbols in the voice recognition text, and determining a plurality of segmentation short sentences.
The long-stop symbol may be punctuation in the text, the colon, period, question mark and exclamation mark in the Chinese, and the punctuation such as colon, period, question mark and exclamation mark in the English, all of which may be used as long-stop symbols.
Further, the electronic device may treat a phrase between two consecutive long stop symbols in the speech recognition text as a divided phrase.
For example, if the speech recognition text is "weather good today, you can go with me if you go to the park to take a walk. "the electronic device may take" weather is good today "as a division phrase," you go to park to walk "as a division phrase, and" you can go with me "as a division phrase.
Step 220, determining at least one language translation sub-text of each segmentation short sentence.
Optionally, as shown in fig. 4, step 220 includes the following steps:
step 221, regarding each of the divided phrases, based on one or more pre-stored text segments and the pre-stored translation text corresponding to each of the pre-stored text segments, in response to the divided phrases including at least one pre-stored text segment, taking the pre-stored translation text of the at least one pre-stored text segment as the first translation text.
The electronic equipment can directly call the translation of the hit prestored text segment as a translation text when each text segment in the segmented short sentence hits at least one prestored text segment, so that the operation pressure of the processor in translation is reduced.
For example, the segmentation short sentence is "the main content of the today's meeting is the recent work summary", and if the electronic device prestores the prestored translation text "the main content of the today's meeting is the text segment", the electronic device does not need to translate "the main content of the today's meeting is the text segment, and only needs to directly call the prestored translation text" the main content of the today's meeting is the text segment "as the first translation result.
It should be noted that one pre-stored text segment may correspond to pre-stored translated texts of multiple languages, and the language specifically corresponding to the pre-stored text segment may be preset according to an actual situation, which is not limited in the embodiment of the present invention.
And step 222, translating the part except the at least one pre-stored text segment in the short segmentation sentence, and determining at least one second translation text.
In connection with the example made in step 221, after the electronic device uses the pre-stored translation text with "the main content of the today's meeting is" text segment as the first translation result, since the electronic device does not have the translation text with the "recent work summary" text segment pre-stored therein, the electronic device needs to translate the "recent work summary" text segment and determine the second translation text.
Step 223, determining a translation sub-text of at least one language of the segmentation short sentence based on the first translation text and the second translation text.
According to the embodiment of the invention, the electronic equipment does not need to consume the computing power of the processor for translation when translating the segmentation short sentences by pre-storing the translation text, so that the computing pressure of the processor is reduced, and meanwhile, the electronic equipment can directly call the pre-stored translation text, so that the translation speed is increased.
It should be noted that, steps 221 to 223 are an implementable manner proposed in the embodiment of the present invention, and in another implementable manner, the electronic device may also directly translate each divided short sentence, and determine each translated sub-text.
Step 230, determining a translation text of at least one language based on each translation sub-text.
According to the embodiment of the invention, the speech recognition text is divided into the plurality of the divided short sentences, and the number of words or characters contained in the divided short sentences is less, so that the electronic equipment can determine the translation text more accurately and more quickly.
Optionally, as shown in fig. 5, step 200 may also be performed as the following steps:
and step 240, taking the pre-stored translation text of at least one pre-stored text segment as a third translation text in response to the voice recognition text comprising at least one pre-stored text segment based on one or more pre-stored text segments and the pre-stored translation text corresponding to each pre-stored text segment.
For example, if the speech recognition text is "weather good today, you can go with me if you go to the park to take a walk. And the prestored text segment comprises 'good weather today' and 'walking in park', so that the electronic equipment does not need to translate 'good weather today' and 'walking in park', and only the prestored translation texts corresponding to the 'good weather today' and 'walking in park' text segments are used as the third translation texts.
And step 250, translating the parts except the at least one pre-stored text segment in the voice recognition text, and determining at least one fourth translation result.
In connection with the example made in step 240, after the electronic device uses the pre-stored translation text corresponding to the text segment "weather is good today" and "go to park and walk" as the third translation text, the electronic device only needs to translate the text segment "if you can" and "you can go with me" and determine the fourth translation result.
Step 260, determining the translated text of at least one language of the voice recognition text based on the third translated text and the fourth translated text.
According to the embodiment of the invention, the electronic equipment can quickly determine the third translation text by matching the voice recognition text with the pre-stored text segment, the calculation power of the processor is not consumed for translation, the calculation pressure of the processor is reduced, and meanwhile, the electronic equipment can directly call the pre-stored translation text, so that the translation speed is accelerated.
Optionally, in one case, the speech recognition text may be a streaming speech recognition text, where the streaming speech recognition text includes: the end part is used for representing a recognition result after the last long stop symbol in the streaming speech recognition text.
Since the streaming voice recognition technology can recognize a voice signal in real time and output a streaming voice recognition text in real time, the ending part of the streaming voice recognition text may change in real time along with the input of the voice signal.
For example, the streaming speech recognition text may be: "now out in the rain, you need" where "you need" is obviously an incomplete word, i.e., "you need" is the ending part in the streaming speech recognition text.
If the electronic device translates the ending part of the streaming speech recognition text in real time, the ending part of the translated text may blink continuously (i.e., the ending part of the translated text may change continuously), so that the user experience is poor.
Therefore, in order to solve the problem, as shown in fig. 6, step 200 may be further performed as the following steps:
step 270, translate the non-ending part.
And step 280, translating the ending part in response to the fact that the ending part meets the preset condition.
Wherein the preset condition comprises at least one of the following conditions:
the condition a, the number of words or phrases in the ending part reaches a preset count threshold.
For example, if the preset count threshold is 5 words, the electronic device translates the ending portion in response to the ending portion of the streaming speech recognition text including 5 words, and otherwise does not translate.
At some time 1, the streaming speech recognition text is: "you need to be in the rain now outside" at which time the end portion has a word count of 3 (word count does not reach 5 words), so the electronic device does not translate the end portion at time 1.
At some time 2, the streaming speech recognition text is: "you need to carry an umbrella while you are now out in the rain," at this point, the number of words in the ending part is 9 (the number of words reaches 5 words), so the electronic device needs to translate the ending part at time 2.
And the condition B is that the time length from the last translation operation of the ending part reaches a first preset time length threshold value.
For example, the first preset time threshold may be 2 seconds, and in combination with the example in the condition a, if the time 1 is 8 hours, 45 minutes, 30.5 seconds, and the time 2 is 8 hours, 45 minutes, 31 seconds, the time between the time 1 and the time 2 is 0.5 seconds (less than 2 seconds).
If the electronic device has translated the ending part at time 1, the electronic device does not translate the ending part at time 2.
For another example, if the time 1 is 8 hours 45 minutes 30.5 seconds and the time 2 is 8 hours 45 minutes 32.5 seconds, the time period between the time 1 and the time 2 is 2 seconds.
If the electronic device has translated the tail portion at time 1, the electronic device needs to translate the tail portion at time 2.
In the prior art, the end part of the translated text changes along with the end part of the streaming voice recognition result, so that the end part of the translated text changes frequently, and the experience of a user for watching the translated text is poor.
It should be noted that the condition a and the condition B are implementable schemes proposed in the embodiment of the present invention, and are intended to control the frequency of the electronic device to translate the ending part of the streaming voice recognition text, in practical applications, the condition a or the condition B may be applied alone, or the condition a and the condition B may be applied in combination, and the embodiment of the present invention is not limited.
Optionally, the target subscription message includes language information, software information, and live room information.
Wherein, each message device channel is respectively corresponding to the combined information composed of language information, software information and live broadcast room information.
In the embodiment of the present invention, the target terminal may send a subscription message to the electronic device to subscribe to the corresponding message device channel.
For example, the message device channel a is an english channel of a number 210 live broadcast room in the live broadcast software X, and if the target terminal a subscribes to the message device channel a by sending a subscription message to the electronic device, the subscription message sent by the target terminal a includes: english (language information), live software X (software information), and 210 (live room information).
After the electronic device receives the subscription message sent by the target terminal a, the electronic device may determine the message device channel a according to the subscription message sent by the target terminal a, and access the target terminal a to the message device channel a, so that the target terminal a may obtain the translation text in the message device channel a.
Optionally, since the embodiment of the present invention accelerates the translation of the speech recognition text, in order to ensure that the target terminal can acquire the translated text at an appropriate frequency, the electronic device may further control the frequency of writing the translated text into the messaging device channel.
Specifically, step 300 may be: and writing the translation text into the message device channel of the corresponding language in response to the fact that the time length from the last writing of the translation text into the message device channel is larger than or equal to a second time length threshold value.
The second duration threshold may be adjusted according to an actual situation, and the embodiment of the present invention is not limited.
According to the embodiment of the invention, the electronic equipment controls the writing speed of the translated text through the second preset time length threshold, so that the problem that the frequency of acquiring the translated text by the target terminal is too high is avoided, the problem that the user does not have enough time to watch the translated text due to too high translation refreshing speed can be further avoided, and the user experience is improved.
Based on the same technical concept, an embodiment of the present invention further provides a machine translation apparatus, as shown in fig. 7, the apparatus includes: a first receiving module 71, a translation module 72, a writing module 73, a second receiving module 74, a determination module 75 and an access module 76.
A first receiving module 71, configured to receive a speech recognition text;
the translation module 72 is configured to translate the speech recognition text, and determine a translation text of at least one language of the speech recognition text;
a writing module 73, configured to write the translation text into the message device channel of the corresponding language according to the language of the translation text;
a second receiving module 74, configured to receive a target subscription message sent by a target terminal, where the target subscription message includes target language information;
a determining module 75, configured to determine a target message device channel corresponding to the target subscription message, where a translation text in the target message device channel is a translation text in a language corresponding to the target language information; and
and an accessing module 76, configured to access the target terminal to the target message device channel, so that the target terminal acquires the translated text in the target message device channel.
Optionally, the translation module 72 is specifically configured to:
based on the long stop symbols in the voice recognition text, segmenting the voice recognition text to determine a plurality of segmentation short sentences;
determining translation sub-texts of at least one language of each segmentation short sentence; and
based on each translated sub-text, at least one language of translated text is determined.
Optionally, the translation module 72 is further specifically configured to:
aiming at each segmentation short sentence, responding to that the segmentation short sentence comprises at least one pre-stored text segment on the basis of one or more pre-stored text segments and the pre-stored translation text corresponding to each pre-stored text segment, and taking the pre-stored translation text of the at least one pre-stored text segment as a first translation text;
translating the part except for the at least one pre-stored text segment in the short segmentation sentence, and determining at least one second translation text; and
and determining a translation sub-text of at least one language of the segmentation short sentence based on the first translation text and the second translation text.
Optionally, the translation module 72 is further specifically configured to:
responding to the voice recognition text comprising at least one pre-stored text segment on the basis of one or more pre-stored text segments and the pre-stored translation text corresponding to each pre-stored text segment, and taking the pre-stored translation text of the at least one pre-stored text segment as a third translation text;
translating the parts of the voice recognition text except the at least one pre-stored text segment, and determining at least one fourth translation result; and
based on the third translated text and the fourth translated text, translated text in at least one language of the speech recognition text is determined.
Optionally, the speech recognition text is a streaming speech recognition text, and the streaming speech recognition text includes: the ending part is used for representing a recognition result after the last long stop symbol in the streaming voice recognition text;
the translation module 72 is further specifically configured to:
translating the non-ending part; and
translating the ending part when the ending part meets a preset condition;
the preset conditions include at least one of the following conditions:
the number of the characters or words at the tail part reaches a preset counting threshold value; and
and the time length from the last translation operation of the ending part reaches a first preset time length threshold value.
Optionally, the target subscription message includes language information, software information, and live broadcast room information;
each message device channel corresponds to combined information consisting of language information, software information and live room information.
Optionally, the writing module 73 is specifically configured to:
and writing the translation text into the message device channel of the corresponding language in response to the fact that the time length from the last writing of the translation text into the message device channel is larger than or equal to a second time length threshold value.
Through the embodiment of the invention, the electronic equipment can translate the voice recognition text into the translation texts of a plurality of languages and write the translation texts into the message device channel corresponding to the languages, if the target terminal subscribes the message device channel, the electronic equipment can access the target terminal into the message device channel, so that the target terminal can acquire the translation texts in the message device channel.
Fig. 8 is a schematic diagram of an electronic device of an embodiment of the invention. As shown in fig. 8, the electronic device shown in fig. 8 is a general address query device, which includes a general computer hardware structure, which includes at least a processor 81 and a memory 82. The processor 81 and the memory 82 are connected by a bus 83. The memory 82 is adapted to store instructions or programs executable by the processor 81. Processor 81 may be a stand-alone microprocessor or a collection of one or more microprocessors. Thus, the processor 81 implements the processing of data and the control of other devices by executing instructions stored by the memory 82 to perform the method flows of embodiments of the present invention as described above. The bus 83 connects the above components together, and also connects the above components to a display controller 84 and a display device and an input/output (I/O) device 85. Input/output (I/O) devices 85 may be a mouse, keyboard, modem, network interface, touch input device, motion sensing input device, printer, and other devices known in the art. Typically, the input/output devices 85 are coupled to the system through an input/output (I/O) controller 86.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus (device) or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-readable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations of methods, apparatus (devices) and computer program products according to embodiments of the invention. It will be understood that each flow in the flow diagrams can be implemented by computer program instructions.
These computer program instructions may be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows.
These computer program instructions may also be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows.
Another embodiment of the invention is directed to a non-transitory storage medium storing a computer-readable program for causing a computer to perform some or all of the above-described method embodiments.
That is, those skilled in the art can understand that all or part of the steps in the method according to the above embodiments may be implemented by a program instructing related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, etc.) or a processor (processor) to execute all or part of the steps in the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (16)

1. A method of machine translation, the method comprising:
receiving a voice recognition text;
translating the voice recognition text, and determining a translation text of at least one language of the voice recognition text;
writing the translation text into a message device channel of a corresponding language according to the language of the translation text;
receiving a target subscription message sent by a target terminal, wherein the target subscription message comprises target language information;
determining a target message device channel corresponding to the target subscription message, wherein the translated text in the target message device channel is the translated text of the language corresponding to the target language information; and
and accessing the target terminal to the target message device channel so that the target terminal acquires the translation text in the target message device channel.
2. The method of claim 1, wherein translating the speech recognition text and determining translated text in at least one language of the speech recognition text comprises:
based on the long stop symbols in the voice recognition text, segmenting the voice recognition text to determine a plurality of segmentation short sentences;
determining translation sub-texts of at least one language of each segmentation short sentence; and
based on each translated sub-text, at least one language of translated text is determined.
3. The method of claim 2, wherein said determining translated sub-text in at least one language for each segmented phrase comprises:
aiming at each segmentation short sentence, responding to that the segmentation short sentence comprises at least one pre-stored text segment on the basis of one or more pre-stored text segments and the pre-stored translation text corresponding to each pre-stored text segment, and taking the pre-stored translation text of the at least one pre-stored text segment as a first translation text;
translating the part of the segmented short sentence except the at least one pre-stored text segment to determine at least one second translation text; and
determining a translated sub-text of at least one language of the segmented phrase based on the first translated text and the second translated text.
4. The method of claim 1, wherein translating the speech recognition text comprises:
responding to the voice recognition text comprising at least one pre-stored text segment on the basis of one or more pre-stored text segments and the pre-stored translation text corresponding to each pre-stored text segment, and taking the pre-stored translation text of the at least one pre-stored text segment as a third translation text;
translating the part of the voice recognition text except the at least one pre-stored text segment, and determining at least one fourth translation result; and
determining a translated text of at least one language of the speech recognition text based on the third translated text and the fourth translated text.
5. The method of claim 1, wherein the speech recognition text is a streaming speech recognition text, and wherein the streaming speech recognition text comprises: the ending part is used for representing a recognition result after the last long stop symbol in the streaming voice recognition text;
the translating the speech recognition text comprises:
translating the non-ending part; and
when the ending part meets a preset condition, translating the ending part;
the preset condition comprises at least one of the following conditions:
the number of the characters or words at the ending part reaches a preset counting threshold value; and
and the time length from the last translation operation of the ending part reaches a first preset time length threshold value.
6. The method of claim 1, wherein the target subscription message comprises language information, software information, and live room information;
each message device channel corresponds to combined information consisting of language information, software information and live room information.
7. The method of claim 1, wherein writing the translated text to a messaging device channel in a corresponding language comprises:
and writing the translation text into the message device channel of the corresponding language in response to the fact that the time length from the last writing of the translation text into the message device channel is larger than or equal to a second time length threshold value.
8. A machine translation apparatus, the apparatus comprising:
the first receiving module is used for receiving the voice recognition text;
the translation module is used for translating the voice recognition text and determining a translation text of at least one language of the voice recognition text;
the writing module is used for writing the translation text into a message device channel of a corresponding language according to the language of the translation text;
the second receiving module is used for receiving a target subscription message sent by a target terminal, wherein the target subscription message comprises target language information;
a determining module, configured to determine a target message device channel corresponding to the target subscription message, where a translation text in the target message device channel is a translation text of a language corresponding to the target language information; and
and the access module is used for accessing the target terminal into the target message device channel so that the target terminal acquires the translation text in the target message device channel.
9. The apparatus of claim 8, wherein the translation module is specifically configured to:
based on the long stop symbols in the voice recognition text, segmenting the voice recognition text to determine a plurality of segmentation short sentences;
determining translation sub-texts of at least one language of each segmentation short sentence; and
based on each translated sub-text, at least one language of translated text is determined.
10. The apparatus of claim 9, wherein the translation module is further specifically configured to:
aiming at each segmentation short sentence, responding to that the segmentation short sentence comprises at least one pre-stored text segment on the basis of one or more pre-stored text segments and the pre-stored translation text corresponding to each pre-stored text segment, and taking the pre-stored translation text of the at least one pre-stored text segment as a first translation text;
translating the part of the segmented short sentence except the at least one pre-stored text segment to determine at least one second translation text; and
determining a translated sub-text of at least one language of the segmented phrase based on the first translated text and the second translated text.
11. The apparatus of claim 8, wherein the translation module is further specifically configured to:
responding to the voice recognition text comprising at least one pre-stored text segment on the basis of one or more pre-stored text segments and the pre-stored translation text corresponding to each pre-stored text segment, and taking the pre-stored translation text of the at least one pre-stored text segment as a third translation text;
translating the part of the voice recognition text except the at least one pre-stored text segment, and determining at least one fourth translation result; and
determining a translated text of at least one language of the speech recognition text based on the third translated text and the fourth translated text.
12. The apparatus of claim 8, wherein the speech recognition text is a streaming speech recognition text, and wherein the streaming speech recognition text comprises: the ending part is used for representing a recognition result after the last long stop symbol in the streaming voice recognition text;
the translation module is further specifically configured to:
translating the non-ending part; and
when the ending part meets a preset condition, translating the ending part;
the preset condition comprises at least one of the following conditions:
the number of the characters or words at the ending part reaches a preset counting threshold value; and
and the time length from the last translation operation of the ending part reaches a first preset time length threshold value.
13. The apparatus of claim 8, wherein the target subscription message comprises language information, software information, and live room information;
each message device channel corresponds to combined information consisting of language information, software information and live room information.
14. The apparatus of claim 8, wherein the write module is specifically configured to:
and writing the translation text into the message device channel of the corresponding language in response to the fact that the time length from the last writing of the translation text into the message device channel is larger than or equal to a second time length threshold value.
15. An electronic device comprising a memory and a processor, wherein the memory is configured to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method of any of claims 1-7.
16. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method of any one of claims 1 to 7.
CN202010988225.8A 2020-09-18 2020-09-18 Machine translation method, device, electronic equipment and readable storage medium Pending CN112115726A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010988225.8A CN112115726A (en) 2020-09-18 2020-09-18 Machine translation method, device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010988225.8A CN112115726A (en) 2020-09-18 2020-09-18 Machine translation method, device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN112115726A true CN112115726A (en) 2020-12-22

Family

ID=73801331

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010988225.8A Pending CN112115726A (en) 2020-09-18 2020-09-18 Machine translation method, device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN112115726A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112992141A (en) * 2021-02-23 2021-06-18 北京百度网讯科技有限公司 Communication method and device under voice recognition scene

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101667176A (en) * 2008-09-01 2010-03-10 株式会社东芝 Method and system for counting machine translation based on phrases
CN102572532A (en) * 2010-12-14 2012-07-11 洪煌炳 TV caption relay translation system based on cable TV network
CN103237045A (en) * 2013-02-22 2013-08-07 北方工业大学 Parallel processing system and parallel processing method for large-scale real-time traffic data
CN203338350U (en) * 2013-06-09 2013-12-11 武汉传神信息技术有限公司 Machine simultaneous interpretation system
CN107632980A (en) * 2017-08-03 2018-01-26 北京搜狗科技发展有限公司 Voice translation method and device, the device for voiced translation
CN111611813A (en) * 2020-04-29 2020-09-01 南京南瑞继保电气有限公司 Document translation method and device, electronic equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101667176A (en) * 2008-09-01 2010-03-10 株式会社东芝 Method and system for counting machine translation based on phrases
CN102572532A (en) * 2010-12-14 2012-07-11 洪煌炳 TV caption relay translation system based on cable TV network
CN103237045A (en) * 2013-02-22 2013-08-07 北方工业大学 Parallel processing system and parallel processing method for large-scale real-time traffic data
CN203338350U (en) * 2013-06-09 2013-12-11 武汉传神信息技术有限公司 Machine simultaneous interpretation system
CN107632980A (en) * 2017-08-03 2018-01-26 北京搜狗科技发展有限公司 Voice translation method and device, the device for voiced translation
CN111611813A (en) * 2020-04-29 2020-09-01 南京南瑞继保电气有限公司 Document translation method and device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112992141A (en) * 2021-02-23 2021-06-18 北京百度网讯科技有限公司 Communication method and device under voice recognition scene

Similar Documents

Publication Publication Date Title
CN110381388B (en) Subtitle generating method and device based on artificial intelligence
CN108537176B (en) Target barrage identification method and device, terminal and storage medium
JP7269286B2 (en) Caption generation method and caption generation device
US20210365749A1 (en) Image data processing method and apparatus, electronic device, and storage medium
US20160147744A1 (en) On-line voice translation method and device
CN112040263A (en) Video processing method, video playing method, video processing device, video playing device, storage medium and equipment
CN107291704B (en) Processing method and device for processing
CN111586469B (en) Bullet screen display method and device and electronic equipment
CN113035199B (en) Audio processing method, device, equipment and readable storage medium
WO2015165524A1 (en) Extracting text from video
CN105512182A (en) Speech control method and intelligent television
WO2020119541A1 (en) Voice data identification method, apparatus and system
CN110069769B (en) Application label generation method and device and storage device
CN111898388A (en) Video subtitle translation editing method and device, electronic equipment and storage medium
CN111816190A (en) Voice interaction method and device for upper computer and lower computer
CN112399269A (en) Video segmentation method, device, equipment and storage medium
CN112530417B (en) Voice signal processing method and device, electronic equipment and storage medium
CN112115726A (en) Machine translation method, device, electronic equipment and readable storage medium
WO2018046007A1 (en) Instant dynamic text inputting method, system, and device
CN109979435B (en) Data processing method and device for data processing
CN110990632A (en) Video processing method and device
CN116189663A (en) Training method and device of prosody prediction model, and man-machine interaction method and device
CN113364665B (en) Information broadcasting method and electronic equipment
CN114595702A (en) Text translation model training method, text translation method and related device
CN112509570B (en) Voice signal processing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20201222