Tibetan digital translation method, device, electronic equipment and storage medium
By generating a dictionary tree and finite state automata for Tibetan numeric keywords, the complexity of Tibetan numeric translation is solved, and a more accurate and reliable translation effect is achieved.
Patent Information
- Application Number
- CN202110962207.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-20
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2041-08-20
AI Technical Summary
The digital expression methods in Tibetan are complex, and existing translation models are difficult to accurately identify and translate, which affects the accuracy and reliability of translation results.
By generating a dictionary tree of Tibetan numeric keywords, numeric keyword matching and category division are performed, and the state transfer path is obtained in combination with the finite state automata to realize the translation of digital keywords.
It improves the accuracy and reliability of Tibetan digital translation and can effectively identify and translate complex Tibetan digital expressions.
Smart Images

Figure CN113887248B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of natural language processing technology, and in particular to a Tibetan digital translation method, device, electronic device and storage medium. Background Art
[0002] Tibetan is a phonetic language with a logical case grammar system, which is widely used in Tibetan areas of my country and other places where Tibetan Buddhism is spread.
[0003] At the same time, Tibetan is one of the most complex languages in the world, and its complexity is reflected in two aspects. On the one hand, Tibetan belongs to the Tibeto-Burman language family of the Sino-Tibetan language family, and there are no obvious marks between words. On the other hand, Tibetan is a phonetic language, consisting of 30 consonants, 4 vowels, and upper and lower characters, and the composition of syllables is relatively complex.
[0004] The translation of numbers is an important part of text translation. Incorrect number recognition and translation will greatly affect the accuracy and reliability of the translation results.
[0005] The numerical expressions in Tibetan include Arabic numerals, basic Tibetan numerical components and compound words. The basic components of compound words are of various kinds and the combination rules of compound words are also very complicated. It is difficult for common translation models to accurately identify and translate these numbers. Summary of the invention
[0006] In order to solve at least one of the above technical problems, the present disclosure provides a Tibetan digital translation method, device, electronic device and storage medium.
[0007] The Tibetan digital translation method, device, electronic device and storage medium disclosed in the present invention are implemented through the following technical solutions.
[0008] According to one aspect of the present disclosure, a Tibetan digital translation method is provided, comprising:
[0009] Generate a dictionary tree of Tibetan digital keywords, the dictionary tree including multiple digital keyword categories;
[0010] Performing digital keyword matching on the target Tibetan text based on the dictionary tree to obtain a digital keyword sequence of the target Tibetan text, wherein the number of the digital keyword sequence is one or more than two;
[0011] Based on the dictionary tree, classify each digital keyword in the digital keyword sequence of the target Tibetan text into a category, and classify each digital keyword into one of a plurality of digital keyword categories;
[0012] Acquire a state transition path based on a finite state automaton and the plurality of digital keyword categories; and,
[0013] The translation result of the digital keyword sequence is obtained based on the state transition path and the corresponding numerical value of each digital keyword in the digital keyword sequence of the target Tibetan text.
[0014] According to the Tibetan digital translation method of at least one embodiment of the present disclosure, the multiple digital keyword categories include one or more of a numeral category, a high-level numeral category, a low-level numeral category, a basic numeral category, a prefix category, a conjunction category, a negative word category, a decimal point category, and an Arabic numeral / abbreviated Tibetan numeral category.
[0015] According to at least one embodiment of the Tibetan digital translation method of the present disclosure, digital keyword matching is performed on the target Tibetan text based on the dictionary tree to obtain the digital keyword sequence of the target Tibetan text, including:
[0016] The target Tibetan text is segmented in units of syllables to obtain a segmented text; and the segmented text is matched using the dictionary tree to obtain the digital keyword sequence.
[0017] According to at least one embodiment of the present disclosure, the Tibetan digital translation method uses the dictionary tree to match the segmented text to obtain the digital keyword sequence, including:
[0018] Inputting the segmented text into the dictionary tree to obtain candidate matching results, wherein the candidate matching results include at least one candidate sequence; and
[0019] A digital keyword sequence is determined from the candidate matching results based on the longest match principle.
[0020] According to the Tibetan digital translation method of at least one embodiment of the present disclosure, based on the dictionary tree, each digital keyword in the digital keyword sequence of the target Tibetan text is classified into categories, and each digital keyword is classified into one category of multiple digital keyword categories, including:
[0021] If a numeric keyword is a conjunction, prefix, or decimal point, it is classified into the corresponding numeric keyword category;
[0022] If the corresponding value of a numeric keyword is less than 100, it is classified as a basic numeral category;
[0023] If a certain digital keyword is a digit word and the context of the digital keyword in the digital keyword sequence meets the preset condition, it is classified into the high-level digit word category, otherwise it is classified into the low-level digit word category;
[0024] If a certain digital keyword is a negative word, classify it into a negative word category, and delete the low-level digital words connected with the negative word from the digital keyword sequence;
[0025] If there are two consecutive basic numerals in the digital keyword sequence, and the corresponding numerical value of one basic numeral is greater than 10, and the corresponding numerical value of the other basic numeral is less than 10, then the two basic numerals are combined into one basic numeral, and the corresponding numerical value of the basic numeral is the sum of the corresponding numerical values of the two basic numerals;
[0026] If a numeric keyword is an Arabic numeral, it is merged with the adjacent Arabic numeral.
[0027] According to the Tibetan digital translation method of at least one embodiment of the present disclosure, the translation result is expressed in Arabic numerals.
[0028] According to the Tibetan digital translation method of at least one embodiment of the present disclosure, the state transition path of the finite state automaton includes:
[0029] The initial state of the finite state automaton is 0. If the currently input numeric keyword is a high-level numeral, the state does not change; if the currently input numeric keyword is a decimal point, the state is transferred to state 1; if the input numeric keyword is a basic numeral, the state is transferred to state 2; if the input numeric keyword is a prefix, the state is transferred to state 3; if the input numeric keyword is a low-level numeral, the state is transferred to state 4; if the input numeric keyword is an Arabic numeral or an abbreviated Tibetan numeral, the state is transferred to state 7;
[0030] When the current state of the finite state automaton is state 1, if the input numeric keyword is a basic numeral, the current state is maintained; if the input numeric keyword is not a basic numeral, a recognition result is returned;
[0031] When the current state of the finite state automaton is state 2, if the input numeric keyword is a conjunction, the state is transferred to state 0; if the input numeric keyword is a low-level digit word, the state is transferred to state 5; if the input numeric keyword is not a low-level digit word or a conjunction, the recognition result is returned;
[0032] When the current state of the finite state automaton is state 3, if the input digital keyword is a digit word (high-level digit word or low-level digit word), the state is transferred to state 5, and if the input digital keyword is not a digit word, the recognition result is returned;
[0033] When the current state of the finite state automaton is state 4, if the input numeric keyword is a basic numeral, the state is transferred to state 6, if the input numeric keyword is a conjunction, the state is transferred to state 0, and if the input numeric keyword is not a conjunction or a basic numeral, the recognition result is returned;
[0034] When the current state of the finite state automaton is state 5, if the input numeric keyword is a basic numeral, the state is transferred to state 2, if the input numeric keyword is a prefix, the state is transferred to state 3, if the input numeric keyword is a conjunction, the state is transferred to state 0, if the input numeric keyword is not a basic numeral, prefix or conjunction, the recognition result is returned;
[0035] When the current state of the finite state automaton is state 6, if the input numeric keyword is a basic numeral, the state is transferred to state 2, if the input numeric keyword is a prefix, the state is transferred to state 3, if the input numeric keyword is a conjunction, the state is transferred to state 0, if the input numeric keyword is not a basic numeral, prefix or conjunction, the recognition result is returned; and,
[0036] When the current state of the finite state automaton is state 7, the recognition result is returned.
[0037] According to at least one embodiment of the Tibetan digital translation method of the present disclosure, obtaining a translation result of the digital keyword sequence based on the state transition path and the corresponding numerical value of each digital keyword in the digital keyword sequence of the target Tibetan text includes:
[0038] Set the high-order digit value to 1, the decimal value to 0, the temporary value to 0, and the final value to 0;
[0039] If the next state of the finite state automaton is state 0, and the input numeric keyword is a conjunction, multiply the higher-order digit value and the temporary value, add the result to the final value, set the higher-order digit value to 1, and set the temporary value record to 0;
[0040] If the next state of the finite state automaton is state 0, and the input numeric keyword is a high-level digital word, then the high-level digital value is multiplied by the corresponding numerical value of the high-level digital word to obtain an updated high-level digital value;
[0041] If the next state of the finite state automaton is state 1, the decimal value is multiplied by 10 and then added to the corresponding value of the input numeric keyword as the updated decimal value;
[0042] If the next state of the finite state automaton is state 2 or state 3, the temporary value is added to the corresponding value of the input numeric keyword as the updated temporary value;
[0043] If the next state of the finite state automaton is state 4, the temporary value is updated to the corresponding value of the input numeric keyword;
[0044] If the next state of the finite state automaton is state 5, the temporary value is multiplied by a value corresponding to the input numeric keyword to obtain an updated temporary value;
[0045] If the next state of the finite state automaton is state 6, the temporary value is multiplied by the corresponding value of the input numeric keyword to obtain an updated temporary value;
[0046] If the next state of the finite state automaton is state 7, the final value is updated to the high-level digital value multiplied by the corresponding value of the input numeric keyword; and,
[0047] The final value and the decimal value are concatenated to return the recognition result, i.e., the translation result.
[0048] According to another aspect of the present disclosure, there is provided a Tibetan digital translation device, comprising:
[0049] A dictionary tree module, wherein the dictionary tree module is a dictionary tree module of Tibetan digital keywords, and the dictionary tree module includes multiple digital keyword categories;
[0050] A matching module, wherein the matching module performs digital keyword matching on the target Tibetan text based on the dictionary tree module to obtain a digital keyword sequence of the target Tibetan text, wherein the number of the digital keyword sequence is one or more than two;
[0051] A category classification module, which classifies each digital keyword in the digital keyword sequence of the target Tibetan text into a category based on the dictionary tree module, and classifies each digital keyword into one of a plurality of digital keyword categories; and
[0052] A finite state automaton having a state transition path, wherein the finite state automaton obtains a translation result of the digital keyword sequence based on the state transition path and corresponding values of each digital keyword in the digital keyword sequence of the target Tibetan text.
[0053] According to the Tibetan digital translation device of at least one embodiment of the present disclosure, the state transition path of the finite state automaton includes:
[0054] The initial state of the finite state automaton is 0. If the currently input numeric keyword is a high-level numeral, the state does not change; if the currently input numeric keyword is a decimal point, the state is transferred to state 1; if the input numeric keyword is a basic numeral, the state is transferred to state 2; if the input numeric keyword is a prefix, the state is transferred to state 3; if the input numeric keyword is a low-level numeral, the state is transferred to state 4; if the input numeric keyword is an Arabic numeral or an abbreviated Tibetan numeral, the state is transferred to state 7;
[0055] When the current state of the finite state automaton is state 1, if the input numeric keyword is a basic numeral, the current state is maintained; if the input numeric keyword is not a basic numeral, a recognition result is returned;
[0056] When the current state of the finite state automaton is state 2, if the input numeric keyword is a conjunction, the state is transferred to state 0; if the input numeric keyword is a low-level digit word, the state is transferred to state 5; if the input numeric keyword is not a low-level digit word or a conjunction, the recognition result is returned;
[0057] When the current state of the finite state automaton is state 3, if the input digital keyword is a digit word (high-level digit word or low-level digit word), the state is transferred to state 5, and if the input digital keyword is not a digit word, the recognition result is returned;
[0058] When the current state of the finite state automaton is state 4, if the input numeric keyword is a basic numeral, the state is transferred to state 6, if the input numeric keyword is a conjunction, the state is transferred to state 0, and if the input numeric keyword is not a conjunction or a basic numeral, the recognition result is returned;
[0059] When the current state of the finite state automaton is state 5, if the input numeric keyword is a basic numeral, the state is transferred to state 2, if the input numeric keyword is a prefix, the state is transferred to state 3, if the input numeric keyword is a conjunction, the state is transferred to state 0, if the input numeric keyword is not a basic numeral, prefix or conjunction, the recognition result is returned;
[0060] When the current state of the finite state automaton is state 6, if the input numeric keyword is a basic numeral, the state is transferred to state 2, if the input numeric keyword is a prefix, the state is transferred to state 3, if the input numeric keyword is a conjunction, the state is transferred to state 0, if the input numeric keyword is not a basic numeral, prefix or conjunction, the recognition result is returned; and,
[0061] When the current state of the finite state automaton is state 7, the recognition result is returned.
[0062] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0063] A memory storing execution instructions; and a processor executing the execution instructions stored in the memory, so that the processor executes any one of the above methods.
[0064] According to another aspect of the present disclosure, a readable storage medium is provided, wherein the readable storage medium stores execution instructions, and the execution instructions are used to implement any of the above-mentioned methods when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] The accompanying drawings illustrate exemplary embodiments of the present disclosure and together with the description serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.
[0066] Figure 1 It is a flowchart of a Tibetan digital translation method according to an embodiment of the present disclosure.
[0067] Figure 2 It is a flowchart of sub-steps of a Tibetan digital translation method according to an embodiment of the present disclosure.
[0068] Figure 3 It is a state transition diagram of a finite state automaton according to an embodiment of the present disclosure.
[0069] Figure 4 It is a structural schematic diagram of a Tibetan digital translation device using a hardware implementation of a processing system according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0070] The present disclosure is further described in detail below in conjunction with the accompanying drawings and implementations. It is understood that the specific implementations described herein are only used to explain the relevant content, rather than to limit the present disclosure. It should also be noted that, for ease of description, only the parts related to the present disclosure are shown in the accompanying drawings.
[0071] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in the present disclosure can be combined with each other. The technical solution of the present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0072] Unless otherwise specified, the exemplary embodiments / embodiments shown will be understood as providing exemplary features of various details of some ways in which the technical concept of the present disclosure can be implemented in practice. Therefore, unless otherwise specified, the features of the various embodiments / embodiments can be combined, separated, interchanged and / or rearranged without departing from the technical concept of the present disclosure.
[0073] The use of cross-hatching and / or shading in the accompanying drawings is generally used to make the boundaries between adjacent components clear. As such, unless otherwise specified, the presence or absence of cross-hatching or shading does not convey or indicate any preference or requirement for the specific materials, material properties, dimensions, proportions, commonalities between the components shown, and / or any other characteristics, attributes, properties, etc. of the components. In addition, in the accompanying drawings, the sizes and relative sizes of the components may be exaggerated for clarity and / or descriptive purposes. When the exemplary embodiments can be implemented differently, the specific process sequence can be performed in a different order than described. For example, two successively described processes can be performed substantially simultaneously or in an order opposite to the described order. In addition, the same figure numbers represent the same components.
[0074] When a component is referred to as being "on," "over," "connected to," or "coupled to" another component, the component may be directly on, directly connected to, or directly coupled to the other component, or intervening components may be present. However, when a component is referred to as being "directly on," "directly connected to," or "directly coupled to" another component, there are no intervening components. For this purpose, the term "connected" may refer to a physical connection, an electrical connection, etc., with or without intervening components.
[0075] The terms used herein are for the purpose of describing specific embodiments, and are not intended to be restrictive. As used herein, unless the context clearly indicates otherwise, the singular forms "one (kind, person)" and "said (the)" are also intended to include plural forms. In addition, when the terms "comprise" and / or "include" and their variations are used in this specification, it is explained that there are stated features, integral bodies, steps, operations, parts, assemblies and / or their groups, but it is not excluded that there are or add one or more other features, integral bodies, steps, operations, parts, assemblies and / or their groups. It should also be noted that, as used herein, the terms "substantially", "approximately" and other similar terms are used as approximate terms and not as degree terms, so that they are used to explain the inherent deviations of the measured values, calculated values and / or the values provided that will be recognized by those of ordinary skill in the art.
[0076] Figure 1 It is a flowchart of a Tibetan digital translation method according to an embodiment of the present disclosure.
[0077] like Figure 1 As shown, the Tibetan digital translation method S1000 of this embodiment includes:
[0078] S100, generating a dictionary tree of Tibetan digital keywords, the dictionary tree including multiple digital keyword categories;
[0079] Among them, the dictionary tree of Tibetan digital keywords can be generated based on the Tibetan keyword dictionary.
[0080] S200, performing digital keyword matching on the target Tibetan text based on the dictionary tree to obtain a digital keyword sequence of the target Tibetan text, where the number of the digital keyword sequence is one or more than two;
[0081] The target Tibetan text is the Tibetan text to be translated, which can be a complete text file, a paragraph, a sentence, etc.
[0082] This step can identify the digital keyword sequence in the target Tibetan text, that is, identify one or more digital keyword sequences in the target Tibetan text.
[0083] S300, based on the dictionary tree, classify each digital keyword in the digital keyword sequence of the target Tibetan text into a category, and classify each digital keyword into one of a plurality of digital keyword categories;
[0084] This step can classify each digital keyword in each digital keyword sequence. Preferably, the digital keyword categories include 8 categories, namely, high-level numeral category, low-level numeral category, basic numeral category, prefix category, conjunction category, negative word category, decimal point category, Arabic numeral / abbreviated Tibetan numeral category.
[0085] S400, acquiring a state transition path based on a finite state automaton (finite state automaton) and multiple digital keyword categories; and,
[0086] S500: Obtain the translation result (ie, the return value described below) of the digital keyword sequence based on the state transition path and the corresponding numerical value of each digital keyword in the digital keyword sequence of the target Tibetan text.
[0087] For the Tibetan digital translation method disclosed in the present invention, preferably, the multiple digital keyword categories may include one or more of a numeral category, a high-level numeral category, a low-level numeral category, a basic numeral category, a prefix category, a conjunction category, a negative word category, a decimal point category, and an Arabic numeral / abbreviated Tibetan numeral category.
[0088] For the Tibetan digital translation method S1000 in the above embodiment, refer to Figure 2Preferably, S200, performing digital keyword matching on the target Tibetan text based on the dictionary tree to obtain a digital keyword sequence of the target Tibetan text, includes:
[0089] S202, segmenting the target Tibetan text in syllable units to obtain a segmented text; and
[0090] S204: Use the dictionary tree to match the segmented text to obtain a digital keyword sequence.
[0091] For the Tibetan digital translation method S1000 of each of the above embodiments, preferably, S204, using a dictionary tree to match the segmented text to obtain a digital keyword sequence, includes:
[0092] S2042, inputting the segmented text into the dictionary tree to obtain candidate matching results, where the candidate matching results include at least one candidate sequence; and,
[0093] S2044. Determine a digital keyword sequence from the candidate matching results based on the longest match principle.
[0094] For the Tibetan digital translation method S1000 of each of the above-mentioned embodiments, preferably, S300, based on the dictionary tree, classify each digital keyword in the digital keyword sequence of the target Tibetan text into one of the multiple digital keyword categories, including:
[0095] If a numeric keyword is a conjunction, prefix or decimal point, it is classified into the corresponding numeric keyword category (conjunction category, prefix category or decimal point category);
[0096] If the corresponding value of a numeric keyword is less than 100, it is classified as a basic numeral category;
[0097] If a certain digital keyword is a digit word, and the context of the digital keyword in the digital keyword sequence meets the preset condition (the preset condition may be whether there are digit words, basic numerals (basic words) or Arabic numerals before and after the digit word), it is classified as a high-level digit word category, otherwise it is classified as a low-level digit word category;
[0098] If a certain digital keyword is a negative word, it is classified into the negative word category, and the low-level digital words connected with the negative word are deleted from the digital keyword sequence;
[0099] If there are two consecutive basic numerals in the numeric keyword sequence, and the corresponding value of one basic numeral is greater than 10, and the corresponding value of the other basic numeral is less than 10, then the two basic numerals are combined into one basic numeral, and its corresponding value is the sum of the corresponding values of the two basic numerals;
[0100] If a numeric keyword is an Arabic numeral, it is merged with the adjacent Arabic numeral.
[0101] This embodiment is a preferred embodiment of the present disclosure, and the processing logic of the classification of digital keywords in this embodiment can accurately conform to the expression habits of Tibetan.
[0102] For the Tibetan numeral translation method S1000 in each of the above-mentioned embodiments, the translation result may be expressed in Arabic numerals.
[0103] For the Tibetan digital translation method S1000 of each of the above embodiments, preferably, the state transition path of the finite state automaton includes:
[0104] S401, the initial state of the finite state automaton is 0. If the currently input numeric keyword is a high-level numeral, the state does not change; if the currently input numeric keyword is a decimal point, the state is transferred to state 1; if the input numeric keyword is a basic numeral, the state is transferred to state 2; if the input numeric keyword is a prefix, the state is transferred to state 3; if the input numeric keyword is a low-level numeral, the state is transferred to state 4; if the input numeric keyword is an Arabic numeral or an abbreviated Tibetan numeral, the state is transferred to state 7;
[0105] S402, when the current state of the finite state automaton is state 1, if the input numeric keyword is a basic numeral, the current state is maintained; if the input numeric keyword is not a basic numeral, a recognition result is returned;
[0106] S403, when the current state of the finite state automaton is state 2, if the input numeric keyword is a conjunction, the state is transferred to state 0, if the input numeric keyword is a low-level digit word, the state is transferred to state 5, if the input numeric keyword is not a low-level digit word or conjunction, the recognition result is returned;
[0107] S404, when the current state of the finite state automaton is state 3, if the input digital keyword is a digit word (high-level digit word or low-level digit word), the state is transferred to state 5, and if the input digital keyword is not a digit word, the recognition result is returned;
[0108] S405, when the current state of the finite state automaton is state 4, if the input numeric keyword is a basic numeral, the state is transferred to state 6, if the input numeric keyword is a conjunction, the state is transferred to state 0, if the input numeric keyword is not a conjunction or a basic numeral, the recognition result is returned;
[0109] S406, when the current state of the finite state automaton is state 5, if the input numeric keyword is a basic numeral, the state is transferred to state 2, if the input numeric keyword is a prefix, the state is transferred to state 3, if the input numeric keyword is a conjunction, the state is transferred to state 0, if the input numeric keyword is not a basic numeral, prefix or conjunction, the recognition result is returned;
[0110] S407, when the current state of the finite state automaton is state 6, if the input numeric keyword is a basic numeral, the state is transferred to state 2, if the input numeric keyword is a prefix, the state is transferred to state 3, if the input numeric keyword is a conjunction, the state is transferred to state 0, if the input numeric keyword is not a basic numeral, prefix or conjunction, the recognition result is returned; and,
[0111] S408. When the current state of the finite state automaton is state 7, the recognition result is returned.
[0112] The finite state automaton with the above-mentioned state transition path can realize the translation result of recognizing the digital keyword sequence that has been divided into keyword categories as Arabic numerals.
[0113] The Tibetan digital translation method disclosed in the present invention designs the above-mentioned state transfer path based on the language structure and language characteristics of Tibetan.
[0114] For the Tibetan digital translation method of each of the above embodiments, preferably, S500, obtaining the translation result of the digital keyword sequence based on the state transition path and the corresponding numerical value of each digital keyword in the digital keyword sequence of the target Tibetan text, includes:
[0115] S501, set the high-order digit value to 1, the decimal value to 0, the temporary value to 0, and the final value to 0;
[0116] That is, tracking calculations are performed through four variables.
[0117] S502, if the next state of the finite state automaton is state 0, and the input numeric keyword is a conjunction, then the higher-order digit value (1) is multiplied by the temporary value (0), and the result (0) is added to the final value (the final value is 0 at this time), the higher-order digit value is set to 1, and the temporary value record is set to 0;
[0118] S503, if the next state of the finite state automaton is state 0, and the input digital keyword is a high-level digital word, then the high-level digital value (1) is multiplied by the corresponding numerical value of the high-level digital word (e.g., 10000) to obtain the updated high-level digital value;
[0119] S504, if the next state of the finite state automaton is state 1, multiply the decimal value by 10 and add the corresponding value of the input numeric keyword as the updated decimal value;
[0120] S505, if the next state of the finite state automaton is state 2 or state 3, the temporary value (0) is added to the corresponding value of the input numeric keyword as the updated temporary value;
[0121] S506, if the next state of the finite state automaton is state 4, the temporary value is updated to the corresponding value of the input numeric keyword;
[0122] S507, if the next state of the finite state automaton is state 5, the temporary value is multiplied by the corresponding value of the input numeric keyword to be used as the updated temporary value;
[0123] S508, if the next state of the finite state automaton is state 6, the temporary value is multiplied by the corresponding value of the input numeric keyword to obtain the updated temporary value;
[0124] S509, if the next state of the finite state automaton is state 7, the final value is updated to the high-level digital value multiplied by the corresponding value of the input digital keyword; and,
[0125] S510: concatenate the final value and the decimal value to return the recognition result, i.e., the translation result.
[0126] In a finite state automaton, the terminal state (see Figure 3 , the corresponding state of the two circles in the figure) means that the input complies with the rules (states 1, 2, 5, 6, 7), and the number corresponding to the terminal state can be calculated; the non-terminal state (states 0, 3, 4) means that the current state still needs certain input to get the final result, and the number cannot be obtained based on the current input.
[0127] The Tibetan digital translation method disclosed in the present invention is described in detail below using a specific example.
[0128] Possible Tibetan expressions for the number 13000000 (thirteen million) include: 1300. and 1300 is often misidentified or cannot be recognized. However, the finite state automaton disclosed in the present invention can effectively recognize these two numbers.
[0129] 1. Numbers The identification process:
[0130] The input string (i.e., sequence of numeric keywords) can be divided into In this example, the finite state automaton tracks the calculation through three variables: advanced value, temporary value, and final value. The initial values of the three variables are 1, 0, and 0 respectively.
[0131] When a finite state automaton reads When (10000), it is judged to be a high-level digital word. At this time, the high-level value is updated to the high-level value multiplied by the value corresponding to the character. At this time, the state of the finite state automaton is transferred to state 0, and the high-level value is updated to 10000.
[0132] When a finite state automaton reads When (1), it is judged to be a basic numeral. At this time, the temporary value (0) plus its corresponding value is equal, the finite state automaton transfers to state 2, and the temporary value is updated to 1.
[0133] When a finite state automaton reads When (1000), it is judged to be a low-level digital word. At this time, the temporary value is updated to the temporary value (1) multiplied by its corresponding value (1000), and the finite state automaton transfers to state 5, and the temporary value is updated to 1000;
[0134] When a finite state automaton reads When (3), it is judged to be a basic numeral. At this time, the final value is updated to the final value (0) plus the temporary value (1000), and the temporary value is updated to Corresponding to the value (3), the finite state automaton transfers to state 2. At this time, the temporary value is 3 and the final value is updated to 1000.
[0135] When a finite state automaton reads When (100), it is judged to be a low-level digital word. At this time, the temporary value is updated to the temporary value (3) multiplied by its corresponding value (100), and the finite state automaton transfers to state 5, and the temporary value is updated to 300.
[0136] Finally, the calculation method of returning the recognition result, that is, the return value, is as follows:
[0137] Return value = (final value + temporary value) * advanced value = (1000 + 300) * 10000 = 13000000.
[0138] 2. Numbers 1300 identification process:
[0139] The input string can be divided into and 1300.
[0140] When a finite state automaton reads , it is judged to be a high-level digital word. At this time, the high-level value is updated to the high-level value (initial value is 1) multiplied by the value corresponding to the character (10000). At this time, the state of the finite state automaton is transferred to state 0, and the high-level value is updated to 10000.
[0141] When the finite state automaton reads 1300, it determines that it is an Arabic numeral. At this time, the final value is its corresponding value (1300), and the finite state automaton transfers to state 7. Finally, the return value = (final value + temporary value) * advanced value = (1300 + 0) * 10000 = 13000000. 】
[0142] According to an embodiment of the present disclosure, a Tibetan digital translation device 1000 includes:
[0143] A dictionary tree module 1002, which is a dictionary tree module for Tibetan digital keywords, and includes multiple digital keyword categories;
[0144] A matching module 1004, which performs digital keyword matching on the target Tibetan text based on the dictionary tree module to obtain a digital keyword sequence of the target Tibetan text, where the number of the digital keyword sequence is one or more than two;
[0145] A category classification module 1006, which classifies each digital keyword in the digital keyword sequence of the target Tibetan text into a category based on the dictionary tree module, and classifies each digital keyword into one of a plurality of digital keyword categories; and
[0146] The finite state automaton 1008 has a state transition path. The finite state automaton 1008 obtains the translation result of the digital keyword sequence based on the state transition path and the corresponding numerical value of each digital keyword in the digital keyword sequence of the target Tibetan text.
[0147] Figure 4 The structure diagram of the Tibetan digital translation device 1000 using the hardware implementation of the processing system is shown.
[0148] The device may include a corresponding module for performing each or several steps in the above flowchart. Therefore, each step or several steps in the above flowchart may be performed by a corresponding module, and the device may include one or more modules in these modules. The module may be one or more hardware modules specially configured to perform the corresponding steps, or implemented by a processor configured to perform the corresponding steps, or stored in a computer-readable medium for implementation by a processor, or implemented by some combination.
[0149] The hardware structure can be implemented using a bus architecture. The bus architecture can include any number of interconnecting buses and bridges, depending on the specific application and overall design constraints of the hardware. The bus 1100 connects various circuits including one or more processors 1200, memory 1300, and / or hardware modules together. The bus 1100 can also connect various other circuits 1400 such as peripherals, voltage regulators, power management circuits, external antennas, etc.
[0150] The bus 1100 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Component (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the figure only uses one connecting line, but does not mean that there is only one bus or one type of bus.
[0151] Any process or method description in the flowchart or otherwise described herein can be understood as a module, fragment or portion of a code representing one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present disclosure includes other implementations, in which the functions may not be performed in the order shown or discussed, including performing the functions in a substantially simultaneous manner or in a reverse order according to the functions involved, which should be understood by a person skilled in the art of the present disclosure. The processor performs the various methods and processes described above. For example, the method implementation in the present disclosure can be implemented as a software program, which is tangibly contained in a machine-readable medium, such as a memory. In some embodiments, part or all of the software program can be loaded and / or installed via a memory and / or a communication interface. When the software program is loaded into the memory and executed by the processor, one or more steps in the method described above can be performed. Alternatively, in other embodiments, the processor can be configured to perform one of the above methods in any other appropriate manner (e.g., by means of firmware).
[0152] The logic and / or steps represented in the flowchart or otherwise described herein may be embodied in any readable storage medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other system that can fetch instructions from and execute instructions on an instruction execution system, apparatus, or device), or in combination with such instruction execution systems, apparatuses, or devices.
[0153] For the purposes of this specification, a "readable storage medium" may be any device that can contain, store, communicate, propagate or transmit a program for use with or in conjunction with an instruction execution system, device or apparatus. More specific examples of readable storage media (a non-exhaustive list) include the following: an electrical connection with one or more wirings (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), a fiber optic device, and a portable read-only memory (CDROM). In addition, the readable storage medium may even be paper or other suitable medium on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a memory.
[0154] It should be understood that the various parts of the present disclosure can be implemented in hardware, software, or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented in software stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0155] A person skilled in the art may understand that all or part of the steps of implementing the above-mentioned implementation method may be completed by instructing related hardware through a program, and the program may be stored in a readable storage medium, which, when executed, includes one or a combination of the steps of the implementation method.
[0156] In addition, each functional unit in each embodiment of the present disclosure may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a readable storage medium. The storage medium may be a read-only memory, a disk or an optical disk, etc.
[0157] According to a preferred embodiment of the present disclosure, the Tibetan digital translation device 1000 of the present disclosure can be implemented in the form of a computer program software architecture.
[0158] For the Tibetan digital translation device 1000 of each of the above embodiments, preferably, the state transition path of the finite state automaton 1008 includes:
[0159] S401, the initial state of the finite state automaton is 0. If the currently input numeric keyword is a high-level numeral, the state does not change; if the currently input numeric keyword is a decimal point, the state is transferred to state 1; if the input numeric keyword is a basic numeral, the state is transferred to state 2; if the input numeric keyword is a prefix, the state is transferred to state 3; if the input numeric keyword is a low-level numeral, the state is transferred to state 4; if the input numeric keyword is an Arabic numeral or an abbreviated Tibetan numeral, the state is transferred to state 7;
[0160] S402, when the current state of the finite state automaton is state 1, if the input numeric keyword is a basic numeral, the current state is maintained; if the input numeric keyword is not a basic numeral, a recognition result is returned;
[0161] S403, when the current state of the finite state automaton is state 2, if the input numeric keyword is a conjunction, the state is transferred to state 0, if the input numeric keyword is a low-level digit word, the state is transferred to state 5, if the input numeric keyword is not a low-level digit word or conjunction, the recognition result is returned;
[0162] S404, when the current state of the finite state automaton is state 3, if the input digital keyword is a digit word (high-level digit word or low-level digit word), the state is transferred to state 5, and if the input digital keyword is not a digit word, the recognition result is returned;
[0163] S405, when the current state of the finite state automaton is state 4, if the input numeric keyword is a basic numeral, the state is transferred to state 6, if the input numeric keyword is a conjunction, the state is transferred to state 0, if the input numeric keyword is not a conjunction or a basic numeral, the recognition result is returned;
[0164] S406, when the current state of the finite state automaton is state 5, if the input numeric keyword is a basic numeral, the state is transferred to state 2, if the input numeric keyword is a prefix, the state is transferred to state 3, if the input numeric keyword is a conjunction, the state is transferred to state 0, if the input numeric keyword is not a basic numeral, prefix or conjunction, the recognition result is returned;
[0165] S407, when the current state of the finite state automaton is state 6, if the input numeric keyword is a basic numeral, the state is transferred to state 2, if the input numeric keyword is a prefix, the state is transferred to state 3, if the input numeric keyword is a conjunction, the state is transferred to state 0, if the input numeric keyword is not a basic numeral, prefix or conjunction, the recognition result is returned; and,
[0166] S408. When the current state of the finite state automaton is state 7, the recognition result is returned.
[0167] The present disclosure also provides an electronic device, including: a memory, the memory storing execution instructions; and a processor or other hardware module, the processor or other hardware module executes the execution instructions stored in the memory, so that the processor or other hardware module executes the above method.
[0168] The present disclosure also provides a readable storage medium, in which execution instructions are stored. When the execution instructions are executed by a processor, they are used to implement the above method.
[0169] In the description of this specification, the description with reference to the terms "one embodiment / method", "some embodiments / methods", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment / method or example are included in at least one embodiment / method or example of the present application. In this specification, the schematic representations of the above terms are not necessarily the same embodiment / method or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments / methods or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments / methods or examples described in this specification and the features of the different embodiments / methods or examples, unless they are contradictory.
[0170] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0171] Those skilled in the art should understand that the above embodiments are only for the purpose of clearly illustrating the present disclosure, and are not intended to limit the scope of the present disclosure. For those skilled in the art, other changes or modifications may be made based on the above disclosure, and these changes or modifications are still within the scope of the present disclosure.
Claims
1. A Tibetan digital translation method, characterized in that: include: Generate a dictionary tree of Tibetan digital keywords, the dictionary tree including multiple digital keyword categories; Performing digital keyword matching on the target Tibetan text based on the dictionary tree to obtain a digital keyword sequence of the target Tibetan text, wherein the number of the digital keyword sequence is one or more than two; Based on the dictionary tree, classify each digital keyword in the digital keyword sequence of the target Tibetan text into a category, and classify each digital keyword into one of a plurality of digital keyword categories; Acquire a state transition path based on a finite state automaton and the multiple digital keyword categories; as well as Obtaining a translation result of the digital keyword sequence based on the state transition path and corresponding values of each digital keyword in the digital keyword sequence of the target Tibetan text; The multiple digital keyword categories are constructed as one or more of a numeral category, a high-level numeral category, a low-level numeral category, a basic numeral category, a prefix category, a conjunction category, a negation category, a decimal point category, an Arabic numeral category, and an abbreviated Tibetan numeral category; Wherein, obtaining the translation result of the digital keyword sequence based on the state transition path and the corresponding numerical value of each digital keyword in the digital keyword sequence of the target Tibetan text includes: Set the high-order digit value to 1, the decimal value to 0, the temporary value to 0, and the final value to 0; If the next state of the finite state automaton is state 0, and the input numeric keyword is a conjunction, multiply the higher-order digit value and the temporary value, add the result to the final value, set the higher-order digit value to 1, and set the temporary value record to 0; If the next state of the finite state automaton is state 0, and the input numeric keyword is a high-level digital word, then the high-level digital value is multiplied by the corresponding numerical value of the high-level digital word to obtain an updated high-level digital value; If the next state of the finite state automaton is state 1, the decimal value is multiplied by 10 and then added to the corresponding value of the input numeric keyword as the updated decimal value; If the next state of the finite state automaton is state 2 or state 3, the temporary value is added to the corresponding value of the input numeric keyword as the updated temporary value; If the next state of the finite state automaton is state 4, the temporary value is updated to the corresponding value of the input numeric keyword; If the next state of the finite state automaton is state 5, the temporary value is multiplied by a value corresponding to the input numeric keyword to obtain an updated temporary value; If the next state of the finite state automaton is state 6, the temporary value is multiplied by the corresponding value of the input numeric keyword to obtain an updated temporary value; If the next state of the finite state automaton is state 7, the final value is updated to the high-level digital value multiplied by the corresponding value of the input numeric keyword; and, The final value and the decimal value are concatenated to return the recognition result, i.e., the translation result.
2. The Tibetan digital translation method according to claim 1, characterized in that: Performing digital keyword matching on the target Tibetan text based on the dictionary tree to obtain a digital keyword sequence of the target Tibetan text includes: Segmenting the target Tibetan text in units of syllables to obtain a segmented text; and The segmented text is matched using the dictionary tree to obtain the digital keyword sequence.
3. The Tibetan digital translation method according to claim 2, characterized in that: Using the dictionary tree to match the segmented text to obtain the digital keyword sequence includes: Inputting the segmented text into the dictionary tree to obtain candidate matching results, wherein the candidate matching results include at least one candidate sequence; and A digital keyword sequence is determined from the candidate matching results based on the longest match principle.
4. The Tibetan digital translation method according to any one of claims 1 to 3, characterized in that: Based on the dictionary tree, each digital keyword in the digital keyword sequence of the target Tibetan text is classified into categories, and each digital keyword is classified into one of a plurality of digital keyword categories, including: If a numeric keyword is a conjunction, prefix, or decimal point, it is classified into the corresponding numeric keyword category; If the corresponding value of a numeric keyword is less than 100, it is classified as a basic numeral category; If a certain digital keyword is a digit word, and the context of the digital keyword in the digital keyword sequence meets the preset condition, it is classified as a high-level digit word category, otherwise it is classified as a low-level digit word category; wherein the preset condition is whether there are digit words, basic numerals or Arabic numerals before and after the digit word; If a certain digital keyword is a negative word, classify it into a negative word category, and delete the low-level digital words connected with the negative word from the digital keyword sequence; If there are two consecutive basic numerals in the digital keyword sequence, and the corresponding numerical value of one basic numeral is greater than 10, and the corresponding numerical value of the other basic numeral is less than 10, then the two basic numerals are combined into one basic numeral, and the corresponding numerical value of the basic numeral is the sum of the corresponding numerical values of the two basic numerals; If a numeric keyword is an Arabic numeral, it is merged with the adjacent Arabic numeral.
5. The Tibetan digital translation method according to any one of claims 1 to 3, characterized in that: The translation results are expressed in Arabic numerals.
6. A Tibetan digital translation device, characterized in that: include: A dictionary tree module, wherein the dictionary tree module is a dictionary tree module of Tibetan digital keywords, and the dictionary tree module includes a plurality of digital keyword categories; A matching module, wherein the matching module performs digital keyword matching on the target Tibetan text based on the dictionary tree module to obtain a digital keyword sequence of the target Tibetan text, wherein the number of the digital keyword sequence is one or more than two; A category classification module, which classifies each digital keyword in the digital keyword sequence of the target Tibetan text into a category based on the dictionary tree module, and classifies each digital keyword into one of a plurality of digital keyword categories; as well as A finite state automaton, obtaining a state transition path based on the finite state automaton and the multiple digital keyword categories, wherein the finite state automaton obtains a translation result of the digital keyword sequence based on the state transition path and the corresponding numerical value of each digital keyword in the digital keyword sequence of the target Tibetan text; The multiple digital keyword categories are constructed as one or more of a numeral category, a high-level numeral category, a low-level numeral category, a basic numeral category, a prefix category, a conjunction category, a negation category, a decimal point category, an Arabic numeral category, and an abbreviated Tibetan numeral category; Wherein, obtaining the translation result of the digital keyword sequence based on the state transition path and the corresponding numerical value of each digital keyword in the digital keyword sequence of the target Tibetan text includes: Set the high-order digit value to 1, the decimal value to 0, the temporary value to 0, and the final value to 0; If the next state of the finite state automaton is state 0, and the input numeric keyword is a conjunction, multiply the higher-order digit value and the temporary value, add the result to the final value, set the higher-order digit value to 1, and set the temporary value record to 0; If the next state of the finite state automaton is state 0, and the input numeric keyword is a high-level digital word, then the high-level digital value is multiplied by the corresponding numerical value of the high-level digital word to obtain an updated high-level digital value; If the next state of the finite state automaton is state 1, the decimal value is multiplied by 10 and then added to the corresponding value of the input numeric keyword as the updated decimal value; If the next state of the finite state automaton is state 2 or state 3, the temporary value is added to the corresponding value of the input numeric keyword as the updated temporary value; If the next state of the finite state automaton is state 4, the temporary value is updated to the corresponding value of the input numeric keyword; If the next state of the finite state automaton is state 5, the temporary value is multiplied by a value corresponding to the input numeric keyword to obtain an updated temporary value; If the next state of the finite state automaton is state 6, the temporary value is multiplied by the corresponding value of the input numeric keyword to obtain an updated temporary value; If the next state of the finite state automaton is state 7, the final value is updated to the high-level digital value multiplied by the corresponding value of the input numeric keyword; and, The final value and the decimal value are concatenated to return the recognition result, i.e., the translation result.
7. An electronic device, characterized in that: include: A memory storing execution instructions; as well as A processor, wherein the processor executes the execution instruction stored in the memory, so that the processor executes the method according to any one of claims 1 to 5.
8. A readable storage medium, characterized in that: The readable storage medium stores execution instructions, which are used to implement the method according to any one of claims 1 to 5 when executed by a processor.
