Text conversion method and device for mathematical formula and electronic equipment

By identifying information such as the positions of operators and numbers in mathematical formulas, conversion rules are obtained, solving the problem of accuracy in mathematical formula text conversion and achieving correct text conversion of mathematical formulas.

CN115408996BActive Publication Date: 2026-04-17BEIJING YOUZHUJU NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING YOUZHUJU NETWORK TECH CO LTD
Filing Date
2022-08-24
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately transcribe mathematical formulas using text regularization, especially in speech synthesis systems where numbers, symbols, and abbreviations in mathematical formulas are converted into spoken text.

Method used

By acquiring the target mathematical formula, identifying formula information, including operators, operator positions and frequency of occurrence, letter and number positions and frequency of occurrence, obtaining preset conversion rules that match the target mathematical formula, determining the target conversion rules, and converting the mathematical formula into text according to the conversion rules.

Benefits of technology

It achieves correct text regularization transcribing of mathematical formulas, and can convert mathematical formulas into text in Chinese, English or other languages, thus improving the accuracy of text conversion of mathematical formulas in speech synthesis systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115408996B_ABST
    Figure CN115408996B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a text conversion method and device for a mathematical formula and an electronic device. A specific embodiment of the method comprises: obtaining a target mathematical formula to be converted; identifying formula information from the target mathematical formula, wherein the formula information comprises at least one of the following: an operator appearing in the target mathematical formula, a position and a number of occurrences of the operator in the target mathematical formula, a position and a number of occurrences of a letter and / or a number in the target mathematical formula; obtaining a preset conversion rule matched with the target mathematical formula based on the formula information, and determining a target conversion rule based on the obtained conversion rule; and converting the target mathematical formula into text according to the target conversion rule. The embodiment can correctly perform text regularization transcription on a mathematical formula.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and more specifically to a method, apparatus, and electronic device for text conversion of mathematical formulas. Background Technology

[0002] Text normalization (TN) is an important component of speech synthesis systems, primarily responsible for converting numbers, symbols, abbreviations, and other textual data into spoken language. As a crucial step in the front-end of a speech synthesis system, accurately transcribing mathematical formulas into written form using text normalization is a pressing issue that needs to be addressed. Summary of the Invention

[0003] This disclosure is provided to briefly introduce the concepts, which will be described in detail in the subsequent Detailed Description section. This disclosure is not intended to identify key or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0004] In a first aspect, embodiments of this disclosure provide a method for text conversion of mathematical formulas, comprising: obtaining a target mathematical formula to be converted; identifying formula information from the target mathematical formula, wherein the formula information includes at least one of the following: operators appearing in the target mathematical formula, the position and frequency of the operators in the target mathematical formula, and the position and frequency of letters and / or numbers in the target mathematical formula; obtaining a preset conversion rule matching the target mathematical formula based on the formula information, and determining a target conversion rule based on the obtained conversion rule; and converting the target mathematical formula into text according to the target conversion rule.

[0005] Secondly, embodiments of this disclosure provide a text conversion apparatus for mathematical formulas, comprising: an acquisition unit for acquiring a target mathematical formula to be converted; an identification unit for identifying formula information from the target mathematical formula, wherein the formula information includes at least one of the following: operators appearing in the target mathematical formula, the position and frequency of the operators in the target mathematical formula, and the position and frequency of letters and / or numbers in the target mathematical formula; a determination unit for acquiring a preset conversion rule matching the target mathematical formula based on the formula information, and determining a target conversion rule based on the acquired conversion rule; and a conversion unit for converting the target mathematical formula into text according to the target conversion rule.

[0006] Thirdly, embodiments of this disclosure provide an electronic device, including: at least one processor; and a storage device for storing at least one program, which, when executed by the at least one processor, causes the at least one processor to implement the text conversion method for mathematical formulas as described in the first aspect.

[0007] Fourthly, embodiments of this disclosure provide a computer-readable medium having a computer program stored thereon that, when executed by a processor, implements the steps of the text conversion method for mathematical formulas as described in the first aspect.

