Text conversion method and apparatus, storage medium, and electronic device

By combining configuration files and a text conversion model, efficient and accurate conversion from dialect text to Mandarin text is achieved, solving the problem of inaccurate language type conversion in existing technologies, reducing costs and improving system stability.

CN116504222BActive Publication Date: 2026-05-19QINGDAO HAIER TECH +3
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
QINGDAO HAIER TECH
Filing Date
2023-03-28
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing voice interaction systems cannot accurately convert text from one language type to another, especially between dialects and Mandarin, resulting in high costs and system instability.

Method used

By combining a pre-configured configuration file and a target text conversion model with speech recognition and semantic understanding, the conversion of dialect text to Mandarin text is achieved. The initial conversion text is determined using the configuration file, and the model is adjusted through training samples to improve conversion accuracy.

Benefits of technology

It improves the accuracy of language type conversion, reduces development and maintenance costs, simplifies system design, reduces latency, and enhances system stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116504222B_ABST
    Figure CN116504222B_ABST
Patent Text Reader

Abstract

The application discloses a text conversion method and device, a storage medium and an electronic device, relates to the technical field of smart homes, and the text conversion method comprises the following steps: performing speech recognition on a target audio obtained, and obtaining target recognized text of a first language type; determining first conversion text corresponding to the target recognized text according to a preconfigured configuration file, and inputting the target recognized text into a target text conversion model to obtain second conversion text, wherein the configuration file and the target text conversion model are both used for converting text of the first language type into text of a second language type; and determining target conversion text of the second language type according to the first conversion text and the second conversion text. By adopting the technical scheme, the problem that the prior art cannot accurately convert text of one language type into text of another language type is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of smart home technology, and more specifically, to a text conversion method and apparatus, storage medium and electronic device. Background Technology

[0002] With the popularization of speech recognition technology, people's demand for voice interaction systems is increasing, especially the demand for diverse language sources. Interaction is no longer limited to Mandarin; the need for interaction in different languages ​​such as English, French, and dialects is becoming increasingly prominent. However, current voice interaction systems are designed based on Mandarin. To achieve voice interaction in other languages, especially dialects, a separate interaction system based on the corresponding language needs to be designed. Designing a system for each language is extremely costly in terms of development and maintenance, and is also very inconvenient for maintenance and portability. Furthermore, individual systems themselves have inherent limitations. Therefore, one proposed solution is to add a complete translation system between speech recognition and semantic understanding. This system first translates text from other languages, such as dialects, into Mandarin text, and then performs semantic analysis in Mandarin.

[0003] However, statistical translation systems have high requirements for both the quantity and quality of data, making it difficult to obtain sufficient data to meet these needs in a short period, thus hindering accurate translation, especially for dialects. Secondly, statistical translation systems are generally non-real-time systems, resulting in high latency, which is fatal for latency-sensitive voice interaction systems. Finally, the performance of existing statistical translation systems is unstable, leading to extremely inconsistent results from subsequent processing modules.

[0004] Regarding the problem that existing technologies cannot accurately convert text from one language type to another, no effective solution has yet been proposed.

[0005] Therefore, it is necessary to improve the relevant technology to overcome the aforementioned defects. Summary of the Invention

[0006] This invention provides a text conversion method, apparatus, storage medium, and electronic device to at least solve the problem that the prior art cannot accurately convert text of one language type into text of another language type.

[0007] According to one aspect of the present invention, a text conversion method is provided, comprising: performing speech recognition on acquired target audio to obtain target recognized text of a first language type; determining a first converted text corresponding to the target recognized text according to a pre-configured configuration file; and inputting the target recognized text into a target text conversion model to obtain a second converted text, wherein the configuration file and the target text conversion model are both used to convert text of the first language type into text of a second language type; and determining a target converted text of the second language type based on the first converted text and the second converted text.

