A method and system for automatic conversion of Chinese to braille based on a pre-trained model
By using a pre-trained model-based approach and leveraging Transformer and GPT models for automatic Chinese-to-Braille conversion, the complexity of translating Chinese into Braille is solved, achieving efficient Chinese-to-Braille conversion and meeting the learning and living needs of blind people.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- LANZHOU UNIV
- Filing Date
- 2023-06-06
- Publication Date
- 2026-08-04
AI Technical Summary
Existing technologies struggle to efficiently convert Chinese into Braille automatically. In particular, the diversity of Chinese characters and the existence of polyphonic characters lead to problems such as translations not conforming to Braille word segmentation and writing rules, and confusion of polyphonic characters. This results in Braille publications being complex to produce and resources being scarce.
By employing a pre-trained model-based approach, an automatic conversion from Chinese to Braille is achieved by constructing a pre-trained corpus and a parallel Chinese-Braille corpus, and using an attention-based Transformer model and a GPT model for encoding and parameter fine-tuning.
It reduces reliance on parallel data and can convert Chinese into corresponding Braille in one step, improving translation efficiency and accuracy and meeting the learning and living needs of blind people.
Smart Images

Figure CN116681037B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of Chinese-Braille conversion technology, specifically involving an automatic Chinese-Braille conversion method and system based on a pre-trained model. Background Technology
[0002] Braille is a type of raised lettering specifically designed for the blind. Blind people identify Braille by touch. It was created in 1824 by Louis Braille, a blind Frenchman. A Braille character consists of six raised dots arranged in three rows and two columns. The left column has dots 1, 2, and 3, and the right column has dots 4, 5, and 6. Based on the arrangement, there are 64 possible combinations of raised dots at the six positions, resulting in 64 different Braille symbols. Computers use 64 ASCII characters to represent Braille, known as Braille ASCII codes. There are three main forms of Braille in my country: the current Braille, double-pinyin Braille, and the national standard Braille. The current Braille uses initials, finals, and tones to represent a character. However, the current Braille requires real-time tone marking. Since Chinese characters have many homophones and polyphonic characters, this is difficult for computers to implement. Therefore, double-pinyin Braille was developed. Double-pinyin Braille does not require tone marking, combining tones and finals into one. It effectively overcomes many shortcomings of the current Braille and has thus gained widespread use. The national standard Braille is more concise. Based on the double-character Braille, tones can be omitted for certain initial consonants, which reduces a lot of work.
[0003] Due to the unique structure of Braille, the production of Braille publications is complex. Therefore, translating sighted printed materials into Braille books is extremely time-consuming and laborious, resulting in a stagnation in the development of Braille publications in my country. The needs of blind people for normal life and learning are not being met, and their education is also being limited. Currently, education for the blind in my country is very worrying; blind students account for only 1% of higher education students. There are many reasons for this situation, one of the most important being the scarcity of Braille resources in my country, which cannot adequately meet the learning needs of blind students.
[0004] The Chinese-to-Braille translation technology is an automated technology that uses a computer to convert Chinese information including punctuation marks, English, numbers, etc. into Braille. The Chinese-to-Braille translation technology can not only help sighted people understand Braille, but also be combined with text recognition technology to improve the learning and life of about 17 million visually impaired people in China. Languages in the Indo-European language family such as English, Italian, and Spanish are composed of a small number of basic letters, and there is a one-to-one correspondence between each letter and Braille symbols. Different from the above languages, Chinese has thousands of basic characters and cannot form a one-to-one correspondence with 64 Braille symbols. Therefore, compared with the translation of Indo-European languages into Braille, the translation of Chinese into Braille is relatively more difficult. Chinese Braille is based on the pinyin tone marking and word segmentation and hyphenation rules of Chinese characters. One Chinese character corresponds to 2-3 Braille symbols, one representing the initial consonant, one representing the final sound, and one representing the tone. The final sounds or tones of some Chinese characters will be omitted, and then combined with the Braille word segmentation and hyphenation rules to form the final Braille. Considering the tactile reading habits of the blind and reducing the length of Braille characters, the Braille word segmentation and hyphenation rules are different from the Chinese word segmentation rules. For example, for the sentence "Anyway, the result is not very good.", based on the Chinese word segmentation rules, it should be divided as "Anyway / , / result / not / very / good / .", and based on the Braille word segmentation and hyphenation rules, it should be divided as "Anyway / how, / result / not very good.". In addition, Chinese contains a large number of polyphonic characters, and one Chinese character may correspond to multiple pronunciations, and thus may correspond to multiple combinations of Braille. The above two aspects are the biggest difficulties in the Chinese-to-Braille translation task. Currently, multi-step Chinese-to-Braille translation methods have challenges such as not conforming to the Braille word segmentation and hyphenation rules and confusion of polyphonic characters. Summary of the Invention
[0005] The present application aims to solve the deficiencies of the prior art and proposes an automatic conversion method and system for Chinese to Braille based on a pre-trained model. First, a pre-trained corpus is used to pre-train the model to enable the model to obtain a good initial state, and then a small amount of Chinese-to-Braille parallel corpus is used for fine-tuning, achieving good results and reducing the model's dependence on the number of parallel corpora.
[0006] To achieve the above object, the present application provides the following solutions:
[0007] An automatic conversion method for Chinese to Braille based on a pre-trained model, comprising the following steps:
[0008] Construct a pre-trained corpus, a Chinese-to-Braille parallel corpus, and a machine translation model;
[0009] Encode the pre-trained corpus and the Chinese-to-Braille parallel corpus to obtain an encoded pre-trained corpus and an encoded Chinese-to-Braille parallel corpus;
[0010] Pre-train the machine translation model based on the encoded pre-trained corpus to obtain a pre-trained model;
[0011] Based on the encoded Chinese-Blind parallel corpus, the parameters of the pre-trained model are fine-tuned to obtain the conversion model;
[0012] The Chinese text is input into the conversion model for translation, resulting in a Braille sequence, thus completing the Chinese-Braille translation.
[0013] Preferably, the method for constructing the pre-trained corpus includes:
[0014] Collect Chinese text, and based on the Chinese text, obtain pinyin information and word segmentation information;
[0015] The Chinese text is modified by deleting some characters with a preset probability to obtain the deleted text. The deleted text is used as the source sequence and the Chinese text is used as the target sequence to obtain a pure Chinese corpus.
[0016] Using the Chinese text as the source sequence and the Pinyin information as the target sequence, a Chinese-Pinyin parallel corpus is obtained.
[0017] Using the Chinese text as the source sequence and the word segmentation information as the target sequence, a Chinese-Chinese word segmentation parallel corpus is obtained.
[0018] Using the Chinese text as the source sequence, the pinyin information as the target sequence, and adding the word segmentation information, a Chinese-pinyin corpus with word segmentation is obtained;
[0019] The pre-training corpus is constructed based on the pure Chinese corpus, the Chinese-Pinyin parallel corpus, the Chinese-Chinese word segmentation parallel corpus, and the Chinese-Pinyin corpus with word segmentation.
[0020] Preferably, the method for constructing the Chinese-Blind Parallel Corpus includes:
[0021] Extract Chinese sequences from the Chinese text;
[0022] Extract the Braille ASCII code sequence;
[0023] By mapping the Chinese sequence and the Braille ASCII code sequence to each other, a Chinese-Braille parallel corpus is obtained.
[0024] Preferably, the machine translation model includes, but is not limited to, the Transformer model based on the attention mechanism and the GPT model.
[0025] Preferably, the encoding method includes:
[0026] A dictionary is constructed based on the pre-trained corpus and the Chinese-Blind parallel corpus;
[0027] Based on the dictionary, the Chinese and Braille ASCII codes in all corpora are individually encoded, and the pronunciation data of all corpora are encoded as a whole, resulting in a pre-trained corpus after encoding and a parallel Chinese-Braille corpus after encoding.
[0028] Preferably, the pre-training method includes:
[0029] The encoded source sequences from the pre-trained encoded corpus are input into the machine translation model, and feature extraction is performed on the encoded source sequences to obtain the extracted features.
[0030] The machine translation model generates a predicted target sequence based on the extracted features;
[0031] The machine translation model is updated with parameters based on the encoded target sequence and the predicted target sequence in the encoded pre-training corpus to obtain the pre-trained model.
[0032] Preferably, the method for fine-tuning the parameters includes:
[0033] The encoded Chinese sequences from the encoded Chinese-Blind parallel corpus are input into the pre-trained model;
[0034] The pre-trained model makes predictions based on the encoded Chinese sequence to obtain the Braille ASCII code sequence prediction value.
[0035] Based on the encoded Braille ASCII code sequence in the encoded Chinese-Braille parallel corpus and the predicted Braille ASCII code value, the parameters of the pre-trained model are fine-tuned to obtain the conversion model.
[0036] This application also provides an automatic Chinese-to-Braille conversion system based on a pre-trained model, including: a data model construction module, an encoding module, a pre-training module, a parameter adjustment module, and a translation module;
[0037] The data model building module is used to build a pre-training corpus, a Chinese-Blind parallel corpus, and a machine translation model;
[0038] The encoding module is used to encode the pre-training corpus and the Chinese-Blind parallel corpus to obtain the encoded pre-training corpus and the encoded Chinese-Blind parallel corpus.
[0039] The pre-training module is used to pre-train the machine translation model based on the encoded pre-training corpus to obtain a pre-trained model;
[0040] The parameter adjustment module is used to fine-tune the parameters of the pre-trained model based on the encoded Chinese-Blind parallel corpus to obtain the conversion model.
[0041] The translation module is used to input Chinese into the conversion model for translation, obtain a Braille sequence, and complete the Chinese-Braille translation.
[0042] Compared with the prior art, the beneficial effects of this application are as follows:
[0043] This application can convert Chinese into the corresponding Braille in one step and greatly reduces the model's dependence on parallel data. It can also achieve good results using a small amount of data for training. Attached Figure Description
[0044] To more clearly illustrate the technical solutions of this application, the drawings used in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0045] Figure 1 This is a schematic diagram of the method flow of an embodiment of this application;
[0046] Figure 2 This is a schematic diagram of the input and output of the Transformer model in an embodiment of this application;
[0047] Figure 3 This is a schematic diagram of the input and output of the GPT model in an embodiment of this application;
[0048] Figure 4 This is a schematic diagram of the system structure according to an embodiment of this application;
[0049] Figure 5 This is a comparison chart showing the translation effects of different sizes of fine-tuned data in embodiments of this application;
[0050] Figure 6 This is a comparison chart showing the translation effects of different sizes of pre-training data in embodiments of this application. Detailed Implementation
[0051] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0052] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, this application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0053] Example 1
[0054] In this embodiment, as Figure 1 As shown, an automatic Chinese-to-Braille conversion method based on a pre-trained model includes the following steps:
[0055] S1. Construct a pre-trained corpus, a parallel corpus of Chinese and English-English linguistics, and a machine translation model.
[0056] The method for constructing a pre-training corpus includes: collecting Chinese text; obtaining pinyin information and word segmentation information based on the Chinese text; deleting some characters from the Chinese text with a preset probability to obtain the deleted text. In this embodiment, the preset probability ranges from 3% to 50%, and in this embodiment, the preset probability is set to 15%. Using the deleted text as the source sequence and the Chinese text as the target sequence, a pure Chinese corpus is obtained; using the Chinese text as the source sequence and the pinyin information as the target sequence, a Chinese-pinyin parallel corpus is obtained; using the Chinese text as the source sequence and the word segmentation information as the target sequence, a Chinese-Chinese word segmentation parallel corpus is obtained; using the Chinese text as the source sequence and the pinyin information as the target sequence, and adding word segmentation information, a Chinese-pinyin corpus with word segmentation is obtained; and a pre-training corpus is constructed based on the pure Chinese corpus, the Chinese-pinyin parallel corpus, the Chinese-Chinese word segmentation parallel corpus, and the Chinese-pinyin corpus with word segmentation.
[0057] In this embodiment, a large amount of pure Chinese text data is first acquired, and the corresponding pinyin and word segmentation information are generated using an algorithm. A pure Chinese corpus is generated using the pure text data. Based on the pinyin and word segmentation information, three corpora are generated: a Chinese-pinyin parallel corpus, a Chinese-Chinese word segmentation parallel corpus, and a Chinese-pinyin corpus with word segmentation. Specifically, the source sequence of the pure Chinese corpus is a Chinese sequence with some characters randomly deleted, and the target sequence is the original Chinese sentence; the source sequence of the Chinese-pinyin corpus is a Chinese sentence, and the target sequence is its corresponding pinyin sequence; the source sequence of the Chinese-Chinese word segmentation corpus is a Chinese sentence, and the target sequence is a Chinese sentence with word segmentation; and the source sequence of the Chinese-pinyin corpus with word segmentation is a Chinese sentence, and the target sequence is its corresponding pinyin sequence, with word segmentation information added. These four corpora are then combined into a pre-training corpus. 95% of the data is used for training, and 5% is used for validation.
[0058] The method for constructing a Chinese-Braille parallel corpus includes: extracting Chinese sequences from Chinese text; extracting Braille ASCII code sequences from Braille; and mapping the Chinese sequences and Braille ASCII code sequences to obtain Chinese-Braille parallel sequence pairs, i.e., the Chinese-Braille parallel corpus.
[0059] Machine translation models include: attention-based Transformer models and GPT models.
[0060] In this embodiment, the construction of the Transformer is as follows: Figure 2 As shown, the system mainly consists of an encoder and a decoder. The encoder is composed of multiple identical stacked modules, each containing a multi-head self-attention layer and a feedforward neural network layer. A padding mask mechanism is used in the multi-head self-attention mechanism because the input sentences have varying lengths and need to be padded to the same length. To avoid the padding position affecting the result, a padding mask mechanism is employed. The decoder is similar to the encoder, also composed of multiple identical stacked modules. Each module contains a decoder multi-head self-attention layer, an encoder-decoder multi-head attention layer, and a feedforward neural network layer. Since the model needs parallel training, the target sequence needs to be input into the model all at once during training. To prevent the model from seeing future time-stack information, a mask mechanism is used in the self-attention layer, applying a triangular mask to the attention matrix to prevent the model from cheating by seeing future time-stack information. The encoder-decoder multi-head attention combines the source sequence information extracted from the encoder with the previous target sequence information to generate the next target sequence token.
[0061] In this embodiment, the GPT model of the machine translation model is as follows: Figure 3 As shown, GPT is similar to Transformer in its construction, except that GPT only contains the decoder of Transformer.
[0062] S2. Encode the pre-training corpus and the Chinese-Blind parallel corpus to obtain the encoded pre-training corpus and the encoded Chinese-Blind parallel corpus.
[0063] The encoding methods include: encoding Chinese and Braille ASCII codes in the corpus character by character based on a dictionary, encoding the pronunciation of Pinyin data in the corpus as a whole, and obtaining a pre-trained corpus and a parallel Chinese-Braille corpus after encoding.
[0064] In this embodiment, a dictionary is constructed based on a pre-trained corpus and a parallel Chinese-Braille corpus, where each character corresponds to a number. All data is encoded based on this dictionary. For Chinese and Braille ASCII codes, each character is encoded individually. For Pinyin data, the entire pronunciation is encoded; for example, the pronunciation "mang2" is encoded as a whole.
[0065] S3. The machine translation model is pre-trained based on the encoded pre-trained corpus to obtain the pre-trained model.
[0066] The pre-training method includes: inputting the encoded source sequence from the encoded pre-training corpus into the machine translation model, and extracting features from the encoded source sequence to obtain extracted features; the machine translation model generates a predicted target sequence based on the extracted features; and updating the parameters of the machine translation model based on the encoded target sequence and the predicted target sequence from the encoded pre-training corpus to obtain the pre-trained model.
[0067] In this embodiment, the pre-training corpus contains several sequence pairs, source sequences and target sequences. The encoded source sequences are input into the machine translation model for feature extraction. The machine translation model generates the target sequence based on the extracted features. Using the real target sequences, the model parameters are updated using the cross-entropy loss function to obtain the pre-trained model. After pre-training, the model will obtain a good initialization state.
[0068] For the Transformer model, during training, the input sequence to the target end needs to be marked with a start symbol [START], and the output sequence to the target end needs to be marked with an end symbol . The model extracts features from the input data and generates the corresponding target sequence. It models the loss using the correct labels and updates the model parameters through backpropagation. In the prediction process, the input Chinese sequence is encoded using a dictionary. The encoded sequence is then input into the Encoder, and a start symbol [START] is input into the Decoder to predict the first target sequence character. Then, [START] and the first character are input into the Decoder to predict the second character, and so on, until the end symbol is predicted, thus obtaining the predicted target sequence.
[0069] For the GPT model, during training, the source and target sequences are concatenated, separated by [SEP]. The concatenated data is then input into the model, allowing it to optimize by predicting the current character based on previous characters. During prediction, the source sequence is concatenated with [SEP] and input into the model, and predictions are performed sequentially until the symbol is predicted, thus obtaining the predicted target sequence.
[0070] S4. Based on the encoded Chinese-Blind parallel corpus, the parameters of the pre-trained model are fine-tuned to obtain the conversion model.
[0071] The parameter fine-tuning method includes: inputting the encoded Chinese sequence from the encoded Chinese-Blind parallel corpus into the pre-trained model; the pre-trained model makes predictions based on the encoded Chinese sequence to obtain the Braille ASCII code sequence prediction value; and fine-tuning the parameters of the pre-trained model based on the encoded Braille ASCII code sequence and the Braille ASCII code prediction value from the encoded Chinese-Blind parallel corpus to obtain the conversion model.
[0072] In this embodiment, the Chinese-Braille parallel corpus contains several pairs of Chinese-Braille parallel sequences. Similar to the pre-training process, the encoded Chinese sequences are input into the model, which then predicts the corresponding Braille ASCII sequences. The model parameters are updated using gradient descent based on the cross-entropy loss function using real Braille ASCII labels to obtain the conversion model.
[0073] S5. Input the Chinese text into the conversion model for translation to obtain the Braille sequence, thus completing the Chinese-Braille translation.
[0074] In this embodiment, the Chinese characters are first encoded and then input into the conversion model. After calculation, the corresponding Braille ASCII code is generated to complete the translation from Chinese to Braille.
[0075] Example 2
[0076] In this embodiment, as Figure 4 As shown, an automatic Chinese-to-Braille conversion system based on a pre-trained model includes: a data model construction module, an encoding module, a pre-training module, a parameter tuning module, and a translation module.
[0077] The data model building module is used to build a pre-trained corpus, a Chinese-Blind parallel corpus, and a machine translation model.
[0078] The method for constructing a pre-training corpus includes: collecting Chinese text; obtaining pinyin information and word segmentation information based on the Chinese text; deleting some characters from the Chinese text with a preset probability to obtain the deleted text, wherein the preset probability ranges from 3% to 50%, and in this embodiment, the preset probability is set to 15%; using the deleted text as the source sequence and the Chinese text as the target sequence to obtain a pure Chinese corpus; using the Chinese text as the source sequence and the pinyin information as the target sequence to obtain a Chinese-pinyin parallel corpus; using the Chinese text as the source sequence and the word segmentation information as the target sequence to obtain a Chinese-Chinese word segmentation parallel corpus; using the Chinese text as the source sequence and the pinyin information as the target sequence, and adding word segmentation information to obtain a Chinese-pinyin corpus with word segmentation; and constructing a pre-training corpus based on the Chinese-pinyin parallel corpus, the Chinese-Chinese word segmentation parallel corpus, and the Chinese-pinyin corpus with word segmentation.
[0079] In this embodiment, a large amount of pure Chinese text data is first acquired, and the corresponding pinyin and word segmentation information are generated using an algorithm. A pure Chinese corpus is generated based on the pure Chinese text data. Three corpora are generated based on the pinyin and word segmentation information: a Chinese-pinyin parallel corpus, a Chinese-Chinese word segmentation parallel corpus, and a Chinese-pinyin corpus with word segmentation. Specifically, the source sequence of the pure Chinese corpus is a Chinese sequence with some characters randomly deleted, and the target sequence is the original Chinese sentence; the source sequence of the Chinese-pinyin corpus is a Chinese sentence, and the target sequence is its corresponding pinyin sequence; the source sequence of the Chinese-Chinese word segmentation corpus is a Chinese sentence, and the target sequence is a Chinese sentence with word segmentation; and the source sequence of the Chinese-pinyin corpus with word segmentation is a Chinese sentence, and the target sequence is its corresponding pinyin sequence, with word segmentation information added. These four corpora are then combined into a pre-training corpus. 95% of the data is used for training, and 5% is used for validation.
[0080] The method for constructing a Chinese-Braille parallel corpus includes: extracting Chinese sequences from Chinese text; extracting Braille ASCII code sequences from Braille; and mapping the Chinese sequences and Braille ASCII code sequences to obtain Chinese-Braille parallel sequence pairs, i.e., the Chinese-Braille parallel corpus.
[0081] Machine translation models include: attention-based Transformer models and GPT models.
[0082] In this embodiment, the construction of the Transformer is as follows: Figure 2As shown, the system mainly consists of an encoder and a decoder. The encoder is composed of multiple identical stacked modules, each containing a multi-head self-attention layer and a feedforward neural network layer. A padding mask mechanism is used in the multi-head self-attention mechanism because the input sentences have varying lengths and need to be padded to the same length. To avoid the padding position affecting the result, a padding mask mechanism is employed. The decoder is similar to the encoder, also composed of multiple identical stacked modules. Each module contains a decoder multi-head self-attention layer, an encoder-decoder multi-head attention layer, and a feedforward neural network layer. Since the model needs parallel training, the target sequence needs to be input into the model all at once during training. To prevent the model from seeing future time-sequence information, a mask mechanism is used in the self-attention layer, applying a triangular mask to the attention matrix to prevent the model from cheating by seeing future time-sequence information. The encoder-decoder multi-head attention combines the source sequence information extracted from the encoder with all token information from the previous target sequence to generate the next target sequence token.
[0083] In this embodiment, the machine translation model can also be the GPT model, such as... Figure 3 As shown, GPT is similar to Transformer in its construction, except that GPT only contains the decoder of Transformer.
[0084] The encoding module is used to encode the pre-training corpus and the Chinese-Blind parallel corpus to obtain the encoded pre-training corpus and the encoded Chinese-Blind parallel corpus.
[0085] The encoding methods include: encoding Chinese and Braille ASCII codes in the corpus character by character based on a dictionary, encoding the pronunciation of Pinyin data in the corpus as a whole, and obtaining a pre-trained corpus and a parallel Chinese-Braille corpus after encoding.
[0086] In this embodiment, a dictionary is constructed based on a pre-trained corpus and a parallel Chinese-Braille corpus, where each character corresponds to a number. All data is encoded based on this dictionary. For Chinese and Braille ASCII codes, each character is encoded individually. For Pinyin data, the entire pronunciation is encoded; for example, the pronunciation "mang2" is encoded as a whole.
[0087] The pre-training module is used to pre-train the machine translation model based on the encoded pre-training corpus to obtain the pre-trained model.
[0088] The pre-training method includes: inputting the encoded source sequence from the encoded pre-training corpus into the machine translation model, and extracting features from the encoded source sequence to obtain extracted features; the machine translation model generates a predicted target sequence based on the extracted features; and updating the parameters of the machine translation model based on the encoded target sequence and the predicted target sequence from the encoded pre-training corpus to obtain the pre-trained model.
[0089] In this embodiment, the pre-training corpus contains several sequence pairs, namely source sequences and target sequences. The encoded source sequences are input into the machine translation model for feature extraction. The machine translation model generates the target sequence based on the extracted features. Using the real target sequences, the model parameters are updated using the cross-entropy loss function to obtain the pre-trained model. After pre-training, the model will obtain a good initialization state.
[0090] For the Transformer model, during training, the input sequence to the target end needs to be marked with a start symbol [START], and the output sequence to the target end needs to be marked with an end symbol . The model extracts features from the input data and generates the corresponding target sequence. It models the loss using the correct labels and updates the model parameters through backpropagation. In the prediction process, the input Chinese sequence is encoded using a dictionary. The encoded sequence is then input into the Encoder, and a start symbol [START] is input into the Decoder to predict the first target sequence character. Then, [START] and the first character are input into the Decoder to predict the second character, and so on, until the end symbol is predicted, thus obtaining the predicted target sequence.
[0091] For the GPT model, during training, the source and target sequences are concatenated, separated by [SEP]. The concatenated data is then input into the model, allowing it to optimize by predicting the current character based on previous characters. During prediction, the source sequence is concatenated with [SEP] and input into the model, and predictions are performed sequentially until the symbol is predicted, thus obtaining the predicted target sequence.
[0092] The parameter adjustment module is used to fine-tune the parameters of the pre-trained model based on the encoded Chinese-Blind parallel corpus to obtain the converted model.
[0093] The parameter fine-tuning method includes: inputting the encoded Chinese sequence from the encoded Chinese-Blind parallel corpus into the pre-trained model; the pre-trained model makes predictions based on the encoded Chinese sequence to obtain the Braille ASCII code sequence prediction value; and fine-tuning the parameters of the pre-trained model based on the encoded Braille ASCII code sequence and the Braille ASCII code prediction value from the encoded Chinese-Blind parallel corpus to obtain the conversion model.
[0094] In this embodiment, the Chinese-Braille parallel corpus contains several pairs of Chinese-Braille parallel sequences. Similar to the pre-training process, the encoded Chinese sequences are input into the model, which then predicts the corresponding Braille ASCII sequences. The model parameters are updated using gradient descent based on the loss function using real Braille ASCII labels to obtain the conversion model.
[0095] The translation module is used to input Chinese into the conversion model for translation, resulting in a Braille sequence, thus completing the Chinese-Braille translation. In this embodiment, the Chinese characters are first encoded and then input into the conversion model. After calculation, the corresponding Braille ASCII codes are generated to complete the Chinese-Braille translation.
[0096] Example 3
[0097] In this embodiment, to verify the impact of different sizes and types of pre-training data and different sizes of fine-tuning data on the results, the pre-training data was divided into three sizes: large, medium, and small. The fine-tuning data was divided into 10,000, 50,000, 100,000, and 200,000 data points. Experiments were conducted for each size, and BLEU was used as the evaluation metric. The experimental results are as follows: Figure 5 and Figure 6 As shown, both the Transformer and GPT models achieved the best results after pre-training on the Chinese-Pinyin corpus with word segmentation, with BLEU improvements of up to 5.43% and 10.36% respectively. Since Braille is based on Chinese Pinyin and Braille word segmentation information, and Chinese word segmentation specifications share some similarities with Braille word segmentation rules, training the model to learn Pinyin and Chinese word segmentation information first is highly beneficial for subsequent Chinese-Braille translation tasks. Furthermore, in most cases, the model performance improves with increasing pre-training data. However, as the amount of fine-tuning data increases, the improvement from pre-training becomes less significant, as fine-tuning data becomes increasingly dominant, and good results can be achieved without pre-training.
[0098] The embodiments described above are merely preferred embodiments of this application and are not intended to limit the scope of this application. Any modifications and improvements made to the technical solutions of this application by those skilled in the art without departing from the spirit of this application shall fall within the protection scope defined by the claims of this application.
Claims
1. A method for automatic conversion from Chinese to Braille based on a pre-trained model, characterized in that, Includes the following steps: Construct a pre-trained corpus, a Chinese-English parallel corpus, and a machine translation model; The pre-training corpus and the Chinese-English parallel corpus are encoded to obtain the encoded pre-training corpus and the encoded Chinese-English parallel corpus; The machine translation model is pre-trained based on the encoded pre-trained corpus to obtain the pre-trained model. Based on the encoded Chinese-Blind parallel corpus, the parameters of the pre-trained model are fine-tuned to obtain the conversion model; The Chinese text is input into the conversion model for translation, resulting in a Braille sequence, thus completing the Chinese-Braille translation. The method for constructing the pre-trained corpus includes: Collect Chinese text, and based on the Chinese text, obtain pinyin information and word segmentation information; The Chinese text is modified by deleting some characters with a preset probability to obtain the deleted text. The deleted text is used as the source sequence and the Chinese text is used as the target sequence to obtain a pure Chinese corpus. Using the Chinese text as the source sequence and the Pinyin information as the target sequence, a Chinese-Pinyin parallel corpus is obtained. Using the Chinese text as the source sequence and the word segmentation information as the target sequence, a Chinese-Chinese word segmentation parallel corpus is obtained. Using the Chinese text as the source sequence and the pinyin information as the target sequence, and adding the word segmentation information, a Chinese-pinyin corpus with word segmentation is obtained; The pre-training corpus is constructed based on the pure Chinese corpus, the Chinese-Pinyin parallel corpus, the Chinese-Chinese word segmentation parallel corpus, and the Chinese-Pinyin corpus with word segmentation. The method for fine-tuning the parameters includes: The encoded Chinese sequences from the encoded Chinese-Blind parallel corpus are input into the pre-trained model; The pre-trained model makes predictions based on the encoded Chinese sequence to obtain the Braille ASCII code sequence prediction value. Based on the encoded Braille ASCII code sequence in the encoded Chinese-Braille parallel corpus and the predicted Braille ASCII code value, the parameters of the pre-trained model are fine-tuned to obtain the conversion model. 2.The automatic conversion method from Chinese to Braille based on a pre-trained model according to claim 1, characterized in that, The method for constructing the Chinese-English parallel corpus includes: Extract Chinese sequences from the Chinese text; Extract the Braille ASCII code sequence; By mapping the Chinese sequence and the Braille ASCII code sequence to each other, a Chinese-Braille parallel corpus is obtained. 3.The automatic conversion method from Chinese to Braille based on a pre-trained model according to claim 1, characterized in that, The machine translation models include, but are not limited to, attention-based Transformer models and GPT models.
4. The method according to claim 1, wherein, The encoding method includes: A dictionary is constructed based on the pre-trained corpus and the Chinese-Blind parallel corpus; Based on the dictionary, the Chinese and Braille ASCII codes in all corpora are individually encoded, and the pronunciation data of all corpora are encoded as a whole, resulting in a pre-trained corpus after encoding and a parallel Chinese-Braille corpus after encoding.
5. The method of claim 1, wherein the pre-trained model is a Chinese-English translation model. The pre-training method includes: The encoded source sequences from the pre-trained encoded corpus are input into the machine translation model, and feature extraction is performed on the encoded source sequences to obtain the extracted features. The machine translation model generates a predicted target sequence based on the extracted features; The machine translation model is updated with parameters based on the encoded target sequence and the predicted target sequence in the encoded pre-training corpus to obtain the pre-trained model.
6. A system for automatic conversion of Chinese to Braille based on a pre-trained model, characterized in that, include: The data model building module, encoding module, pre-training module, parameter tuning module, and translation module are all included. The data model building module is used to build a pre-training corpus, a Chinese-Blind parallel corpus, and a machine translation model; The encoding module is used to encode the pre-training corpus and the Chinese-Blind parallel corpus to obtain the encoded pre-training corpus and the encoded Chinese-Blind parallel corpus. The pre-training module is used to pre-train the machine translation model based on the encoded pre-training corpus to obtain a pre-trained model; The parameter adjustment module is used to fine-tune the parameters of the pre-trained model based on the encoded Chinese-Blind parallel corpus to obtain the conversion model. The translation module is used to input Chinese into the conversion model for translation, obtain a Braille sequence, and complete the Chinese-Braille translation. The method for constructing the pre-training corpus in the data model construction module includes: Collect Chinese text, and based on the Chinese text, obtain pinyin information and word segmentation information; The Chinese text is modified by deleting some characters with a preset probability to obtain the deleted text. The deleted text is used as the source sequence and the Chinese text is used as the target sequence to obtain a pure Chinese corpus. Using the Chinese text as the source sequence and the Pinyin information as the target sequence, a Chinese-Pinyin parallel corpus is obtained. Using the Chinese text as the source sequence and the word segmentation information as the target sequence, a Chinese-Chinese word segmentation parallel corpus is obtained. Using the Chinese text as the source sequence, the pinyin information as the target sequence, and adding the word segmentation information, a Chinese-pinyin corpus with word segmentation is obtained; The pre-training corpus is constructed based on the pure Chinese corpus, the Chinese-Pinyin parallel corpus, the Chinese-Chinese word segmentation parallel corpus, and the Chinese-Pinyin corpus with word segmentation. In the parameter adjustment module, the method for fine-tuning the parameters includes: The encoded Chinese sequences from the encoded Chinese-Blind parallel corpus are input into the pre-trained model; The pre-trained model makes predictions based on the encoded Chinese sequence to obtain the Braille ASCII code sequence prediction value. Based on the encoded Braille ASCII code sequence in the encoded Chinese-Braille parallel corpus and the predicted Braille ASCII code value, the parameters of the pre-trained model are fine-tuned to obtain the conversion model.