Text-to-voice optimization method and device, electronic equipment and computer program product
By pre-processing the conversion of numbers in text into target language forms in the TTS system, the problem of unnatural reading of numbers in the TTS system is solved, and the user experience and speech synthesis are improved, and it is suitable for multiple language scenarios.
Patent Information
- Application Number
- CN202411470047.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2024-12-06
AI Technical Summary
When the existing TTS system reads Chinese text aloud, the numbers are read out one by one by one by one, resulting in poor user experience, especially in scenarios such as navigation, notification and information broadcasting, and it is difficult to deal with mixed readings in different languages.
By obtaining the digital content in the pending text, using preset conversion rules and current conversion scenarios, the digital content is converted into digital text in the target language, and reorganized with the original text, and input it as preprocessed text to the TTS system for speech synthesis , solves the problem of unnatural reading of digital and mixed reading of different languages.
It improves the naturalness of voice broadcasting, improves user experience, meets the conversion needs of different usage scenarios, reduces costs, and is suitable for digital reading scenarios in various languages.
Smart Images

Figure CN119091855A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of text-to-speech conversion, and in particular to an optimization method, device, electronic device, and computer program product for text-to-speech conversion. Background Art
[0002] In existing TTS (Text-To-Speech) systems, when the voice is in Chinese, many third-party TTS SDKs often read out the numbers in the text one by one. This situation is very unnatural in many application scenarios, especially in scenarios such as navigation, notifications, and information broadcasting.
[0003] For example, when "traffic jam ahead 256 meters" is read as "traffic jam ahead 256 meters", the user experience will be greatly affected. This problem is generally caused by the word segmentation problem when the TTS system is processing text, that is, when understanding the semantics and segmenting the words, 256 is not recognized as a whole and then processed as a number.
[0004] To improve this problem, a common approach is to perform speech comprehension, sentence segmentation, and word segmentation on a whole text that needs to be processed by TTS, and then identify the numbers for conversion. Although this approach can fundamentally solve the problem, it requires the TTS system to have strong natural language comprehension capabilities. The reverse parsing process is difficult and often has poor results. The optimization cycle is often very long, and some special situations cannot be considered, such as mixed reading of different languages. Summary of the invention
[0005] The embodiments of the present application provide a text-to-speech optimization method, device, electronic device, and computer program product to meet the text-to-speech requirements of different usage scenarios and improve the user experience.
[0006] The present application embodiment adopts the following technical solutions:
[0007] In a first aspect, an embodiment of the present application provides a text-to-speech optimization method, wherein the text-to-speech optimization method includes:
[0008] Obtaining the text to be processed and the digital content in the text to be processed;
[0009] Using preset conversion rules and current conversion scenarios, convert the digital content in the text to be processed into digital text in a target language;
[0010] Recombining the digital text in the target language with the text to be processed to obtain a recombined text;
[0011] The reorganized text is input as preprocessed text into a text-to-speech system for speech synthesis, and the synthesized speech is output.
[0012] Optionally, the obtaining of the text to be processed and the digital content in the text to be processed includes:
[0013] If the text to be processed is a text to be spliced, then obtaining digital content in the text to be spliced according to the current conversion scenario;
[0014] If the text to be processed is a complete text, text recognition is performed on the complete text to obtain the digital content in the complete text.
[0015] Optionally, the converting the digital content in the text to be processed into a digital text in a target language by using a preset conversion rule and a current conversion scenario includes:
[0016] Determine the target language based on the current conversion scenario;
[0017] Using preset conversion rules, converting the digital content in the text to be processed into digital text in the target language;
[0018] The target language is the same as or different from the language of the text to be processed.
[0019] Optionally, the digital content in the text to be processed includes multiple digital parts, and the converting of the digital content in the text to be processed into a digital text in a target language by using a preset conversion rule and a current conversion scenario includes:
[0020] Determine the target language corresponding to each digital part according to the current conversion scenario;
[0021] Using preset conversion rules, convert each digital part in the text to be processed into a digital text of the corresponding target language;
[0022] The target languages corresponding to each of the digital parts are the same or different.
[0023] Optionally, the target language includes Chinese, and the converting of the digital content in the text to be processed into digital text in the target language by using a preset conversion rule and a current conversion scenario includes:
[0024] Define a mapping array for converting numbers to Chinese characters, wherein the mapping array for converting numbers to Chinese characters includes an array for representing Chinese units of different digits and an array for representing Chinese characters corresponding to different numbers;
[0025] Based on the mapping array of numbers to Chinese, the digital content in the text to be processed is converted to obtain Chinese digital text.
[0026] Optionally, the target language includes English, and the converting of the digital content in the text to be processed into digital text in the target language by using a preset conversion rule and a current conversion scenario includes:
[0027] Define a mapping array for converting numbers to English, wherein the mapping array for converting numbers to English includes a plurality of English word arrays divided based on the magnitude of the numbers;
[0028] Based on the mapping array of numbers to English, the digital content in the text to be processed is converted to obtain English digital text.
[0029] Optionally, the step of recombining the digital text in the target language with the text to be processed to obtain the recombined text comprises:
[0030] If the text to be processed is a text to be spliced, splicing the digital text in the target language to the target position of the text to be spliced to obtain the reorganized text;
[0031] If the text to be processed is a complete text, the digital content in the complete text is replaced by the digital text in the target language to obtain the reorganized text.
[0032] In a second aspect, an embodiment of the present application further provides a text-to-speech optimization device, wherein the text-to-speech optimization device comprises:
[0033] An acquisition unit, used for acquiring the text to be processed and the digital content in the text to be processed;
[0034] A conversion unit, used to convert the digital content in the text to be processed into a digital text in a target language by using a preset conversion rule and a current conversion scenario;
[0035] A recombining unit, which recombines the digital text in the target language with the text to be processed to obtain a recombined text;
[0036] The speech synthesis unit is used to input the reorganized text into the text-to-speech system for speech synthesis and output the synthesized speech.
[0037] In a third aspect, an embodiment of the present application further provides an electronic device, including:
[0038] Processor; and
[0039] A memory arranged to store computer executable instructions, wherein when the executable instructions are executed, the processor performs any of the aforementioned text-to-speech optimization methods.
[0040] In a fourth aspect, an embodiment of the present application further provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements any of the aforementioned text-to-speech optimization methods.
[0041] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects: the text-to-speech optimization method of the embodiments of the present application first obtains the text to be processed and the digital content in the text to be processed; then uses the preset conversion rules and the current conversion scenario to convert the digital content in the text to be processed into digital text in the target language; then reorganizes the digital text in the target language with the text to be processed to obtain the reorganized text; finally, the reorganized text is input as the preprocessed text into the text-to-speech system for speech synthesis, and the synthesized speech is output. The execution of the text-to-speech optimization method of the embodiments of the present application is independent of the internal processing of the TTS system, and the operations such as conversion and reorganization of the digital content in the text to be processed are pre-placed, and the text that meets the requirements of different scenarios is generated by preprocessing and then input into the TTS system, without the need for reverse parsing within the TTS system, and at the same time solves the problem that the internal logic of the existing TTS system cannot cope with the conversion requirements of different usage scenarios, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0043] Figure 1 A flowchart of a text-to-speech optimization method in an embodiment of the present application;
[0044] Figure 2 This is a schematic diagram of the structure of a text-to-speech optimization device in an embodiment of the present application;
[0045] Figure 3 This is a schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0047] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0048] The present application embodiment provides a text-to-speech optimization method, such as Figure 1 As shown, a flowchart of a text-to-speech optimization method in an embodiment of the present application is provided, and the text-to-speech optimization method at least includes the following steps S110 to S140:
[0049] Step S110, obtaining the text to be processed and the digital content in the text to be processed.
[0050] The object to be converted and processed by the text-to-speech optimization method in the embodiment of the present application is mainly the numerical content in the text to be processed. Because in the process of converting text to speech in the existing TTS system, the numbers in the text are often read out directly character by character, but this way of reading numbers may not meet the needs of actual scenarios or contexts, resulting in a significant impact on the user experience.
[0051] When performing text-to-speech processing, the embodiment of the present application needs to first obtain the text to be processed and the digital content in the text to be processed. The text to be processed here can have different sources based on different application scenarios and can be text in various languages. The digital content in the text to be processed can be included in the text to be processed or can be obtained separately.
[0052] Step S120, using preset conversion rules and the current conversion scenario, converting the digital content in the text to be processed into digital text in the target language.
[0053] After obtaining the text to be processed and the digital content in the text to be processed, it is necessary to combine the current conversion scenario and use the pre-set conversion rules to convert the digital content in the text to be processed into digital text in the target language. For example, in scenarios such as navigation, notifications, and information broadcasts, the text to be processed is "Traffic congestion 256 meters ahead", then it can be determined based on the current usage scenario and conversion rules that the digital content "256" needs to be converted to "two hundred and fifty-six", and "two hundred and fifty-six" is the digital text in the target language. Of course, the specific target language to be converted into can be flexibly set according to the actual scenario requirements, and no specific limitation is made here.
[0054] Step S130, recombining the digital text in the target language with the text to be processed to obtain a recombined text.
[0055] After obtaining the converted digital text of the target language, it is necessary to reorganize the digital text of the target language with the text to be processed to obtain the reorganized text. The reorganized text is the text that meets the requirements of direct speech synthesis of the subsequent TTS system. For example, if the text to be processed is "traffic jam ahead 256 meters", the reorganized text is "traffic jam ahead 256 meters". The subsequent TTS system can directly perform speech synthesis on the reorganized text and read it out.
[0056] Step S140: input the reorganized text as preprocessed text into a text-to-speech system for speech synthesis, and output the synthesized speech.
[0057] The above steps S110 to S130 can be regarded as the stage of preprocessing the text to be processed and the digital content therein, which is the pre-stage of the TTS system for speech synthesis. The preprocessed text is input into the TTS system for speech synthesis, and the synthesized speech is output and read aloud. This process essentially does not require the TTS system itself to have accurate natural language understanding capabilities. The input received by the TTS system is the converted text content that meets the reading requirements, and speech synthesis can be performed directly.
[0058] The execution of the text-to-speech optimization method of the embodiment of the present application is independent of the internal processing of the TTS system. It puts the operations such as conversion and reorganization of the digital content in the text to be processed in front, generates text that meets the requirements of different scenarios through preprocessing, and then inputs it into the TTS system. There is no need for reverse parsing within the TTS system. At the same time, it solves the problem that the internal logic of the existing TTS system cannot cope with the conversion requirements of different usage scenarios, thereby improving the user experience.
[0059] In some embodiments of the present application, obtaining the text to be processed and the digital content in the text to be processed includes: if the text to be processed is a text to be spliced, obtaining the digital content in the text to be spliced according to the current conversion scenario; if the text to be processed is a complete text, performing text recognition on the complete text to obtain the digital content in the complete text.
[0060] There are mainly two types of texts to be processed obtained in the embodiments of the present application. One is that the text to be processed is in the form of text to be spliced. For example, in scenarios such as navigation, notification, and information broadcasting, the text to be spliced is "traffic jam ahead xx meters". According to the scenario, it can be determined that the "xx" content therein is the digital content that needs to be converted. Since the "xx" content in this scenario will be updated according to the real-time driving dynamics of the vehicle, the digital content to be converted can be obtained separately in the text splicing stage and converted. In this case, the understanding of the text to be processed and the processing of sentence and word segmentation can be omitted.
[0061] The other is that the text to be processed is in the form of complete text. For example, in the weather report and other scenarios, the complete text is "Today is September 25, 2024. Beijing is cloudy today. The maximum temperature during the day is 24°C, the minimum temperature at night is 14°C, the east wind is level 2, breeze, and the ultraviolet intensity is level 4." According to the scenario, it can be determined that "September 25, 2024", "24", "14" and other contents are digital content that needs to be converted. Therefore, it is necessary to first identify the above content from the complete text and then perform the conversion processing. Specifically, regular expressions or other text processing technologies can be used to identify the digital part in the text.
[0062] In some embodiments of the present application, the converting of the digital content in the text to be processed into digital text in a target language using preset conversion rules and a current conversion scenario includes: determining the target language according to the current conversion scenario; wherein the target language is the same as or different from the language of the text to be processed; and converting the digital content in the text to be processed into digital text in the target language using preset conversion rules.
[0063] The existing TTSSDK cannot handle some special mixed reading examples of different languages well. For example, when the text to be broadcasted is "Today is August 23. We have an exam scheduled in 15 days, and the exam time is 150 minutes. The weather forecast for the day is 28℃ to 35℃, please prepare in advance. During this period, we need to prepare 20 documents for review." In this example, according to the scenario or user needs, the Chinese part is required to be read in Chinese and the digital part is read in English.
[0064] If the existing TTSSDK is used for speech synthesis and reading, since the number part is recognized to be in Chinese text, TTS will read it according to Chinese grammar by default. Similarly, if the number appears in English text, it will be read according to English grammar by default. This inherent conversion method cannot meet the reading needs of different language texts mixed in a text, and cannot meet the needs of some special scenarios. This is mainly because the general TTSSDK or TTS system can only specify one broadcast language when making a method call. When performing digital conversion, the numbers mixed in Chinese will automatically be converted according to Chinese grammar, and the numbers mixed in English will automatically be converted according to English grammar. More refined settings are not allowed.
[0065] Since the conversion of digital content in the embodiment of the present application is a preprocessing process and is a pre-stage for the TTS system to perform speech synthesis, the embodiment of the present application can break away from the inherent logical limitations of the traditional TTS SDK or TTS system when converting digital content. The target language to be converted can be determined according to the conversion requirements of different scenarios, thereby achieving flexible conversion of digital content.
[0066] In some embodiments of the present application, the digital content in the text to be processed includes multiple digital parts, and using preset conversion rules and the current conversion scenario to convert the digital content in the text to be processed into digital text in a target language includes: determining the target language corresponding to each digital part according to the current conversion scenario; using preset conversion rules, converting each digital part in the text to be processed into a digital text in the corresponding target language; wherein the target languages corresponding to each of the digital parts are the same or different.
[0067] For example, the text to be processed is "Today is August 23. We have an exam scheduled for 15 days later, and the exam time is 150 minutes. The weather forecast for that day is 28℃ to 35℃, please prepare in advance. During this period, we need to prepare 20 documents for review." In this example, the text to be processed contains multiple digital parts to be converted. In actual application scenarios, different digital parts may be required to be read in different languages.
[0068] The embodiment of the present application can determine the target language corresponding to each digital part according to the requirements of the current conversion scenario, and then convert the digital content at different positions of the processed text using different language grammars as needed, thereby meeting the usage requirements in special scenarios.
[0069] The conversion process in the above-mentioned embodiments can achieve better conversion effect at a lower cost, which is also due to the fact that the conversion processing of the text to be processed in this application is implemented before the TTS system processes it, independently of the internal logic of the TTS system.
[0070] In some embodiments of the present application, the target language includes Chinese, and the use of preset conversion rules and the current conversion scenario to convert the digital content in the text to be processed into digital text in the target language includes: defining a mapping array for converting numbers to Chinese, the mapping array for converting numbers to Chinese including an array for representing Chinese units of different digits and an array for representing Chinese characters corresponding to different numbers; based on the mapping array for converting numbers to Chinese, converting the digital content in the text to be processed to obtain Chinese digital text.
[0071] As an example of a practical application scenario, the conversion process of the embodiment of the present application is described by taking Chinese as the target language, which specifically includes the following contents:
[0072] (1) Define the mapping relationship between numbers and units:
[0073] Define two static arrays, units and numArray, to convert Arabic numerals into Chinese. The units array represents Chinese units for different digits (ones, tens, hundreds, thousands), and the numArray array represents Chinese characters corresponding to the numbers 0-9.
[0074] (2) Define the method numberToChinese() for converting numbers to Chinese:
[0075] 1) Handle the number 0 specially and directly return "zero".
[0076] 2) For other numbers, parse them digit by digit and convert them into corresponding Chinese characters and units.
[0077] 3) During the conversion process, handle Chinese rules:
[0078] If there is a zero in the number and there is no consecutive zero before it, add "zero".
[0079] If the number starts with 10, omit the "one" in "ten".
[0080] If the result ends with "zero", this extra zero needs to be removed.
[0081] After the above processing, return the final Chinese representation.
[0082] For the convenience of understanding the embodiments of the present application, the following gives the pseudo-code for converting numbers to Chinese based on JAVA in the embodiments of the present application:
[0083]
[0084]
[0085]
[0086]
[0087] In some embodiments of the present application, the target language includes English. The converting the digital content in the text to be processed into the digital text in the target language by using the preset conversion rules and the current conversion scenario includes: defining a mapping array for converting numbers to English, where the mapping array for converting numbers to English includes multiple English word arrays divided based on the magnitude of numbers; and converting the digital content in the text to be processed based on the mapping array for converting numbers to English to obtain the English digital text.
[0088] As an example of an actual application scenario, taking the target language as English as an example, the conversion process of the embodiments of the present application is further elaborated, which specifically includes the following content:
[0089] (1) Define three arrays to store the mapping relationship between numbers and English words:
[0090] 1) The belowTwenty array is defined based on the pronunciation characteristics of English, which contains English words corresponding to numbers from 0 to 19 (such as "Zero", "One", "Two", ..., "Nineteen").
[0091] 2) The tens array contains English words that are multiples of 10 between 20 and 90 (such as "Twenty", "Thirty", ..., "Ninety").
[0092] 3) The thousands array contains the English word for thousand ("Thousand").
[0093] (2) Define the numberToEnglish() method to convert numbers to English:
[0094] 1) If the number is 0, return "Zero" directly.
[0095] 2) Use integer division and remainder operations to break numbers into thousands, hundreds, tens, and ones.
[0096] 3) According to the decomposed parts, construct the corresponding English word strings in turn:
[0097] If there is a thousand part, add "Thousand" and the corresponding numeral.
[0098] If there is a hundred part, add "Hundred" and the corresponding numeral.
[0099] For the remaining tens and ones digits, if they are greater than or equal to 20, use the tens array to get the tens digit word and append it to the result.
[0100] If the remaining number is less than 20, use the belowTwenty array to get the corresponding numeral.
[0101] Finally, the constructed English number string is returned.
[0102] To facilitate understanding of the embodiments of the present application, a pseudo code for converting numbers into English based on JAVA in the embodiments of the present application is given below:
[0103]
[0104]
[0105]
[0106] The above code implementation only provides conversion codes for Chinese and English readings. The conversion of other languages is similar and will not be described here.
[0107] In some embodiments of the present application, the reorganizing the digital text in the target language with the text to be processed to obtain the reorganized text includes: if the text to be processed is a text to be spliced, the digital text in the target language is spliced to the target position of the text to be spliced to obtain the reorganized text; if the text to be processed is a complete text, the digital text in the target language is used to replace the digital content in the complete text to obtain the reorganized text.
[0108] When the digital text of the target language is reorganized with the text to be processed, the embodiment of the present application can adopt different reorganization methods according to the type of the text to be processed. If the text to be processed is a text to be spliced, the digital text of the target language can be directly spliced to the corresponding position of the text to be spliced. For example, if the text to be processed is "traffic jam ahead xx meters", the digital text of the target language is "two hundred and fifty-six", and the spliced text is "traffic jam ahead two hundred and fifty-six meters". If the text to be processed is a complete text, the digital content in the complete text is replaced with the digital text of the target language to obtain the reorganized text. For example, if the text to be processed is "traffic jam ahead 256 meters", the digital text of the target language is "two hundred and fifty-six", and the replaced text is "traffic jam ahead two hundred and fifty-six meters".
[0109] In summary, the text-to-speech optimization method of the present application achieves at least the following technical effects by converting numbers into text of corresponding language pronunciation before calling the TTS system:
[0110] 1) Improved the naturalness of speech broadcasting: By converting digital content into the target language form in different scenarios, the problem of unnatural reading of digital parts in the existing TTS system is solved, and the naturalness of speech synthesis is greatly improved.
[0111] 2) Improved user experience: In application scenarios such as navigation and notifications, correctly reading numbers can effectively improve user experience and increase system usability and satisfaction.
[0112] 3) Reduced cost: This application completes the conversion of digital content in the preprocessing stage of the text, which is simple to implement and low-cost.
[0113] 4) Wide scope of application: This application is applicable to digital reading scenarios in various languages, not limited to specific application scenarios, has wide applicability, and meets the needs of special scenarios in which multiple languages cannot be mixed in the existing TTS system.
[0114] The present application embodiment also provides a text-to-speech optimization device 200, such as Figure 2 As shown, a schematic diagram of the structure of a text-to-speech optimization device in an embodiment of the present application is provided, wherein the text-to-speech optimization device 200 includes: an acquisition unit 210, a conversion unit 220, a reorganization unit 230, and a speech synthesis unit 240, wherein:
[0115] An acquisition unit 210 is used to acquire the text to be processed and the digital content in the text to be processed;
[0116] A conversion unit 220, configured to convert the digital content in the text to be processed into a digital text in a target language by using a preset conversion rule and a current conversion scenario;
[0117] A reorganization unit 230 reorganizes the digital text in the target language with the text to be processed to obtain a reorganized text;
[0118] The speech synthesis unit 240 is used to input the reorganized text into the text-to-speech system for speech synthesis and output the synthesized speech.
[0119] In some embodiments of the present application, the acquisition unit 210 is specifically used to: if the text to be processed is a text to be spliced, then acquire the digital content in the text to be spliced according to the current conversion scenario; if the text to be processed is a complete text, then perform text recognition on the complete text to obtain the digital content in the complete text.
[0120] In some embodiments of the present application, the conversion unit 220 is specifically used to: determine a target language according to a current conversion scenario; wherein the target language is the same as or different from the language of the text to be processed; and convert the digital content in the text to be processed into digital text in the target language using preset conversion rules.
[0121] In some embodiments of the present application, the digital content in the text to be processed includes multiple digital parts, and the conversion unit 220 is specifically used to: determine the target language corresponding to each digital part according to the current conversion scenario; use preset conversion rules to convert each digital part in the text to be processed into a digital text of the corresponding target language; wherein the target language corresponding to each of the digital parts is the same or different.
[0122] In some embodiments of the present application, the target language includes Chinese, and the conversion unit 220 is specifically used to: define a mapping array for converting numbers to Chinese, the mapping array for converting numbers to Chinese including an array for representing Chinese units of different digits and an array for representing Chinese characters corresponding to different numbers; based on the mapping array for converting numbers to Chinese, convert the digital content in the text to be processed to obtain Chinese digital text.
[0123] In some embodiments of the present application, the target language includes English, and the conversion unit 220 is specifically used to: define a mapping array for converting numbers to English, the mapping array for converting numbers to English including multiple English word arrays divided based on the magnitude of the numbers; based on the mapping array for converting numbers to English, convert the digital content in the text to be processed to obtain English digital text.
[0124] In some embodiments of the present application, the reorganization unit 230 is specifically used to: if the text to be processed is a text to be spliced, then the digital text in the target language is spliced to the target position of the text to be spliced to obtain the reorganized text; if the text to be processed is a complete text, then the digital text in the target language is used to replace the digital content in the complete text to obtain the reorganized text.
[0125] It can be understood that the above-mentioned text-to-speech optimization device can implement the various steps of the text-to-speech optimization method provided in the aforementioned embodiment. The relevant explanations about the text-to-speech optimization method are applicable to the text-to-speech optimization device and will not be repeated here.
[0126] Figure 3 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. Figure 3 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. The memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. Of course, the electronic device may also include hardware required for other services.
[0127] The processor, network interface and memory can be interconnected through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0128] The memory is used to store the program. Specifically, the program may include a program code, and the program code includes a computer operation instruction. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.
[0129] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming an optimized device for text-to-speech at the logical level. The processor executes the program stored in the memory and is specifically used to perform the following operations:
[0130] Obtaining the text to be processed and the digital content in the text to be processed;
[0131] Using preset conversion rules and current conversion scenarios, convert the digital content in the text to be processed into digital text in a target language;
[0132] Recombining the digital text in the target language with the text to be processed to obtain a recombined text;
[0133] The reorganized text is input as preprocessed text into a text-to-speech system for speech synthesis, and the synthesized speech is output.
[0134] The above application Figure 1The method performed by the text-to-speech optimization device disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0135] The present application also provides a computer program product, which stores one or more programs, wherein the one or more programs include instructions, which, when executed by an electronic device including multiple application programs, enable the electronic device to execute Figure 1 The method performed by the text-to-speech optimization device in the illustrated embodiment is specifically used to perform:
[0136] Obtaining the text to be processed and the digital content in the text to be processed;
[0137] Using preset conversion rules and current conversion scenarios, convert the digital content in the text to be processed into digital text in a target language;
[0138] Recombining the digital text in the target language with the text to be processed to obtain a recombined text;
[0139] The reorganized text is input as preprocessed text into a text-to-speech system for speech synthesis, and the synthesized speech is output.
[0140] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0141] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0142] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0143] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0144] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0145] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0146] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0147] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0148] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0149] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A text-to-speech optimization method, wherein: The text-to-speech optimization method comprises: Obtaining the text to be processed and the digital content in the text to be processed; Using preset conversion rules and current conversion scenarios, convert the digital content in the text to be processed into digital text in a target language; Recombining the digital text in the target language with the text to be processed to obtain a recombined text; The reorganized text is input as preprocessed text into a text-to-speech system for speech synthesis, and the synthesized speech is output.
2. The text-to-speech optimization method according to claim 1, wherein: The obtaining of the text to be processed and the digital content in the text to be processed comprises: If the text to be processed is a text to be spliced, then obtaining digital content in the text to be spliced according to the current conversion scenario; If the text to be processed is a complete text, text recognition is performed on the complete text to obtain the digital content in the complete text.
3. The text-to-speech optimization method according to claim 1, wherein: The method of converting the digital content in the text to be processed into a digital text in a target language by using a preset conversion rule and a current conversion scenario includes: Determine the target language based on the current conversion scenario; Using preset conversion rules, converting the digital content in the text to be processed into digital text in the target language; The target language is the same as or different from the language of the text to be processed.
4. The text-to-speech optimization method according to claim 1, wherein: The digital content in the text to be processed includes multiple digital parts, and the method of converting the digital content in the text to be processed into a digital text in a target language by using a preset conversion rule and a current conversion scenario includes: Determine the target language corresponding to each digital part according to the current conversion scenario; Using preset conversion rules, convert each digital part in the text to be processed into a digital text of the corresponding target language; The target languages corresponding to each of the digital parts are the same or different.
5. The text-to-speech optimization method according to claim 1, wherein: The target language includes Chinese, and the method of converting the digital content in the text to be processed into a digital text in the target language by using a preset conversion rule and a current conversion scenario includes: Define a mapping array for converting numbers to Chinese characters, wherein the mapping array for converting numbers to Chinese characters includes an array for representing Chinese units of different digits and an array for representing Chinese characters corresponding to different numbers; Based on the mapping array of numbers to Chinese, the digital content in the text to be processed is converted to obtain Chinese digital text.
6. The text-to-speech optimization method according to claim 1, wherein: The target language includes English, and the method of converting the digital content in the text to be processed into digital text in the target language by using the preset conversion rule and the current conversion scenario includes: Define a mapping array for converting numbers to English, wherein the mapping array for converting numbers to English includes a plurality of English word arrays divided based on the magnitude of the numbers; Based on the mapping array of numbers to English, the digital content in the text to be processed is converted to obtain English digital text.
7. The text-to-speech optimization method according to claim 1, wherein: The step of recombining the digital text in the target language with the text to be processed to obtain the recombined text comprises: If the text to be processed is a text to be spliced, splicing the digital text in the target language to the target position of the text to be spliced to obtain the reorganized text; If the text to be processed is a complete text, the digital content in the complete text is replaced by the digital text in the target language to obtain the reorganized text.
8. A text-to-speech optimization device, wherein: The text-to-speech optimization device comprises: An acquisition unit, used for acquiring the text to be processed and the digital content in the text to be processed; A conversion unit, used to convert the digital content in the text to be processed into a digital text in a target language by using a preset conversion rule and a current conversion scenario; A recombining unit, which recombines the digital text in the target language with the text to be processed to obtain a recombined text; The speech synthesis unit is used to input the reorganized text into the text-to-speech system for speech synthesis and output the synthesized speech.
9. An electronic device, comprising: processor; as well as A memory arranged to store computer executable instructions, wherein when the executable instructions are executed, the processor executes the text-to-speech optimization method according to any one of claims 1 to 7.
10. A computer program product, comprising a computer program or instructions, wherein when the computer program or instructions are executed by a processor, the text-to-speech optimization method according to any one of claims 1 to 7 is implemented.