[0008] In an exemplary embodiment, determining the first converted text corresponding to the identified text according to a pre-configured configuration file includes: obtaining a pre-configured configuration file, wherein the configuration file contains converted texts of the second language type corresponding to identified texts of different first language types; determining a reference identified text with the highest matching degree to the target identified text according to the configuration file; and determining the converted text in the configuration file corresponding to the reference identified text as the first converted text.

[0009] In an exemplary embodiment, determining the reference identification text with the highest matching degree to the target identification text according to the configuration file includes: using a target matching algorithm to match multiple sub-reference texts that have a corresponding relationship with the target identification text from the configuration file, wherein the reference identification text includes the multiple sub-reference texts, and each sub-reference text has a corresponding relationship with a sub-text in the target identification text; determining the converted text in the configuration file corresponding to the reference identification text as the first converted text includes: determining the sub-converted text corresponding to each sub-reference text from the configuration file; and combining each sub-converted text according to the correspondence with the sub-text in the target identification text to form the first converted text.

[0010] In an exemplary embodiment, before inputting the target recognition text into the target text conversion model, the method further includes: obtaining a training sample set, wherein each set of data in the training sample set includes text of the first language type and text of the corresponding second language type; training the text conversion model to be trained using the training sample set until the value of the target loss function corresponding to the text conversion model to be trained is less than a preset threshold, ending the training, and determining the text conversion model to be trained at the end of the training as the target text conversion model.

[0011] In an exemplary embodiment, determining the target converted text based on the first converted text and the second converted text includes: determining the first converted text as the target converted text when the difference between the first converted text and the second converted text is greater than or equal to a preset threshold; and determining the second converted text as the target converted text when the difference between the first converted text and the second converted text is less than the preset threshold.

[0012] In an exemplary embodiment, when the difference between the first converted text and the second converted text is greater than or equal to a preset threshold, the method further includes: adding a set of training data containing the target recognition text and the first converted text to a training sample set; using the training sample set to train the target text conversion model until the value of the target loss function corresponding to the target text conversion model is less than a preset threshold, ending the training, and re-determining the target text conversion model at the end of the training as the target text conversion model.

[0013] In an exemplary embodiment, determining the target converted text based on the first converted text and the second converted text includes: if the difference between the first converted text and the second converted text is greater than or equal to a preset threshold, correcting the first converted text using the second converted text to obtain the target converted text; if the difference between the first converted text and the second converted text is less than the preset threshold, correcting the second converted text using the first converted text to obtain the target converted text.

[0014] According to another aspect of the present invention, a text conversion apparatus is also provided, comprising: a recognition module, configured to perform speech recognition on acquired target audio to obtain target recognized text of a first language type; a first determination module, configured to determine a first converted text corresponding to the target recognized text according to a pre-configured configuration file, and to input the target recognized text into a target text conversion model to obtain a second converted text, wherein the configuration file and the target text conversion model are both used to convert text of the first language type into text of a second language type; and a second determination module, configured to determine the target converted text of the second language type based on the first converted text and the second converted text.

[0015] According to another aspect of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, which is configured to execute the above-described text conversion method at runtime.

[0016] According to another aspect of the present invention, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the text conversion method described above through the computer program.

[0017] This invention, after performing speech recognition on target audio to obtain target recognized text in a first language type, determines the first converted text corresponding to the target recognized text based on a pre-configured configuration file, and inputs the target recognized text into a target text conversion model to obtain a second converted text. Then, based on the first and second converted texts, a target converted text in a second language type is determined. Both the configuration file and the target text conversion model are used to convert text in the first language type into text in the second language type. Because the target converted text is jointly determined by the first converted text determined according to the pre-configured configuration file and the second converted text determined according to the target text conversion model, the accuracy of converting text in one language type to text in another language type is improved, solving the problem that existing technologies cannot accurately convert text in one language type to text in another language type. Attached Figure Description

