# English Semantic Analysis Algorithm and Application Based on Improved Attention Mechanism Model

Authors: Tingting Chen; Lixia Du
Journal: Mathematical Problems in Engineering
 (2022)

---

## Abstract

This work provides an enhanced attention model by addressing the drawbacks of standard English semantic analysis methods. This work provides the semantic component analysis and intelligent algorithm structure in order to investigate the intelligent algorithm of sentence component-focused English semantic analysis. In addition, the whole process of intelligently analyzing English semantics is investigated. In the process of English semantic analysis, semantic ambiguity, poor semantic analysis accuracy, and incorrect quantifiers are continually optimized and solved based on semantic analysis. It improves the accuracy of English semantic analysis. In the long sentence semantic analysis test, improving the performance of attention mechanism semantic analysis model is also ideal. It is proved that the performance of the proposed algorithm model is obviously improved compared with the traditional model in order to continuously promote the accuracy and quality of English language semantic analysis.


---

## Body

## 1. Introduction

With the continuous development and evolution of economic globalization, the exchanges and interactions among countries around the world are also constantly strengthening. As a universal language, English has become more widely used [1]. English is gaining in popularity, English semantic analysis has become a necessary component, and many machine semantic analysis methods are fast evolving. The correctness of English semantic analysis directly influences the effect of language communication in the process of English language application [2]. To increase the real accuracy and impact of English semantic analysis, we should focus on in-depth investigation and knowledge of English language semantics, as well as the application of powerful English semantic analysis methodologies [3]. Machine translation is more about the context knowledge of phrase groups, paragraphs, chapters, and genres inside the language than single grammar and sentence translation. Semantic analysis as a technique or process is still in its infancy. Statistical approaches for obtaining semantic information, such as word sense disambiguation and shallow semantic analysis, are now attracting many people’s interest from many areas of life [4]. From the semantic point of view, word semantic calculation can be defined in the whole text or between single word meanings, so word semantics have relevance and similarity; that is, they reflect the commonness of two words in the same context and the aggregation characteristics between two words [5]. To a certain extent, the more similar the semantics between words, the greater their relevance, which will easily lead to misunderstanding in different contexts and bring difficulties to translation [6]. In the face of the limitations and shortcomings of the traditional translation methods of grammatical type variables in English language, through the analysis of English semantics, more practical methods and strategies of English semantic analysis should be put forward to promote the accuracy of English semantic analysis.Currently, machine translation research is not limited to the syntactic and semantic analysis of a single sentence, but it also requires a thorough examination of language’s internal laws as well as an examination of various types of contextual information such as sentence groups, paragraphs, chapters, and genres [7]. The English translation system saves the collected translated materials in the system database; after semantic detection of the included language, information feature extraction, and word and semantic analysis in a specific context [8], it finally feeds back the results to the users. The fundamental objective of semantic analysis, which is a logical step in the compilation process, is to investigate the context-related features and types of structurally valid source programs. Semantic analysis checks for semantic flaws in the source program and collects type information for the code generation step [9]. The semantic language-based multilanguage machine translation approach performs semantic analysis on source language phrases and extends them into target language sentences to achieve translation. System database, word analysis algorithm, sentence part-of-speech analysis algorithm, and sentence semantic analysis algorithm are examples of English semantic analysis algorithms based on sentence components [10]. Semantic analysis may give a suitable framework and procedure for knowing reasoning and language and can better grasp and evaluate the collected text information, thanks to the growth of social networks. It is an artificial intelligence and computational linguistics-based scientific technique [11]. Semantic analysis is a term that deduces the syntactic structure of a phrase as well as the meaning of each notional word in the sentence to represent the real meaning of the sentence. Semantic analysis may convert human-understandable natural language into computer-understandable language structures. This paper studies the English semantic analysis algorithm based on the improved attention mechanism model.Semantic analysis method is a research method to reveal the meaning of words and sentences by analyzing language elements and syntactic context [12]. In the process of improving the accuracy of English language translation, analyzing and understanding the semantic content of English language on the basis and premise of semantic analysis can promote the rapid improvement of the accuracy of English language translation and enhance the actual technology and level of English language translation [13]. In the traditional attention mechanism network, the correlation degree between the semantic features of text context and the target aspect category is mainly calculated directly [14]. However, the difference of improving the attention mechanism model in this paper lies in learning the text aspect features based on the text context and constructing the attention weight between the text context semantic features and aspect features. We think that calculating the correlation between semantic features and aspect features of text context is beneficial to the extraction of potential context words related to category prediction of text aspects. To completely tap the possible semantic link between text context words and text aspect information, an English semantic analysis algorithm is employed to describe text aspect features, and the attention mechanism between aspect characteristics and text context semantic features is exploited. In order to reduce redundant information of tensor weight and weight parameters, we use tensor decomposition technology to reduce the dimension of tensor weight. The feature weight after dimension reduction can not only represent the potential correlation between various features, but also control the training scale of the model.


