A natural language semantic recognition model and system for linguistics

By using a multi-level context-aware semantic recognition model, combining static and dynamic word vectors, bidirectional long short-term memory networks, and graph neural networks, the semantic recognition capability of traditional models is optimized. This solves the problem of insufficient understanding of multi-level contexts in complex sentences and long texts by traditional methods, and achieves higher-precision semantic recognition and cross-language information consistency.

CN120181096BActive Publication Date: 2025-10-28GUANGDONG OCEAN UNIVERSITY
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510668219.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-23
Publication Date
2025-10-28
Estimated Expiration
2045-05-23

AI Technical Summary

Technical Problem

Traditional semantic recognition methods are insufficient in handling complex sentence structures and multi-layered contextual understanding of long texts, resulting in inaccurate semantic recognition and unclear expression, which makes it difficult to meet the high-precision requirements of linguistic research and multilingual applications.

Method used

Design a natural language semantic recognition model, including a multi-level context-aware semantic recognition module. Through word-level, sentence-level and paragraph-level context modeling units, combined with static word vectors, dynamic word vectors, bidirectional long short-term memory networks and graph neural networks, optimize semantic feature extraction and context awareness. Employ cross-language semantic alignment module and semantic reasoning module for logical reasoning and verification.

Benefits of technology

It improves the accuracy and expressive richness of semantic recognition, enhances the robustness of the system and the consistency of cross-linguistic information, solves the problem of insufficient understanding of complex sentence structures and multi-layered contexts, and provides more scientific and reliable semantic parsing results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120181096B_ABST
    Figure CN120181096B_ABST
Patent Text Reader

Abstract

This invention discloses a natural language semantic recognition model and system for linguistics, relating to the field of semantic recognition technology. It includes a multi-level context-aware semantic recognition module, which receives preprocessed data output from a text preprocessing module and adjusts semantic weights under the guidance of a disambiguation optimization module. This module is used to extract semantic features from multiple context levels. By designing a multi-level context-aware semantic recognition module, this invention achieves the extraction of semantic features to capture the logical relationships between complex contexts and long texts, overcoming the shortcomings of traditional models in understanding complex sentence structures and multi-layered contexts, and improving the overall accuracy and expressive richness of semantic recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of semantic recognition technology, specifically to a natural language semantic recognition model and system for linguistics. Background Technology

[0002] Currently, with the continuous breakthroughs in artificial intelligence and natural language processing technologies, traditional semantic recognition methods face many challenges in handling the logical relationships between complex sentence structures and long texts. They are unable to meet the high-precision requirements of linguistic research and multilingual applications, resulting in problems such as insufficient understanding of complex contexts, inaccurate semantic recognition, and unclear expression.

[0003] Patent CN117010409B discloses a text recognition method and system based on natural language semantic analysis. The above patent realizes the natural language semantics of the first central text character through natural language semantic matching relationship, thereby improving the text recognition efficiency.

[0004] The aforementioned patent uses a semantic center labeling model to analyze the first text character based on topology, thereby labeling key semantic information. For the first central text character corresponding to the key semantic information, the natural language semantics of the first central text character are obtained through natural language semantic matching relationship, which improves the efficiency of text recognition. However, there is still room for optimization in the multi-level context perception process of understanding complex sentence structures and long texts.

[0005] Therefore, this application proposes a natural language semantic recognition model and system for linguistics that can achieve multi-level context awareness. Summary of the Invention

[0006] The purpose of this invention is to provide a natural language semantic recognition model and system for linguistics, in order to solve the technical problems of insufficient understanding of complex contexts, inaccurate semantic recognition, and unclear expression mentioned in the background art.

[0007] To achieve the above objectives, the present invention provides the following technical solution: a natural language semantic recognition model for linguistics, comprising a multi-level context-aware semantic recognition module, wherein the multi-level context-aware semantic recognition module receives preprocessed data output from a text preprocessing module and adjusts semantic weights under the guidance of a disambiguation optimization module, the multi-level context-aware semantic recognition module is used to extract semantic features from multiple context levels, and the multi-level context-aware semantic recognition module includes:

[0008] Word-level semantic encoding unit: Based on the fusion of static word vectors and context-based dynamic word vectors, semantic representations are generated, and the ability to understand polysemous words is optimized through sub-word-level semantic decomposition;

[0009] Sentence-level semantic encoding unit: A bidirectional long short-term memory network combined with a self-attention mechanism is used to calculate syntactic structure and semantic relations, and a dependency syntax tree is further used to adjust attention weights to optimize long sentence parsing;

[0010] Paragraph-level and text-level context modeling units: A long text cross-sentence early warning information network is constructed based on graph neural networks, and global semantic features are extracted using a hierarchical attention mechanism.