[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a schematic diagram of the hardware environment for a text conversion method according to an embodiment of this application;

[0021] Figure 2 This is a flowchart (a) of a text conversion method according to an embodiment of the present invention;

[0022] Figure 3 This is a flowchart (II) of a text conversion method according to an embodiment of the present invention;

[0023] Figure 4 This is a schematic diagram of a voice interaction system according to an embodiment of the present invention;

[0024] Figure 5 This is a structural block diagram of a text conversion device according to an embodiment of the present invention. Detailed Implementation

[0025] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0026] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0027] According to one aspect of the embodiments of this application, a text conversion method is provided. This text conversion method is widely applicable to whole-house intelligent digital control application scenarios such as smart homes, smart home ecosystems, and intelligencehouse ecosystems. Optionally, in this embodiment, the above-mentioned text conversion method can be applied to, for example... Figure 1 The hardware environment shown consists of terminal device 102 and server 104. For example... Figure 1 As shown, server 104 is connected to terminal device 102 via a network and can be used to provide services (such as application services) to the terminal or clients installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data processing services for server 104.

[0028] The aforementioned network may include, but is not limited to, at least one of the following: wired network, wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network, metropolitan area network, local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity), Bluetooth. The terminal device 102 may not be limited to PC, mobile phone, tablet computer, smart air conditioner, smart range hood, smart refrigerator, smart oven, smart stove, smart washing machine, smart water heater, smart washing equipment, smart dishwasher, smart projector, smart TV, smart clothes rack, smart curtains, smart audio-visual equipment, smart socket, smart speaker, smart speaker box, smart fresh air equipment, smart kitchen and bathroom equipment, smart bathroom equipment, smart robot vacuum cleaner, smart window cleaning robot, smart mopping robot, smart air purifier, smart steam oven, smart microwave oven, smart water heater, smart air purifier, smart water dispenser, smart door lock, etc.

[0029] To address the aforementioned issues, this embodiment provides a text conversion method, including but not limited to one applied to the speech conversion engine in the terminal device 102 or server 104 (for converting text in a first language type into text in a second language type). Figure 2 This is a flowchart (I) of a text conversion method according to an embodiment of the present invention, which includes the following steps:

[0030] Step S202: Perform speech recognition on the acquired target audio to obtain target recognition text of the first language type;

[0031] It should be noted that the first language type and the second language type are two different language types. As an optional example, the first language type includes, but is not limited to, dialects, while the second language type can include, but is not limited to, Mandarin. A speech recognition engine can be used to perform speech recognition on the target audio to obtain the target recognized text in the first language type.

[0032] Step S204: Determine the first converted text corresponding to the target recognition text according to the pre-configured configuration file, and input the target recognition text into the target text conversion model to obtain the second converted text, wherein the configuration file and the target text conversion model are both used to convert the text of the first language type into the text of the second language type;

[0033] In an exemplary embodiment, determining the first converted text corresponding to the identified text based on a pre-configured configuration file can be achieved through the following steps S11-S12:

[0034] Step S11: Obtain a pre-configured configuration file, where the configuration file has conversion texts of the second language type corresponding to recognition texts of different first language types;

[0035] As an optional example, the recognition texts of the first language type include, but are not limited to, vocabulary, short sentences, etc. of the first language type. Correspondingly, the conversion texts of the second language type are vocabulary, short sentences, etc. of the corresponding second language type. For example, the recognition text of the first language type in the configuration file is "crutch", and the corresponding recognition text of the second language type is "elder brother".

[0036] Step S12: Determine the reference recognition text with the highest matching degree with the target recognition text according to the configuration file;

[0037] As an optional example, in order to improve the accuracy of language conversion, the target recognition text of the first language type obtained can be pre-processed, and the pre-processed text is searched and matched in the configuration file.

[0038] As an optional example, in order to improve the accuracy of the obtained matching relationship, the inverted index method can be used to search and match the content of the target recognition text with the content of the recognition text in the configuration file.

[0039] Step S13: Determine the conversion text corresponding to the reference recognition text in the configuration file as the first conversion text.

[0040] In an exemplary embodiment, the above step S12 can be implemented through the following step S121, and correspondingly, the above step S13 is implemented through the following step S131:

[0041] Step S121: Use a target matching algorithm to match multiple sub-reference texts corresponding to the target recognition text from the configuration file, where the reference recognition text includes the multiple sub-reference texts, and each sub-reference text has a corresponding relationship with a sub-text in the target recognition text;

[0042] Step S131: Determine the sub-conversion text corresponding to each sub-reference text from the configuration file; combine each sub-conversion text into the first conversion text according to the corresponding relationship with the sub-text in the target recognition text.

[0043] As an optional example, if the target recognition text includes 1x0 sub-texts (vocabulary or short sentences), then 1x0 sub-texts can be matched in the configuration file, and 1x0 sub-conversion texts of the second language type corresponding to the 1x0 sub-texts can be found in the configuration file, and the 1x0 sub-conversion texts are combined into the first conversion text according to the corresponding relationship with the target recognition text.

[0044] For better understanding, an example is given below. Suppose the target recognition text is: "Guai Zi, Li Dai Zou Mo Si", that is, the target recognition text includes two sub-texts, "Guai Zi" and "Li Dai Zou Mo Si". Then, find the corresponding sub-conversion texts of these two sub-texts from the configuration file: "elder brother", "What are you doing"; and then combine them according to the corresponding relationship to obtain the first recognition text as "elder brother, what are you doing".

[0045] In this embodiment, by means of a configuration file, only a small amount of data of Putonghua with a dialect background is required, and by using dialect-related knowledge, the conversion between a dialect-background language and standard Putonghua can be achieved.

[0046] In addition, since the expressions of the same dialect also have differences in different regions (such as two adjacent county towns), the users who specifically use the product equipment can be allowed to actively configure or modify the configuration file according to their own language expression habits, so that the dialect in the configuration file conforms to the users' language expression habits, and thus the conversion between dialect texts and Putonghua texts can be more accurate.

[0047] In an exemplary embodiment, before inputting the target recognition text into the target text conversion model, the following steps S21-S22 are further included:

[0048] Step S21: Obtain a training sample set, where each group of data in the training sample set includes the text of the first language type and the corresponding text of the second language type;

[0049] Step S22: Use the training sample set to train the text conversion model to be trained until the value of the target loss function corresponding to the text conversion model to be trained is less than a preset threshold, end the training, and determine the text conversion model to be trained at the end of the training as the target text conversion model.

[0050] As an optional example, the above target text conversion model is a neural network model.

[0051] Step S206, determine the target conversion text of the second language type according to the first conversion text and the second conversion text.

[0052] In an exemplary embodiment, the above step S206 can be implemented by the following steps S31-S32:

[0053] Step S31: When the difference degree between the first conversion text and the second conversion text is greater than or equal to a preset threshold, determine the first conversion text as the target conversion text;

[0054] It should be noted that since the first converted text is determined by a configuration file (configured by the operations and maintenance personnel or by the user), while the second converted text is determined by the target text conversion model (i.e., the text determined by the machine), the confidence level of the first converted text is higher than that of the second converted text. Therefore, if the difference between the first and second converted texts is greater than or equal to a preset threshold, the first converted text is determined as the target converted text.

[0055] In an exemplary embodiment, if the difference between the first converted text and the second converted text is greater than or equal to a preset threshold, the following steps S311-S312 are further included:

[0056] Step S311: Add a set of training data containing the target recognition text and the first converted text to the training sample set;

[0057] Step S312: Train the target text conversion model using the training sample set until the value of the target loss function corresponding to the target text conversion model is less than a preset threshold, then end the training and re-determine the target text conversion model at the end of the training as the target text conversion model.

[0058] As an optional example, since the difference between the first converted text and the second converted text is greater than or equal to a preset threshold, and the confidence level of the second converted text is lower than that of the first converted text, indicating that the target text conversion model has made a mistake, a set of training data containing the target text and the first converted text can be added to the training sample set, and the target text conversion model can be trained again using the training samples.

[0059] As an alternative example, after adding a set of training data containing the target recognition text and the first converted text to the training sample set, the target text conversion model can be trained only when the number of samples in the training sample set meets a preset condition.