[0008] The text conversion method, apparatus, and electronic device for mathematical formulas provided in this disclosure involve: acquiring a target mathematical formula to be converted; identifying formula information from the target mathematical formula; acquiring a preset conversion rule matching the target mathematical formula based on the formula information; determining a target conversion rule based on the acquired conversion rule; and finally converting the target mathematical formula into text according to the target conversion rule. This method can correctly perform text regularization transcribing of mathematical formulas. Attached Figure Description

[0009] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.

[0010] Figure 1 This is a flowchart of an embodiment of a text conversion method for mathematical formulas according to the present disclosure;

[0011] Figure 2 This is a flowchart of yet another embodiment of the text conversion method for mathematical formulas according to the present disclosure;

[0012] Figure 3 This is a schematic diagram of a structure of an embodiment of a text conversion device for mathematical formulas according to the present disclosure;

[0013] Figure 4 These are exemplary system architecture diagrams to which the various embodiments of this disclosure can be applied;

[0014] Figure 5 This is a schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present disclosure. Detailed Implementation

[0015] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0016] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.

[0017] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.

[0018] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.

[0019] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0020] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.

[0021] Please refer to Figure 1 The diagram illustrates a flow 100 of an embodiment of a text conversion method for mathematical formulas according to the present disclosure. This text conversion method for mathematical formulas includes the following steps:

[0022] Step 101: Obtain the target mathematical formula to be converted.

[0023] In this embodiment, the execution entity of the text conversion method for mathematical formulas can obtain the target mathematical formula to be converted. The target mathematical formula may include numbers / letters and operators, such as decimals, fractions, percentages; addition, subtraction, multiplication, division, parentheses, equations, inequalities, powers, and square roots.

[0024] Step 102: Identify formula information from the target mathematical formula.

[0025] In this embodiment, the executing entity can identify formula information from the target mathematical formula. The formula information may include at least one of the following: operators appearing in the target mathematical formula, the position and frequency of operators in the target mathematical formula, and the position and frequency of letters and / or numbers in the target mathematical formula.

[0026] As an example, if the target mathematical formula is: \dfrac{\sqrt{3}}{5}x=\dfrac{5}{6}, then the formula information identified by the executing entity from the target mathematical formula can be: the operators "semicolon" and "square root"; in order from left to right, the contents of the target mathematical formula are: operator "semicolon", operator "square root", three letters and numbers, operator "equal sign", operator "semicolon" and two numbers.

[0027] Step 103: Based on the formula information, obtain the preset conversion rules that match the target mathematical formula, and determine the target conversion rule based on the obtained conversion rules.

[0028] In this embodiment, the execution entity can obtain a preset conversion rule matching the target mathematical formula based on the formula information. This conversion rule is typically used to indicate the position of operators, numbers, letters, etc., in the converted text, as well as the pronunciation of operators in the formula.

[0029] Here, obtaining preset conversion rules matching the aforementioned target mathematical formula may include at least one of the following: preset conversion rules matching the entire content of the aforementioned target mathematical formula, preset conversion rules matching a portion of the aforementioned target mathematical formula, and preset conversion rules matching the operators in the aforementioned target mathematical formula. The executing entity can first obtain preset conversion rules matching the entire content of the aforementioned target mathematical formula, thereby determining the positions of operators, numbers, letters, etc., in the text of the aforementioned target mathematical formula; if no preset conversion rule matching the entire content of the aforementioned target mathematical formula exists, then preset conversion rules matching a portion of the aforementioned target mathematical formula can be obtained; subsequently, preset conversion rules matching the operators in the aforementioned target mathematical formula can be obtained, thereby obtaining the text corresponding to each operator.

[0030] Subsequently, the aforementioned executing entity can determine the target transformation rule based on the acquired transformation rules. For each operator contained in the target mathematical formula, if the operator corresponds to only one transformation rule, then that unique transformation rule can be determined as the target transformation rule corresponding to that operator.

[0031] Step 104: Convert the target mathematical formula into text according to the target transformation rules.

[0032] In this embodiment, the above-mentioned execution subject may convert the above-mentioned target mathematical formula into text according to the above-mentioned target conversion rule. Here, the above-mentioned target mathematical formula may be converted into Chinese text, English text or text in other languages.