[0011] Preferably, the text preprocessing module is used to standardize the input data and transmit the results of word segmentation, part-of-speech tagging, and dependency relation analysis to the multi-level context-aware semantic recognition module. The text preprocessing module includes:

[0012] Formatting unit: Used to unify the encoding format of input text, convert special characters, and perform text denoising;

[0013] Word segmentation unit: Based on sub-word decomposition, it achieves efficient word segmentation and optimizes the recognition of low-frequency words and new words;

[0014] Part-of-speech tagging unit: The BiLSTM-CRF model is used to perform part-of-speech tagging on the text, and the tagging results are used to optimize syntactic analysis;

[0015] Dependency parsing unit: Uses Biaffine Parser to generate dependency syntax trees, providing hierarchical information for modeling syntactic structures.

[0016] Preferably, the word-level semantic coding unit includes:

[0017] Static word vector generation unit: Constructs preliminary word vectors based on FastText and enhances semantic features using pre-trained embeddings;

[0018] Dynamic word vector optimization unit: Uses Transformer structure to generate context-sensitive dynamic word vectors, enhancing semantic modeling capabilities;

[0019] Polysemous word disambiguation unit: Combines semantic clustering methods to optimize the vector representations of synonyms and polysemous words, so that polysemous words in the same context have optimal semantic matching.

[0020] Preferably, the sentence-level semantic coding unit includes:

[0021] Bidirectional LSTM semantic coding units are used to capture bidirectional contextual information of text and improve semantic consistency.

[0022] Dependency-enhanced paradigms utilize syntactic analysis results to optimize attention distribution, giving core components a higher weight in semantic modeling.

[0023] The global context adjustment unit optimizes the semantic connection between sentences by combining paragraph-level contextual information.

[0024] Preferably, the paragraph-level and text-level context modeling units employ a hierarchical attention mechanism to construct cross-sentence contextual relationships and optimize global semantic modeling through graph neural networks.

[0025] Preferably, the semantic disambiguation optimization module obtains polysemous candidate semantics from the multi-level context-aware semantic recognition module and optimizes the disambiguation strategy through a reward mechanism. The semantic disambiguation optimization module adopts a reinforcement learning policy network and uses a policy gradient algorithm to adjust the network weights according to the degree of matching between the predicted semantics and the real labels.

[0026] Preferably, the natural language semantic recognition model further includes a cross-lingual semantic alignment module for cross-lingual semantic mapping, which combines bidirectional semantic projection and contrastive learning to optimize the semantic equivalence calculation of multilingual texts, and shares semantic representations with the multi-level context-aware semantic recognition module.

[0027] The cross-language semantic alignment module uses a contrastive learning method to optimize cross-language semantic mapping, ensuring equivalent semantic representations of texts in different languages.

[0028] Preferably, the natural language semantic recognition model further includes a semantic reasoning module, which feeds back reasoning adjustment information to the multi-level context-aware semantic recognition module;

[0029] The semantic reasoning module combines knowledge graphs to perform logical reasoning on semantic relationships, automatically completes and verifies semantic relationships through reasoning networks, and provides interpretability analysis.

[0030] Preferably, the system includes: a data acquisition and preprocessing module, a semantic recognition core engine, an interactive optimization module, and an API interface module;

[0031] The data acquisition and preprocessing module is used to collect text data in multiple languages ​​and to clean, convert, and standardize the data.

[0032] The semantic recognition core engine performs semantic encoding, contextual analysis, semantic disambiguation, and cross-language alignment tasks based on the natural language semantic recognition model.

[0033] The interactive optimization module provides a user interface that allows users to manually correct the semantic annotation results of the model and update the model weights through an active learning strategy.

[0034] The API interface module is used to provide semantic recognition services to external applications.

[0035] Preferably, the API interface module also provides:

[0036] Semantic query interface: used to perform semantic parsing on input text and return structured semantic data;

[0037] Cross-language translation interface: Provides automatic translation results through cross-language semantic alignment technology;

[0038] Semantic Search Interface: Optimizes the relevance of information retrieval based on deep semantic understanding.

[0039] Compared with the prior art, the beneficial effects of the present invention are:

[0040] 1. This invention, by designing a multi-layered context-aware semantic recognition module, enables the extraction of semantic features to capture the logical relationships between complex contexts and long texts, thus overcoming the shortcomings of traditional models in understanding complex sentence structures and multi-layered contexts, and improving the overall accuracy and expressive richness of semantic recognition;

[0041] 2. This invention, by designing a semantic disambiguation optimization module, achieves dynamic adjustment of semantic weights, accurately selects the optimal semantic interpretation, solves the problem of semantic ambiguity of polysemous words in different contexts, significantly improves the automation and accuracy of semantic disambiguation, and enhances the robustness of the system;