## 2. Related Work

Reference [15] uses attention mechanism to mine the parts related to aspect information in text and constructs attention mechanism networks with different granularity. Reference [16] points out that sentences are composed of semantic unit representations and there is a corresponding relationship between the representations of semantic units in different languages. Reference [17] points out that semantic unit representation can not only be composed of words and phrases, but also have variables. The value of a variable can be an element in a set of words, phrases, and semantic unit representations that meet certain conditions. That is to say, the sentence is not composed of linear arrangement of semantic unit representations, but of staggered semantic unit representations. Reference [18] puts forward the principle of machine translation method based on semantic unit theory. Reference [19] studies one of the key issues in machine translation system based on semantic language: quantifiers. Reference [20] holds that, due to the limitation of extracted corpus and the complex and changeable language phenomena, the existing semantic unit library is incomplete and its representation is incomplete or incorrect, which cannot guarantee that all sentences can be translated and the results are correct. Reference [21] realizes the English semantic analysis algorithm based on sentence components by using English grammar rules and regular expressions. It has been successfully applied to the automatic scoring of subjective questions in English-Chinese translation, and the level of English computer-aided teaching has been improved. Reference [22] determines the relevant semantic extraction rules and dependencies based on the established corpus. We can determine the degree of differentiation of sentences and separate the elements of speech, grammar, and tense between sentences and words using the English sentence similarity method, which uses the vector space model standard and takes the determined similarity as a vector element. A semantic picture interpretation method based on adaptive attention is suggested in [23]. Reference [24] focuses on the methodology and abilities of correct English language translation using semantic analysis.Based on a review of relevant literature, this study concludes that although many academics have researched attention mechanism networks in the past, these networks are still insufficient for the representation of text information. They are unable to detect the possible link between text context terms and text content and hence cannot be utilized to correctly perform English semantic analysis. This work provides an English semantic analysis algorithm based on an enhanced attention mechanism model to overcome this challenge. English full semantic patterns may be obtained through semantic analysis of English phrases and sentences using a semantic pattern library, which can then be enlarged into English complete semantic patterns and English translations by replacement. Finally, three specific preposition semantic analysis techniques based on connection grammar and semantic pattern method, semantic pattern decomposition method, and semantic pattern expansion method are provided in the semantic analysis stage. The experimental results show that the semantic analysis performance of the improved attention mechanism model is obviously better than that of the traditional semantic analysis model.


## 3. Methodology

### 3.1. English Semantic Analysis