[0033] As an example, if the above-mentioned target mathematical formula is: \(\frac{\sqrt{3}}{5}x = \frac{5}{6}\), it can be converted into Chinese text: five over the square root of three x equals five over six, or it can be converted into English text: the square root of three over five x equals five over six.

[0034] The method provided by the above-mentioned embodiment of the present disclosure obtains a target mathematical formula to be converted; then, identifies formula information from the above-mentioned target mathematical formula; then, based on the above-mentioned formula information, obtains a preset conversion rule matching the above-mentioned target mathematical formula, and determines a target conversion rule based on the obtained conversion rule; finally, converts the above-mentioned target mathematical formula into text according to the above-mentioned target conversion rule. In this way, the text regularization transcription of the mathematical formula can be correctly performed.

[0035] In some optional implementation manners, the operator appearing in the above-mentioned target mathematical formula may be a first target operator. The above-mentioned first target operator is usually an operator with at least two readings. The above-mentioned first target operator is usually matched with at least two preset conversion rules, and the above-mentioned conversion rules usually correspond to weights. The above-mentioned execution subject may determine the target conversion rule based on the obtained conversion rule in the following manner: the above-mentioned execution subject may determine the conversion rule corresponding to the maximum weight among the above-mentioned at least two conversion rules as the target conversion rule corresponding to the above-mentioned first target operator.

[0036] As an example, in a mathematical formula with a power operator, when converting it into English text, if the number following the power operator is 2 or 3, the first conversion rule that can convert the power operator into squared or cubed and the second conversion rule that can convert the power operator into to the power of can be obtained. Among them, the weight corresponding to the first conversion rule is greater than that of the second conversion rule, so the first conversion rule can be determined as the target conversion rule. It should be noted that the weight corresponding to the conversion rule is usually associated with the number of formulas that the conversion rule can cover. If the conversion rule can cover more formulas, the weight corresponding to this conversion rule is smaller; if the conversion rule can cover fewer formulas, the weight corresponding to this conversion rule is larger.

[0037] As an example, for the first transformation rule that can convert the exponentiation operator to squared or cubed, the second transformation rule that can convert the exponentiation operator to the power of, and the third transformation rule that can convert the inner exponentiation operator to squared or cubed and the outer exponentiation operator to the power of, since the number of formulas covered by the third transformation rule is less than the number of formulas covered by the first transformation rule and the number of formulas covered by the second transformation rule, the weight of the third transformation rule is set to be larger.

[0038] In some optional implementations, the execution entity can obtain the target mathematical formula to be converted in the following way: The execution entity can obtain the mathematical formula to be converted, which is typically a LaTeX mathematical formula. The execution entity can determine whether a second target operator exists in the mathematical formula. The reading of the second target operator is related to its position in the mathematical formula. For example, the absolute value symbol, |2|, is read as "the absolute value of two." In fact, the left absolute value symbol is read as "the absolute value of," and the right absolute value symbol is not read. If a second target operator exists in the mathematical formula, the execution entity can modify the second target operator according to its position in the mathematical formula, and determine the modified mathematical formula as the target mathematical formula. For example, the left absolute value symbol can be modified to \lvert, and the right absolute value symbol can be written as \rvert.

[0039] In some alternative implementations, before obtaining the target mathematical formula to be converted, the executing entity can obtain target text, which typically contains numbers. Then, based on the target text, the executing entity can determine the category to which the numbers belong. These categories typically include mathematical formulas. The categories may also include, but are not limited to, at least one of the following: cardinal numbers, ordinal numbers, percentages, dates, times, units of measurement, URLs, emails, currencies, addresses, and telephone numbers. Here, the executing entity can obtain contextual information about the numbers from the target text, and then analyze this contextual information to determine the category to which the numbers belong. For example, if the target text is: "Please dial telephone number 1234567", then "1234567" can be analyzed as a telephone number; if the target text is: "Delivery address is No. 100, XX Street, Haidian District, Beijing", then "100" can be analyzed as an address.

[0040] In some optional implementations, after determining the category to which the aforementioned numbers belong, the executing entity can generate structured data corresponding to the aforementioned numbers based on the category. Here, the executing entity can obtain the structured data transformation rules corresponding to the aforementioned category, and then generate the structured data corresponding to the aforementioned numbers according to the structured data transformation rules corresponding to the aforementioned category. The aforementioned structured data transformation rules are used to extract the structured data corresponding to numbers from text. As an example, if the category to which the aforementioned numbers belong is telephone numbers, then the structured data may include: Category: Telephone Number; Number: 1234567; Context Information: Please dial the telephone number.