[0042] 3. This invention, by designing a cross-language semantic alignment module, ensures that multilingual texts have equivalent semantic representations, achieves consistency of cross-language information, eliminates semantic deviations and mapping difficulties between different languages, and improves the accuracy and practicality of tasks such as cross-language translation and information retrieval;

[0043] 4. This invention, through the design of a semantic reasoning and feedback mechanism, enables automatic verification and supplementation of identified semantics, making up for the lack of logical reasoning and interpretability in traditional semantic recognition, enhancing the intelligence and transparency of the system, and providing users with more scientific and reliable semantic parsing results. Attached Figure Description

[0044] Figure 1 This is a schematic diagram of the system framework and model operation process of the present invention. Detailed Implementation

[0045] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0046] Please see Figure 1The present invention provides an embodiment of a natural language semantic recognition model for linguistics, comprising a multi-level context-aware semantic recognition module. This module receives preprocessed data output from a text preprocessing module and adjusts semantic weights under the guidance of a disambiguation optimization module. The multi-level context-aware semantic recognition module is used to extract semantic features from multiple context levels. The multi-level context-aware semantic recognition module includes:

[0047] Word-level semantic encoding unit: Based on the fusion of static word vectors and context-based dynamic word vectors, semantic representations are generated, and the ability to understand polysemous words is optimized through sub-word-level semantic decomposition;

[0048] Sentence-level semantic encoding unit: A bidirectional long short-term memory network combined with a self-attention mechanism is used to calculate syntactic structure and semantic relations, and a dependency syntax tree is further used to adjust attention weights to optimize long sentence parsing;

[0049] Paragraph-level and text-level context modeling units: A long text cross-sentence early warning information network is constructed based on graph neural networks, and global semantic features are extracted using hierarchical attention mechanisms;

[0050] The word-level semantic coding unit includes:

[0051] Static word vector generation unit: Constructs preliminary word vectors based on FastText and enhances semantic features using pre-trained embeddings;

[0052] Dynamic word vector optimization unit: Uses Transformer structure to generate context-sensitive dynamic word vectors, enhancing semantic modeling capabilities;

[0053] Polysemous word disambiguation unit: Combines semantic clustering methods to optimize the vector representations of synonyms and polysemous words, so that polysemous words in the same context have optimal semantic matching;

[0054] The sentence-level semantic coding unit includes:

[0055] Bidirectional LSTM semantic coding units are used to capture bidirectional contextual information of text and improve semantic consistency.

[0056] Dependency-enhanced paradigms utilize syntactic analysis results to optimize attention distribution, giving core components a higher weight in semantic modeling.

[0057] The global context adjustment unit optimizes semantic coherence between sentences by combining paragraph-level contextual information.

[0058] The paragraph-level and text-level context modeling units employ a hierarchical attention mechanism to construct cross-sentence contextual relationships and optimize global semantic modeling through graph neural networks.

[0059] Furthermore, the static word vector generation unit uses the FastText model to train the preprocessed text data, constructing a preliminary word vector library. It then fuses the FastText model parameters with publicly available pre-trained words embedded in the GloVe pre-trained model to obtain rich static word vectors. These pre-trained word vectors are then fused with the part-of-speech tagging and dependency syntax information output by the preprocessing module to generate preliminary word-level semantic representations. The data generated in this process is passed to the subsequent dynamic word vector optimization unit in matrix format to ensure data consistency and sharing. The dynamic word vector optimization unit uses a Transformer structure to perform contextual encoding on the input text. The Transformer's multi-head sub-attention mechanism can capture long-distance dependencies between words. Through additional positional encoding or syntactic relation encoding, the Transformer optimizes the word vectors to achieve higher-order word vectors. Ormer can better adjust the semantic representation of each word; it fuses dynamically generated word vectors with static word vectors and obtains a mixed semantic representation through a weighted average method. The fusion result will be passed to the polysemous word disambiguation unit, and at the same time, it will provide preliminary semantic information for subsequent sentence-level encoding. For words with polysemous phenomena, the polysemous word disambiguation unit performs cluster analysis on the vectors of the same word in different contexts through hierarchical clustering. The cluster center serves as the representative of each candidate semantic, and the similarity of each candidate center of the word vector in the current context is calculated. Using the weight information fed back by the disambiguation optimization module, the clustering results are dynamically adjusted based on historical context and reinforcement learning reward mechanism to determine the optimal semantic representation in the current context. The finally determined word vector is output as the word-level encoding result and interacts with the sentence-level encoding unit to ensure the consistency of the semantic expression of words in the same text.