Machine translation of natural language has been studied for more than half a century, but its translation quality is still not satisfactory. The main reason is linguistic problems; that is, language knowledge cannot be expressed accurately. Unit theory is widely used in machine translation, off-line handwriting recognition, network information monitoring, postprocessing of speech and character recognition, and so on [25]. In order to better improve the effect and quality of English language translation, when exploring English language translation methods, we must understand and master the connotation and process of English language semantic analysis and then put forward more effective English language translation methods to effectively improve the accuracy of English language translation.People who use different languages can communicate, and sentences in different languages can be translated because these sentences have the same sentence meaning; that is, they have a corresponding relationship. Generally speaking, words and phrases in different languages do not necessarily have definite correspondence. Understanding the pragmatic level of English language is mainly to understand the actual use of the language. The semantics of a sentence in any specific natural language is called sentence meaning. The unit that expresses a meaning in sentence meaning is called semantic unit [26]. Sentence meaning consists of semantic units, and sentence meaning itself is also a semantic unit. Semantic unit representation is used in specific natural language. In the process of understanding English language, understanding the semantics of English language, including its language level, knowledge level, and pragmatic level, is fundamental. From this point of view, sentences are made up of semantic unit representations. A concrete natural language is composed of all semantic unit representations. Semantic language is composed of all semantic units.We should have not only a comprehensive and profound understanding and mastery of English language semantics when using English semantics to improve the accuracy of English language translation, but also a better understanding of the actual process of English language semantic analysis, so that when analyzing English language semantics, it can be targeted and streamlined, and it is easier to improve the quality and accuracy of English translation [27]. A concrete natural language I can be regarded as a representation of semantic language. Sentences between different specific natural languages can be translated into each other, and people who use different specific natural languages can communicate with each other because there are sentences corresponding to the same semantics between different specific natural languages, or a group of sentences expressing the semantics can be established. The translation between two natural languages (I, J) can be regarded as the transformation between two different representations of the same semantics in these two natural languages. The flowchart of English lexical semantic analysis is shown in Figure 1.Figure 1
Flowchart of English lexical semantic analysis.Semantic analysis has great advantages, the most prominent of which is that it decomposes every word into many word meanings, instead of a set of free translations, and puts these word meanings in different contexts for learners to understand and use. A sentence is a semantic unit representation in which all variables are replaced with semantic unit representations without variables in a certain natural language. There is no production and no start character in this definition. Language is also not created by a formal structure. The majority of language members exist objectively, while members with variables and variable replacement can only comprise a portion of the content. English semantics, like any other language, is influenced by literary, theological, and other elements, and the vocabulary is vast. However, in order to implement an intelligent algorithm for English semantic analysis based on computer technology, a semantic resource database for popular terms must be established. Parsing English semantics is generally implemented in four steps. ① Make clear the actual standards and requirements of English language semantics, and collect, sort out, and arrange relevant data or information. ② Make clear the relevant elements of English language semantic analysis, and better create the analysis types of each element. ③ Select a part of the content, and analyze the selected content by using the proposed analysis category and manual coding method. ④ Manage the parsed data as a whole, verify whether the coder is consistent, and finally complete the interpretation of data expression.Basic semantic units are semantic units that cannot be replaced by other semantic units. Basic semantic unit representations are semantic unit representations that cannot be replaced by other semantic unit representations. For the representation of a discarded semantic units, they are semantic units that can be replaced by other semantic units. In the semantic analysis of English language, in order to strengthen and improve the accuracy of English language translation, it is necessary to know all the information resources of English corpus and English dictionary, which cover the part-of-speech, word form, and word analysis. At the same time, it is necessary to conduct a comprehensive analysis of English grammar, master the application rules of English grammar, deeply analyze the sentence structure, and analyze and explain the subject-predicate object and attribute of English language. The framework of English semantic analysis algorithm based on the improved attention mechanism model is shown in Figure2.Figure 2
English semantic analysis algorithm framework.The understanding of natural language is to understand the semantics of natural language. There are three different levels of natural language semantics: language level, knowledge level, and pragmatic level. The multilingual machine translation system based on semantic language consists of two parts: (1) multi-natural language machine translation software that is unified; (2) multilingual unified semantic unit library with excellent quality, scalability, and completeness, as well as no discarding, repetition, false ambiguity, or normal ambiguity. In the semantic analysis of English language, we should analyze it according to the rules and templates of semantic analysis; analyze the content of English language according to grammatical rules, semantics, and their relevance; and then choose the appropriate templates to express the actual English language connotation.In semantic language theory, the translation of sentences or texts in two natural languages (I, J) can be realized in two steps. Firstly, according to the semantic unit representation library, the sentence of language is analyzed semantically in I language, and the sentence semantic expression of the sentence is obtained. This process can be realized by special pruning of semantic unit tree. Then, according to the semantic unit representation library, the semantic expression of this sentence is substituted by the semantic unit representation of J language into a sentence in J language. In this step, the semantic expressions can be easily expanded into multilanguage representations simultaneously with the translation method based on semantic linguistics. Whether in the language category or in the field of information technology, when analyzing semantics, it is necessary to carry out layer-by-layer analysis and processing according to this step and process and, finally, to highlight and interpret the true meaning and value of semantics.


### 3.2. English Semantic Analysis Algorithm Based on Improved Attention Mechanism