[0041] In some optional implementations, the target mathematical formula is typically a LaTeX mathematical formula. LaTeX is a format, and a LaTeX mathematical formula is a mathematical formula typed using the LaTeX format. Using LaTeX for typesetting allows for the generation of high-quality, complex mathematical formulas in a short time. When referencing LaTeX formulas in text, the mathematical formula content and the text content can be interspersed.

[0042] Continue to refer to Figure 2 This illustrates a flow 200 of another embodiment of a text conversion method for mathematical formulas. The flow 200 of this text conversion method for mathematical formulas includes the following steps:

[0043] Step 201: Obtain the target mathematical formula to be converted.

[0044] Step 202: Identify formula information from the target mathematical formula.

[0045] In this embodiment, steps 201-202 can be performed in a similar manner to steps 101-102, and will not be described again here.

[0046] Step 203: Determine the category to which the operator belongs.

[0047] In this embodiment, the execution entity of the text conversion method for mathematical formulas can determine the category to which the aforementioned operators belong. The execution entity can pre-set the operators into a preset number of categories. Here, the operators can be divided into three categories: pre-unary operators, post-unary operators, and binary operators.

[0048] A preceding unary operator typically refers to an operator preceded by a preceding unary operator, a binary operator, or an operator that does not exist, followed by a number or a preceding unary operator. Examples include the fraction symbol \dfrac{, the square root symbol \sqrt, and the left parenthesis ([).

[0049] A unary operator typically refers to an operator that is preceded by a number or a binary operator or a number, such as a right parenthesis}, a percent sign \%, an exponentiation ^, etc.

[0050] Binary operators typically refer to operators that are preceded by a number or followed by a unary operator, and followed by a number or followed by a unary operator, such as addition, subtraction, multiplication, and division.

[0051] The aforementioned executing entity can determine which of the three categories—prefix unary operator, postfix unary operator, and binary operator—the aforementioned operator belongs to. It should be noted that the aforementioned target mathematical formula may contain one operator, or it may contain at least two of the following categories: prefix unary operator, postfix unary operator, and binary operator.

[0052] Step 204: Based on the category to which the operator belongs, the position and frequency of the operator in the target mathematical formula, and the position and frequency of the letters and / or numbers in the target mathematical formula, obtain the preset conversion rules that match the target mathematical formula.

[0053] In this embodiment, the executing entity can obtain a preset conversion rule matching the target mathematical formula based on the category to which the operator belongs, the position and frequency of the operators of the above category in the target mathematical formula, and the position and frequency of letters and / or numbers in the target mathematical formula. The conversion rule is typically used to indicate the position of operators, numbers, letters, etc., in the converted text, as well as the pronunciation of the operators in the formula.

[0054] As an example, if the target mathematical formula is: \dfrac{\sqrt{3}}{5}x=\dfrac{5}{6}, then firstly, it is determined that the operators \dfrac and \sqrt in the target mathematical formula are both unary operators, and the operator "=" is a binary operator. The execution entity can use the contents of the target mathematical formula (i.e., two unary operators, three letters and numbers, one binary operator, one unary operator and two numbers) in the order from left to right to obtain the template formula that the formula matches: at least zero unary operators + at least one number and / or letter + binary operator + at least zero unary operators + at least one number and / or letter. Then, the preset conversion rule corresponding to the template formula can be determined as the preset conversion rule that matches the target mathematical formula.

[0055] Step 205: Determine the target conversion rule based on the obtained conversion rules.

[0056] Step 206: Convert the target mathematical formula into text according to the target transformation rules.

[0057] In this embodiment, steps 205-206 can be performed in a similar manner to steps 103-104, and will not be described again here.

[0058] from Figure 2 It can be seen from this that, with Figure 1 Compared to the corresponding embodiments, the process 200 of the text conversion method for mathematical formulas in this embodiment embodies the steps of determining the category to which the operator belongs and obtaining a matching preset conversion rule based on the category to which the operator belongs. Therefore, the solution described in this embodiment allows a single conversion rule to cover more mathematical formulas, reducing the workload of setting conversion rules.

[0059] Further reference Figure 3 As an implementation of the methods shown in the above figures, this application provides an embodiment of a text conversion device for mathematical formulas, which is similar to... Figure 1 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.

[0060] like Figure 3 As shown, the text conversion device 300 for mathematical formulas in this embodiment includes: an acquisition unit 301, an identification unit 302, a determination unit 303, and a conversion unit 304. The acquisition unit 301 acquires the target mathematical formula to be converted; the identification unit 302 identifies formula information from the target mathematical formula, wherein the formula information includes at least one of the following: operators appearing in the target mathematical formula, the position and frequency of the operators in the target mathematical formula, and the position and frequency of letters and / or numbers in the target mathematical formula; the determination unit 303 acquires a preset conversion rule matching the target mathematical formula based on the formula information, and determines a target conversion rule based on the acquired conversion rule; the conversion unit 304 converts the target mathematical formula into text according to the target conversion rule.

[0061] In this embodiment, the specific processing of the acquisition unit 301, recognition unit 302, determination unit 303, and conversion unit 304 of the text conversion device 300 for mathematical formulas can be referred to Figure 1 The corresponding steps are 101, 102, 103 and 104 in the embodiment.

[0062] In some optional implementations, the operator appearing in the target mathematical formula is the first target operator, which is an operator with at least two ways of reading, and the first target operator matches at least two preset conversion rules, which have corresponding weights; and the determining unit 303 can be further used to determine the target conversion rule based on the obtained conversion rule in the following way: the determining unit 303 can determine the conversion rule corresponding to the largest weight among the at least two conversion rules as the target conversion rule corresponding to the first target operator.

[0063] In some optional implementations, the determining unit 303 may be further used to obtain a preset conversion rule matching the target mathematical formula based on the formula information in the following manner: the determining unit 303 may determine the category to which the operator belongs; then, based on the category to which the operator belongs, the position and frequency of the operator of the above category in the target mathematical formula, and the position and frequency of the letters and / or numbers in the target mathematical formula, a preset conversion rule matching the target mathematical formula may be obtained.

[0064] In some optional implementations, the acquisition unit 301 can be further used to acquire the target mathematical formula to be converted in the following way: the acquisition unit 301 can acquire the mathematical formula to be converted, determine whether there is a second target operator in the mathematical formula, wherein the reading of the second target operator is related to its position in the mathematical formula; if so, the second target operator is modified according to its position in the mathematical formula, and the modified mathematical formula is determined as the target mathematical formula.

[0065] In some alternative implementations, the text conversion device 300 for mathematical formulas may further include a text acquisition unit (not shown in the figure) and a category determination unit (not shown in the figure). The text acquisition unit can acquire target text, wherein the target text contains numbers; the category determination unit can determine the category to which the numbers belong based on the target text, wherein the category includes mathematical formulas.

[0066] In some alternative implementations, the text conversion device 300 for mathematical formulas may further include a generation unit (not shown in the figure). The generation unit may generate structured data corresponding to the numbers based on the category to which the numbers belong.

[0067] In some alternative implementations, the target mathematical formula is a mathematical formula using the Lattech scheme.

[0068] Continue to refer to Figure 4 , Figure 4An exemplary system architecture 400 is shown, in which embodiments of the text conversion method for mathematical formulas disclosed herein can be applied.

[0069] like Figure 4 As shown, system architecture 400 may include terminal devices 4011, 4012, and 4013, network 402, and server 403. Network 402 is used as a medium to provide a communication link between terminal devices 4011, 4012, and 4013 and server 403. Network 402 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.

[0070] Users can use terminal devices 4011, 4012, and 4013 to interact with server 403 via network 402 to send or receive messages, etc. For example, terminal devices 4011, 4012, and 4013 can send the target mathematical formula to be converted to server 403, and terminal devices 4011, 4012, and 4013 can also obtain preset conversion rules from server 403. Various communication client applications can be installed on terminal devices 4011, 4012, and 4013, such as speech synthesis applications, formula editors, instant messaging software, etc.

[0071] Terminal devices 4011, 4012, and 4013 can acquire the target mathematical formula to be converted. Then, they can identify formula information from the target mathematical formula, wherein the formula information includes at least one of the following: operators appearing in the target mathematical formula, the position and frequency of the operators in the target mathematical formula, and the position and frequency of letters and / or numbers in the target mathematical formula. Next, based on the formula information, they can acquire a preset conversion rule matching the target mathematical formula, and based on the acquired conversion rule, determine a target conversion rule. Finally, they can convert the target mathematical formula into text according to the target conversion rule.

[0072] Terminal devices 4011, 4012, and 4013 can be either hardware or software. When terminal devices 4011, 4012, and 4013 are hardware, they can be various electronic devices with displays and supporting information interaction, including but not limited to smartphones, tablets, and laptops. When terminal devices 4011, 4012, and 4013 are software, they can be installed in the aforementioned electronic devices. They can be implemented as multiple software programs or software modules (e.g., multiple software programs or software modules used to provide distributed services) or as a single software program or software module. No specific limitations are imposed here.

[0073] Server 403 can be a server providing various services. For example, it can be a backend server performing text regularization on mathematical formulas. Server 403 can obtain the target mathematical formula to be converted from terminal devices 4011, 4012, and 4013; then, it can identify formula information from the target mathematical formula, wherein the formula information includes at least one of the following: operators appearing in the target mathematical formula, the position and frequency of operators in the target mathematical formula, and the position and frequency of letters and / or numbers in the target mathematical formula; then, based on the formula information, it can obtain a preset conversion rule matching the target mathematical formula, and based on the obtained conversion rule, determine a target conversion rule; finally, it can convert the target mathematical formula into text according to the target conversion rule. Server 403 can send the converted text to terminal devices 4011, 4012, and 4013.

[0074] It should be noted that a server 403 can be either hardware or software. When the server 403 is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When the server 403 is software, it can be implemented as multiple software programs or software modules (e.g., used to provide distributed services), or as a single software program or software module. No specific limitations are made here.

[0075] It should also be noted that the text conversion method for mathematical formulas provided in this embodiment can be executed by terminal devices 4011, 4012, and 4013, and therefore the text conversion device for mathematical formulas can be installed in terminal devices 4011, 4012, and 4013. Alternatively, the text conversion method for mathematical formulas can be executed by server 403, and therefore the text conversion device for mathematical formulas can also be installed in server 403.

[0076] It should be understood that Figure 4 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0077] The following is for reference. Figure 5 It illustrates an electronic device suitable for implementing embodiments of the present disclosure (e.g., Figure 4 The diagram below shows the structure of the server or terminal device 500. The terminal device in the embodiments of this disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of this disclosure.

[0078] like Figure 5 As shown, the electronic device 500 may include a processing unit (e.g., a central processing unit, a graphics processor, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the electronic device 500. The processing unit 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0079] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows electronic device 500 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 An electronic device 500 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively. Figure 5 Each box shown can represent a device or multiple devices as needed.

[0080] Specifically, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by a processing device 501, it performs the functions defined in the methods of embodiments of this disclosure. It should be noted that the computer-readable medium described in embodiments of this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In embodiments of this disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In embodiments of this disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0081] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device. The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to: acquire a target mathematical formula to be converted; identify formula information from the target mathematical formula, wherein the formula information includes at least one of the following: operators appearing in the target mathematical formula, the position and frequency of the operators in the target mathematical formula, and the position and frequency of letters and / or numbers in the target mathematical formula; based on the formula information, acquire a preset conversion rule matching the target mathematical formula, and based on the acquired conversion rule, determine a target conversion rule; and convert the target mathematical formula into text according to the target conversion rule.