[0060] The sentence-level semantic encoding unit inputs the fused word vector sequence output by the word-level semantic encoding unit into a bidirectional LSTM network. Global contextual information of the text is extracted through forward and backward information flows. The bidirectional combination of the LSTM network's hidden states generates a preliminary representation of the overall semantics of the sentence. The hidden states of the bidirectional LSTM are then passed as input to the dependency syntax enhancement unit and the global context adjustment unit to further refine the semantic weight distribution within the sentence. The dependency syntax enhancement unit, based on the dependency syntax tree information generated in the preprocessing module, maps the dependency relationships between words in the sentence into a structured weight matrix. This weight matrix is ​​then used to weight and adjust the hidden states output by the bidirectional LSTM, ensuring that the core components of the dependency relationships are properly weighted. Achieving a higher attention score, the adjusted sentence semantic representation is merged with the original latent state to form a semantic feature enhanced by syntax. This data is used by the global context adjustment unit and also passed to the paragraph-level context modeling unit to maintain semantic consistency across multiple levels. The global context adjustment unit combines global context information from the paragraph and text levels to perform secondary correction on the semantic features of the current sentence, compensating for the lack of local context capture. Through a simple weighted sum or gating mechanism, it dynamically adjusts the semantic representation of the current sentence to maintain higher consistency with surrounding sentences. The final output sentence-level semantic representation and dependency syntax enhancement results together constitute the semantic description at the sentence level and are passed to the next level paragraph-level context modeling unit.

[0061] Paragraph-level and text-level context modeling units collect the outputs of all sentence-level semantic encoding units within the same paragraph or text to form a sentence sequence. A hierarchical attention mechanism is used to dynamically score the relative importance of sentences, generating a weight distribution for each sentence in the global context. Based on the calculated weights, the semantic representations of each sentence are weighted and summed to form a paragraph-level or text-level global semantic vector. This global vector reflects the semantic connections between local sentences and provides a summary description of the overall semantics of the long text. Sentences or paragraphs are treated as nodes in a graph. The hierarchical attention mechanism determines the semantic relevance of the edge weights between nodes, constructing a graph neural network (GNN) to structure the relationships between sentences into a graph structure for information transmission. Graph convolution operations are used to aggregate information from each node sentence or paragraph, updating the global semantic representation. The iterative update process of the GNN allows the semantic information between nodes to influence each other, further improving the overall consistency of the long text's semantics. The generated global semantic vector is combined with the sentence-level semantic representation and passed to the upper-level semantic inference module and fed back to the disambiguation optimization module for subsequent reinforcement learning adjustments.

[0062] Please see Figure 1One embodiment of the present invention provides a natural language semantic recognition model for linguistics. The text preprocessing module is used to standardize the input data and transmit the results of word segmentation, part-of-speech tagging, and dependency relation analysis to a multi-level context-aware semantic recognition module. The text preprocessing module includes:

[0063] Formatting unit: Used to unify the encoding format of input text, convert special characters, and perform text denoising;

[0064] Word segmentation unit: Based on sub-word decomposition, it achieves efficient word segmentation and optimizes the recognition of low-frequency words and new words;

[0065] Part-of-speech tagging unit: The BiLSTM-CRF model is used to perform part-of-speech tagging on the text, and the tagging results are used to optimize syntactic analysis;

[0066] Dependency parsing unit: Uses Biaffine Parser to generate dependency syntax trees, providing hierarchical information for modeling syntactic structures;

[0067] Furthermore, after receiving the original input text, the system first detects the text's encoding format, such as UTF-8 or GBK, and converts it to a preset standard encoding format, such as UTF-8, to ensure that subsequent processing will not encounter errors due to encoding inconsistencies. Simultaneously, it parses and converts special characters in the text, such as non-ASCII characters and HTML entities, into standard character representations. Using regular expressions or predefined cleaning rules, it removes irrelevant noise information from the text, such as HTML tags, extra spaces, special symbols, and punctuation anomalies. For text with formatting tags, a filtering algorithm is used to strip away the formatting information, retaining semantically valid plain text data. The formatting processing unit saves the text processed in the above steps in a unified data format, such as JSON or XML, and marks it with a timestamp and processing status, providing a standardized data interface for subsequent modules.

[0068] The word segmentation unit utilizes sub-word decomposition algorithms such as BPE or WordPiece to segment standardized text. This method divides the text into basic morphemes or sub-word units to improve the recognition of low-frequency words and new words. During the segmentation process, a pre-trained word segmentation model and vocabulary are used to ensure that out-of-vocabulary words or emerging words can be reasonably split and labeled. The initial word segmentation results are post-processed by merging adjacent semantically related sub-words to form lexical units that are more consistent with the actual language. The word segmentation results are converted into a unified data structure such as a serialized array or vector sequence, and the position information of each sub-word in the original text is attached to provide auxiliary data for subsequent part-of-speech tagging and dependency analysis.