Attention mechanism was originally proposed to be applied in computer vision. When human brain processes visual signals, it is often necessary to quickly scan the global image to identify the target areas that need special attention. The attention mechanism is quite similar to the signal processing system in the human brain, which selects the information that is most relevant to the present goal from a large amount of data. The mathematical principle of attention mechanism is that the input data of neural network are weighted first and then imported into the encoder, then the encoder imports the data into the decoder, and the decoder queries the data weight in the decoding process as the reverse input data, so as to realize the weighted average of the data in each state. In recent years, attention mechanism has been widely used in different fields of deep learning, including image processing, speech recognition, and natural language processing.The attention mechanism module is mainly divided into an encoder module and a decoder module. The input part of the encoder module is the entire data sequence, and three input matrices are used, namely,Q, K, and V. The attention mechanism function can be regarded as a mapping relationship, and the functional formula is as follows:(1)attentionQ,K,V=softmaxQKTdkV.Semantic analysis can hardly satisfy the colorful language. The algorithm has the characteristics of “dichotomy,” and the set semantic components will be judged according to the context. However, this analytical method with dichotomy cannot meet the colorful rhetorical devices in actual language. Attention mechanism has achieved good results in machine translation and has since been introduced into emotion analysis by researchers. In the task of emotion analysis, the objective function is no longer the outputyt at a certain moment, but the emotion polarity or emotion category corresponding to the sentence. In the end, the primary principle of the attention mechanism is to enhance the weight of information in the input sequence linked to the objective issue so that it may get more attention, hence increasing the model’s learning of the objective function. Word frequency is used to measure the degree of relevance between words in a document, such as the following formula:(2)dcowi,wj=Ndocw1,w2Ndocw1.Among them,dco (wi,wj) represents the cooccurrence similarity between the words wi and wj, Ndoc (wi,wj) represents the number of words wi and wj that appear in the document at the same time, and Ndoc (wi) represents the word wi in the document.Sentence part-of-speech analysis is mainly based on vocabulary analysis. First, we get the part-of-speech and meaning of each word. The part-of-speech of the word in this phrase may then be determined using the gathered data and the part-of-speech of words before and after the word. This paper’s encoder-decoder structure comprises an encoder and a decoder. The encoder converts the neural network’s input data into a fixed-length piece of data. The data encoded by the decoder is decoded backward and then produced as a translated phrase.On the basis of relevant research, the concept order similarity calculation approach is redefined with a focus on the similarity of concept words between sentences. That is, it is determined that the semantic similarity value between two concept words lies in the interval [0, 1], and the mutual relationship is shown in the following formula:(3)simω1,ω2=e−αL⋅12HcH1+HcH2.Among them,L is the shortest path between the concept words ω1 and ω2; Hc is the depth of the concept word in the common hypernym set, the depth corresponding to Hω1 and Hω2; and α is a constant. In the vectorized representation of English sentences, the two sentences are first represented by vectors of equal length. For example, for sentences T1 and T2, all the single words of the two sentences are integrated into a joint word set T, such as the following formula:(4)T=T1∪T2=ω1,q1,…,ωm,qn.Remove the same words inT1 and T2 to ensure that the elements in the joint word set T are mutually exclusive. Among them, ω1,ω2,…,ωm is the set of words in the sentence T1, and q1,q2,…,qn is the set of words in the sentence T2.After determining the semantic vectors S1 and S2 corresponding to the sentences T1 and T2, the similarity between T1 and T2 is calculated according to (5), and the similarity value is greater than the set threshold candidate answer as the final answer:(5)simT1,T2=S1⋅S2S1⋅S2.Semantic pattern is a unit of meaning, while translation template is words and strings that can be translated into each other under certain conditions. For a semantic pattern, all variables including main variables have semantic types. Semantic patterns are based on semantics, and translation templates are mostly based on grammatical structures. Therefore, semantic patterns can be represented and processed while translation templates generally cannot. Get the average precision and recall of each test set, draw the precision and recall charts according to these data, and determine the changes of the average precision and recall of the system through the overall comparison and analysis of these two charts, so as to obtain the performance of the system in these aspects. Because the time adverbs and auxiliary words such as “Jiang” are ignored in the semantic unit of sentences, only the semantic units of time phrases are extracted, only the time conjunctions are extracted in the sentences with time conjunctions, and no time information is marked in the expression. Obviously, the time pattern table can directly reflect the time information and transform tenses. Therefore, we directly use this algorithm to process sentences according to semantic similarity to obtain temporal results, and combine them with the translation results of machine response system to obtain the translation with temporal tags. The maximum log-likelihood function is used as the objective function, as shown in the following formula:(6)max1T∑t=1T∑−c≤j≤c,j≠0logpwt+j|wt.Among them,c is the word between the upper and lower window, and T is the length of the text. In addition, pwt+j|wt is calculated using the softmax function, as shown in the following formula:(7)pwO|wI=expvwO′TvwI∑w=1WexpvwO′TvwI,where v′ and v are the input and output vectors of words. W is the size of the dictionary, which contains all possible words in the text. The semantic similarity between words is used as the weight and the cooccurrence similarity as an evaluation function to measure the degree of association between words, and the evaluation function is used as the weight in the word cooccurrence matrix as shown in the following formula:(8)Weightwij=dsemanticwi,wj×dcowi,wj.Based on English grammar rules and analysis results of sentences, the system uses regular expressions of English grammar. First, determine the predicate part of a complete sentence, and then determine the subject and object parts of the sentence according to the subject-predicate-object relationship, with the rest as other parts. Next, judge its role in the sentence according to its position. Semantic rules and templates cover high-level semantic analysis and set patterns. According to grammatical rules, semantics, and semantic relevance, the system first defines the content and then expresses it through appropriate semantic templates.The sentence structure is thoroughly examined, and the subject, predicate, attribute, and direct and indirect objects of the English language are described and studied in the “grammatical rules” level. Taking “ontology” as an example, abstract, concrete, and related class definitions in many disciplines, etc., in the “concept class tree” process, are all based on hierarchical and organized extended tree language definitions. Simultaneously, a natural language processing system is developed for efficient interaction between humans and computers, and information exchange is achieved as an auxiliary aspect of the translation system. The questions are uploaded to the user’s terminal by the user. The system translation model is used once the information exchange can only be handled via natural language. The model file is used for scoring and providing feedback on the results. The user’s English translation document is examined, and the training model translation set data is chosen to enhance the overall translation effect, based on manual inspection and assessment.


## 3.1. English Semantic Analysis