[0082] Computer program code for performing the operations of embodiments of this disclosure can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0083] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0084] According to one or more embodiments of this disclosure, a method for text conversion of mathematical formulas is provided. The method includes: obtaining a target mathematical formula to be converted; identifying formula information from the target mathematical formula, wherein the formula information includes at least one of the following: operators appearing in the target mathematical formula, the position and frequency of the operators in the target mathematical formula, and the position and frequency of letters and / or numbers in the target mathematical formula; obtaining a preset conversion rule matching the target mathematical formula based on the formula information, and determining a target conversion rule based on the obtained conversion rule; and converting the target mathematical formula into text according to the target conversion rule.

[0085] According to one or more embodiments of this disclosure, the operator appearing in the target mathematical formula is a first target operator, the first target operator is an operator with at least two ways of reading, the first target operator is matched with at least two preset conversion rules, the conversion rules have corresponding weights; and the above-mentioned determination of the target conversion rule based on the obtained conversion rules includes: determining the conversion rule corresponding to the largest weight among the at least two conversion rules as the target conversion rule corresponding to the first target operator.

[0086] According to one or more embodiments of this disclosure, obtaining a preset conversion rule matching the target mathematical formula based on the above formula information includes: determining the category to which the above operator belongs; and obtaining a preset conversion rule matching the target mathematical formula based on the category to which the above operator belongs, the position and frequency of the operators of the above category in the target mathematical formula, and the position and frequency of the letters and / or numbers in the target mathematical formula.