[0069] The system loads a pre-trained and fine-tuned BiLSTM-CRF model, which has a bidirectional long short-term memory network (BiLSTM) layer and a conditional random field (CRF) layer to capture contextual information and optimize sequence labeling. During initialization, the model parameters are adjusted according to domain features to adapt to part-of-speech tagging tasks for specific text types.

[0070] Part-of-speech tagging process:

[0071] Input: The sequence of sub-words output by the word segmentation unit is fed into the BiLSTM layer, and contextual representation of each sub-word is generated using contextual information.

[0072] Sequence labeling: The generated context representation is jointly labeled using a CRF layer to calculate the globally optimal part-of-speech tag sequence, ensuring that the labeling results are consistent and reasonable within the sequence;

[0073] Output: Each sub-word and its corresponding part-of-speech tag are combined into a sequence of labeled results and passed to the dependency analysis unit and subsequent modules in a standardized format, such as structured data with timestamps.

[0074] The system loads a dependency parsing model based on the Biaffine structure. This model uses pre-trained word vectors and part-of-speech tagging results as input, calculates the dependency relationship score between each word pair through bilinear transformation, and combines global sentence information to score all possible dependency relationships. It then uses a greedy or graph algorithm to determine the globally optimal dependency structure. Based on the calculated scores, a dependency tree is constructed between the words in the sentence, where each node represents a word and each edge represents the dependency relationship between words, such as subject-verb, attributive-head, adverbial-complement, etc. The dependency tree is output in a standard format, such as CoNLL-U, which includes vocabulary, part-of-speech tags, dependency relationship labels, parent node indexes, etc., ensuring a hierarchical expression of grammatical structure information. The dependency parsing unit encapsulates the generated dependency parsing tree along with the word segmentation and part-of-speech tagging results into a standardized data package, which is then transmitted to the multi-level context-aware semantic recognition module. The word segmentation, part-of-speech tags, and dependency structures of each part of the data package are associated through a unified identifier, ensuring that subsequent modules can perform semantic modeling based on complete and accurate grammatical information.

[0075] Please see Figure 1 The present invention provides an embodiment of a natural language semantic recognition model for linguistics, wherein the semantic disambiguation optimization module obtains polysemous candidate semantics from a multi-level context-aware semantic recognition module and optimizes the disambiguation strategy through a reward mechanism. The semantic disambiguation optimization module adopts a reinforcement learning policy network and uses a policy gradient algorithm to adjust the network weights according to the degree of matching between the predicted semantics and the real labels.

[0076] Furthermore, after the multi-level context-aware semantic recognition module processes the input text, for words with polysemy, it outputs candidate semantic representations. Each candidate representation includes: a word-level dynamic and static fusion vector, context information (such as the global semantic vector of the current sentence and surrounding sentences), and dependency syntax and position encoding information; for each polysemous word to be disambiguated, the candidate semantic representation is concatenated or fused with context features (e.g., the hidden state output by the sentence-level semantic encoding unit, the weighted result of the dependency relationship, etc.) to form a state vector s, which provides an environmental description for the reinforcement learning policy network, enabling it to judge the best semantic choice according to the current context;

[0077] For each polysemous word, the action space A is defined as the index of each candidate representation in the candidate semantic set, and the task of the policy network is to select an action a from the candidate set {a1, a2,..., a3}, corresponding to the selected semantic interpretation. The policy network uses a feed-forward neural network, and the structural example is as follows:

[0078] Input layer: Receives the state vector s; Hidden layer: There are one or more fully connected layers, and the activation function can be ReLU or tanh, which is used for non-linear feature extraction; Output layer: Uses the Softmax activation function to convert the output into a probability distribution Π(a丨s; θ) of each candidate action; The network parameter θ represents the weights and biases in the policy network;

[0079] When the policy network selects a candidate semantic for a polysemous word, the system calculates the matching degree by comparing the predicted semantic with the true label:

[0080] If the predicted semantic matches the true semantic, a positive reward R = ±1 is given;

[0081] If the prediction is incorrect, a negative reward R = -1 or a lower positive reward is given;

[0082] This reward signal is immediately fed back to the policy network after each decision for subsequent weight updates;

[0083] The weight of the policy network is updated using the policy gradient method, and the basic update formula:

[0084] Δθ = α·RDian·▽ ,

[0087] , , θ , ,

[0086] , , ,

[0082] , <0000​​​​​​​​​​​Forward propagation: For each polysemous word, use the current policy network to calculate the selection probability Π(a|s; θ) of each candidate semantics in state s;

[0088] Action sampling: Sample according to the output probability distribution to determine the action a, that is, select the candidate semantics;

[0089] Reward calculation: Compare the selected candidate semantics with the true label, calculate the matching degree, and thus determine the reward R;

[0090] Gradient calculation: Calculate the gradient ▽ θ logΠ(a|s; θ);