Machine translation of natural language has been studied for more than half a century, but its translation quality is still not satisfactory. The main reason is linguistic problems; that is, language knowledge cannot be expressed accurately. Unit theory is widely used in machine translation, off-line handwriting recognition, network information monitoring, postprocessing of speech and character recognition, and so on [25]. In order to better improve the effect and quality of English language translation, when exploring English language translation methods, we must understand and master the connotation and process of English language semantic analysis and then put forward more effective English language translation methods to effectively improve the accuracy of English language translation.People who use different languages can communicate, and sentences in different languages can be translated because these sentences have the same sentence meaning; that is, they have a corresponding relationship. Generally speaking, words and phrases in different languages do not necessarily have definite correspondence. Understanding the pragmatic level of English language is mainly to understand the actual use of the language. The semantics of a sentence in any specific natural language is called sentence meaning. The unit that expresses a meaning in sentence meaning is called semantic unit [26]. Sentence meaning consists of semantic units, and sentence meaning itself is also a semantic unit. Semantic unit representation is used in specific natural language. In the process of understanding English language, understanding the semantics of English language, including its language level, knowledge level, and pragmatic level, is fundamental. From this point of view, sentences are made up of semantic unit representations. A concrete natural language is composed of all semantic unit representations. Semantic language is composed of all semantic units.We should have not only a comprehensive and profound understanding and mastery of English language semantics when using English semantics to improve the accuracy of English language translation, but also a better understanding of the actual process of English language semantic analysis, so that when analyzing English language semantics, it can be targeted and streamlined, and it is easier to improve the quality and accuracy of English translation [27]. A concrete natural language I can be regarded as a representation of semantic language. Sentences between different specific natural languages can be translated into each other, and people who use different specific natural languages can communicate with each other because there are sentences corresponding to the same semantics between different specific natural languages, or a group of sentences expressing the semantics can be established. The translation between two natural languages (I, J) can be regarded as the transformation between two different representations of the same semantics in these two natural languages. The flowchart of English lexical semantic analysis is shown in Figure 1.Figure 1
Flowchart of English lexical semantic analysis.Semantic analysis has great advantages, the most prominent of which is that it decomposes every word into many word meanings, instead of a set of free translations, and puts these word meanings in different contexts for learners to understand and use. A sentence is a semantic unit representation in which all variables are replaced with semantic unit representations without variables in a certain natural language. There is no production and no start character in this definition. Language is also not created by a formal structure. The majority of language members exist objectively, while members with variables and variable replacement can only comprise a portion of the content. English semantics, like any other language, is influenced by literary, theological, and other elements, and the vocabulary is vast. However, in order to implement an intelligent algorithm for English semantic analysis based on computer technology, a semantic resource database for popular terms must be established. Parsing English semantics is generally implemented in four steps. ① Make clear the actual standards and requirements of English language semantics, and collect, sort out, and arrange relevant data or information. ② Make clear the relevant elements of English language semantic analysis, and better create the analysis types of each element. ③ Select a part of the content, and analyze the selected content by using the proposed analysis category and manual coding method. ④ Manage the parsed data as a whole, verify whether the coder is consistent, and finally complete the interpretation of data expression.Basic semantic units are semantic units that cannot be replaced by other semantic units. Basic semantic unit representations are semantic unit representations that cannot be replaced by other semantic unit representations. For the representation of a discarded semantic units, they are semantic units that can be replaced by other semantic units. In the semantic analysis of English language, in order to strengthen and improve the accuracy of English language translation, it is necessary to know all the information resources of English corpus and English dictionary, which cover the part-of-speech, word form, and word analysis. At the same time, it is necessary to conduct a comprehensive analysis of English grammar, master the application rules of English grammar, deeply analyze the sentence structure, and analyze and explain the subject-predicate object and attribute of English language. The framework of English semantic analysis algorithm based on the improved attention mechanism model is shown in Figure2.Figure 2
English semantic analysis algorithm framework.The understanding of natural language is to understand the semantics of natural language. There are three different levels of natural language semantics: language level, knowledge level, and pragmatic level. The multilingual machine translation system based on semantic language consists of two parts: (1) multi-natural language machine translation software that is unified; (2) multilingual unified semantic unit library with excellent quality, scalability, and completeness, as well as no discarding, repetition, false ambiguity, or normal ambiguity. In the semantic analysis of English language, we should analyze it according to the rules and templates of semantic analysis; analyze the content of English language according to grammatical rules, semantics, and their relevance; and then choose the appropriate templates to express the actual English language connotation.In semantic language theory, the translation of sentences or texts in two natural languages (I, J) can be realized in two steps. Firstly, according to the semantic unit representation library, the sentence of language is analyzed semantically in I language, and the sentence semantic expression of the sentence is obtained. This process can be realized by special pruning of semantic unit tree. Then, according to the semantic unit representation library, the semantic expression of this sentence is substituted by the semantic unit representation of J language into a sentence in J language. In this step, the semantic expressions can be easily expanded into multilanguage representations simultaneously with the translation method based on semantic linguistics. Whether in the language category or in the field of information technology, when analyzing semantics, it is necessary to carry out layer-by-layer analysis and processing according to this step and process and, finally, to highlight and interpret the true meaning and value of semantics.


