Design of a Neural Machine Translation Model for English Based on LSTM and Enhanced Attention Mechanism
Jieying Li · 2024
The fusion of long short-term memory networks and attention mechanisms has led to the creation of a novel English translation model aimed at addressing the shortcomings of existing models, such as low translation efficiency and accuracy. Firstly, the output of the LSTM network is used as the input for the multi hop attention mechanism, and attention weights are calculated through multiple iterations, allowing the model to gradually focus on important information in the sentence and generate weighted sentence representations accordingly. Then, the weighted sentence representation is fed into a multi head attention mechanism, which divides the input sentence into multiple subspaces and independently calculates attention weights in each subspace to further extract deep features of the sentence. Finally, these features are used to generate translation results. The results indicated that the proposed model achieved accuracy, recall rate, and F1 score of up to 0.99, 0.98, and 0.98 respectively, in benchmark performance tests. In contrast, other advanced models achieved the highest accuracy of 0.95, recall of 0.96, and F1 score of 0.96. Furthermore, the proposed model demonstrated an accuracy of up to 0.99 in real translation tasks. These findings suggest that the designed translation model not only exhibits superior performance but also excels in extracting deep sentence information, thereby providing improved translation effects for real-time translation of long and complex sentences through the combined use of two attention mechanisms.