[0091] Parameter update: Adjust the policy network parameter θ according to the update formula, so that in the future, it is more inclined to select the correct semantic interpretation in a similar state;

[0092] For each polysemous word in each training sample, repeat the above process. The system continuously collects state, action, and reward data, and gradually optimizes the policy network by means of batch update or online update. After each weight update, the probability distribution output by the policy network can be fed back to the multi-level context-aware semantic recognition module to guide the downstream module to adjust the ranking or weight distribution of polysemous word candidate semantics. In addition, the semantic disambiguation optimization module will store the successful decision results in the experience replay pool for subsequent re-learning and improving the robustness of the policy network. Regularly evaluate the policy network on the validation set, monitor the training progress by calculating the average reward and matching accuracy, and adjust the learning rate or network structure according to the evaluation results to obtain better semantic disambiguation effects.

[0093] Please refer to Figure 1 For an embodiment provided by the present invention: A natural language semantic recognition model for linguistics, the natural language semantic recognition model further includes a cross-lingual semantic alignment module for cross-lingual semantic mapping, combines bidirectional semantic projection and contrast learning to optimize the calculation of semantic equivalence of multilingual texts, and shares semantic representations with the multi-level context-aware semantic recognition module;

[0094] The cross-lingual semantic alignment module uses the contrast learning method to optimize cross-lingual semantic mapping to ensure equivalent semantic representations of different language texts;

[0095] The natural language semantic recognition model further includes a semantic reasoning module, and the semantic reasoning module feeds back reasoning adjustment information to the multi-level context-aware semantic recognition module;

[0096] The semantic reasoning module combines the knowledge graph to perform logical reasoning on semantic relationships, automatically completes and verifies semantic relationships through an inference network, and provides interpretability analysis;

[0097] Furthermore, the input text is encoded using a pre-trained multilingual encoder XLM-R. For each input text, regardless of language, contextual information is extracted through a Transformer structure to generate an initial embedding vector h. The initial embedding vector is normalized to ensure the comparability of different texts in numerical range. The initial embedding vector h of semantic representation generated by the multi-level context-aware semantic recognition module is shared with the cross-language semantic alignment module and used as the basic input for subsequent cross-language mapping.

[0098] Construct a bidirectional mapping matrix:

[0099] For language A and language B, two linear mapping matrices W are set up respectively. AB and W BA ;

[0100] Text embedding h for language A A The projected representation z is obtained through linear transformation. A =W AB ·h A ;

[0101] For text embedding h in language B B The projected representation z is obtained through linear transformation. B =W BA ·h B ;

[0102] To ensure mapping consistency, a reconstruction mechanism is introduced, namely, through back projection W. BA z A Mapped back to the original space and associated with h A Comparison, and vice versa; helps networks learn more robust cross-linguistic semantic correspondences;

[0103] Construction of positive and negative sample pairs:

[0104] Positive sample pairs: Utilize known translation pairs or semantically equivalent text pairs in the corpus, such as sentences (x, y), where x belongs to language A and y belongs to language B;

[0105] Negative sample pairs: Other text embeddings that have no semantic relation to positive samples are randomly selected from the same batch as negative samples;

[0106] Similarity calculation and comparison loss:

[0107] The similarity between projected vectors is calculated using cosine similarity, and the formula is as follows:

[0108]

[0109] The InfoNCE loss function is used to compare and learn positive and negative samples. The loss function is defined as follows:

[0110]

[0111] Where τ is the temperature parameter, and N represents all candidate negative samples in the current batch;

[0112] The above contrastive learning mechanism is used for both language A to language B and language B to language A, while updating W. AB With W BA A matrix ensures the consistency and robustness of bidirectional semantic projection.

[0113] The entire model is trained using the Adam optimizer, and the backpropagation algorithm is used to adjust the contrastive learning loss function with respect to W. AB W BA The gradients of some multilingual encoder parameters are calculated and the parameters are updated. To prevent overfitting, an L2 regularization strategy is adopted. During the training process, dynamic negative sample mining technology is combined to ensure the diversity and difficulty of negative samples in each batch, thereby improving the model's discrimination ability.

[0114] The semantic representation h generated by the multi-level context-aware semantic recognition module is passed as input to the cross-language semantic alignment module. After bidirectional semantic projection and contrastive learning training, the output cross-language semantic representation z is shared with the original semantic representation and can be called by the subsequent semantic reasoning module.

[0115] The effectiveness of cross-lingual semantic alignment is evaluated using a validation set, with metrics including matching accuracy, recall, and F1 score. Simultaneously, the mapping effect is evaluated by calculating the mean cosine similarity difference between positive and negative samples. If the evaluation metrics are lower than expected, the semantic reasoning module can detect abnormal logic in the cross-lingual mapping results and pass the information to the cross-lingual module through a feedback mechanism to assist in further optimizing the projection matrix and contrastive learning parameters.

