A Heterogeneous Dual-Stream Chinese Memory Reasoning Method Based on Dynamic Adjustment of Semantic Confidence
The heterogeneous dual-stream Chinese memory inference method with dynamic adjustment of semantic confidence solves the problems of hidden state confusion and high computational complexity when large language models process long Chinese texts, and achieves more efficient and accurate processing of long Chinese texts.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ANYISHANG (SHENZHEN) TECH CO LTD
- Filing Date
- 2026-02-09
- Publication Date
- 2026-05-26
AI Technical Summary
Existing large language models suffer from high hidden state confusion rates and high computational complexity when processing long Chinese texts, especially when dealing with similar-looking characters and long texts, where they are inefficient.
A heterogeneous dual-stream Chinese memory reasoning method based on dynamic adjustment of semantic confidence is adopted. By adjusting the weights of the glyph features and context semantic vectors of Chinese characters through semantic mapping table and gating mechanism, combined with state space model and attention correction mechanism, the fused representation of Chinese characters is dynamically generated, and the calculation process is optimized by cross attention calculation.
It effectively distinguishes between similar-looking characters, reduces computational complexity and power consumption, and improves the efficiency and accuracy of long Chinese text processing, especially performing exceptionally well when processing abstract words.
Smart Images

Figure CN122088694A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural language processing and large model architecture optimization in artificial intelligence, and particularly to a heterogeneous dual-stream Chinese memory reasoning method based on dynamic regulation of semantic confidence. Background Art
[0002] Large language models, abbreviated as LLM, refer to deep learning models trained with a large amount of text data, enabling the models to generate natural language text or understand the meaning of language text. These models can provide in-depth knowledge and language production on various topics through training on a vast dataset. The core idea is to learn the patterns and structures of natural language through large-scale unsupervised training, and to simulate the human language cognition and generation process to a certain extent.
[0003] The current large language models face the following problems when processing long Chinese contexts: 1. Memory blur problem of efficient models: Although the architecture based on the state space model can process ultra-long sequences with linear time complexity, its internal hidden state is a lossy compression of historical information. When processing Chinese characters with similar shapes such as "己 / 已 / 巳", the confusion rate of hidden states is relatively high, and it is unable to effectively distinguish characters with similar shapes; 2. Computational power waste problem of high-precision models: Models based on the attention mechanism such as Transformer can accurately model semantics, but their computational complexity grows quadratically with the sequence length. The inference takes a long time. Existing hybrid architectures such as Jamba adopt static layer stacking, with a relatively high proportion of activation parameters in the attention layer and higher computational power consumption. Summary of the Invention
[0004] To solve the technical problems in the background art, the present invention proposes a heterogeneous dual-stream Chinese memory reasoning method based on dynamic regulation of semantic confidence.
[0005] The heterogeneous dual-stream Chinese memory reasoning method based on dynamic regulation of semantic confidence proposed by the present invention includes the following steps: S1. Obtain the long Chinese text to be processed input by the user; As an illustration, the long Chinese text to be processed is, for example, legal consultation documents, medical documents, policy documents, etc.; Establish the association relationship between Chinese character components, the deformation forms corresponding to the Chinese character components, and the semantic directions of the Chinese character components to form a semantic mapping table; Assign a set of low-rank adaptation parameters to each Chinese character component; For illustration, multiple Chinese character components are those recorded in existing publicly available Chinese character standard documents, and the existing publicly available Chinese character standard documents are "General Standard Chinese Characters Table" and "Specifications for Components of Commonly Used Chinese Characters in Modern Chinese"; the semantic directions of Chinese character components can be obtained by referring to existing publicly available resources such as the National Language Commission's Chinese character semantic knowledge base, Cilin components, and semantic association research, so as to obtain the semantic direction of each Chinese character component; for example, the "person" component corresponds to the semantic direction of [human, human form association], and the "氵" component corresponds to the semantic direction of [water, liquid association]. Generate the fusion representation of each Chinese character in the to-be-processed long Chinese text according to the semantic mapping table. S2. Generate the semantic confidence score for each Chinese character according to the fusion representation of each Chinese character. S3. When the semantic confidence score of a certain Chinese character is lower than the preset threshold, obtain the text within the preset length context window where the Chinese character is located as the target text; if there is a logical trigger word in the target text, then trigger the execution of the attention-based correction mechanism to obtain the corrected vector representation for the target text. S4. When the semantic confidence score of a certain Chinese character is lower than the preset threshold, obtain one, two or more Chinese character components corresponding to the Chinese character as the target Chinese character components; obtain a set of low-rank adaptation parameters corresponding to each target Chinese character component; update a set of low-rank adaptation parameters corresponding to each target Chinese character component according to the corrected vector representation of the target text.
[0006] Preferably, generate the fusion representation of each Chinese character in the to-be-processed long Chinese text as follows: According to the semantic mapping table, for the to-be-processed long Chinese text, match the glyph of each Chinese character in the to-be-processed long Chinese text with the deformed form corresponding to the Chinese character component in the semantic mapping table to obtain the Chinese character component and the semantic direction of the Chinese character component for each Chinese character in the to-be-processed long Chinese text. For each Chinese character in the to-be-processed long Chinese text, extract the glyph feature vector of each Chinese character through a convolutional neural network. For each Chinese character in the to-be-processed long Chinese text, extract the context semantic vector of each Chinese character through a context encoder. Obtain the fusion weight of each Chinese character through a gating mechanism, use the fusion weight of each Chinese character as the weight of the glyph feature vector of each Chinese character, and use 1 minus the fusion weight of each Chinese character as the weight of the context semantic vector of each Chinese character. For one of the Chinese characters, use the sum of the product of the glyph feature vector of the Chinese character and the weight of the glyph feature vector of the Chinese character and the product of the context semantic vector of the Chinese character and the weight of the context semantic vector of the Chinese character as the fusion representation of the Chinese character.
[0007] Preferably, generate the semantic confidence score for each Chinese character according to the fusion representation of each Chinese character as follows: For the fusion representation of each Chinese character, the hidden state vector of each Chinese character is obtained through the state space model; The fused representation of each Chinese character is mapped using a nonlinear transformation function to obtain the mapped feature vector of each Chinese character; The feature vector mapped to each Chinese character is concatenated with the latent state vector of each Chinese character to obtain the combined vector of each Chinese character. A linear transformation is performed on the combined vector of each Chinese character to obtain the new hidden state vector of each Chinese character. For a given Chinese character, obtain the sample variance of the new hidden state vector corresponding to the character across all feature dimensions; based on the sample variance, obtain the semantic confidence score of the Chinese character through a normalization function; Obtain the semantic confidence score for each Chinese character; As an explanation, each Chinese character is a token, and a token is the input object of the state-space model.
[0008] Preferably, in step S3, a logic trigger word library is obtained, which includes logic trigger words; logic trigger words are extracted from the logic trigger word library to form a logic trigger word set; If logical trigger words exist in the target text, the following applies: The target text is matched with the logical trigger words in the set of logical trigger words. If the semantic similarity between the target text and the logical trigger words in the set of logical trigger words is not lower than the set threshold, then the attention-based correction mechanism is triggered. As an explanation, the logical trigger words extracted from the logical trigger word library to form a set of logical trigger words are pre-configured according to task requirements. The logical trigger words include why, basis, confirmation, judgment, and analysis. The semantic subgraph is constructed by clustering the retrieved triples based on a cosine similarity of not less than 0.8; The computational complexity of the reflexive flow is linearly related to the size of the semantic subgraph, with a linearity coefficient not exceeding 0.1. As an explanation, the preset length in the preset length context window can be defined as a fixed number of words or up to the sentence boundary, depending on the actual design.
[0009] Preferably, the attention-based correction mechanism is as follows: Obtain the external memory of the graph structure, which includes triples; As an explanation, a triple is constructed in the form of "entity-relationship-entity"; Retrieve triples whose cosine similarity to the target text is not lower than a preset threshold from the external memory of the graph structure as target triples; Cluster the target triples to construct a semantic subgraph, where the number of nodes in the semantic subgraph does not exceed N, where N is a positive integer; Obtain the new hidden state vector of each Chinese character in the target text, and form a query sequence by arranging the new hidden state vectors of each Chinese character in the target text according to the order of each Chinese character in the target text; Transform the semantic subgraph into a set of vector representations as a key sequence and a value sequence; Using the query sequence, key sequence, and value sequence as input, a cross-attention mechanism is used to perform cross-attention calculation, resulting in a corrected semantic representation vector as the correction result. The query sequence is formed by combining the new hidden state vectors of each Chinese character in the target text, and the vector representations of each semantic unit in the semantic subgraph are combined into a key sequence and a value sequence. Cross-attention calculation is then performed to obtain the corrected vector representation for the target text.
[0010] Preferably, when the semantic confidence score of a certain Chinese character is lower than a preset threshold, one, two, or more Chinese character components corresponding to that character are obtained as target Chinese character components; a set of low-rank adaptation parameters corresponding to each target Chinese character component is obtained; and the set of low-rank adaptation parameters corresponding to each target Chinese character component is updated according to the corrected vector representation of the target text, as follows: Obtain the vector representation of each triple in the semantic subgraph; The mean cosine similarity between the corrected vector representation of the target text and the vector representation of each triple in the semantic subgraph is obtained as the target confidence score. When the semantic confidence score of a certain Chinese character is lower than a preset threshold, one, two or more Chinese character components corresponding to that Chinese character are obtained as target Chinese character components; the new hidden state vector corresponding to that Chinese character is obtained as the target new hidden state vector; Obtain a set of low-rank adaptation parameters corresponding to each target Chinese character component; As an explanation, when the semantic confidence score of a certain Chinese character is lower than a preset threshold, the number of Chinese character components corresponding to that Chinese character is obtained as target Chinese character components.
[0011] The difference between the corrected vector representation and the target new hidden state vector is obtained as the loss function; the target confidence is used as the weighting coefficient of the loss function, and the weighting coefficient is multiplied by the loss function to obtain the weighted loss. The stochastic gradient descent method is used to update a set of low-rank adaptation parameters corresponding to each target Chinese character component, with the weighted loss as the optimization objective.
[0012] Preferably, the method further includes: converting the modified vector representation of the target text into triples and writing them into the graph structure external memory; to update the graph structure external memory.
[0013] The heterogeneous dual-stream Chinese memory reasoning method based on dynamic adjustment of semantic confidence proposed in this invention has the following beneficial technical effects: 1. This application uses a semantic mapping table and a gating mechanism to dynamically adjust the weights of the glyph feature vector and the context semantic vector of each Chinese character in order to generate a fused representation of each Chinese character, thereby more effectively distinguishing similar-looking characters and more accurately processing abstract words.
[0014] 2. A latent state vector for each Chinese character is generated using a state-space model. The fused representation of each character is mapped using a nonlinear transformation function to obtain the mapped feature vector. The mapped feature vectors of each character are concatenated with the latent state vectors of each character to obtain a concatenated combined vector. A linear transformation is then performed on the concatenated combined vector to obtain a new latent state vector for each character. The semantic confidence score of each character is calculated to provide a stable and reproducible dynamic control signal. A heterogeneous dual-stream architecture is formed through the state-space model and an attention-based correction mechanism, in which the state-space model continuously generates the latent state vectors of each character. The attention correction mechanism is activated when the semantic confidence score of a Chinese character is lower than a preset threshold and a logical trigger word is detected in the target text. It retrieves triples with a cosine similarity to the target text that is not lower than a preset threshold from the external memory of the graph structure as target triples. The target triples are clustered to construct a semantic subgraph. Cross-attention calculation is performed on the semantic subgraph to obtain the corrected vector representation for the target text. Since the number of nodes in the semantic subgraph is limited, this correction process significantly reduces the computational cost compared to the global attention calculation of the Transformer model or static hybrid architecture such as Jamba in the same text processing scenario. 3. By updating a set of low-rank adaptation parameters corresponding to each target Chinese character component, the storage and computing overhead is greatly reduced, and the accidental interference or damage to other mastered abilities is effectively avoided when updating individual knowledge. Attached Figure Description
[0015] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation
[0016] Embodiments of the present invention are described in detail below. Examples of these embodiments are illustrated in the accompanying drawings, wherein the same or similar symbols denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0017] like Figure 1 The heterogeneous dual-stream Chinese memory reasoning method based on dynamic adjustment of semantic confidence, as shown, includes the following steps: S1. Obtain the long Chinese text to be processed input by the user; For illustration, the long Chinese text to be processed is, for example, legal consultation documents, medical documents, policy documents, etc.; Obtain multiple Chinese character components, the deformation forms corresponding to the Chinese character components, and the semantic directions of the Chinese character components; Establish the association relationship among the Chinese character components, the deformation forms corresponding to the Chinese character components, and the semantic directions of the Chinese character components, and form a semantic mapping table; Assign a set of low-rank adaptation parameters to each Chinese character component; In an optional embodiment, the rank of the low-rank adaptation parameters is 8; For illustration, the multiple Chinese character components are the Chinese character components recorded in the existing publicly available Chinese character specification documents, and the existing publicly available Chinese character specification documents are "General Standard Chinese Character Table" and "Specification of Components of Commonly Used Chinese Characters in Modern Chinese"; the semantic directions of the Chinese character components can be obtained by referring to existing publicly available resources such as the Chinese Character Semantic Knowledge Base of the National Language Commission, the components in Cilin, and semantic association research; for example, the "person" component corresponds to the semantic direction of [human, human form association], and the "氵" component corresponds to the semantic direction of [water, liquid association]; In an optional embodiment, the number of Chinese character components is 214; Generate the fusion representation of each Chinese character in the long Chinese text to be processed according to the semantic mapping table; Generate the fusion representation of each Chinese character in the long Chinese text to be processed according to the semantic mapping table, as follows; According to the semantic mapping table, for the long Chinese text to be processed, match the glyph of each Chinese character in the long Chinese text to be processed with the deformation form corresponding to the Chinese character component in the semantic mapping table to obtain the Chinese character component and the semantic direction of the Chinese character component of each Chinese character in the long Chinese text to be processed; For each Chinese character in the long Chinese text to be processed, extract the glyph feature vector of each Chinese character through a convolutional neural network; For each Chinese character in the long Chinese text to be processed, extract the context semantic vector of each Chinese character through a context encoder; Obtain the fusion weight of each Chinese character through a gating mechanism, use the fusion weight of each Chinese character as the weight of the glyph feature vector of each Chinese character, and use 1 minus the fusion weight of each Chinese character as the weight of the context semantic vector of each Chinese character; For one of the Chinese characters, use the sum of the product of the glyph feature vector of the Chinese character and the weight of the glyph feature vector of the Chinese character and the product of the context semantic vector of the Chinese character and the weight of the context semantic vector of the Chinese character as the fusion representation of the Chinese character; S2. Generate the semantic confidence score for each Chinese character according to the fusion representation of each Chinese character; Generate the semantic confidence score for each Chinese character according to the fusion representation of each Chinese character, as follows: For the fusion representation of each Chinese character, the hidden state vector of each Chinese character is obtained through the state space model; The fused representation of each Chinese character is mapped using a nonlinear transformation function to obtain the mapped feature vector of each Chinese character; The feature vector mapped to each Chinese character is concatenated with the latent state vector of each Chinese character to obtain the combined vector of each Chinese character. A linear transformation is performed on the combined vector of each Chinese character to obtain the new hidden state vector of each Chinese character. For a given Chinese character, obtain the sample variance of the new hidden state vector corresponding to the character across all feature dimensions; based on the sample variance, obtain the semantic confidence score of the Chinese character through a normalization function; Obtain the semantic confidence score for each Chinese character; As an illustration, in an optional embodiment, a Chinese character is equivalent to a Token, and the Token is the input object of the state-space model; S3. When the semantic confidence score of a certain Chinese character is lower than the preset threshold, the text in the preset length context window containing the Chinese character is obtained as the target text; if there is a logical trigger word in the target text, the attention-based correction mechanism is triggered to obtain the correction vector representation for the target text. In S3, the logic trigger word library is obtained, which includes logic trigger words; logic trigger words are extracted from the logic trigger word library to form a logic trigger word set. If logical trigger words exist in the target text, the following applies: The target text is matched with the logical trigger words in the set of logical trigger words. If the semantic similarity between the target text and the logical trigger words in the set of logical trigger words is not lower than the set threshold, then the attention-based correction mechanism is triggered. In an optional embodiment, the semantic similarity threshold is set to 0.85; As an explanation, the logical trigger words extracted from the logical trigger word library to form a set of logical trigger words are pre-configured according to task requirements. The logical trigger words include why, basis, confirmation, judgment, and analysis. The semantic subgraph is constructed by clustering the retrieved triples based on a cosine similarity of not less than 0.8; The computational complexity of the reflexive flow is linearly related to the size of the semantic subgraph, with a linearity coefficient not exceeding 0.1. In one embodiment, the preset threshold is 0.7; As an explanation, the preset length in the preset length context window can be defined as a fixed number of words or up to the sentence boundary, depending on the actual design. The attention-based correction mechanism is as follows: Obtain the external memory of the graph structure, which includes triples; As an explanation, a triple is constructed in the form of "entity-relationship-entity"; Retrieve triples whose cosine similarity to the target text is not lower than a preset threshold from the external memory of the graph structure as target triples; Cluster the target triples to construct a semantic subgraph, where the number of nodes in the semantic subgraph does not exceed N, where N is a positive integer; In an optional embodiment, when a triplet with a cosine similarity of not less than a preset threshold to the target text is obtained from the external memory of the graph structure as the target triplet, the preset threshold for cosine similarity is 0.8. In an optional embodiment, N is 64; Obtain the new hidden state vector of each Chinese character in the target text, and form a query sequence by arranging the new hidden state vectors of each Chinese character in the target text according to the order of each Chinese character in the target text; Transform the semantic subgraph into a set of vector representations as a key sequence and a value sequence; Using the query sequence, key sequence, and value sequence as input, a cross-attention mechanism is used to perform cross-attention calculation, resulting in a corrected semantic representation vector as the correction result. The query sequence is formed by combining the new hidden state vector of each Chinese character in the target text, and the vector representation of each semantic unit in the semantic subgraph is formed into a key sequence and a value sequence. Cross attention calculation is performed to obtain the corrected vector representation for the target text. S4. When the semantic confidence score of a certain Chinese character is lower than the preset threshold, obtain one, two or more Chinese character components corresponding to that Chinese character as target Chinese character components; obtain a set of low-rank adaptation parameters corresponding to each target Chinese character component; update the set of low-rank adaptation parameters corresponding to each target Chinese character component according to the corrected vector representation of the target text.
[0018] When the semantic confidence score of a certain Chinese character is lower than a preset threshold, one, two, or more Chinese character components corresponding to that character are obtained as target Chinese character components; a set of low-rank adaptation parameters corresponding to each target Chinese character component is obtained; based on the corrected vector representation of the target text, the set of low-rank adaptation parameters corresponding to each target Chinese character component is updated as follows: Obtain the vector representation of each triple in the semantic subgraph; The mean cosine similarity between the corrected vector representation of the target text and the vector representation of each triple in the semantic subgraph is obtained as the target confidence score. When the semantic confidence score of a certain Chinese character is lower than a preset threshold, one, two or more Chinese character components corresponding to that Chinese character are obtained as target Chinese character components; the new hidden state vector corresponding to that Chinese character is obtained as the target new hidden state vector; Obtain a set of low-rank adaptation parameters corresponding to each target Chinese character component; As an explanation, when the semantic confidence score of a certain Chinese character is lower than a preset threshold, the number of Chinese character components corresponding to that Chinese character is obtained as target Chinese character components.
[0019] The difference between the corrected vector representation and the target new hidden state vector is obtained as the loss function; the target confidence is used as the weighting coefficient of the loss function, and the weighting coefficient is multiplied by the loss function to obtain the weighted loss. The stochastic gradient descent method is used to update a set of low-rank adaptation parameters corresponding to each target Chinese character component, with the weighted loss as the optimization objective. It also includes: converting the modified vector representation of the target text into triples and writing them into the graph structure external memory; in order to update the graph structure external memory.
[0020] This application employs a semantic mapping table and a gating mechanism to dynamically adjust the weights of the glyph feature vector and the context semantic vector of each Chinese character in order to generate a fused representation of each Chinese character, thereby more effectively distinguishing similar-looking characters and more accurately processing abstract words.
[0021] The system generates a latent state vector for each Chinese character using a state-space model. The fused representation of each character is mapped using a nonlinear transformation function to obtain a mapped feature vector. This mapped feature vector is then concatenated with the latent state vector of each character to obtain a concatenated combined vector. A linear transformation is then applied to this combined vector to obtain a new latent state vector for each character. The system also calculates the semantic confidence score for each character, providing a stable and reproducible dynamic control signal. A heterogeneous dual-stream architecture is formed through the state-space model and an attention-based correction mechanism, in which the state-space model continuously generates the latent state vector for each Chinese character. The attention correction mechanism is activated when the semantic confidence score of a Chinese character is lower than a preset threshold and a logical trigger word is detected in the target text. It then retrieves triples with a cosine similarity to the target text that is not lower than a preset threshold from the external memory of the graph structure as target triples. The target triples are clustered to construct a semantic subgraph. Cross-attention calculation is performed on the semantic subgraph to obtain a corrected vector representation for the target text. Since the number of nodes in the semantic subgraph is limited, this correction process significantly reduces computational power consumption compared to the global attention calculation of the Transformer model or static hybrid architecture such as Jamba in the same text processing scenario. By updating a set of low-rank adaptation parameters corresponding to each target Chinese character component, the storage and computational overhead is greatly reduced, and the accidental interference or damage to other mastered abilities is effectively avoided when updating individual knowledge.
[0022] This method is applicable to scenarios such as legal consultation, medical document analysis, and policy interpretation.
[0023] For clarification, "acquisition" in this application refers to obtaining the required content or data using existing technical means.
[0024] Furthermore, any content not described in detail in this specification is existing technology known to those skilled in the art.
[0025] In the embodiments provided by this invention, it should be understood that the disclosed system or method can be implemented in other ways. For example, the embodiments of the invention described above are merely illustrative; for instance, the division of modules is only a logical functional division, and there may be other division methods in actual implementation.
[0026] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0027] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated module can be implemented in hardware or in the form of hardware plus software functional modules.
[0028] For those skilled in the art, it is obvious that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the basic characteristics of the present invention.
[0029] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A heterogeneous dual-stream Chinese memory reasoning method based on dynamic adjustment of semantic confidence, characterized in that, Includes the following steps: S1. Obtain the long Chinese text to be processed input by the user; establish the association relationship between Chinese character components, the corresponding deformation forms of Chinese character components, and the semantic direction of Chinese character components to form a semantic mapping table; assign a set of low-rank adaptation parameters to each Chinese character component; generate the fused representation of each Chinese character in the long Chinese text to be processed according to the semantic mapping table. S2. Generate the semantic confidence score for each Chinese character based on the fused representation of each Chinese character; S3. When the semantic confidence score of a certain Chinese character is lower than the preset threshold, the text in the preset length context window containing the Chinese character is obtained as the target text. If a logical trigger word exists in the target text, an attention-based correction mechanism is triggered to obtain a corrected vector representation for the target text. S4. When the semantic confidence score of a certain Chinese character is lower than the preset threshold, obtain one, two or more Chinese character components corresponding to that Chinese character as target Chinese character components; obtain a set of low-rank adaptation parameters corresponding to each target Chinese character component; update the set of low-rank adaptation parameters corresponding to each target Chinese character component according to the corrected vector representation of the target text.
2. The heterogeneous dual-stream Chinese memory reasoning method based on dynamic adjustment of semantic confidence as described in claim 1, characterized in that, Based on the semantic mapping table, the fused representation of each Chinese character in the long Chinese text to be processed is generated as follows; Based on the semantic mapping table, for the long Chinese text to be processed, the glyph of each Chinese character in the long Chinese text to be processed is matched with the shape transformation form of the Chinese character component in the semantic mapping table to obtain the Chinese character component and the semantic direction of the Chinese character component for each Chinese character in the long Chinese text to be processed. For each Chinese character in a long Chinese text to be processed, a convolutional neural network is used to extract the glyph feature vector of each character; For each Chinese character in the long Chinese text to be processed, the context semantic vector of each Chinese character is extracted by the context encoder; The fusion weight of each Chinese character is obtained through a gating mechanism. The fusion weight of each Chinese character is used as the weight of the glyph feature vector of each Chinese character, and 1 minus the fusion weight of each Chinese character is used as the weight of the context semantic vector of each Chinese character. For any one of the Chinese characters, the fused representation of the Chinese character is the sum of the weights of its glyph feature vector and its context semantic vector.
3. The heterogeneous dual-stream Chinese memory reasoning method based on dynamic adjustment of semantic confidence as described in claim 2, characterized in that, Based on the fused representation of each Chinese character, a semantic confidence score for each character is generated as follows: For the fusion representation of each Chinese character, the hidden state vector of each Chinese character is obtained through the state space model; The fused representation of each Chinese character is mapped using a nonlinear transformation function to obtain the mapped feature vector of each Chinese character; The feature vector mapped to each Chinese character is concatenated with the latent state vector of each Chinese character to obtain the combined vector of each Chinese character. A linear transformation is performed on the combined vector of each Chinese character to obtain the new hidden state vector of each Chinese character. For a given Chinese character, obtain the sample variance of the new hidden state vector corresponding to the character across all feature dimensions; based on the sample variance, obtain the semantic confidence score of the Chinese character through a normalization function; Obtain the semantic confidence score for each Chinese character.
4. The heterogeneous dual-stream Chinese memory reasoning method based on dynamic adjustment of semantic confidence according to claim 3, characterized in that, In S3, the logic trigger word library is obtained, which includes logic trigger words; logic trigger words are extracted from the logic trigger word library to form a logic trigger word set. If logical trigger words exist in the target text, the following applies: The target text is matched with the logical trigger words in the set of logical trigger words. If the semantic similarity between the target text and the logical trigger words in the set of logical trigger words is not lower than the set threshold, then the attention-based correction mechanism is triggered. The semantic subgraph is constructed by clustering the retrieved triples based on a cosine similarity of not less than 0.8; The computational complexity of the reflexive flow is linearly related to the size of the semantic subgraph, with a linearity coefficient not exceeding 0.
1.
5. The heterogeneous dual-stream Chinese memory reasoning method based on dynamic adjustment of semantic confidence according to claim 4, characterized in that, The attention-based correction mechanism is as follows: Obtain the external memory of the graph structure, which includes triples; As an explanation, a triple is constructed in the form of "entity-relationship-entity"; Retrieve triples whose cosine similarity to the target text is not lower than a preset threshold from the external memory of the graph structure as target triples; Cluster the target triples to construct a semantic subgraph, where the number of nodes in the semantic subgraph does not exceed N, where N is a positive integer; Obtain the new hidden state vector of each Chinese character in the target text, and form a query sequence by arranging the new hidden state vectors of each Chinese character in the target text according to the order of each Chinese character in the target text; Transform the semantic subgraph into a set of vector representations as a key sequence and a value sequence; Using the query sequence, key sequence, and value sequence as input, a cross-attention mechanism is used to perform cross-attention calculation, resulting in a corrected semantic representation vector as the correction result. The query sequence is formed by combining the new hidden state vectors of each Chinese character in the target text, and the vector representations of each semantic unit in the semantic subgraph are combined into a key sequence and a value sequence. Cross-attention calculation is then performed to obtain the corrected vector representation for the target text.
6. The heterogeneous dual-stream Chinese memory reasoning method based on dynamic adjustment of semantic confidence according to claim 5, characterized in that, When the semantic confidence score of a certain Chinese character is lower than a preset threshold, one, two, or more Chinese character components corresponding to that character are obtained as target Chinese character components; a set of low-rank adaptation parameters corresponding to each target Chinese character component is obtained; based on the corrected vector representation of the target text, the set of low-rank adaptation parameters corresponding to each target Chinese character component is updated as follows: Obtain the vector representation of each triple in the semantic subgraph; The mean cosine similarity between the corrected vector representation of the target text and the vector representation of each triple in the semantic subgraph is obtained as the target confidence score. When the semantic confidence score of a certain Chinese character is lower than a preset threshold, one, two or more Chinese character components corresponding to that Chinese character are obtained as target Chinese character components; the new hidden state vector corresponding to that Chinese character is obtained as the target new hidden state vector; Obtain a set of low-rank adaptation parameters corresponding to each target Chinese character component; The difference between the corrected vector representation and the target new hidden state vector is obtained as the loss function; the target confidence is used as the weighting coefficient of the loss function, and the weighting coefficient is multiplied by the loss function to obtain the weighted loss. The stochastic gradient descent method is used to update a set of low-rank adaptation parameters corresponding to each target Chinese character component, with the weighted loss as the optimization objective.
7. The heterogeneous dual-stream Chinese memory reasoning method based on dynamic adjustment of semantic confidence according to claim 5, characterized in that, Also includes: The modified vector representation of the target text is converted into triples and written into the external memory of the graph structure; To update the external memory of the graph structure.