[0060] Step S32: If the difference between the first converted text and the second converted text is less than the preset threshold, the second converted text is determined as the target converted text.

[0061] It should be noted that if the difference between the first and second converted texts is less than a preset threshold, it means that both have been correctly converted. Since the first converted text is determined by the configuration file and the second converted text is determined by the target text conversion model, the second converted text will be more fluent and have more natural syntax than the first converted text, and thus the second converted text will be determined as the target converted text.

[0062] In this embodiment, the above steps S31-S32 can be used to more accurately determine the target text to be converted.

[0063] In an exemplary embodiment, step S206 above can be implemented by the following steps S41-S42:

[0064] Step S41: If the difference between the first converted text and the second converted text is greater than or equal to a preset threshold, the first converted text is corrected using the second converted text to obtain the target converted text;

[0065] As an optional example, since the confidence level of the first converted text is greater than that of the second converted text, and the difference between the first converted text and the second converted text is greater than or equal to a preset threshold, the first converted text is corrected using the second converted text as a basis.

[0066] As an optional example, the correction of the first transformed text using the second transformed text can be achieved in the following way: determining a first subtext from the first transformed text, determining a second subtext from the second transformed text, wherein the difference between the first subtext and the second subtext is less than a preset threshold; determining a first target subtext based on the first subtext and the second subtext; replacing the first subtext in the first transformed text with the first target subtext to obtain the target transformed text.

[0067] As an optional example, determining the first target subtext based on the first subtext and the second subtext can be achieved by performing semantic parsing on the first subtext and the second subtext, and determining the first target subtext based on the result of the semantic parsing.

[0068] Step S42: If the difference between the first converted text and the second converted text is less than the preset threshold, the second converted text is corrected using the first converted text to obtain the target converted text.

[0069] As an optional example, the correction of the second transformed text using the first transformed text can be achieved in the following way: determining a third sub-text from the first transformed text, determining a fourth sub-text from the second transformed text, wherein the difference between the third sub-text and the fourth sub-text is greater than or equal to a preset threshold; determining a second target sub-text based on the third sub-text and the fourth sub-text; replacing the fourth sub-text in the second transformed text with the second target sub-text to obtain the target transformed text.

[0070] As an optional example, determining the second target subtext based on the third subtext and the fourth subtext can be achieved by performing semantic parsing on the third subtext and the fourth subtext, and determining the second target subtext based on the result of the semantic parsing.

[0071] In an exemplary embodiment, step S206 can also be implemented by: playing the first converted text and the second converted text aloud, and determining the target converted text from the first converted text and the second converted text based on the response information of the target object.

[0072] Through the above steps, after performing speech recognition on the target audio to obtain target recognized text in a first language type, the first converted text corresponding to the target recognized text is determined according to a pre-configured configuration file. The target recognized text is then input into a target text conversion model to obtain a second converted text. Finally, the target converted text in a second language type is determined based on the first and second converted texts. Both the configuration file and the target text conversion model are used to convert text in the first language type into text in the second language type. Since the target converted text is jointly determined by the first converted text determined by the pre-configured configuration file and the second converted text determined by the target text conversion model, the accuracy of converting text in one language type to text in another language type is improved, solving the problem that existing technologies cannot accurately convert text in one language type to text in another language type.

[0073] Obviously, the embodiments described above are merely some embodiments of the present invention, and not all embodiments. To better understand the above method, the following description, in conjunction with embodiments, illustrates the process, but is not intended to limit the technical solutions of the embodiments of the present invention. Specifically:

[0074] In an optional embodiment, this application adds a front-end conversion system (i.e., ...) between the speech recognition engine and the semantic parsing engine in the speech processing chain. Figure 4 This approach utilizes a pre-conversion engine (likely referring to a speech conversion engine), eliminating the need for separate interactive systems for other languages ​​or dialects. Instead, the received language text is converted to Mandarin within this pre-conversion system (e.g., converting dialect text to Mandarin), and then the Mandarin text is passed to the subsequent semantic analysis engine for processing. This allows the front-end and subsequent processing of the entire voice interaction system to be shared and integrated. Only a speech conversion engine is needed after text recognition for pre-conversion processing. The implementation is simpler, and the speech conversion accuracy is high. Separating language conversion and semantic recognition allows them to work simultaneously.