[0116] Please see Figure 1 The present invention provides an embodiment of a natural language semantic recognition system for linguistics, comprising: a data acquisition and preprocessing module, a semantic recognition core engine, an interactive optimization module, and an API interface module;

[0117] The data acquisition and preprocessing module is used to collect text data in multiple languages ​​and to clean, convert, and standardize the data.

[0118] The semantic recognition core engine performs semantic encoding, contextual analysis, semantic disambiguation, and cross-language alignment tasks based on the natural language semantic recognition model.

[0119] The interactive optimization module provides a user interface that allows users to manually correct the semantic annotation results of the model and update the model weights through an active learning strategy.

[0120] The API interface module is used to provide semantic recognition services to external applications;

[0121] The API interface module also provides:

[0122] Semantic query interface: used to perform semantic parsing on input text and return structured semantic data;

[0123] Cross-language translation interface: Provides automatic translation results through cross-language semantic alignment technology;

[0124] Semantic search interface: Optimizes the relevance of information retrieval based on deep semantic understanding;

[0125] Furthermore, the data acquisition and preprocessing module collects text in multiple languages, performs data cleaning and format conversion, word segmentation, part-of-speech tagging, and dependency analysis, generating a standardized data preprocessing package. The semantic recognition core engine inputs the preprocessing package and performs semantic encoding at the word, sentence, paragraph, and text levels. It then calls the semantic disambiguation optimization module for contextual analysis and disambiguation, and uses bidirectional mapping and contrastive learning for cross-language semantic alignment. Simultaneously, the semantic reasoning module performs logical reasoning on the recognition results and provides feedback adjustment information. Users can manually correct the semantic annotation results through an interactive interface, and the feedback data is sent to the active learning module. The model weight updates are fed back to the semantic recognition core engine. External applications call the semantic query, cross-language translation, and semantic search API interfaces. The system calls various internal modules to process the requests and returns structured semantic data, translation results, or search results.

[0126] In terms of working principle, the system first collects, cleans, converts, and standardizes multilingual texts through the data acquisition and preprocessing module, generating a preprocessed data package containing information such as word segmentation, part-of-speech tagging, and dependency syntax trees. Subsequently, the semantic recognition core engine calls a multi-level context-aware model. This model uses static and dynamic word vector fusion, bidirectional LSTM combined with self-attention, dependency syntax, and graph neural networks at the word level, sentence level, paragraph level, and text level, respectively, to achieve comprehensive encoding and context analysis of the deep semantics of the text.

[0127] For words with polysemy, the system utilizes a reinforcement learning-driven semantic disambiguation optimization module. This module constructs a state space, samples candidate semantics, designs a reward function, and employs a policy gradient algorithm to adjust the disambiguation strategy in real time, ensuring the selection of the optimal semantics within the context. Simultaneously, the cross-lingual semantic alignment module maps texts from different languages ​​to the same semantic space through a pre-trained multilingual encoder, bidirectional linear mapping, and contrastive learning, achieving semantic equivalence and guaranteeing consistency in multilingual semantic recognition.

[0128] The system's semantic reasoning module combines knowledge graphs to perform logical reasoning and automatic incompleteness analysis on the identified semantic relationships. At the same time, the reasoning results are fed back to the semantic recognition core engine to further optimize the semantic representation. Users can manually correct the semantic annotation results through the interactive optimization module. The active learning strategy continuously updates the model weights. Finally, through the API interface module, the system provides services such as semantic parsing, cross-language translation, and semantic search to external applications in the form of structured data, realizing closed-loop feedback and continuous optimization.

[0129] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.

Claims

1. A natural language semantic recognition model for linguistics, comprising a multi-level context-aware semantic recognition module, characterized in that: The multi-level context-aware semantic recognition module receives the preprocessed data output by the text preprocessing module and adjusts the semantic weights under the guidance of the disambiguation optimization module. The semantic disambiguation optimization module obtains polysemous candidate semantics from the multi-level context-aware semantic recognition module and optimizes the disambiguation strategy through a reward mechanism. The semantic disambiguation optimization module adopts a reinforcement learning policy network and uses a policy gradient algorithm to adjust the network weights according to the degree of matching between the predicted semantics and the real labels. The multi-level context-aware semantic recognition module is used to extract semantic features from multiple context levels. The multi-level context-aware semantic recognition module includes: Word-level semantic encoding unit: Based on the fusion of static word vectors and context-based dynamic word vectors, semantic representations are generated, and the ability to understand polysemous words is optimized through sub-word-level semantic decomposition; Sentence-level semantic encoding unit: A bidirectional long short-term memory network combined with a self-attention mechanism is used to calculate syntactic structure and semantic relations, and a dependency syntax tree is further used to adjust attention weights to optimize long sentence parsing; Paragraph-level and text-level context modeling units: Based on graph neural networks, a cross-sentence context information network for long texts is constructed, and a hierarchical attention mechanism is used to extract global semantic features.