[0087] According to one or more embodiments of this disclosure, the above-mentioned method of obtaining the target mathematical formula to be converted includes: obtaining the mathematical formula to be converted, determining whether there is a second target operator in the mathematical formula, wherein the reading of the second target operator is related to its position in the mathematical formula; if so, modifying the second target operator according to its position in the mathematical formula, and determining the modified mathematical formula as the target mathematical formula.

[0088] According to one or more embodiments of this disclosure, prior to obtaining the target mathematical formula to be converted, the method further includes: obtaining target text, wherein the target text contains numbers; and determining the category to which the numbers belong based on the target text, wherein the category includes mathematical formulas.

[0089] According to one or more embodiments of this disclosure, the method further includes: generating structured data corresponding to the above-mentioned numbers based on the category to which the numbers belong.

[0090] According to one or more embodiments of this disclosure, the target mathematical formula described above is a mathematical formula using the Lattech format.

[0091] According to one or more embodiments of this disclosure, a text conversion apparatus for mathematical formulas is provided. The apparatus includes: an acquisition unit for acquiring a target mathematical formula to be converted; an identification unit for identifying formula information from the target mathematical formula, wherein the formula information includes at least one of the following: operators appearing in the target mathematical formula, the position and frequency of the operators in the target mathematical formula, and the position and frequency of letters and / or numbers in the target mathematical formula; a determination unit for acquiring a preset conversion rule matching the target mathematical formula based on the formula information, and determining a target conversion rule based on the acquired conversion rule; and a conversion unit for converting the target mathematical formula into text according to the target conversion rule.

