Enhanced question answering method based on agricultural large model training and RAG
Through a large-model training method based on the Transformer architecture, combined with polysemy disambiguation, regional language pattern enhancement, and entity-aware position encoding, the problems of terminology polysemy and regional difference adaptability in agricultural models in multi-source heterogeneous data processing are solved, achieving more efficient multi-task learning and data utilization.
Patent Information
- Application Number
- CN202511188422.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-25
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2045-08-25
AI Technical Summary
Existing large agricultural models have shortcomings in processing multi-source heterogeneous data, the ambiguity of agricultural terms, and adaptability to regional differences, resulting in insufficient information utilization and inaccurate semantic expression, making it difficult to achieve a balance in multi-task learning.
A large-scale model training method based on the Transformer architecture is adopted. Through the disambiguation of agricultural terminology, enhanced encoding of regional language patterns and location encoding of agricultural entity perception, combined with multi-granularity loss function optimization, deep fusion and dynamic word embedding of multi-source heterogeneous data are achieved, thereby improving the model's understanding and adaptability to complex agricultural data.
It significantly improves the agricultural model's ability to process multi-source heterogeneous data, solves the problems of terminology ambiguity and regional differences, achieves a more balanced multi-task learning effect, and improves the data utilization and semantic understanding accuracy of agricultural intelligent systems.
Smart Images