## 3.2. English Semantic Analysis Algorithm Based on Improved Attention Mechanism

Attention mechanism was originally proposed to be applied in computer vision. When human brain processes visual signals, it is often necessary to quickly scan the global image to identify the target areas that need special attention. The attention mechanism is quite similar to the signal processing system in the human brain, which selects the information that is most relevant to the present goal from a large amount of data. The mathematical principle of attention mechanism is that the input data of neural network are weighted first and then imported into the encoder, then the encoder imports the data into the decoder, and the decoder queries the data weight in the decoding process as the reverse input data, so as to realize the weighted average of the data in each state. In recent years, attention mechanism has been widely used in different fields of deep learning, including image processing, speech recognition, and natural language processing.The attention mechanism module is mainly divided into an encoder module and a decoder module. The input part of the encoder module is the entire data sequence, and three input matrices are used, namely,Q, K, and V. The attention mechanism function can be regarded as a mapping relationship, and the functional formula is as follows:(1)attentionQ,K,V=softmaxQKTdkV.Semantic analysis can hardly satisfy the colorful language. The algorithm has the characteristics of “dichotomy,” and the set semantic components will be judged according to the context. However, this analytical method with dichotomy cannot meet the colorful rhetorical devices in actual language. Attention mechanism has achieved good results in machine translation and has since been introduced into emotion analysis by researchers. In the task of emotion analysis, the objective function is no longer the outputyt at a certain moment, but the emotion polarity or emotion category corresponding to the sentence. In the end, the primary principle of the attention mechanism is to enhance the weight of information in the input sequence linked to the objective issue so that it may get more attention, hence increasing the model’s learning of the objective function. Word frequency is used to measure the degree of relevance between words in a document, such as the following formula:(2)dcowi,wj=Ndocw1,w2Ndocw1.Among them,dco (wi,wj) represents the cooccurrence similarity between the words wi and wj, Ndoc (wi,wj) represents the number of words wi and wj that appear in the document at the same time, and Ndoc (wi) represents the word wi in the document.Sentence part-of-speech analysis is mainly based on vocabulary analysis. First, we get the part-of-speech and meaning of each word. The part-of-speech of the word in this phrase may then be determined using the gathered data and the part-of-speech of words before and after the word. This paper’s encoder-decoder structure comprises an encoder and a decoder. The encoder converts the neural network’s input data into a fixed-length piece of data. The data encoded by the decoder is decoded backward and then produced as a translated phrase.On the basis of relevant research, the concept order similarity calculation approach is redefined with a focus on the similarity of concept words between sentences. That is, it is determined that the semantic similarity value between two concept words lies in the interval [0, 1], and the mutual relationship is shown in the following formula:(3)simω1,ω2=e−αL⋅12HcH1+HcH2.Among them,L is the shortest path between the concept words ω1 and ω2; Hc is the depth of the concept word in the common hypernym set, the depth corresponding to Hω1 and Hω2; and α is a constant. In the vectorized representation of English sentences, the two sentences are first represented by vectors of equal length. For example, for sentences T1 and T2, all the single words of the two sentences are integrated into a joint word set T, such as the following formula:(4)T=T1∪T2=ω1,q1,…,ωm,qn.Remove the same words inT1 and T2 to ensure that the elements in the joint word set T are mutually exclusive. Among them, ω1,ω2,…,ωm is the set of words in the sentence T1, and q1,q2,…,qn is the set of words in the sentence T2.After determining the semantic vectors S1 and S2 corresponding to the sentences T1 and T2, the similarity between T1 and T2 is calculated according to (5), and the similarity value is greater than the set threshold candidate answer as the final answer:(5)simT1,T2=S1⋅S2S1⋅S2.Semantic pattern is a unit of meaning, while translation template is words and strings that can be translated into each other under certain conditions. For a semantic pattern, all variables including main variables have semantic types. Semantic patterns are based on semantics, and translation templates are mostly based on grammatical structures. Therefore, semantic patterns can be represented and processed while translation templates generally cannot. Get the average precision and recall of each test set, draw the precision and recall charts according to these data, and determine the changes of the average precision and recall of the system through the overall comparison and analysis of these two charts, so as to obtain the performance of the system in these aspects. Because the time adverbs and auxiliary words such as “Jiang” are ignored in the semantic unit of sentences, only the semantic units of time phrases are extracted, only the time conjunctions are extracted in the sentences with time conjunctions, and no time information is marked in the expression. Obviously, the time pattern table can directly reflect the time information and transform tenses. Therefore, we directly use this algorithm to process sentences according to semantic similarity to obtain temporal results, and combine them with the translation results of machine response system to obtain the translation with temporal tags. The maximum log-likelihood function is used as the objective function, as shown in the following formula:(6)max1T∑t=1T∑−c≤j≤c,j≠0logpwt+j|wt.Among them,c is the word between the upper and lower window, and T is the length of the text. In addition, pwt+j|wt is calculated using the softmax function, as shown in the following formula:(7)pwO|wI=expvwO′TvwI∑w=1WexpvwO′TvwI,where v′ and v are the input and output vectors of words. W is the size of the dictionary, which contains all possible words in the text. The semantic similarity between words is used as the weight and the cooccurrence similarity as an evaluation function to measure the degree of association between words, and the evaluation function is used as the weight in the word cooccurrence matrix as shown in the following formula:(8)Weightwij=dsemanticwi,wj×dcowi,wj.Based on English grammar rules and analysis results of sentences, the system uses regular expressions of English grammar. First, determine the predicate part of a complete sentence, and then determine the subject and object parts of the sentence according to the subject-predicate-object relationship, with the rest as other parts. Next, judge its role in the sentence according to its position. Semantic rules and templates cover high-level semantic analysis and set patterns. According to grammatical rules, semantics, and semantic relevance, the system first defines the content and then expresses it through appropriate semantic templates.The sentence structure is thoroughly examined, and the subject, predicate, attribute, and direct and indirect objects of the English language are described and studied in the “grammatical rules” level. Taking “ontology” as an example, abstract, concrete, and related class definitions in many disciplines, etc., in the “concept class tree” process, are all based on hierarchical and organized extended tree language definitions. Simultaneously, a natural language processing system is developed for efficient interaction between humans and computers, and information exchange is achieved as an auxiliary aspect of the translation system. The questions are uploaded to the user’s terminal by the user. The system translation model is used once the information exchange can only be handled via natural language. The model file is used for scoring and providing feedback on the results. The user’s English translation document is examined, and the training model translation set data is chosen to enhance the overall translation effect, based on manual inspection and assessment.