[0092] According to one or more embodiments of this disclosure, the operator appearing in the target mathematical formula is a first target operator, which is an operator with at least two ways of reading, and the first target operator is matched with at least two preset conversion rules, which are weighted accordingly; and the determining unit is further configured to determine a target conversion rule based on the obtained conversion rule in the following manner: the conversion rule corresponding to the largest weight among the at least two conversion rules is determined as the target conversion rule corresponding to the first target operator.

[0093] According to one or more embodiments of this disclosure, the determining unit is further configured to obtain a preset conversion rule matching the target mathematical formula based on the formula information in the following manner: determining the category to which the operator belongs; and obtaining a preset conversion rule matching the target mathematical formula based on the category to which the operator belongs, the position and frequency of the operator of the above category in the target mathematical formula, and the position and frequency of the letters and / or numbers in the target mathematical formula.

[0094] According to one or more embodiments of this disclosure, the acquisition unit is further configured to acquire the target mathematical formula to be converted in the following manner: acquire the mathematical formula to be converted, determine whether there is a second target operator in the mathematical formula, wherein the reading of the second target operator is related to its position in the mathematical formula; if so, modify the second target operator according to its position in the mathematical formula, and determine the modified mathematical formula as the target mathematical formula.

[0095] According to one or more embodiments of this disclosure, the text conversion apparatus for mathematical formulas further includes: a text acquisition unit and a category determination unit. The text acquisition unit is used to acquire target text, wherein the target text contains numbers; the category determination unit is used to determine the category to which the numbers belong based on the target text, wherein the category includes mathematical formulas.

[0096] According to one or more embodiments of this disclosure, the text conversion apparatus for mathematical formulas further includes a generation unit. The generation unit is used to generate structured data corresponding to the numbers based on the category to which the numbers belong.