[0075] As an optional example, Figure 3 This is a flowchart (II) of a text conversion method according to an embodiment of the present invention. The specific steps of the speech conversion engine to convert text of one language type to text of another language type are as follows:

[0076] Step S302: Configure the storage of language data pairs (equivalent to the configuration file in the above embodiment) containing the first language and the matching second language. The first language is a dialect, and the second language is Mandarin. Depending on different scenario requirements, the first language can also be designed as English, French, etc.; it can also be designed in reverse, for example, configuring the first language as Mandarin and the second language as a dialect or other required language.

[0077] Step S304: Obtain the first language text to be converted (equivalent to the target recognition text in the above embodiment). The first language text to be converted can be directly input by the speech recognition engine, or it can be obtained through other methods;

[0078] Step S306: Search and match the content of the first language text with the language data pair to obtain the first candidate data pair record with the highest matching degree (equivalent to the first converted text in the above embodiment). To improve the accuracy of language conversion, the obtained first language text is first preprocessed, and the preprocessed first language text is searched and matched with the content of the language data pair configured in step S302 to obtain the data with the highest matching degree as the first candidate data. To improve the accuracy of the obtained matching relationship, the inverted index method in the prior art is used to search and match the content of the first language text with the content of the language data pair.

[0079] Step S308: Obtain the second candidate data pair record (equivalent to the second converted text in the above embodiment) that has the highest matching degree with the first language text through the network model (equivalent to the target text conversion model in the above embodiment). Specifically, the first language text is first converted into a first feature vector according to the constructed neural network model.

[0080] Step S310: Determine the text conversion result output based on the first alternative data pair and the second alternative data pair.

[0081] Figure 4This is a schematic diagram of a voice interaction system according to an embodiment of the present invention. Specifically, the dialect voice interaction system includes: a voice recognition engine, a voice conversion engine, a semantic parsing engine, and a dialogue management engine. The voice recognition engine converts the acquired current dialect language information into dialect speech text and outputs it to the voice conversion engine. The voice recognition engine, semantic parsing engine, and dialogue management engine can all be corresponding engine modules from existing voice interaction systems. The voice conversion engine is implemented as the aforementioned language processing conversion device. In this application scenario, the language data pairs in the storage module of the language processing conversion device are configured with a dialect as the first language and Mandarin as the second language, to convert the dialect speech text into deterministic text and generate a conversion result output. The semantic parsing engine performs semantic parsing on the conversion result to generate a parsing result output. The dialogue management engine implements voice interaction based on the parsing result.

[0082] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of the present invention.

[0083] This embodiment also provides a text conversion device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, hardware implementations, or a combination of software and hardware, are also possible and contemplated.

[0084] Figure 5 This is a structural block diagram of a text conversion apparatus according to an embodiment of the present invention, the apparatus comprising:

[0085] The recognition module 52 is used to perform speech recognition on the acquired target audio to obtain target recognition text of the first language type;

[0086] The first determining module 54 is used to determine the first converted text corresponding to the target recognition text according to the pre-configured configuration file, and to input the target recognition text into the target text conversion model to obtain the second converted text, wherein the configuration file and the target text conversion model are both used to convert the text of the first language type into the text of the second language type;

[0087] The second determining module 56 is used to determine the target conversion text of the second language type based on the first conversion text and the second conversion text.