## 4. Result Analysis and Discussion

In the formal quantifier-noun collocation rule base, formal quantifiers are arranged in order of priority from high to low. According to the collocation flexibility of formal quantifiers and nouns, the priority level is set from low to high. Set the arrangement order of the database: put the priority in front of the database table. The query data set contains all kinds of query information, which puts forward various query requirements to the system and drives the system to perform query and retrieval operations, so that various experiments can be carried out to train or test the performance of the system. The query information is in various forms such as query word sets, query sentences, and query text segments and can be used to train or test the performance of various aspects of the system.The semantic expansion stage includes the generation of the target language, that is, considering how to choose a more appropriate one from multiple target words corresponding to the same word meaning according to the collocation habits of related words in the target language. The choice of English formal quantifiers is one of the problems to be solved. Other problems to be solved include the choice of verb generation in verb-noun collocation and adjective generation in adjective-noun collocation. The accuracy and recall of each experiment result are determined in the experiment, and all of the experimental result data for each experiment item is summed and presented on the chart. As a consequence, diverse system performances may be simply and intuitively examined in light of the experimental data. When designing these charts, the drawing scale factor is sometimes utilized to increase or minimize the experimental data in order to properly display it on the charts. In order to test the effectiveness of the algorithm in this paper, the algorithm in [22], the algorithm in [23], and the algorithm in this paper are compared; the average error values are obtained; and the graph shown in Figure 3 is generated.Figure 3
Comparison of average error of each algorithm.The accuracy and resilience of this model are superior to those in the literature, as shown in Figure3. This algorithm’s validity has been established. Prepositions in English are a kind of unique, versatile, and often used word. It is important to extract semantic units particularly for preposition-containing phrases and sentences, as well as to enhance and improve the current semantic unit library. The semantic analysis and translation errors of prepositions will inevitably increase as a result of the original semantic unit library’s defects in extracting semantic units of prepositions, and whether the translation of prepositions is correct or not is very important to the translation quality of the entire sentence. As a result, preposition semantic disambiguation and Chinese translation must be studied individually using the semantic pattern library. Verifying the accuracy of current semantic patterns and improving the semantic pattern library are both useful. The training set is utilized to train numerous adjustment parameters in the adjustment determination system’s algorithm, and each adjustment parameter is trained using the classic isolation approach. That is, while training and changing a parameter, leave other parameters alone and alter the value of this parameter to fall within a particular range. Examine the changes in system performance throughout this process, and choose the parameter value that results in the best system performance as the final training adjustment parameter value. This operation is performed on all these adjustment parameters one by one, and their optimal system parameter values are obtained. In the experimental test, the method of comparative test is used for evaluation, and the RNN model, LSTM model, and this model are compared in BLUE value. The test results are shown in Figure 4.Figure 4
Comparison of model test results.It can be concluded that the model established in this paper does improve the quality of semantic analysis to some extent. Semantic pattern is a unique representation of semantic units. According to the characteristics of semantic collocation and semantic restriction, it determines the real quantity in the semantic unit representation and transforms the variables in the semantic unit representation, so that the variables that have no direct influence on the semantic determination are represented by a simpler symbol, without marking the semantic type and without translation. The advantage of this method is that it can reduce the complexity of semantic analysis and make the description clearer. Determine a set of query data sets, use these query information to query the system, then compare and calculate the result document set returned by the system with the corresponding correct query result document set to find out its precision and recall, and draw all these data into a calibration curve or calculate their average value. In order to verify the effectiveness of this algorithm, we conducted three open experiments and got the recall and accuracy results of the algorithm. The recall rate of the algorithm is shown in Figure5. The accuracy of the algorithm is shown in Figure 6.Figure 5
The recall rate of the algorithm.Figure 6
Accuracy of the algorithm.The experimental results show that this method is effective in solving English semantic analysis and Chinese translation. The recall and accuracy of open test 3 are much lower than those of the other two open tests because the corpus is news genre. It is characterized by the interweaving of narrative words and explanatory words, and mistakes often occur in the choice of present tense, past tense, and perfect tense. Therefore, it is necessary to further study the temporal patterns and recognition rules of sentences in restricted fields, places, or situations, as well as the rules of cohesion between sentences.The realization of the system mainly depends on using regular expressions to express English grammar rules, and regular expressions refer to a single string used to describe or match a series of strings that conform to a certain syntax rule. In word analysis, sentence part-of-speech analysis, and sentence semantic analysis algorithms, regular expressions are utilized to convey English grammatical rules. It is totally equal to semantic unit representation if all variables in the semantic schema are annotated with semantic type. As a result, semantic patterns, like semantic unit representations, may reflect both grammatical structure and semantic information in phrases or sentences. And it represents semantic as whole and can be substituted among semantic modes.The sentences of corpus are clustered according to the length, and then the semantic analysis model is tested with sentences of different lengths to verify the long sentence analysis ability of the model. The test results are shown in Figure7.Figure 7
Model long sentence analysis results.From Figure7, it can be seen that the performance of the algorithm in this paper is the best under different sentence lengths, which also proves that the model in this paper has good analytical ability in long sentence analysis. In the aspect of long sentence analysis, this method has certain advantages compared with the other two algorithms. The results show that this method can better adapt to the change of sentence length, and the period analysis results are more accurate than other models.The main reason for introducing semantic pattern of prepositions is that it is a comprehensive summary of preposition usage, covering most usages of most prepositions. Many usages of prepositions cannot be found in the semantic unit library of the existing system, which leads to poor translation quality of prepositions. The translation error of prepositions is also one of the main reasons that affect the quality of sentence translation. Furthermore, the variable word list contains a high number of terms that have a direct impact on preposition semantic determination. When analyzing the semantics of English words, we should focus on the study and mastery of parts-of-speech such as nouns, verbs, adjectives, and prepositions, as well as verb tenses such as the simple present tense, simple past tense, and past perfect tense, so that we can understand the parts-of-speech of different English words and the different semantics of different tenses. Because of the relevance between semantic pattern and semantic unit representation, semantic pattern can further expand the existing semantic unit library, which is conducive to adding semantic units, correcting the incorrect division of semantic units, and eliminating the false ambiguity of semantic units.This paper proposes an English semantic analysis algorithm based on the improved attention mechanism model. Furthermore, an effective multistrategy solution is proposed to solve the problem that the machine translation system based on semantic language cannot handle temporal transformation. This method can directly give the temporal conversion results without being influenced by the translation quality of the original system. The experimental results show that the English semantic analysis algorithm based on the improved attention mechanism model proposed in this paper, on the basis of semantic analysis of English language, uses the translation template with syntactic variables based on semantic analysis to implement accurate translation of English language and obtains accurate and fluent translation. Through comparative experiments, it can be seen that this method is obviously superior to traditional semantic analysis methods.


## 5. Conclusions

Starting from the morphological changes of existing English words and regular expressions of English grammar, this paper first analyzes the basic theory of semantic component analysis, then introduces the intelligent algorithm structure of semantic analysis, and finally studies each part of the algorithm structure with examples. The similarity calculation model based on the combination of semantic dictionary and corpus is given, and the development process of the system and the function of the module are given. Based on the corpus, the relevant semantic extraction rules and dependencies are determined. Moreover, from the reverse mapping relationship between English tenses and Chinese time expressions, this paper studies the corresponding relationship between Chinese and English time expressions and puts forward a new classification of English sentence time information. It can greatly reduce the difficulty of problem analysis, and it is not easy to ignore some timestamped sentences. In addition, the constructed time information pattern library can also help to further complete the existing semantic unit library of the system. In the process of translating English language, through semantic analysis of words, sentence patterns, etc., using effective English translation templates and methods is very beneficial for improving the accuracy and fluency of English language translation. Due to the limited time and energy of the author and the high complexity of the model, further research is needed in the future. Subsequent efforts can be made to reduce the complexity of the model, optimize the structure of attention mechanism, and shorten the training time of the model without reducing the accuracy.



---

*Source: 2165537-2022-04-14.xml*