[0097] According to one or more embodiments of this disclosure, the target mathematical formula described above is a mathematical formula using the Lattech format.

[0098] The units described in the embodiments of this disclosure can be implemented in software or hardware. The described units can also be housed in a processor; for example, a processor can be described as including an acquisition unit, an identification unit, a determination unit, and a conversion unit. The names of these units do not necessarily limit the specific unit; for example, an acquisition unit can also be described as "a unit that acquires the target mathematical formula to be converted."

[0099] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the embodiments of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above technical concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in the embodiments of this disclosure.

Claims

1. A text conversion method for mathematical formulas, characterized by, include: Obtain the target mathematical formula to be converted; Formula information is identified from the target mathematical formula, wherein the formula information includes at least one of the following: operators appearing in the target mathematical formula, the position and number of occurrences of operators in the target mathematical formula, and the position and number of occurrences of letters and / or numbers in the target mathematical formula; Based on the formula information, a preset conversion rule matching the target mathematical formula is obtained, and based on the obtained conversion rule, the target conversion rule is determined; According to the target transformation rules, the target mathematical formula is converted into text; The step of obtaining the target mathematical formula to be converted includes: obtaining the mathematical formula to be converted, determining whether there is a second target operator in the mathematical formula, wherein the reading of the second target operator is related to its position in the mathematical formula; if so, modifying the second target operator according to its position in the mathematical formula, and determining the modified mathematical formula as the target mathematical formula.

2. The method of claim 1, wherein, The operator appearing in the target mathematical formula is the first target operator. The first target operator is an operator with at least two ways of reading. The first target operator is matched with at least two preset conversion rules, and the conversion rules are weighted. as well as The determination of the target transformation rule based on the acquired transformation rule includes: The transformation rule corresponding to the largest weight among the at least two transformation rules is determined as the target transformation rule corresponding to the first target operator.

3. The method of claim 1, wherein, The step of obtaining a preset conversion rule that matches the target mathematical formula based on the formula information includes: Determine the category to which the operator belongs; Based on the category to which the operator belongs, the position and frequency of the operators of the category in the target mathematical formula, and the position and frequency of the letters and / or numbers in the target mathematical formula, a preset conversion rule matching the target mathematical formula is obtained.

4. The method of claim 1, wherein, Before obtaining the target mathematical formula to be converted, the method further includes: Obtain target text, wherein the target text contains numbers; Based on the target text, the category to which the number belongs is determined, wherein the category includes mathematical formulas.

5. The method of claim 4, wherein, The method further includes: Based on the category to which the number belongs, generate the structured data corresponding to the number.

6. The method according to one of claims 1 to 5, characterized in that The target mathematical formula is a mathematical formula using the Lattech scheme.

7. A text conversion apparatus for mathematical formulas, characterized by, include: The acquisition unit is used to acquire the target mathematical formula to be converted. The identification unit is used to identify formula information from the target mathematical formula, wherein the formula information includes at least one of the following: operators appearing in the target mathematical formula, the position and number of occurrences of operators in the target mathematical formula, and the position and number of occurrences of letters and / or numbers in the target mathematical formula; The determining unit is used to obtain a preset conversion rule that matches the target mathematical formula based on the formula information, and to determine the target conversion rule based on the obtained conversion rule; A conversion unit is used to convert the target mathematical formula into text according to the target conversion rules; The acquisition unit is further configured to acquire the target mathematical formula to be converted in the following manner: acquire the mathematical formula to be converted, determine whether there is a second target operator in the mathematical formula, wherein the reading of the second target operator is related to its position in the mathematical formula; if so, modify the second target operator according to its position in the mathematical formula, and determine the modified mathematical formula as the target mathematical formula.

8. An electronic device, comprising: include: At least one processor; Storage device having at least one program stored thereon When the at least one program is executed by the at least one processor, the at least one processor implements the method as described in any one of claims 1-6.

9. A computer readable medium having stored thereon a computer program, characterized in that When the program is executed by the processor, it implements the method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Method and device for information input, and device for information input

    CN107102747A

  • Symbolic-To-Natural Language Conversion

    US20140039878A1