[0088] Using the aforementioned device, after performing speech recognition on the target audio to obtain target recognized text in a first language type, a first converted text corresponding to the target recognized text is determined according to a pre-configured configuration file. The target recognized text is then input into a target text conversion model to obtain a second converted text. Finally, a target converted text in a second language type is determined based on the first and second converted texts. Both the configuration file and the target text conversion model are used to convert text in the first language type into text in the second language type. Since the target converted text is jointly determined by the first converted text determined according to the pre-configured configuration file and the second converted text determined according to the target text conversion model, the accuracy of converting text in one language type to text in another language type is improved, solving the problem that existing technologies cannot accurately convert text in one language type to text in another language type.

[0089] In an exemplary embodiment, the first determining module 54 is further configured to obtain a pre-configured configuration file, wherein the configuration file contains converted text of the second language type corresponding to the recognized text of the first language type; determine the reference recognized text with the highest matching degree with the target recognized text according to the configuration file; and determine the converted text in the configuration file corresponding to the reference recognized text as the first converted text.

[0090] In an exemplary embodiment, the first determining module 54 is further configured to use a target matching algorithm to match a plurality of sub-reference texts that correspond to the target identification text from the configuration file, wherein the reference identification text includes the plurality of sub-reference texts, and each sub-reference text corresponds to a sub-text in the target identification text; determine the sub-converted text corresponding to each sub-reference text from the configuration file; and combine each sub-converted text into the first converted text according to the correspondence with the sub-text in the target identification text.

[0091] In an exemplary embodiment, the above-described apparatus further includes a training module, configured to obtain a training sample set before inputting the target recognition text into the target text conversion model, wherein each set of data in the training sample set includes text of the first language type and text of the corresponding second language type; train the text conversion model to be trained using the training sample set until the value of the target loss function corresponding to the text conversion model to be trained is less than a preset threshold, end the training, and determine the text conversion model to be trained at the end of the training as the target text conversion model.

[0092] In an exemplary embodiment, the second determining module 56 is further configured to determine the first converted text as the target converted text when the difference between the first converted text and the second converted text is greater than or equal to a preset threshold; and to determine the second converted text as the target converted text when the difference between the first converted text and the second converted text is less than the preset threshold.

[0093] In an exemplary embodiment, the training module is further configured to add a set of training data containing the target recognition text and the first converted text to the training sample set when the difference between the first converted text and the second converted text is greater than or equal to a preset threshold; use the training sample set to train the text conversion model to be trained until the value of the target loss function corresponding to the text conversion model to be trained is less than the preset threshold, end the training, and determine the text conversion model to be trained at the end of the training as the target text conversion model.

[0094] In an exemplary embodiment, the second determining module 56 is further configured to, when the difference between the first converted text and the second converted text is greater than or equal to a preset threshold, use the second converted text to correct the first converted text to obtain a target converted text; and when the difference between the first converted text and the second converted text is less than the preset threshold, use the first converted text to correct the second converted text to obtain the target converted text.

[0095] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to perform the steps in any of the above method embodiments when executed.

[0096] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:

[0097] S1, perform speech recognition on the acquired target audio to obtain target recognition text in the first language type;

[0098] S2, determine the first converted text corresponding to the target recognition text according to the pre-configured configuration file, and input the target recognition text into the target text conversion model to obtain the second converted text, wherein the configuration file and the target text conversion model are both used to convert the text of the first language type into the text of the second language type;

[0099] S3, determine the target conversion text for the second language type based on the first conversion text and the second conversion text.

[0100] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0101] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.

[0102] Embodiments of the present invention also provide an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.

[0103] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:

[0104] S1, perform speech recognition on the acquired target audio to obtain target recognition text in the first language type;

[0105] S2, determine the first converted text corresponding to the target recognition text according to the pre-configured configuration file, and input the target recognition text into the target text conversion model to obtain the second converted text, wherein the configuration file and the target text conversion model are both used to convert the text of the first language type into the text of the second language type;

[0106] S3, determine the target conversion text for the second language type based on the first conversion text and the second conversion text.

[0107] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0108] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.

[0109] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.