Figure CN120705282A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of artificial intelligence and agricultural big data, and in particular to a question-answering method based on large agricultural model training and RAG enhancement. Background Art
[0002] With the diversification and large-scale growth of agricultural production data, the agricultural sector has generated a vast amount of structured, semi-structured, and unstructured data, such as temperature and humidity data collected by sensors, agricultural yearbook reports, and scientific research papers. Traditional data processing and analysis methods are often limited to processing a single type of data and lack the effective integration of multi-source, heterogeneous data. Furthermore, the ambiguity of agricultural terminology and regional differences in dialects pose challenges to intelligent agricultural systems. In recent years, with the continuous development of deep learning technology, particularly the maturity of the Transformer architecture, many natural language processing models have been introduced to the agricultural sector. However, existing models still face challenges in handling complex agricultural data and tasks, such as term disambiguation, poor adaptability to regional differences, and insufficient knowledge coverage.
[0003] In modern agricultural production, massive amounts of agricultural data are generated in various forms, including sensor data such as temperature, humidity, and soil pH, agricultural meteorology and agricultural machinery data, pest and disease monitoring reports, and unstructured text data such as agricultural manuals and scientific research papers. This data provides important support for agricultural management, decision-making, and precision agriculture. However, traditional data processing and analysis methods primarily rely on a single type of data, resulting in limitations in data utilization and an inability to fully support the intelligent development needs of the agricultural sector. The existing large agricultural models have the following problems during training and application: 1. Traditional agricultural intelligent technologies mostly rely on a single type of data source, such as structured data or unstructured data, and lack effective fusion of multi-source heterogeneous data, resulting in insufficient information utilization; 2. Existing natural language processing methods are difficult to effectively handle the ambiguity of agricultural terms, especially the inability to flexibly adjust the semantic representation of terms according to different contexts or regional differences; 3. In existing technologies, many models cannot adapt to regional differences in the agricultural field, especially the processing of dialects and local terms often cannot correspond to standard terms, resulting in inaccurate semantic expression; 4. Many large agricultural models cannot balance the effects of fine-grained tasks (such as term recognition) and global tasks (such as document classification) when performing multi-task learning, resulting in unstable performance of the model between different tasks. Summary of the Invention
[0004] The purpose of the present invention is to overcome the shortcomings of the existing technology and provide a method based on agricultural large model training and RAG enhanced question answering to solve the shortcomings of the existing technology.
[0005] The object of the present invention is achieved through the following technical solution: a method based on agricultural large model training and RAG enhanced question answering, the method comprising: Step 1: Collect agricultural data and build a large agricultural model training dataset; Step 2: Form the Transformer input embedding by disambiguating agricultural terminology and initializing dynamic word embeddings, encoding regional language patterns, and encoding agricultural entity-aware locations. Finally, build a Transformer encoder to train a large model based on the Transformer architecture. Step 3: After the user enters the question text, the large model sequentially performs dynamic word embedding disambiguation, regional term replacement, and entity-aware position encoding to generate an enhanced representation of the input sequence. The Transformer encoder then extracts deep semantic features. The classification task directly outputs the predicted label, while the generation task uses the decoder to generate the answer word by word. Step 4: Combine the retrieval enhancement generation mechanism to perform RAG enhanced question answering.
[0006] The agricultural term polysemy disambiguation and dynamic word embedding initialization specifically include the following: A1. Constructing agricultural ontology graph: Constructing agricultural entity set as , set the semantic relationship set between entities to be , then the agricultural ontology map is ,in, represents the total number of agricultural entities, Indicates the agricultural entities, Represents the first agricultural entity, Represents the second agricultural entity, Indicates the agricultural entities; A2. Context-aware disambiguation: This method uses a bidirectional LSTM to encode the target word's local context window word sequence and generate a context vector. The cosine similarity between the target word and the pre-trained vectors of each entity in the agricultural ontology is calculated. After adjusting the similarity discrimination control coefficient, the vector is normalized using a natural exponential function to obtain the semantic similarity score between the target word and each entity. A3. Dynamic word embedding generation: Based on the semantic similarity scores of the target word's base word vector and each entity vector, a weighted sum is taken to obtain the entity vector fusion result. The fusion weight of the base word vector is calculated using the Sigmoid function. The base word vector and entity vector fusion results are added together according to the weights to generate a context-aware dynamic word embedding vector.
[0007] The regional language mode enhanced coding specifically includes the following contents: B1. Regional dictionary construction: Extract the mapping relationship between dialect terms and standard terms from agricultural yearbook materials and construct a dialect-standard term mapping table; B2. Bidirectional replacement mask generation: For each word in the input sentence, if there is a dialect term mapping, a standard term replacement mask value of 1 is generated, otherwise it is 0; B3. Fusion coding representation: The dynamic word embedding vector is concatenated with the masked weighted result of the standard term vector, and the trained fusion projection matrix and bias vector are linearly transformed to generate the regional enhanced word vector.
[0008] The agricultural entity perception position coding specifically includes the following contents: C1. Entity location tagging: Identify the locations of all agricultural entities in the input sequence and construct a location index set for each entity; C2. Relative distance matrix calculation: Calculate the shortest absolute distance from each word position to the position index set of each entity; C3. Entity-aware position coding generation: Based on the shortest distance matrix, the standard sinusoidal position coding of each entity is weighted by the distance attenuation factor, normalized and summed to generate an enhanced position coding vector.
[0009] The construction of the Transformer encoder specifically includes: D1. Building the base layer structure: Adopting a block-aggregation strategy, we capture intra-block features through local attention, implement inter-block interaction through a gating mechanism, and layer-by-layer fuse local and global representations. D2. Stacking: Repeated stacking of basic layer structures Second-rate, is the number of stacking layers, and the output of the stack is the context representation of the last layer encoder, which is achieved by repeatedly stacking the basic layer structure. Second, final The layer output is the result of the entire encoder, and the output feature of the last layer encoder is set to ; D3. Output: The output of the last layer encoder is used as the context representation of the document for classification tasks and is input to the decoder for generating answers.
[0010] The D1 specifically includes the following contents: D101, Semantic Chunking and Local Attention Calculation: Divide the input document into semantic chunks, calculate the projection of the query matrix, key matrix, and value matrix within each chunk, and generate local attention output through scaled dot product attention and normalized exponential function; D102, Global Attention Gating Aggregation: The average pooling of each local attention output is compressed into a block representation, weighted by hyperbolic tangent activation and sigmoid gating weight, and aggregated into a global document representation; D103, layer normalization and residual connection based on hierarchical weighted fusion: The local attention output and the global document representation are weighted and summed according to the hierarchical fusion coefficient, and then the residual connection is connected with the output feature of the previous layer. After layer normalization, the current layer feature is output. The output feature of the layer normalization and residual connection based on hierarchical weighted fusion is set to ; D104, Feedforward Neural Network: The feedforward neural network uses the standard Transformer feedforward neural network. The input is the layer-normalized output features based on hierarchical weighted fusion. The activation function of the feedforward neural network uses the ReLU activation function. D105, standard layer normalization and residual connection: layer normalization and residual connection adopt the standard layer normalization and residual connection of Transformer, the input is the output feature of the feedforward neural network, after layer normalization processing, Perform residual addition and output the output features of the current layer. Define the output features of layer normalization and residual connection based on hierarchical weighted fusion as .
[0011] The D3 specifically includes the following contents: D301, classification task: The first word vector of is input into the fully connected layer, and the classification result is generated by Softmax; D302, Generate Task: The decoder is fed into the Transformer decoder, which uses the encoder output as a key-value pair and the previous word as the query target, iteratively generating a sequence of answers. During the decoder training phase, the decoder input consists of the encoder output, the answer sequence offset input, and the self-attention mask; specifically, it includes the following: Encoder output: The contextual representation from the last encoder layer, i.e., the deep semantic features of the document, including dynamically disambiguated agricultural terms, regional standardized expressions, and entity spatial relationship information; Answer sequence offset input: Generate the answer sequence of the task based on the constructed training dataset , and shift it one position to the right, i.e. add a start mark at the starting position as the initial input of the decoder; Self-attention mask: ensures that each position only focuses on the generated left word during decoding to avoid information leakage; During the training phase, the decoder performs the following steps layer by layer: Masked self-attention layer: calculates the internal dependencies of the currently generated word sequence; Encoder-decoder attention layer: aligns the masked self-attention output with the encoder's contextual representation to focus on key information; Feedforward network with residual connection: fuses features and passes them to the next layer.
[0012] The training of the large model based on the Transformer architecture specifically includes the following: E1. Multi-granularity loss function optimization: A dual-granularity joint loss function is used to enhance semantic consistency learning through term-level contrastive loss, and dynamically weighted fusion with document-level task loss to achieve multi-level supervised optimization. E2. Model iterative training and parameter update: A multi-modal adaptive gradient modulator is used to achieve refined parameter updates through gradient sensitivity analysis, parameter clustering and grouping, and sub-modal learning rate scheduling. E3. Stop iterative condition judgment: Continuously monitor the performance of the validation set during training and calculate the total loss of the validation set after each iteration. If the verification loss does not decrease for five consecutive rounds or the task indicator reaches the predetermined threshold, the early stopping mechanism is triggered. At the same time, the maximum number of iterations is set as a forced termination condition.
[0013] The step 4 specifically includes the following contents: Retrieval stage: The user's question is converted into a vector through the Transformer input embedding, and the top-K relevant paragraphs are retrieved from the constructed agricultural knowledge base; Enhanced input: The search paragraph is concatenated with the original question and input into the trained agricultural model; Generate answers: The agricultural big model integrates the search content with its own knowledge to generate structured answers.
[0014] The step 1 specifically includes the following contents: Collect multi-source heterogeneous agricultural data, including structured data, semi-structured data, and unstructured data; Perform outlier removal, timestamp alignment, and feature standardization on structured time series data to form a continuous sensor data stream; For semi-structured data, key fields are extracted using table parsing tools, converted into structured records in the form of key-value pairs, and the extracted fields are used as classification labels. Unstructured text data is segmented, denoised, and divided into semantic paragraphs to ensure logical integrity and construct question-answer pairs. Perform unified encoding of multi-task data sets, encode all data into text sequence format, and embed numerical data through bucket discretization.
[0015] The present invention has the following advantages: 1. Through the deep integration and cleaning of multi-source heterogeneous data, the modeling capabilities of complex data sets in the agricultural field have been improved, especially when processing data with temporal and structured characteristics, the model effect has been significantly improved.
[0016] 2. The dynamic word embedding mechanism effectively solves the ambiguity of agricultural terms in different contexts and regions, significantly improving the accuracy of agricultural semantic understanding.
[0017] 3. By enhancing the encoding module with regional language patterns, the model can recognize and convert dialect terms, improving the processing effect of agricultural data from different regions.
[0018] 4. Through the joint optimization of multi-granularity losses, a more balanced performance improvement can be achieved between classification tasks and generation tasks, optimizing the learning effect of complex tasks in the agricultural field. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is a schematic diagram of the process of the present invention; Figure 2 This is a schematic diagram comparing the disambiguation performance of agricultural terms; Figure 3 Schematic diagram of the performance comparison of classification tasks in the multi-granularity loss function ablation experiment; Figure 4 Schematic diagram of the performance comparison of generation tasks in the multi-granularity loss function ablation experiment; Figure 5 Schematic diagram of model performance under different document lengths; Figure 6 A diagram showing the comparison of RAG-enhanced question-answering effects. DETAILED DESCRIPTION
[0020] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the detailed description of the embodiments of the present application provided below in conjunction with the drawings is not intended to limit the scope of protection of the present application for which protection is claimed, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application. The present invention is further described below in conjunction with the drawings.
[0021] The present invention specifically relates to a question-answering method based on large-scale agricultural model training and RAG enhancement. It collects and integrates agricultural data by combining structured data, semi-structured data and unstructured data, providing a rich data source for intelligent applications in the agricultural field, solving the problem of relying on only a single data source in the existing technology; adopting a three-level term disambiguation mechanism, combining agricultural ontology graph and context-aware model, to generate dynamic word embedding, solving the shortcomings of traditional static word embedding methods in the polysemy and regional differences of agricultural terms; through an adaptive word segmentation enhancement module and a regional dictionary, dialect terms are mapped to standard terms, realizing the dynamic conversion of local languages and terms in the agricultural field, and improving the adaptability of the model to data from different regions; adopting an improved Transformer architecture, combined with multi-granularity loss function optimization, respectively strengthens the learning of term-level semantic consistency and document-level overall semantics, so that agricultural multi-task learning can take into account both detail recognition and overall understanding.
[0022] like Figure 1 As shown, specifically including the following: S1, agricultural data collection; Collect multi-source heterogeneous agricultural data, including structured data, semi-structured data, and unstructured data, as follows: (1) Structured data: Real-time collection of time series data such as temperature and humidity, pH value, and crop growth indicators from agricultural meteorological stations, soil sensors, and agricultural machinery IoT devices, with a sampling frequency of ≥1 Hz; (2) Semi-structured data: crawl agricultural yearbooks, pest and disease monitoring reports, and agricultural product market transaction reports in PDF / Excel format, and use OCR and table parsing tools to extract key fields; (3) Unstructured data: Collect agricultural research papers, planting technology manuals, and farmer consultation dialogue texts, covering staple foods such as rice and wheat and regional cash crops.
[0023] S2, construction of agricultural large model training dataset; After completing the collection of multi-source heterogeneous agricultural data, we constructed a standardized dataset suitable for training large Transformer models. We deeply cleaned and aligned the three types of data collected by S1 and enhanced them into a multi-task format to support question-answer pair generation and classification tasks. The details are as follows: (1) For structured time series data: outlier removal, timestamp alignment, and feature standardization are performed to form a continuous sensor data stream; further, question-answer pairs are generated based on time series features. For example, based on temperature anomalies, the question is generated: "Is the current temperature suitable for rice growth?" The answer is: "No, irrigation and cooling are required." (2) For semi-structured data: Use table parsing tools to extract key fields, such as the incidence of pests and diseases and fluctuations in agricultural product prices, and convert them into structured records in the form of key-value pairs. At the same time, extract the fields as classification labels. For example, the type of pest and disease is mapped to the category ID: 0 = rust, 1 = mildew; (3) For unstructured text data: After sentence segmentation, denoising and semantic paragraph division, logical integrity is ensured; further question-answer pairs are constructed, for example, question-answer pairs are directly extracted from the text of farmer consultation dialogues (for example, question: "Symptoms of corn leaf spot disease?", answer: "Brown spots appear on the leaves").
[0024] For scientific research papers and technical manuals, template matching is used to generate synthetic question-answer pairs (for example, based on the entity "rice", the question is: "What is the fertilization plan for high-yield rice?", and the answer is: "Extract relevant paragraphs from the manual").
[0025] Furthermore, the multi-task dataset is uniformly encoded, that is, all data are uniformly encoded into a text sequence format, and numerical data are discretized and embedded by bucketing.
[0026] Based on this, each sample contains: 1. Input sequence, i.e. raw text or sensor data encoding.
[0027] 2. Task tags: 2.1 Classification Task: Labeling , is the total number of categories, such as crop disease types; 2.2. Generation Task: Target Answer Sequence , which is the answer part of the question and answer pair.
[0028] The dataset is divided into training set, validation set and test set in a ratio of 7:2:1 to ensure coverage of different crop types, regional characteristics and agricultural scenarios. In addition, when dividing, question-answer pairs and classification samples are sampled independently to avoid data leakage.
[0029] S3. Build the Transformer input embedding; S301, Agricultural term polysemy disambiguation and dynamic word embedding initialization; Terms in agricultural texts exhibit significant regional polysemy. For example, "apple" can refer to a fruit or an electronic brand. Conventional static word embedding methods cannot distinguish contextual semantic differences, resulting in a lack of dynamic adaptability in term representation. This paper adopts a three-level term disambiguation mechanism, which generates dynamic word embedding representations through the construction of an agricultural ontology graph, context-aware disambiguation, and dynamic word embedding generation. The specific steps are as follows: (1) Constructing an agricultural ontology map: defining the agricultural entity set and the relationship between entities, and constructing a structured ontology map as a basis for disambiguation. Specifically, the agricultural entity set is constructed as , define the semantic relationship set between entities as , then the agricultural ontology map is , represents the total number of agricultural entities, Indicates the agricultural entities, Represents the first agricultural entity, Represents the second agricultural entity, Indicates the an agricultural entity.
[0030] (2) Context-aware disambiguation: The local context window word sequence of the target word is encoded through a bidirectional LSTM (a special recurrent neural network structure) to generate a context vector. Then, the cosine similarity between the target word and the pre-trained vectors of each entity in the agricultural ontology graph is calculated. After adjusting the similarity discrimination control coefficient, it is normalized by the natural exponential function to obtain the semantic similarity score between the target word and each entity, which is expressed as: , in, Expressive words With entity The semantic similarity score of is the natural exponential function, is the i-th target word, i.e. the term to be disambiguated, Represents the local context encoding vector, which is calculated as , Indicates surrounding the target word The local context window of arrive The word sequence, is the bidirectional long short-term memory network function, Representing an entity The pre-trained vectors of Representing an entity The pre-trained vectors of The first entities, Represents the similarity discrimination control coefficient, such as, , Represents the cosine similarity calculation function.
[0031] (3) Dynamic word embedding generation: Based on the semantic similarity scores of the target word’s basic word vector and each entity vector, the entity vector fusion result is obtained by weighted summation. Then, the fusion weight of the basic word vector is calculated by the Sigmoid function, and the basic word vector and entity vector fusion results are added according to the weights to generate a context-aware dynamic word embedding vector, which is expressed as: , in, Indicates the The generated dynamic word embedding vectors, Expressive words The basic word vector of Expressive words With entity The semantic similarity score of Represents the fusion weight of the basic word vector, which is calculated as follows: , represents the Sigmoid activation function, represents the word vector dimension, Represents a vector concatenation operation.
[0032] like Figure 2 As shown in the figure, the effectiveness of the dynamic word embedding technology proposed in the present invention in solving the problem of polysemy in agricultural terms is verified. By comparing the disambiguation accuracy of the static word embedding method, the general language model baseline and the method of the present invention on three typical agricultural terms: common terms, polysemous terms and regional terms, the height of the column in the figure represents the accuracy level, and the scatter points at the top of the column simulate the data fluctuations of multiple experiments, which enhances the authenticity. The experimental results show that the method of the present invention has achieved significant improvement in all types of terms, especially in polysemous terms and regional terms. The advantage is most prominent, which verifies that the three-level term disambiguation mechanism can effectively capture the regional characteristics and contextual relevance of agricultural terms, and solves the core problem that traditional methods cannot distinguish the semantic differences of some terms in different agricultural scenarios.
[0033] S302, regional language pattern enhanced coding; Agricultural texts contain a large number of regional dialect terms, such as "baomi" (bāo mi) for corn. Conventional word segmenters cannot recognize these non-standard terms, leading to semantic representation bias and reduced performance in downstream tasks. This paper uses an adaptive word segmentation enhancement module to dynamically convert regional dialect terms to standard terms by constructing a regional dictionary, generating standard term replacement masks, and fusing encoded representations. The specific steps are as follows: (1) Construction of regional dictionary: Extract the mapping relationship between dialect terms and standard terms from agricultural yearbooks and other materials, and construct a dialect-standard term mapping table, which is expressed as: , in, Represents the dialect-standard term mapping table, Indicates dialect terms, Indicates standard terminology, Indicates the A mapping pair of dialect terms and their corresponding standard terms, Indicates the total number of entries in the mapping table.
[0034] (2) Bidirectional replacement mask generation: For each word in the input sentence, if there is a dialect term mapping, the standard term replacement mask value is generated as 1, otherwise it is 0, which is expressed as: , in, Indicates the The replacement mask value of each word, Represents an existential quantifier, used to determine whether a dialect term mapping exists.
[0035] (3) Fusion encoding representation: The dynamic word embedding vector is concatenated with the masked weighted result of the standard term vector, and then linearly transformed with the trainable fusion projection matrix and bias vector to generate the regional enhanced word vector, which is expressed as: , in, Indicates the generated Regionally enhanced word vectors, Represents the fusion projection matrix, which is a trainable parameter. represents the standard term replacement mask value, Indicates standard terminology The vector representation of Represents the fusion bias vector, which is a trainable parameter.
[0036] S303, agricultural entity perception position coding; Traditional positional encoding methods, such as sinusoidal encoding in Transformer, only consider the absolute position of word order, ignoring the importance of relative distances between entities in agricultural text for semantic understanding. For example, the distance between words describing pests and diseases and crops directly affects their relevance, and conventional methods cannot effectively capture such features. This paper designs an entity-aware relative distance encoding mechanism. By marking entity positions, calculating the shortest distance matrix, and integrating distance-weighted positional encoding, the model enhances its ability to perceive spatial relationships between entities. The specific steps are as follows: (1) Entity location tagging: Identify the occurrence locations of all agricultural entities in the input sequence and construct a location index set for each entity, expressed as: , in, Representing an entity A collection of indexes at positions in a sequence, The first entity in the agricultural entity set entities, Representing an entity No. The position index of the occurrence, Representing an entity The position index of the first occurrence, Representing an entity The index of the second occurrence.
[0037] (2) Relative distance matrix calculation: Calculate the shortest absolute distance from each word position to the position index set of each entity, expressed as: , in, Expressive words To Entity The shortest distance, Representing an entity The position index in the sequence, Representing an entity The position index collection, Represents the word position index, represents the absolute value operation, Indicates minimum value operation.
[0038] (3) Entity-aware position coding generation: Based on the shortest distance matrix, the standard sinusoidal position coding of each entity is weighted by the distance attenuation factor, normalized and summed to generate an enhanced position coding vector, which is expressed as: , in, Indicates the The enhanced positional encoding vector of each word, Represents the distance attenuation factor, such as, , Represents the standard sinusoidal position encoding function.
[0039] S304, forming the input embedding of Transformer; The regional enhanced word vector and the enhanced position encoding vector are combined as the input embedding of the Transformer. That is, the input embedding of the Transformer includes: the regional enhanced word vector and the enhanced position encoding vector.
[0040] S4. Build the Transformer encoder. S401, constructing a basic layer structure; (1) Multi-head self-attention sublayer (using a multi-head self-attention sublayer based on a hierarchical attention enhancement mechanism instead of a standard multi-head self-attention sublayer to perform self-attention calculation); Agricultural documents, such as pest and disease research reports, generally have long-range semantic dependencies, and the descriptions often span multiple paragraphs. The self-attention mechanism of conventional Transformer models is unable to effectively capture this hierarchical structural feature, resulting in the loss of key semantic information.
[0041] This paper adopts a block-aggregation strategy to capture intra-block features through local attention, implement inter-block interaction through a gating mechanism, and hierarchically fuse local and global representations. The specific steps are as follows: 1. Semantic Blocking and Local Attention Calculation: Divide the input document into semantic blocks, calculate the projection of the query matrix, key matrix, and value matrix in each block, and generate the local attention output by scaling the dot product attention and the normalized exponential function, which is expressed as: , in, Indicates the The local attention output of the semantic block, Indicates the The query matrix of the block, Indicates the The block's key matrix, Indicates the The value matrix of the block, represents the query projection matrix, represents the key projection matrix, represents transpose, represents the normalized exponential function.
[0042] 2. Global attention gate aggregation: The average pooling of each local attention output is compressed into a block representation, which is weighted by hyperbolic tangent activation and sigmoid gate weights and aggregated into a global document representation, which is expressed as: , in, represents the global document representation of the aggregation, Indicates the The compressed representation of semantic blocks is calculated as follows: , represents the average pooling operation, Indicates the The gate weight of a semantic block is calculated as , represents the hyperbolic tangent activation function, represents the gating weight vector, for The transpose of represents the gated projection matrix, is the total number of semantic blocks, that is, the number of blocks into which the input document is divided.
[0043] 2. Layer normalization and residual connection based on hierarchical weighted fusion: The local attention output and the global document representation are weighted and summed according to the hierarchical fusion coefficient, and then connected with the residual output feature of the previous layer. After layer normalization, the current layer feature is output, which is expressed as: , , in, Indicates the The mixed output features of the layer, Indicates the The output features of the layer, Indicates the The output features of the layer, Representation layer normalization operation, represents the local attention output, Indicates the The layer-level fusion coefficient is set to 0.1 times the layer index.
[0044] It should be noted that the layer normalization and residual connection module based on hierarchical weighted fusion adopts a hierarchical fusion strategy to enhance semantic transmission. First, the local attention output As the semantic features within the block, the aggregated global document representation As cross-block aggregation features, the two are fused through the hierarchical coefficient Perform weighted summation to generate a mixture and then perform residual connection with the output features of the previous layer, then input the layer normalization layer, output the output features of the current layer, and define the output features of the layer normalization and residual connection based on the hierarchical weighted fusion as .
[0045] 3. Feedforward neural network: The feedforward neural network adopts the standard feedforward neural network of Transformer. The input is the layer-normalized output feature based on hierarchical weighted fusion. The activation function of the feedforward neural network adopts the ReLU activation function.
[0046] 4. Standard layer normalization and residual connection: The layer normalization and residual connection adopt the standard layer normalization and residual connection of Transformer. The input is the output feature of the feedforward neural network. After layer normalization, Perform residual addition and output the output features of the current layer. Define the output features of layer normalization and residual connection based on hierarchical weighted fusion as .
[0047] S402, stacking; Repeated stacking of basic layer structures Second-rate, is the number of stacking layers, such as Specifically, the output of the stack is the context representation of the last layer encoder, which is achieved by repeatedly stacking the basic layer structure. Second, final The layer output is the result of the entire encoder, and the output features of the last layer encoder are defined as .
[0048] S403, large model output; The output of the last layer of encoder is used as the context representation of the document for classification tasks and is input to the decoder for generating answers. Specifically, the output features of the last layer of encoder are As the context representation of the document, it is used for classification and generation tasks as follows: 1. Classification task: The first word vector ([CLS] tag) is input into the fully connected layer, and the classification result is generated by Softmax, such as the type of crop disease.
[0049] 2. Generate tasks: The input is a Transformer decoder, which generates an answer through autoregression. For example, the decoder uses the encoder output as a key-value pair and the previous word as the query target to iteratively generate an answer sequence. Specifically, for generation tasks, the decoder works based on the Transformer's autoregressive architecture. Its core is to use the context representation output by the encoder as the knowledge base and gradually generate an answer sequence that conforms to agricultural semantics. During the decoder training phase, the decoder input consists of the encoder output, the answer sequence offset input, and the self-attention mask, as follows: a) Encoder output: The contextual representation from the last encoder layer of S402, i.e., the deep semantic features of the document, including dynamically disambiguated agricultural terms, regional standardized expressions, and entity spatial relationship information; b) Answer sequence offset input: the answer sequence of the generation task in the training dataset constructed using S2 , but shift it one position to the right, that is, add the [START] mark at the starting position as the initial input of the decoder; c) Self-attention mask: Ensures that each position only focuses on the generated left word during decoding to avoid information leakage.
[0050] During the training phase, the decoder performs the following steps layer by layer: a) Masked self-attention layer: Calculates internal dependencies for the currently generated word sequence, such as the causal logic in agricultural technology descriptions: "fertilize" → "irrigate"; b) Encoder-decoder attention layer: aligns the masked self-attention output with the encoder’s contextual representation to focus on key information, e.g., extracting the “disease cycle” feature from pest and disease reports; c) Feedforward network with residual connection: fuses features and passes them to the next layer.
[0051] Finally, the hidden state of the top-level output is linearly transformed and softmaxed to generate a vocabulary probability distribution. During training, a teacher-forcing strategy is used to force the decoder to predict the current word based on the previous word of the true answer. For example, when the input is "The symptoms of corn leaf spot are", the predicted output is "brown spots", allowing the model to learn the semantic logic of agricultural question answering.
[0052] In the inference stage of the decoder, the autoregressive generation method is adopted. The specific steps are as follows: a) The starting point is the representation of the user question (e.g., “How to prevent and control rice sheath blight?”) obtained by the encoder and the [START] tag.
[0053] b) The decoder generates the answer word by word: Each step predicts the next word based on the historical generated words and the encoder context, such as generating "1." in the first step and "before seeding" in the second step, until the token is output or the length limit is reached.
[0054] c) The generation process dynamically calls the agricultural knowledge model learned through training: For questions and answers generated from structured data (e.g., how to respond to abnormal temperatures), output concise instructions ("irrigation is needed to cool down"); For unstructured data (such as agricultural technology manuals), generate paragraph-style technical guidance ("spray with 50g / mu of Jinggangmycin mixed with water").
[0055] S5. Training large models based on the Transformer architecture; S501, multi-granularity loss function optimization; Agricultural tasks require capturing both fine-grained term-level semantics and document-level holistic semantics. Conventional single loss functions are unable to take into account both levels of supervisory signals, resulting in unbalanced performance of the model in detail tasks such as entity recognition and overall tasks such as document classification.
[0056] This paper adopts a dual-granularity joint loss function to enhance semantic consistency learning through term-level contrastive loss and dynamically weighted fusion with document-level task loss to achieve multi-level supervised optimization. The specific steps are as follows: 1. Term-level contrastive loss calculation: Calculate the cosine similarity of the instance representation vectors of the same term identifier in the batch, normalize it with the natural exponential function and the temperature coefficient, and generate a contrastive loss to enforce semantic consistency. It is expressed as: , in, represents the term-level contrastive loss, For the The representation vector of the term instance is used as the anchor point. For Another term of the same class ( The representation vector of each instance is used as a positive sample. For the The representation vector of term instances, used for negative sample calculation, represents the cosine similarity function, Represents the temperature coefficient, such as, , Indicates the batch size, represents the indicator function, when The value is 1 when the Represents a logarithmic function, with the default base being a natural constant. For the The term identifier of each term instance, For the The term identifier for a term instance.
[0057] 2. Document-level task loss calculation: Based on the true label and predicted probability of the classification task, the cross entropy loss is calculated, which is expressed as: , Where, represents the document-level task loss; Indicates the number of documents in the batch; Indicates the number of classification categories, specifically the categories of downstream document-level tasks, such as crop type, pest type, or regional category in document classification tasks, which are classified according to the content of agricultural documents; Indicates the The true label of the document is One-hot encoding of categories; Indicates the The predicted probability of the document in Softmax probability of the class.
[0058] 3. Generation loss calculation: The sequence negative log-likelihood loss function is used to calculate the cross entropy loss between the model prediction sequence and the target answer sequence in the generation task, which is expressed as: , Where, Indicates generation loss; Indicates the length of the answer sequence; Represents the target answer sequence Middle word at position; Representation model based on historical generated words And the output features of the last layer encoder Predict the probability of the current word; Generate words for history.
[0059] 4. Joint optimization of multi-granularity losses: The term-level contrast loss and the document-level task loss are weighted and summed according to the term-level loss weight coefficient to obtain the total loss, which is expressed as: , Where, is the total loss, representing the final optimization objective function; represents the term loss weight coefficient, such as, .
[0060] like Figure 3 The following is a comparison chart of classification task performance: Figure 4 Shown is a performance comparison chart of generation tasks. In order to verify the optimization effect of multi-granularity joint loss function on agricultural multi-task learning, by comparing the performance of single task loss, term-free loss and complete method on classification and generation dual tasks, the parallel columns in the figure clearly show the difference in the effects of each ablation setting on the two tasks, and the dark columns mark the specific performance values. The experimental results show that the complete method achieves the best in both classification accuracy and generation quality, indicating that the term-level contrast loss strengthens the semantic consistency of the same term, and the document-level task loss ensures the overall supervision effect. The two work together to solve the difficult balance problem between fine-grained term recognition and overall document understanding in agricultural tasks, so that the model can not only accurately identify the type of crop disease, but also generate technical guidance text that conforms to agricultural semantics.
[0061] S502, model iterative training and parameter update; Large agricultural models require simultaneous optimization of dynamic word embedding parameters, hierarchical attention weights, and task head parameters. However, conventional optimizers such as Adam use a uniform learning rate for all parameters, which cannot adapt to the significant differences in parameter sensitivity between modules, resulting in unstable convergence.
[0062] The present invention adopts a multi-modal adaptive gradient modulator to achieve refined parameter update through gradient sensitivity analysis, parameter clustering and sub-modal learning rate scheduling. The specific steps are as follows: 1. Parameter gradient sensitivity analysis: Calculate the gradient sensitivity coefficient of each parameter tensor and quantify the influence of the parameter on the total loss, expressed as: , Where, Represents a parameter tensor Gradient sensitivity coefficient, quantifying the effect of parameter update on the total loss the intensity of the impact; Indicates the parameter tensors, which are the trainable parameters of the model; represents the expected value operator, which is used to calculate the average value of the gradient norm; Indicates total loss About parameters gradient; Represents the L2 norm, that is, the Euclidean norm, which calculates the length of the gradient vector; Represents the total loss function, such as multi-granularity joint loss; Represents the variance operator, which is used to calculate the discreteness of the gradient; Represents a small constant used to prevent the denominator from being zero and ensure numerical stability, such as, .
[0063] 2. Parameter clustering and grouping: According to the gradient sensitivity coefficient threshold, the parameters are divided into four groups: high sensitivity group, medium sensitivity group, low sensitivity group, and very low sensitivity group, each represented as follows: Highly sensitive group, specifically refers to the dynamic embedding layer parameters: ; Medium-sensitive group, specifically refers to the attention gating parameters: ; Low sensitivity group, specifically refers to the standard feedforward neural network parameters: ; Very low sensitivity group, specifically refers to position encoding parameters: ; Where, A set of parameters representing a highly sensitive group; The parameter set of the sensitive group in the representation; A set of parameters representing the low-sensitivity group; A set of parameters representing the very low sensitivity group; Indicates the parameter tensors; Representation parameters The gradient sensitivity coefficient is as defined in 503.1; Indicates "so that" or "satisfies a condition" and is used in set definitions to specify conditions for parameter grouping; Indicates a high sensitivity threshold; indicates the medium sensitivity threshold; In one embodiment, the threshold is set to: , , .
[0064] 3. Modal learning rate scheduling: Each group of parameters is assigned an independent basic learning rate. The learning rate is dynamically adjusted based on the number of training rounds, loss change, and decay coefficient. It is expressed as: , Where, Indicates in At the first iteration, Learning rate of group parameters; Indicates the The base learning rate of the group parameters; represents the minimum value function; Indicates the number of rounds of current training iteration; Indicates in The change in loss at each iteration; Represents the scaling factor of loss change, controlling the sensitivity of learning rate adjustment to loss fluctuations, such as, ; is a natural constant; Indicates the The decay coefficient of the group parameter; Indicates the total number of iterations, such as, .
[0065] The settings need to be designed differently according to the characteristics of the parameter group, referring to the threshold grouping rules. The specific settings are shown in Table 1 below: Table 1. Reference threshold grouping rules 4. Gradient modulation update: Use the improved Adam optimizer to calculate the first-order momentum and second-order momentum of the gradient, inject the gradient correction term of the sign function and the infinite norm threshold judgment, and update the parameters according to the group learning rate, which is expressed as: , , , , Where, Indicates in The first-order momentum of the iteration; Indicates in The first-order momentum of the iteration; represents the decay rate of the first-order momentum, such as, ; Indicates in The gradient vector of the iteration; Indicates in The second-order momentum of the iteration; Indicates in The second-order momentum of the iteration; represents the decay rate of the second-order momentum, such as, ; represents element-wise multiplication; represents the modulation gradient vector; Represents the weight coefficient of the gradient correction term, such as, ; represents a symbolic function; represents the indicator function, when The value is 1 when it is set, otherwise it is 0; Represents the gradient The infinite norm of Represents the gradient size threshold, which is used to determine whether to apply the correction term; Indicates the The set of parameter tensors of the iteration, representing the A high-dimensional tensor consisting of all trainable parameters at the iteration, whose dimension is consistent with the model structure; Indicates the The set of parameter tensors of the iteration, representing the A high-dimensional tensor consisting of all trainable parameters at the iteration, whose dimension is consistent with the model structure.
[0066] like Figure 5 As shown, the effect of the entity-aware position encoding mechanism of the present invention on improving the long document processing capability is analyzed. By measuring the performance change trends of the conventional model, the relative position encoding method and the method of the present invention in the agricultural document classification task when the document length changes from short text to long document, the curve change trend and the discrete point distribution in the figure simulate the performance fluctuations in the real experiment. The experimental results show that as the document length increases, the performance of the conventional method drops sharply, while the method of the present invention maintains stable and excellent performance, which proves that the entity-aware relative distance encoding mechanism can effectively capture the spatial relationship characteristics between the pest and disease description and the crop entity in the agricultural text, and overcomes the defect that the traditional position encoding only considers the word order position and ignores the semantic association of the entity.
[0067] S503, stop iterative condition judgment; Continuously monitor the validation set performance during training and calculate the total loss of the validation set after each iteration If the validation loss does not decrease for five consecutive rounds, or the task indicator reaches a predetermined threshold, such as accuracy > 95%, the early stopping mechanism is triggered. At the same time, a maximum number of iterations is set as a forced termination condition, such as 10,000 rounds, to avoid overfitting.
[0068] S6, Large Model Reasoning Application; The trained model is deployed as an agricultural knowledge service engine. Specifically, after the user enters a question text (such as "corn leaf spot prevention and control methods"), the model sequentially performs dynamic word embedding disambiguation, regional term replacement, and entity-aware position encoding to generate an enhanced representation of the input sequence. Then, the Transformer encoder extracts deep semantic features, the classification task directly outputs the predicted label, and the generation task generates the answer word by word through the decoder.
[0069] S7. RAG Enhanced Question Answering; RAG is a model architecture that combines retrieval and generation. By retrieving relevant information from a large-scale external knowledge base and integrating it into the generation process, it enhances the knowledgeability and accuracy of the model, thereby generating richer and more accurate text content.
[0070] To improve the ability to answer complex questions, we combine the retrieval enhancement generation mechanism to perform RAG enhanced question answering, as follows: 1) Retrieval stage: The user question is converted into a vector through the embedding model, and the top-K relevant paragraphs are retrieved from the agricultural knowledge base built by S1, such as papers and manuals in the agricultural knowledge base; 2) Enhanced input: The search paragraph is concatenated with the original question and then fed into the trained agricultural model; 3) Generate answers: The model integrates search results with its own knowledge to generate structured answers, such as step-by-step prevention and control plans, thereby improving its coverage of long-tail knowledge such as timely policies and regional agricultural techniques.
[0071] like Figure 6 As shown in the figure, the improvement of the retrieval enhancement generation mechanism's ability to answer complex agricultural problems is evaluated. By comparing the answer accuracy of the basic model and the RAG enhancement model on four typical agricultural problems: common problems, professional problems, regional problems and time-sensitive policies, the grouped columns in the figure intuitively show the performance differences in each scenario, and the scattered points inside the columns represent the distribution of experimental data. The experimental results show that the RAG enhancement mechanism has the most significant improvement on professional knowledge and time-sensitive content. First, the user's question is converted into a vector to retrieve the professional literature and the latest policies in the relevant knowledge base, and then the search content is spliced with the original question and input into the model to generate a structured answer, which effectively makes up for the problem that the large model has insufficient coverage of long-tail knowledge such as regional agricultural technology and time-sensitive policies.
[0072] The foregoing description is merely a preferred embodiment of the present invention. It should be understood that the present invention is not limited to the form disclosed herein and should not be construed as excluding other embodiments. Rather, the present invention is capable of various other combinations, modifications, and improvements, and is capable of modifications within the scope of the concepts described herein, through the above teachings, or through techniques or knowledge in the relevant fields. Modifications and variations made by those skilled in the art that do not depart from the spirit and scope of the present invention are intended to be within the scope of the appended claims.
Claims
1. A question-answering method based on large agricultural model training and RAG enhancement, characterized by: The method comprises: Step 1: Collect agricultural data and build a large agricultural model training dataset; Step 2: Form the Transformer input embedding by disambiguating agricultural terminology and initializing dynamic word embeddings, encoding regional language patterns, and encoding agricultural entity-aware locations. Finally, build a Transformer encoder to train a large model based on the Transformer architecture. Step 3: After the user enters the question text, the large model sequentially performs dynamic word embedding disambiguation, regional term replacement, and entity-aware position encoding to generate an enhanced representation of the input sequence. The Transformer encoder then extracts deep semantic features. The classification task directly outputs the predicted label, while the generation task uses the decoder to generate the answer word by word. Step 4: Combine the retrieval enhancement generation mechanism to perform RAG enhanced question answering.
2. The method according to claim 1, characterized in that: The agricultural term polysemy disambiguation and dynamic word embedding initialization specifically include the following: A1. Constructing agricultural ontology graph: Constructing agricultural entity set as , set the semantic relationship set between entities to be , then the agricultural ontology map is ,in, represents the total number of agricultural entities, Indicates the agricultural entities, Represents the first agricultural entity, Represents the second agricultural entity, Indicates the agricultural entities; A2. Context-aware disambiguation: This method uses a bidirectional LSTM to encode the target word's local context window word sequence and generate a context vector. The cosine similarity between the target word and the pre-trained vectors of each entity in the agricultural ontology is calculated. After adjusting the similarity discrimination control coefficient, the vector is normalized using a natural exponential function to obtain the semantic similarity score between the target word and each entity. A3. Dynamic word embedding generation: Based on the semantic similarity scores of the target word's base word vector and each entity vector, a weighted sum is taken to obtain the entity vector fusion result. The fusion weight of the base word vector is calculated using the Sigmoid function. The base word vector and entity vector fusion results are added together according to the weights to generate a context-aware dynamic word embedding vector.
3. The method according to claim 1, characterized in that: The regional language mode enhanced coding specifically includes the following contents: B1. Regional dictionary construction: Extract the mapping relationship between dialect terms and standard terms from agricultural yearbook materials and construct a dialect-standard term mapping table; B2. Bidirectional replacement mask generation: For each word in the input sentence, if there is a dialect term mapping, a standard term replacement mask value of 1 is generated, otherwise it is 0; B3. Fusion coding representation: The dynamic word embedding vector is concatenated with the masked weighted result of the standard term vector, and the trained fusion projection matrix and bias vector are linearly transformed to generate the regional enhanced word vector.
4. The method according to claim 1, characterized in that: The agricultural entity perception position coding specifically includes the following contents: C1. Entity location tagging: Identify the locations of all agricultural entities in the input sequence and construct a location index set for each entity; C2. Relative distance matrix calculation: Calculate the shortest absolute distance from each word position to the position index set of each entity; C3. Entity-aware position coding generation: Based on the shortest distance matrix, the standard sinusoidal position coding of each entity is weighted by the distance attenuation factor, normalized and summed to generate an enhanced position coding vector.
5. The method of claim 1, wherein: The construction of the Transformer encoder specifically includes: D1. Building the base layer structure: Adopting a block-aggregation strategy, we capture intra-block features through local attention, implement inter-block interaction through a gating mechanism, and layer-by-layer fuse local and global representations. D2. Stacking: Repeated stacking of basic layer structures Second-rate, is the number of stacking layers, and the stacked output is the context representation of the last layer encoder, which is achieved by repeatedly stacking the basic layer structure. Second, final The layer output is the result of the entire encoder, and the output feature of the last layer encoder is set to ; D3. Output: The output of the last layer encoder is used as the context representation of the document for classification tasks and is input to the decoder for generating answers.
6. The method of claim 5 based on agricultural large model training and RAG enhanced question answering, characterized in that: The D1 specifically includes the following contents: D101, Semantic Chunking and Local Attention Calculation: Divide the input document into semantic chunks, calculate the projection of the query matrix, key matrix, and value matrix within each chunk, and generate local attention output through scaled dot product attention and normalized exponential function; D102, Global Attention Gating Aggregation: The average pooling of each local attention output is compressed into a block representation, weighted by hyperbolic tangent activation and sigmoid gating weight, and aggregated into a global document representation; D103, layer normalization and residual connection based on hierarchical weighted fusion: The local attention output and the global document representation are weighted and summed according to the hierarchical fusion coefficient, and then the residual connection is connected with the output feature of the previous layer. After layer normalization, the current layer feature is output. The output feature of the layer normalization and residual connection based on hierarchical weighted fusion is set to ; D104, Feedforward Neural Network: The feedforward neural network uses the standard Transformer feedforward neural network. The input is the layer-normalized output features based on hierarchical weighted fusion. The activation function of the feedforward neural network uses the ReLU activation function. D105, standard layer normalization and residual connection: layer normalization and residual connection adopt the standard layer normalization and residual connection of Transformer, the input is the output feature of the feedforward neural network, after layer normalization processing, Perform residual addition and output the output features of the current layer. Define the output features of layer normalization and residual connection based on hierarchical weighted fusion as .
7. The method of claim 5, characterized in that: The D3 specifically includes the following contents: D301, classification task: The first word vector of is input into the fully connected layer, and the classification result is generated by Softmax; D302, Generate Task: The decoder is fed into the Transformer decoder, which uses the encoder output as a key-value pair and the previous word as the query target, iteratively generating a sequence of answers. During the decoder training phase, the decoder input consists of the encoder output, the answer sequence offset input, and the self-attention mask; specifically, it includes the following: Encoder output: The contextual representation from the last encoder layer, i.e., the deep semantic features of the document, including dynamically disambiguated agricultural terms, regional standardized expressions, and entity spatial relationship information; Answer sequence offset input: Generate the answer sequence of the task based on the constructed training dataset , and shift it one position to the right, i.e. add a start mark at the starting position as the initial input of the decoder; Self-attention mask: ensures that each position only focuses on the generated left word during decoding to avoid information leakage; During the training phase, the decoder performs the following steps layer by layer: Masked self-attention layer: calculates the internal dependencies of the currently generated word sequence; Encoder-decoder attention layer: aligns the masked self-attention output with the encoder's contextual representation to focus on key information; Feedforward network with residual connections: The features are fused and passed to the next layer.
8. The method of claim 1, wherein: The training of the large model based on the Transformer architecture specifically includes the following: E1. Multi-granularity loss function optimization: A dual-granularity joint loss function is used to enhance semantic consistency learning through term-level contrastive loss, and dynamically weighted fusion with document-level task loss to achieve multi-level supervised optimization. E2. Model iterative training and parameter update: A multi-modal adaptive gradient modulator is used to achieve refined parameter updates through gradient sensitivity analysis, parameter clustering and grouping, and sub-modal learning rate scheduling. E3. Stop iterative condition judgment: Continuously monitor the performance of the validation set during training and calculate the total loss of the validation set after each iteration. If the verification loss does not decrease for five consecutive rounds or the task indicator reaches the predetermined threshold, the early stopping mechanism is triggered. At the same time, the maximum number of iterations is set as a forced termination condition.
9. The method of claim 1, characterized in that: The step 4 specifically includes the following contents: Retrieval stage: The user's question is converted into a vector through the Transformer input embedding, and the top-K relevant paragraphs are retrieved from the constructed agricultural knowledge base; Enhanced input: The search paragraph is concatenated with the original question and input into the trained agricultural model; Generate answers: The agricultural big model integrates the search content with its own knowledge to generate structured answers.
10. The method for question answering based on large agricultural model training and RAG enhancement according to any one of claims 1 to 9, characterized in that: The step 1 specifically includes the following contents: Collect multi-source heterogeneous agricultural data, including structured data, semi-structured data, and unstructured data; Perform outlier removal, timestamp alignment, and feature standardization on structured time series data to form a continuous sensor data stream; For semi-structured data, key fields are extracted using table parsing tools, converted into structured records in the form of key-value pairs, and the extracted fields are used as classification labels. Unstructured text data is segmented, denoised, and divided into semantic paragraphs to ensure logical integrity and construct question-answer pairs. Perform unified encoding of multi-task data sets, encode all data into text sequence format, and embed numerical data through bucket discretization.
Citation Information
Patent Citations
Chinese electronic medical record entity recognition method based on Lattice LSTM model
CN112151183A
Intelligent question and answer system based on knowledge graph subgraph retrieval
CN113297369A
Question and answer method and device based on multi-modal industrial large model
CN118761458A
Agricultural field large language model training method and device and medium
CN119128070A
Proactive queries and content suggestions for questions and answers generated using generative models
CN119271882A
Cited By
Multi-source heterogeneous code conversion method and device for cross-language development
CN121143797A
Cross-document event co-reference resolution method based on long document encoder
CN121524348A
Agricultural data processing method and device, electronic equipment and storage medium
CN121707099A