2. The natural language semantic recognition model for linguistics according to claim 1, characterized in that: The text preprocessing module is used to standardize the input data and transmit the results of word segmentation, part-of-speech tagging, and dependency relation analysis to the multi-level context-aware semantic recognition module. The text preprocessing module includes: Formatting unit: Used to unify the encoding format of input text, convert special characters, and perform text denoising; Word segmentation unit: Achieving efficient word segmentation based on sub-word decomposition; Part-of-speech tagging unit: The BiLSTM-CRF model is used to perform part-of-speech tagging on the text, and the tagging results are used to optimize syntactic analysis; Dependency parsing unit: Uses Biaffine Parser to generate dependency syntax trees, providing hierarchical information for modeling syntactic structures.

3. The natural language semantic recognition model for linguistics according to claim 1, characterized in that: The word-level semantic coding unit includes: Static word vector generation unit: Constructs preliminary word vectors based on FastText and enhances semantic features using pre-trained embeddings; Dynamic word vector optimization unit: Uses Transformer structure to generate context-sensitive dynamic word vectors, enhancing semantic modeling capabilities; Polysemous word disambiguation unit: Combines semantic clustering methods to optimize the vector representation of synonyms and polysemous words.

4. The natural language semantic recognition model for linguistics according to claim 1, characterized in that: The sentence-level semantic coding unit includes: Bidirectional LSTM semantic coding unit, used to capture bidirectional contextual information of text; Dependency-enhanced paradigms utilize syntactic analysis results to optimize attention distribution, giving core components a higher weight in semantic modeling. The global context adjustment unit optimizes the semantic connection between sentences by combining paragraph-level contextual information.

5. A natural language semantic recognition model for linguistics according to claim 1, characterized in that: The paragraph-level and text-level context modeling units employ a hierarchical attention mechanism to construct cross-sentence contextual relationships and optimize global semantic modeling through graph neural networks.

6. A natural language semantic recognition model for linguistics according to claim 1, characterized in that: The semantic disambiguation optimization module obtains polysemous candidate semantics from the multi-level context-aware semantic recognition module and optimizes the disambiguation strategy through a reward mechanism. The semantic disambiguation optimization module adopts a reinforcement learning policy network and uses a policy gradient algorithm to adjust the network weights according to the degree of matching between the predicted semantics and the real labels.

7. A natural language semantic recognition model for linguistics according to claim 1, characterized in that: The natural language semantic recognition model also includes a cross-language semantic alignment module for cross-language semantic mapping, which combines bidirectional semantic projection and contrastive learning to optimize the semantic equivalence calculation of multilingual texts and shares semantic representations with the multi-level context-aware semantic recognition module. The cross-language semantic alignment module uses a contrastive learning method to optimize cross-language semantic mapping.

8. A natural language semantic recognition model for linguistics according to claim 1, characterized in that: The natural language semantic recognition model also includes a semantic reasoning module, which feeds back reasoning adjustment information to the multi-level context-aware semantic recognition module. The semantic reasoning module combines knowledge graphs to perform logical reasoning on semantic relationships, automatically completes and verifies semantic relationships through reasoning networks, and provides interpretability analysis.

9. A natural language semantic recognition system for linguistics, applicable to the natural language semantic recognition model for linguistics as described in any one of claims 1-8, characterized in that: The system includes: a data acquisition and preprocessing module, a semantic recognition core engine, an interactive optimization module, and an API interface module; The data acquisition and preprocessing module is used to collect text data in multiple languages ​​and to clean, convert, and standardize the data. The semantic recognition core engine performs semantic encoding, contextual analysis, semantic disambiguation, and cross-language alignment tasks based on the natural language semantic recognition model. The interactive optimization module provides a user interface that allows users to manually correct the semantic annotation results of the model and update the model weights through an active learning strategy. The API interface module is used to provide semantic recognition services to external applications.

10. A natural language semantic recognition system for linguistics according to claim 9, characterized in that: The API interface module also provides: Semantic query interface: used to perform semantic parsing on input text and return structured semantic data; Cross-language translation interface: Provides automatic translation results through cross-language semantic alignment technology; Semantic Search Interface: Optimizes the relevance of information retrieval based on deep semantic understanding.

Citation Information

Patent Citations

  • A Text Recognition Method and System Based on Natural Language Semantic Analysis

    CN117010409B

  • Full-text retrieval system based on two-level semantic analysis

    CN103136352A

  • Visual data processing method based on cloud server

    CN118626637A