[0110] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A text conversion method, characterized in that, include: The acquired target audio is subjected to speech recognition to obtain the target recognized text in the first language type; The first converted text corresponding to the target recognition text is determined according to the pre-configured configuration file, and the target recognition text is input into the target text conversion model to obtain the second converted text. The configuration file and the target text conversion model are both used to convert the text of the first language type into the text of the second language type. Determine the target conversion text for the second language type based on the first and second converted texts; The step of determining the target converted text based on the first converted text and the second converted text includes: determining the first converted text as the target converted text when the difference between the first converted text and the second converted text is greater than or equal to a preset threshold; and determining the second converted text as the target converted text when the difference between the first converted text and the second converted text is less than the preset threshold. Wherein, if the difference between the first converted text and the second converted text is greater than or equal to a preset threshold, the method further includes: adding a set of training data containing the target recognition text and the first converted text to a training sample set; using the training sample set to train the target text conversion model until the value of the target loss function corresponding to the target text conversion model is less than a preset threshold, ending the training, and re-determining the target text conversion model at the end of the training as the target text conversion model.

2. The text conversion method according to claim 1, characterized in that, Determining the first converted text corresponding to the identified text based on a pre-configured configuration file includes: Obtain a pre-configured configuration file, wherein the configuration file contains converted text of the second language type corresponding to the recognized text of the first language type; Based on the configuration file, determine the reference recognition text that has the highest matching degree with the target recognition text; The converted text corresponding to the reference identification text in the configuration file is determined as the first converted text.

3. The text conversion method according to claim 2, characterized in that, Determining the reference recognition text with the highest matching degree to the target recognition text according to the configuration file includes: using a target matching algorithm to match multiple sub-reference texts that have a corresponding relationship with the target recognition text from the configuration file, wherein the reference recognition text includes the multiple sub-reference texts, and each sub-reference text has a corresponding relationship with a sub-text in the target recognition text; Determining the converted text corresponding to the reference recognition text in the configuration file as the first converted text includes: determining the sub-converted text corresponding to each sub-reference text from the configuration file; and combining each sub-converted text into the first converted text according to the correspondence with the sub-text in the target recognition text.

4. The text conversion method according to claim 1, characterized in that, Before inputting the target-recognized text into the target text conversion model, the method further includes: Obtain a training sample set, wherein each set of data in the training sample set includes text of the first language type and the corresponding text of the second language type; The text conversion model to be trained is trained using a training sample set until the value of the target loss function corresponding to the text conversion model to be trained is less than a preset threshold. The training ends and the text conversion model to be trained at the end of the training is determined as the target text conversion model.

5. The text conversion method according to claim 1, characterized in that, Determining the target converted text based on the first converted text and the second converted text includes: If the difference between the first converted text and the second converted text is greater than or equal to a preset threshold, the second converted text is used to correct the first converted text to obtain the target converted text; If the difference between the first converted text and the second converted text is less than the preset threshold, the second converted text is corrected using the first converted text to obtain the target converted text.

6. A text conversion device, characterized in that, include: The recognition module is used to perform speech recognition on the acquired target audio to obtain target recognition text in the first language type. The first determining module is used to determine the first converted text corresponding to the target recognition text according to a pre-configured configuration file, and to input the target recognition text into the target text conversion model to obtain the second converted text, wherein the configuration file and the target text conversion model are both used to convert the text of the first language type into the text of the second language type; The second determining module is used to determine the target conversion text of the second language type based on the first conversion text and the second conversion text; The second determining module is further configured to determine the first converted text as the target converted text when the difference between the first converted text and the second converted text is greater than or equal to a preset threshold; and to determine the second converted text as the target converted text when the difference between the first converted text and the second converted text is less than the preset threshold. The device further includes a training module, which is used to add a set of training data containing the target recognition text and the first converted text to a training sample set when the difference between the first converted text and the second converted text is greater than or equal to a preset threshold; to train the target text conversion model using the training sample set until the value of the target loss function corresponding to the target text conversion model is less than a preset threshold, to end the training, and to re-determine the target text conversion model at the end of the training as the target text conversion model.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method of any one of claims 1 to 5.

8. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method of any one of claims 1 to 5 through the computer program.