Agricultural legal question and answer intelligent interaction system based on large model

The intelligent interactive system for agricultural legal questions and answers based on a large model solves the problems of information fragmentation and difficulty in handling logical relationships in existing systems, and achieves accurate answers and dynamic adaptation to agricultural legal questions, thereby improving the reliability and accuracy of the answers.

CN121658616APending Publication Date: 2026-03-13ZHEJIANG WEIGHT DATA TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202512002596.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-29
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing agricultural legal information service systems struggle to effectively analyze and integrate the complex logical relationships between legal provisions, judicial interpretations, and case summaries, resulting in fragmented information. Furthermore, they lack processing of the deep semantic structure of agricultural terminology and legal texts, affecting the accuracy and reliability of responses.

Method used

An intelligent interactive system for agricultural legal questions and answers based on a large model is adopted. Unstructured document data is acquired through a data parsing module and analyzed in multiple dimensions. Legal knowledge units with hierarchical labels are constructed, and a knowledge graph network with contextual association is generated. Multi-round intent matching and contextual retrieval are performed. A large language model is called to generate multi-path answers and to verify the consistency of legal logic and the accuracy of facts. The semantic association weights of the knowledge graph network are dynamically optimized.

Benefits of technology

It enables accurate identification and resolution of agricultural legal issues, improves the reliability of responses and the system's adaptability to dynamic changes in legal knowledge, and ensures logical consistency and factual accuracy of the answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121658616A_ABST
    Figure CN121658616A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence intelligent agriculture, and discloses an agricultural legal question and answer intelligent interaction system based on a large model. According to the system, analysis and semantic anchor point marking are carried out on an unstructured legal document, and a knowledge unit with a hierarchical label is constructed. And fusing the units by using a large model to generate a context-associated knowledge graph. When a user inputs a question, the system retrieves related units from the map through multiple rounds of intention matching, and calls a large model to generate a multi-path answer sequence. And after the answer is subjected to legal logic and fact accuracy verification, the system dynamically optimizes the semantic association weight of the atlas according to a result, and finally outputs a reliable response. According to the scheme, deep structuring of agricultural legal knowledge and closed-loop optimization of a question and answer process are realized, and the accuracy and adaptive ability of professional consultation are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence-based smart agriculture technology, specifically to an intelligent interactive system for agricultural legal question-and-answer based on a large model. Background Technology

[0002] Currently, agricultural legal information services primarily rely on general search engines and traditional structured databases. These solutions generally employ keyword-based full-text matching or simple semantic similarity calculations for retrieval, making it difficult to effectively analyze and integrate the complex logical relationships between legal provisions, judicial interpretations, and case summaries. Due to the lack of specialized processing of agricultural terminology and the deep semantic structure of legal texts, the returned information is often fragmented, failing to form coherent and accurate knowledge support for specific agricultural practice issues.

[0003] Existing question-answering systems that incorporate knowledge graphs typically have knowledge networks built statically in a one-time manner, making it difficult to incorporate new legal interpretations or precedents in real time, resulting in insufficient adaptability. When generating the final answer, most systems directly rely on the results generated by large language models, lacking specialized verification mechanisms for agricultural law. This can lead to answers with legal logic conflicts, outdated citations, or a disconnect from specific agricultural contexts, affecting the accuracy and reliability of the responses. Therefore, a technical solution is needed that can achieve deep, structured knowledge parsing and dynamic optimization within a closed loop. Summary of the Invention

[0004] The purpose of this invention is to provide an intelligent interactive system for agricultural legal question-and-answer based on a large model, so as to solve the problems mentioned in the background art.

[0005] To achieve the above objectives, this invention provides an intelligent interactive system for agricultural legal question-and-answer based on a large model, the system comprising: The data parsing module acquires unstructured document data in the field of agricultural law and performs multi-dimensional analysis to identify legal provisions, judicial interpretations, and case summaries in the documents. The knowledge construction module imports the parsed legal provisions, judicial interpretations and case summaries into the agricultural legal knowledge unit construction process. The process fragments the content and marks semantic anchors to form legal knowledge units with hierarchical tags. The graph generation module inputs the generated legal knowledge units into a large language model for deep semantic fusion, generating a knowledge graph network with contextual relationships. The interactive processing module receives agricultural legal consultation questions input by users in natural language, performs multi-round intent matching and context retrieval with the consultation questions and knowledge graph network, and extracts relevant legal knowledge units. The answer generation module, based on the legal knowledge units extracted through matching, invokes the reasoning and generation capabilities of the large language model to construct a multi-path answer sequence that conforms to agricultural legal norms, and verifies its legal logic consistency and factual accuracy, filtering out answer paths that are conflicting or ambiguous. The feedback module is optimized to dynamically optimize the semantic association weights in the knowledge graph network based on the verification results, and the optimized association weights are fed back to the intent matching stage. Based on the optimized semantic association weights, the final legal question and answer response is generated and output to the interactive interface.

[0006] Preferably, the acquisition and multi-dimensional analysis of unstructured document data in the field of agricultural law specifically involves: The initial document data includes legal texts, administrative penalty decisions, and judgments from agricultural administrative departments' databases, judicial rulings websites, and legal professional libraries. The initial document data is formatted and normalized to unify the encoding format and layout style of documents from different sources, thereby eliminating parsing interference caused by format differences. Named entity recognition technology is used to scan normalized documents, identify and label the agricultural production and management entities, administrative action names, legal and regulatory clause indexes and geographical area information involved; By combining syntactic dependency analysis, we delineate three logical components in legal provisions: assumed conditions, behavioral patterns, and legal consequences, and assign independent structured identifiers to each component. By associating structured identifiers with corresponding original document fragments, an index for locating key legal points in the original text is established, enabling multi-dimensional parsing of the document.

[0007] Preferably, the step of importing the parsed legal provisions, judicial interpretations, and case summaries into the agricultural legal knowledge unit construction process specifically involves: Based on the structured identifiers of legal provisions, assumptions, behavioral patterns, and legal consequences are encapsulated into independent legal knowledge sub-units. The judicial interpretations and case summary texts are semantically segmented according to their argumentation logic and the main points of the judgments, and each segment is encapsulated as a case knowledge subunit; Each legal knowledge subunit and case law knowledge subunit is assigned a globally unique knowledge unit identifier code, and its legal domain level and validity level are marked accordingly; Semantic anchors are established between knowledge units, including synonyms of legal concepts, citation relationships of provisions, and similarity associations of cases; Initial association strength coefficients between knowledge units are generated based on semantic anchors, and all knowledge units and their relationships are stored in the agricultural law knowledge unit database.

[0008] Preferably, the process of inputting the formed legal knowledge units into a large language model for deep semantic fusion to generate a knowledge graph network with contextual association is as follows: All knowledge unit description texts in the agricultural law knowledge unit library are input into a pre-trained large language model in batches. The deep semantic vector representation of each knowledge unit is extracted from the text using a large language model. The deep semantic vector representation contains the abstract features and contextual meaning of legal concepts. Calculate the cosine similarity between the deep semantic vectors of any two knowledge units as a supplementary measure of their potential semantic relevance. The initial association strength coefficient based on semantic anchors and the latent semantic association degree based on deep semantic vectors are weighted and fused to generate a comprehensive association weight between knowledge units. Using knowledge units as nodes and comprehensive association weights as edges, an agricultural legal knowledge graph network is constructed and stored in a graph database.

[0009] Preferably, the process of receiving agricultural legal consultation questions input by users in natural language form involves performing multi-round intent matching and context retrieval with a knowledge graph network, specifically: The system performs word segmentation and part-of-speech tagging on the natural language consultation questions entered by users, removes stop words, and extracts core legal consultation terms. Core legal consulting terms are converted into query vectors, and preliminary node matching is performed in the agricultural law knowledge graph network to retrieve first-level related knowledge units whose similarity to the query vectors exceeds a threshold. Starting with the first-level related knowledge unit, the graph is traversed along the edges of the knowledge graph network. Based on the comprehensive association weight, the second-level and third-level related knowledge units are selected to form a preliminary set of related knowledge units. The descriptive text of the initially associated knowledge unit set is combined with the user's original inquiry to form an enhanced contextual query statement; The enhanced contextual query statement is input again into the large language model to generate a more accurate secondary query vector. The secondary query vector is then used to perform a refined retrieval in the initial set of associated knowledge units to determine the final set of matching target knowledge units.

[0010] Preferably, the step of constructing a multi-path answer sequence that conforms to agricultural legal norms by utilizing the reasoning and generation capabilities of a large language model based on the legal knowledge units extracted through matching is specifically as follows: The description text of each knowledge unit in the target knowledge unit set is sorted according to its legal validity level and logical relevance. The sorted knowledge unit description text is used as the basis for reasoning, and combined with the legal reasoning rules built into the big language model, the analysis is carried out from multiple reasoning perspectives, including rights recognition, obligation performance, remedies and risk prevention. For each reasoning perspective, the large language model generates an independent answer path that includes legal basis, applicable facts, and key conclusions; All independent answer paths generated from all reasoning perspectives are aggregated to form a multi-path answer sequence for the same consultation question; In the multi-path answer sequence, record the original knowledge unit identifier code and its reasoning angle label that each answer path depends on.

[0011] Preferably, the step of verifying the legal logic consistency and factual accuracy of the multi-path answer sequence specifically involves: Establish an agricultural legal logic rule base, which includes the hierarchical relationship between legal concepts, the preconditions for legal acts, and the criteria for determining conflict clauses; The legal conclusion stated by each answer path in the multi-path answer sequence is compared with the rules in the agricultural legal logic rule base to detect whether there are any violations of logical rules or conceptual contradictions. The original legal provisions and case facts in the agricultural law knowledge unit database are retrieved to verify the original text of the factual descriptions and legal applications cited in the answer path. When a logical inconsistency or inaccurate factual reference is detected in an answer path, a verification failure flag and the specific reason for the conflict are marked on the answer path. Only the answer paths that pass the checks for logical consistency and factual accuracy are retained, forming a refined sequence of verified answers.

[0012] Preferably, the step of dynamically optimizing the semantic association weights in the knowledge graph network based on the verification results specifically involves: Extract the original knowledge unit identifier code on which the failed verification answer path depends and the reason for its conflict; Analyze the causes of the conflict. If the incorrect reasoning is caused by an excessively high initial association strength coefficient between knowledge units, then reduce the overall association weight between the corresponding knowledge unit nodes. Analyze the causes of the conflict. If the key knowledge units are not retrieved due to low potential semantic relevance, then increase the comprehensive relevance weight between the corresponding nodes based on the knowledge unit relevance of the successful path in the refined answer sequence. The optimized and adjusted comprehensive correlation weights will be synchronously updated to the agricultural law knowledge graph network stored in the graph database; Record the log of this optimization adjustment, including the knowledge unit identifier code involved, the direction and magnitude of weight adjustment, for subsequent model iteration analysis.

[0013] Preferably, the step of generating the final legal question-and-answer response and outputting it to the interactive interface based on the optimized semantic association weights specifically involves: The validated and refined answer sequence is associated with the current optimized agricultural law knowledge graph network status; Based on the preset response format template of the user interface, each answer path in the refined answer sequence is converted into a natural language paragraph that the user can read. At the end of each natural language paragraph, a source note for the core legal knowledge unit on which it is based is attached; All the converted natural language paragraphs are arranged in a logical order according to their reasoning perspective, and combined into a structurally complete final legal Q&A response document; The final legal Q&A response document is pushed to the user's device for display through the response output interface of the interactive interface.

[0014] Preferably, the large language model is constructed through the following steps: Collect professional textual data in the field of agricultural law, including full texts of laws and regulations, judicial interpretations, academic papers, and case analyses; Clean and preprocess professional text corpora to remove irrelevant characters and formatting marks, and retain plain text content; The text was segmented using a legal dictionary to ensure the completeness and accuracy of the technical terms. Construct a word vector table specific to the legal field, mapping legal terms into vector representations in a high-dimensional space; The Transformer architecture is used to build the basic network of a large language model, and a multi-layer self-attention mechanism is set up. The basic network is pre-trained using a masked language model task, enabling the model to learn the contextual semantic relationships of legal texts; Fine-tuning the model through legal reasoning tasks enhances its ability to understand legal logical relationships; The model is trained using legal question-and-answer tools to enhance the accuracy and standardization of the legal answers it generates.

[0015] Compared with the prior art, the beneficial effects of the present invention are: The parsed legal text is fragmented and marked with semantic anchors based on key elements such as legal concepts, responsible parties, and applicable conditions. It is also labeled with tags reflecting the hierarchical structure of the agricultural legal system. This transforms unstructured legal text into standardized knowledge units with clear semantic boundaries and classification attributes. Consequently, in subsequent interactive matching, the system can go beyond simple keyword overlap calculations, achieving accurate identification and association of legal elements based on deep semantics. This improves the accuracy and interpretability of matching complex agricultural legal issues with relevant knowledge units.

[0016] A large model is invoked to generate a multi-path answer sequence for the same question. Legal logic consistency rules and factual accuracy models are introduced to cross-validate and detect conflicts among these parallel answers, automatically filtering out contradictory or ambiguous answer paths. The validation results are used to dynamically adjust the weight strength of semantic associations between nodes in the knowledge graph. This optimization mechanism forms a closed-loop feedback, enabling the relationships within the knowledge network to continuously iterate and strengthen based on the validation results of actual question-and-answer interactions. This allows the system's intent understanding and answer generation to not only rely on the initially constructed knowledge but also to continuously self-correct and optimize as the interaction process deepens, thereby improving the reliability of the answers and the system's adaptability to dynamic changes in legal knowledge. Attached Figure Description

[0017] Figure 1 This is a schematic diagram illustrating the working principle of the intelligent interactive system for agricultural legal questions and answers based on a large model, as described in this invention. Figure 2 A flowchart for multi-dimensional parsing of unstructured document data; Figure 3 A flowchart for generating a knowledge graph network through deep semantic fusion; Figure 4 A pie chart showing the types of failed path validations for agricultural law Q&A answers; Figure 5 Radar chart for evaluating the response effectiveness of agricultural legal Q&A. Detailed Implementation

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

[0019] Please see Figure 1This invention provides an intelligent interactive system for agricultural legal question-and-answer based on a large-scale model. The system includes: a data parsing module that acquires unstructured document data in the field of agricultural law and performs multi-dimensional analysis to identify legal provisions, judicial interpretations, and case summaries within the documents; a knowledge construction module that imports the parsed legal provisions, judicial interpretations, and case summaries into an agricultural legal knowledge unit construction process, which segments the content into fragments and marks semantic anchors to form hierarchical legal knowledge units; a graph generation module that inputs the formed legal knowledge units into a large-scale language model for deep semantic fusion to generate a knowledge graph network with contextual relationships; an interaction processing module that receives agricultural legal consultation questions input by users in natural language, performs multi-round intent matching and contextual retrieval between the consultation questions and the knowledge graph network, and extracts relevant legal knowledge units; and an answer generation module that, based on the extracted legal knowledge units, utilizes the reasoning and generation capabilities of the large-scale language model to construct a multi-path answer sequence that conforms to agricultural legal norms, and verifies its legal logic consistency and factual accuracy, filtering out conflicting or ambiguous answer paths. The optimization feedback module dynamically optimizes the semantic association weights in the knowledge graph network based on the verification results, and feeds the optimized association weights back to the intent matching stage. Based on the optimized semantic association weights, the final legal question and answer response is generated and output to the interactive interface.

[0020] In one embodiment of the present invention, see [reference] Figure 2 The data parsing module acquires unstructured document data in the field of agricultural law and performs multi-dimensional analysis. It collects legal texts, administrative penalty decisions, and typical case judgments from agricultural administrative department databases, judicial judgment document websites, and legal professional document libraries as initial document data. The initial document data undergoes format normalization processing to unify the encoding format and layout style of documents from different sources, eliminating parsing interference caused by format differences. Named entity recognition technology is used to scan the normalized documents, identifying and labeling the agricultural production and management entities, administrative act names, legal clause indexes, and geographical area information involved. Combined with syntactic dependency analysis, three logical components are identified in the legal provisions: hypothetical conditions, behavioral patterns, and legal consequences. Each component is assigned an independent structured identifier. The structured identifiers are mapped to corresponding original document fragments to establish an original text location index for key legal points, completing the multi-dimensional analysis of the documents.

[0021] The knowledge construction module imports the parsed legal provisions, judicial interpretations, and case summaries into the agricultural legal knowledge unit construction process. Based on the structured identifiers of the legal provisions, it encapsulates the assumptions, behavioral patterns, and legal consequences into independent legal knowledge sub-units. Judicial interpretations and case summaries are semantically segmented according to their argumentation logic and judgment principles, with each segment encapsulated as a case law knowledge sub-unit. A globally unique knowledge unit identifier is assigned to each legal knowledge sub-unit and case law knowledge sub-unit, indicating its legal domain level and validity grade. Semantic anchors are established between knowledge units, including synonymous legal concepts, textual citation relationships, and case similarity associations. Initial association strength coefficients are generated between knowledge units based on these semantic anchors, and all knowledge units and their relationships are stored in the agricultural legal knowledge unit database.

[0022] In practical implementation, the data parsing module acquires unstructured document data in the field of agricultural law and performs multi-dimensional analysis. This process involves the module collecting data from three sources: the database of agricultural administrative departments, the Judicial Judgment Documents Network, and a legal professional document library. In practice, the module performs format normalization on the initial document data. For example, it converts HTML-formatted judgments from the Judicial Judgment Documents Network and PDF-formatted regulations from the database of agricultural administrative departments into UTF-8 encoded plain text format and removes layout style marks such as headers, footers, and page breaks. This process eliminates the interference of format differences between different document sources on subsequent text parsing. In some embodiments, named entity recognition technology is used to scan the normalized documents. The named entity recognition model identifies and labels the entity information involved in the document. The model identifies agricultural production and management entities such as "rural collective economic organizations" and "family contracted farmers," administrative action names such as "administrative penalties" and "administrative enforcement," and geographical area information such as "North China Plain" and "Yangtze River Basin," and labels these entities with their types. By combining syntactic dependency analysis, the module delineates the logical structure of legal texts. For example, after syntactic analysis of the text "It is prohibited for any unit or individual to leave farmland idle or abandoned", "any unit or individual" is delineated as the hypothetical condition part, "idle or abandoned farmland" is delineated as the behavior pattern part, and the legal consequences caused by "prohibition" are delineated as the legal consequences part. Independent structured identifiers in the form of "ASSUMPTION_001", "BEHAVIOR_001", and "CONSEQUENCE_001" are assigned to these three logical components respectively.

[0023] It is understandable that by associating structured identifiers with corresponding original document fragments and establishing an index for locating key legal points, the module creates a mapping table. This table records the correspondence between the structured identifier "ASSUMPTION_001" and the original document fragment "any unit or individual," the structured identifier "BEHAVIOR_001" and the original document fragment "idle or abandoned farmland," and the structured identifier "CONSEQUENCE_001" and the overall legal consequences interpretation text of the provision. The establishment of this mapping signifies the completion of multi-dimensional document analysis. In practice, the knowledge construction module imports the parsed legal provisions, judicial interpretations, and case summaries into the agricultural legal knowledge unit construction process, which encapsulates the legal provisions based on their structured identifiers. For the clauses that have been parsed into three parts, “ASSUMPTION_001”, “BEHAVIOR_001”, and “CONSEQUENCE_001”, the process encapsulates “any unit or individual” as an independent legal knowledge sub-unit, “idle or abandoned farmland” as another independent legal knowledge sub-unit, and the corresponding legal consequence interpretation text as a third independent legal knowledge sub-unit.

[0024] In some embodiments, the texts of judicial interpretations and case summaries are semantically segmented according to their argumentation logic and the main points of the judgment, with each segment encapsulated as a case law knowledge subunit. For example, a case summary concerning the invalidity of a land contract might contain three core segments: "examination of the qualifications of the contracting parties," "determination of violation of mandatory provisions," and "legal consequences of contract invalidity." The process will segment and encapsulate these three semantic segments into three independent case law knowledge subunits. Each legal knowledge subunit and case law knowledge subunit is assigned a globally unique knowledge unit identifier, generated in the format "KLU_[type][timestamp][serial number]". The identifier is assigned along with the legal domain level and validity level of the knowledge unit, such as "land management - farmland protection" for the legal domain level and "law," "judicial interpretation," or "typical case" for the validity level.

[0025] It is understandable that semantic anchors are established between knowledge units. These anchors include synonymous references to legal concepts, citation relationships between articles, and case similarity associations. The process identifies the concepts in the legal knowledge sub-units "arable land" and "basic farmland" as having a hierarchical synonymous relationship, thus establishing a synonymous anchor; it also identifies the high similarity between two case law knowledge sub-units in terms of case facts and legal application, thus establishing a case similarity association anchor. Based on the semantic anchors, an initial association strength coefficient between knowledge units is generated. The formula for calculating the association strength coefficient is: in: Represents the initial correlation strength coefficient. This represents the total number of semantic anchor types that exist between knowledge unit pairs. Representing the Preset type weights for anchor point types, Representing the The specific number of anchor points existing on this knowledge unit pair. All knowledge units and their relationships calculated using formulas are stored in the agricultural law knowledge unit database.

[0026] In one embodiment of the present invention, see [reference] Figure 3 The knowledge graph generation module inputs the generated legal knowledge units into a large language model for deep semantic fusion, generating a knowledge graph network with contextual relationships. All knowledge unit description texts from the agricultural legal knowledge unit library are input into the pre-trained large language model in batches. The large language model extracts the deep semantic vector representation of each knowledge unit description text, which contains the abstract features and contextual meaning of legal concepts. The cosine similarity between the deep semantic vectors of any two knowledge units is calculated as a supplementary measure of their potential semantic relationship. The initial association strength coefficient based on semantic anchors and the potential semantic relationship based on deep semantic vectors are weighted and fused to generate a comprehensive association weight between knowledge units. Using knowledge units as nodes and comprehensive association weights as edges, an agricultural legal knowledge graph network is constructed and stored in a graph database.

[0027] The large language model is constructed by collecting specialized text corpora in the field of agricultural law, including full texts of laws and regulations, judicial interpretations, academic papers, and case analyses. The specialized text corpora undergo cleaning and preprocessing to remove irrelevant characters and formatting tags, retaining only the plain text content. A legal dictionary is used for word segmentation to ensure the completeness and accuracy of professional terminology. A word vector table specific to the legal domain is constructed, mapping legal terms to vector representations in a high-dimensional space. The basic network of the large language model is built using a Transformer architecture, with multiple layers of self-attention mechanisms. The basic network is pre-trained using a masked language model task, enabling the model to learn the contextual semantic relationships of legal texts. The model is fine-tuned through a legal reasoning task to improve its ability to understand legal logical relationships. Legal question answering is used to reinforce the training data, optimizing the accuracy and standardization of the legal answers generated by the model.

[0028] In practice, the knowledge graph generation module performs deep semantic fusion by inputting the generated legal knowledge units into a large language model. This process involves the module inputting the description texts of all knowledge units in the agricultural legal knowledge unit database in batches. Specifically, the tens of thousands of knowledge units stored in the database are input into a pre-trained large language model in batches of one thousand description texts each. The large language model extracts the deep semantic vector representation of each knowledge unit description text. This deep semantic vector representation is a high-dimensional dense vector containing the abstract features and contextual meaning of the legal concept. For example, the deep semantic vectors of a knowledge unit describing "farmland protection" and a knowledge unit describing "basic farmland" will be relatively close in vector space. The cosine similarity between the deep semantic vectors of any two knowledge units is calculated. The result of the cosine similarity calculation serves as a numerical measure, supplementing the measurement of the potential semantic relationship between knowledge units.

[0029] In some embodiments, an initial association strength coefficient based on semantic anchors and a latent semantic association degree based on deep semantic vectors are weighted and fused to generate a comprehensive association weight between knowledge units. The weighted fusion process is calculated using a linear combination formula, and the formula for calculating the comprehensive association weight is as follows: in: This represents the overall correlation weight between the final generated knowledge units. This represents the initial association strength coefficient generated based on semantic anchors. This represents the numerical measure of cosine similarity calculated based on deep semantic vectors. and These are pre-set weighted fusion coefficients used to adjust the contribution ratio of the initial association strength coefficient and the latent semantic association degree to the overall association weight. Knowledge units are used as nodes, and the overall association weight is used as the fusion weight. Using edge weights, an agricultural legal knowledge graph network is constructed, and the complete agricultural legal knowledge graph network is stored in the Neo4j graph database.

[0030] In some embodiments, a word vector table specific to the legal domain is constructed. This table is generated by training on cleaned professional text corpora using the Word2Vec algorithm, mapping legal terms such as "administrative penalty," "administrative review," and "administrative litigation" into vector representations in a 300-dimensional or higher real-valued space. A large language model foundation network is built using the Transformer architecture, configured with 12 encoder layers, each with 8 self-attention heads, and a feedforward neural network dimension of 2048. The foundation network is pre-trained using a masked language model task. During pre-training, 15% of the words in the input legal text sequence are randomly masked, and the foundation network is trained to predict the masked words based on context. This task enables the model to learn the contextual semantic relationships of the legal text.

[0031] It is understandable that model fine-tuning is performed through legal text reasoning tasks. These tasks construct a large number of "premise-legal conclusion" sample pairs. For example, given the premise "producing and selling seeds without obtaining a seed production and operation license," the model needs to deduce the conclusion "the agricultural department of the people's government at or above the county level shall order the cessation of production and operation." This fine-tuning process improves the model's ability to understand legal logical relationships. Furthermore, legal question-and-answer pairs are used for enhanced training. These pairs contain user inquiries and corresponding standard legal answers. The training model generates accurate answer texts based on the questions, thus enhancing the accuracy and standardization of the legal answers generated by the model.

[0032] In one embodiment of the present invention, the interactive processing module receives agricultural legal consultation questions input by a user in natural language form. It performs multi-round intent matching and context retrieval on the consultation questions against a knowledge graph network. The module performs word segmentation and part-of-speech tagging on the user-input natural language consultation questions, removes stop words, and extracts core legal consultation terms. These core legal consultation terms are converted into query vectors, and preliminary node matching is performed in the agricultural legal knowledge graph network to retrieve first-level related knowledge units whose similarity to the query vector exceeds a threshold. Starting from the first-level related knowledge units, a graph traversal is performed along the edges of the knowledge graph network. Second-level and third-level related knowledge units are selected based on comprehensive association weights, forming a preliminary set of related knowledge units. The descriptive text of the preliminary related knowledge unit set is concatenated with the user's original consultation question to form an enhanced contextual query statement. The enhanced contextual query statement is then input again into a large language model to generate a more accurate secondary query vector. This secondary query vector is used to perform a refined retrieval within the preliminary related knowledge unit set to determine the final matching target knowledge unit set.

[0033] The answer generation module, based on the extracted legal knowledge units, utilizes the reasoning and generation capabilities of the large language model to construct a multi-path answer sequence conforming to agricultural legal norms. It sorts the descriptive text of each knowledge unit in the target knowledge unit set according to its legal validity level and logical relevance. Using the sorted knowledge unit descriptive text as the basis for reasoning, it combines this with the legal reasoning rules built into the large language model to analyze from multiple reasoning perspectives, including rights determination, obligation fulfillment, remedies, and risk prevention. For each reasoning perspective, the large language model generates an independent answer path containing legal basis, factual application, and key conclusions. All independent answer paths generated from all reasoning perspectives are aggregated to form a multi-path answer sequence for the same consultation question. The original knowledge unit identifier and its reasoning perspective label are recorded in the multi-path answer sequence.

[0034] In its implementation, the interactive processing module receives agricultural legal consultation questions input by users in natural language and performs multi-round intent matching and context retrieval with the knowledge graph network. The module receives the user's input question, "How should we handle the destruction of arable land?" and processes it. It performs word segmentation and part-of-speech tagging on the user's natural language input question, obtaining lexical units such as "arable land," "was," "destroyed," "should," "how," and "handle." After removing stop words such as "was," "should," and "how," the core legal consultation terms "arable land" and "destruction" are extracted. These core legal consultation terms are converted into query vectors. The conversion process uses a large language model to map the terms into high-dimensional semantic vectors. Preliminary node matching is performed in the agricultural legal knowledge graph network. By calculating the cosine similarity between the query vector and the deep semantic vector representations of all knowledge unit nodes in the knowledge graph network, first-level related knowledge units with similarity scores exceeding a preset threshold are retrieved. These knowledge units may include knowledge units describing the principle of "arable land protection" and knowledge units describing "acts of destroying arable land."

[0035] In some embodiments, a graph traversal is performed along the edges of the knowledge graph network, starting with a first-level related knowledge unit. Second-level and third-level related knowledge units are selected based on the comprehensive association weight between them. For example, starting with the knowledge unit "acts of damaging farmland," the traversal proceeds to the legal knowledge subunit describing the crime of "illegally occupying farmland" as a second-level related knowledge unit, based on the higher comprehensive association weight. Further traversal then proceeds to the relevant administrative penalty case precedents as a third-level related knowledge unit. All retrieved related knowledge units form a preliminary set of related knowledge units. The descriptive text of all knowledge units in the preliminary set is then concatenated with the user's original inquiry question, "How should we handle the damage to farmland?", to form an enhanced contextual query statement. This statement includes the original question, relevant legal provisions, and case background information. The enhanced contextual query statement is input into the large language model again. The large language model combines the context to generate a more accurate secondary query vector. This secondary query vector is more focused on the intent of "legal remedy" and "accountability" than the initial query vector. The secondary query vector is used to refine the retrieval in the initially associated knowledge unit set. The final matching target knowledge unit set is determined by vector similarity calculation. The target knowledge unit set precisely contains the legal basis and case guidance related to the handling of farmland destruction.

[0036] It is understandable that the answer generation module performs the operation of invoking the reasoning and generation capabilities of the large language model based on the legal knowledge units extracted from the matching to construct a multi-path answer sequence that conforms to agricultural legal norms. The module sorts the descriptive text of each knowledge unit in the target knowledge unit set according to its legal validity level and logical relevance. The sorting is based on a sorting function that comprehensively considers the weight of the legal validity level and the logical relevance score; the calculation formula is as follows: in: The ranking score represents the knowledge unit. The legal force ranking weights of knowledge units This represents the semantic relevance score between the description text of the knowledge unit and the user's inquiry. and It is a balancing weight coefficient. The sorted knowledge unit description text is used as the basis for reasoning and combined with the legal reasoning rules built into the large language model. The large language model analyzes from multiple reasoning perspectives, including rights recognition, obligation performance, remedies, and risk prevention.

[0037] In some embodiments, from the perspective of obligation fulfillment reasoning, the large language model generates another independent answer path that includes the legal basis of the relevant party's obligation to protect farmland and restore it to its original state, the factual basis of describing the specific obligations violated by the destructive act, and the conclusion point of clarifying what obligations the relevant party should fulfill. From the perspective of remedies reasoning, the large language model generates an independent answer path that includes the legal basis of reporting to the natural resources authority or filing a civil lawsuit, the factual basis of specifying the procedural requirements for reporting or filing a lawsuit, and the conclusion point of summarizing feasible remedies. All the independent answer paths generated from all reasoning perspectives are summarized to form a multi-path answer sequence for the consultation question "How should the destruction of farmland be handled?" The original knowledge unit identifier code and its reasoning perspective label are recorded for each answer path in the multi-path answer sequence.

[0038] In one embodiment of the present invention, the answer generation module verifies the legal logic consistency and factual accuracy of multi-path answer sequences, and establishes an agricultural legal logic rule base. The rule base includes hierarchical relationships between legal concepts, preconditions for legal acts, and criteria for determining conflicting clauses. The legal conclusions stated in each answer path of the multi-path answer sequence are compared one by one with the rules in the agricultural legal logic rule base to detect any violations of logical rules or conceptual contradictions. Original legal provisions and case facts from the agricultural legal knowledge unit base are invoked to perform a textual back-verification of the factual descriptions and legal applications cited in the answer paths. When a logical inconsistency or inaccurate factual citation is detected in an answer path, a verification failure marker and the specific reason for the conflict are indicated. Only answer paths that pass the logical consistency and factual accuracy verification are retained, forming a refined answer sequence after verification.

[0039] The optimization feedback module dynamically optimizes the semantic association weights in the knowledge graph network based on the verification results, extracting the original knowledge unit identifiers and conflict reasons of the failed answer paths. Analyzing the conflict reasons, if incorrect reasoning is caused by excessively high initial association strength coefficients between knowledge units, the overall association weights between the corresponding knowledge unit nodes are reduced. Analyzing the conflict reasons, if key knowledge units are not retrieved due to excessively low potential semantic associations, the overall association weights between the corresponding nodes are increased based on the knowledge unit associations of successful paths in the refined answer sequence. The optimized and adjusted overall association weights are synchronously updated to the agricultural law knowledge graph network stored in the graph database. A log of this optimization adjustment is recorded, including the involved knowledge unit identifiers, the direction and magnitude of weight adjustments, for subsequent model iteration analysis.

[0040] In practice, the answer generation module performs legal logic consistency and factual accuracy verification on the multi-path answer sequence. During the initialization phase, the module establishes an agricultural legal logic rule base. This base includes rules governing hierarchical relationships between legal concepts, such as "basic farmland is a type of arable land," rules governing preconditions for legal acts, such as "administrative penalties must be based on clear facts and conclusive evidence," and criteria for determining conflicting clauses, such as "higher-level laws prevail over lower-level laws, and special laws prevail over general laws." Each answer path in the multi-path answer sequence is compared with the rules in the agricultural legal logic rule base to detect any violations of logical rules or conceptual contradictions. For example, if an answer path simultaneously cites the prohibition of "building houses on arable land" and the permitting provision of "applying for homestead land if it complies with planning regulations" without specifying the applicable conditions, the conflicting clause determination criteria in the agricultural legal logic rule base will detect this potential logical conflict.

[0041] In some embodiments, the original legal provisions and case facts in the agricultural legal knowledge unit base are invoked to perform a textual back-verification of the factual descriptions and legal applications cited in the answer paths. When a logical inconsistency or inaccurate factual citation is detected in an answer path, a verification failure mark and specific conflict reason are marked on the answer path, such as "Verification failed: Inaccurate factual citation, the penalty amount description of the cited clause does not match the original text." Only the answer paths that pass the logical consistency and factual accuracy verification are retained, forming a refined answer sequence after verification. In specific implementation, the multi-path answer sequence contains three answer paths, as shown in Table 1, and its verification process and results are shown in Table 1.

[0042] Table 1: Multi-path answer sequence verification results It is understandable that the optimization feedback module dynamically optimizes the semantic association weights in the knowledge graph network based on the verification results. The module extracts the original knowledge unit identifiers and conflict reasons of the failed answer paths. Analyzing the conflict reasons, if incorrect reasoning is caused by an excessively high initial association strength coefficient between knowledge units, the overall association weight between the corresponding knowledge unit nodes is reduced. For example, the error in answer path B stems from an overly strong association between the "administrative reconsideration" knowledge unit and the "administrative litigation pre-procedure" knowledge unit; the module will reduce the overall association weight between these two knowledge unit nodes in the agricultural law knowledge graph network. Analyzing the conflict reasons, if key knowledge units are not retrieved due to excessively low potential semantic association, the overall association weight between the corresponding nodes is increased based on the knowledge unit associations of successful paths in the refined answer sequence. For example, successful path A correctly associates the "farmland destruction" and "tort liability" knowledge units, but the potential semantic association between these two units is low; the module will increase its overall association weight.

[0043] In some embodiments, the weight optimization adjustment is calculated based on a dynamic adjustment formula. The formula for calculating the adjustment amount of the comprehensive correlation weights is as follows: in: This represents the adjustment amount for the overall correlation weight. This represents the preset learning rate coefficient. This represents the frequency of associations reflected in the successful paths within the refined answer sequence. This represents the frequency of erroneous associations reflected in the failed answer paths. The optimized and adjusted comprehensive association weights are synchronously updated to the agricultural law knowledge graph network stored in the graph database. A log of this optimization adjustment is recorded, with log entries including the relevant knowledge unit identifier, the direction of weight adjustment, and the adjustment magnitude. For example, recording "Knowledge units KLU_LAW_100 and KLU_CASE_200, weight adjustment direction: decrease, adjustment magnitude: -0.15". The recorded data is used for subsequent model iteration analysis.

[0044] See Figure 4 This is a pie chart showing the distribution of various reasons for answer path validation failures in an agricultural legal question-and-answer system. "Incorrect factual citation" accounts for the highest percentage, indicating that discrepancies between factual descriptions and the original legal text are the most prominent issues in the answer path. "Logical inconsistencies" and "missing applicable conditions" also account for relatively high percentages, reflecting common problems such as logical contradictions in legal reasoning and incomplete condition descriptions. This type of chart is typically used for performance analysis during the validation phase of agricultural legal question-and-answer systems. It helps developers identify high-frequency problems in the answer generation module and provides data support for optimizing knowledge graph association weights and improving the legal logic rule base.

[0045] In one embodiment of the present invention, the optimization feedback module generates a final legal Q&A response based on the optimized semantic association weights and outputs it to the interactive interface, associating the verified refined answer sequence with the current optimized agricultural legal knowledge graph network state. According to the response format template preset by the user interface, each answer path in the refined answer sequence is converted into a user-readable natural language paragraph. At the end of each natural language paragraph, a source hint of the core legal knowledge unit it is based on is appended. All converted natural language paragraphs are arranged in logical order according to their reasoning perspective, combining them into a structurally complete final legal Q&A response document. The final legal Q&A response document is pushed to the user terminal for display through the response output interface of the interactive interface.

[0046] In implementation, the optimization feedback module generates the final legal Q&A response based on the optimized semantic association weights and outputs it to the interactive interface. The module associates the verified refined answer sequence with the current optimized agricultural law knowledge graph network state. This association establishes a mapping relationship, linking the knowledge unit identifier code of each answer path in the refined answer sequence with the latest comprehensive association weight value of the corresponding node in the agricultural law knowledge graph network. Based on the user interface's preset response format template, which specifies the answer's title, paragraph structure, font, and citation style, each answer path in the refined answer sequence is converted into a user-readable natural language paragraph.

[0047] In some embodiments, all converted natural language paragraphs are arranged in a logical order according to their reasoning perspective, following a fixed logical sequence: rights determination, obligations fulfilled, remedies, and risk prevention. The combined and arranged natural language paragraphs form a structurally complete final legal Q&A response document, which includes a title, restated questions, explanations of answers from different perspectives, and a summary. The arrangement and combination process is implemented through a document generation function. The function takes a sorted list of natural language paragraphs as input and outputs a final legal Q&A response document that meets the required format. The logic of the document generation function can be expressed as follows: in: This represents the final legal Q&A response document. Represented by template and user issues The function that generates the title. This represents a string concatenation operation. Representing the An arranged natural language paragraph, It is the total number of paragraphs. This function represents the summary and tips at the end of the document. Through the response output interface of the interactive interface, defined as the ` / api / responsePOST` endpoint of the RESTful API, the final legal Q&A response document is encapsulated in JSON format and pushed to the user's client for display. The user's client can be a web browser or a mobile application interface.

[0048] Optionally, when displaying the final legal Q&A response document on the user interface, hyperlinks can be added to the source prompts for the core legal knowledge units attached to the document, allowing users to click the links to directly jump to view the detailed original text of that knowledge unit. It can be understood that the generation and output of the final legal Q&A response document marks the end of the complete processing flow for a single user inquiry, and the system will record the log of this interaction for future reference.

[0049] See Figure 5 This is a radar chart evaluating the response effectiveness of an agricultural law Q&A system. The "Logicality" score is perfect, indicating that the system's legal reasoning in the answers is rigorous. The "Usefulness" and "Readability" scores are relatively low, reflecting room for improvement in the practical operational guidance value and user reading experience. The "Completeness" and "Accuracy" scores are high, demonstrating good information coverage and content correctness. This type of radar chart is often used for multi-dimensional comprehensive evaluation of system performance, helping developers identify the system's strengths and weaknesses and providing direction for future optimization.

[0050] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0051] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. An intelligent interactive system for agricultural legal questions and answers based on a large model, characterized in that: The system includes: The data parsing module acquires unstructured document data in the field of agricultural law and performs multi-dimensional analysis to identify legal provisions, judicial interpretations, and case summaries in the documents. The knowledge construction module imports the parsed legal provisions, judicial interpretations and case summaries into the agricultural legal knowledge unit construction process. The process fragments the content and marks semantic anchors to form legal knowledge units with hierarchical tags. The graph generation module inputs the generated legal knowledge units into a large language model for deep semantic fusion, generating a knowledge graph network with contextual relationships. The interactive processing module receives agricultural legal consultation questions input by users in natural language, performs multi-round intent matching and context retrieval with the consultation questions and knowledge graph network, and extracts relevant legal knowledge units. The answer generation module, based on the legal knowledge units extracted through matching, invokes the reasoning and generation capabilities of the large language model to construct a multi-path answer sequence that conforms to agricultural legal norms, and verifies its legal logic consistency and factual accuracy, filtering out answer paths that are conflicting or ambiguous. The feedback module is optimized to dynamically optimize the semantic association weights in the knowledge graph network based on the verification results, and the optimized association weights are fed back to the intent matching stage. Based on the optimized semantic association weights, the final legal question and answer response is generated and output to the interactive interface.

2. The intelligent interactive system for agricultural legal question-and-answer based on a large model as described in claim 1, characterized in that, The acquisition and multi-dimensional analysis of unstructured document data in the field of agricultural law specifically involves: The initial document data includes legal texts, administrative penalty decisions, and judgments from agricultural administrative departments' databases, judicial rulings websites, and legal professional libraries. The initial document data is formatted and normalized to unify the encoding format and layout style of documents from different sources, thereby eliminating parsing interference caused by format differences. Named entity recognition technology is used to scan normalized documents, identify and label the agricultural production and management entities, administrative action names, legal and regulatory clause indexes and geographical area information involved; By combining syntactic dependency analysis, we delineate three logical components in legal provisions: assumed conditions, behavioral patterns, and legal consequences, and assign independent structured identifiers to each component. By associating structured identifiers with corresponding original document fragments, an index for locating key legal points in the original text is established, enabling multi-dimensional parsing of the document.

3. The intelligent interactive system for agricultural legal question-and-answer based on a large model as described in claim 2, characterized in that, The process of importing the parsed legal provisions, judicial interpretations, and case summaries into the agricultural legal knowledge unit construction process is as follows: Based on the structured identifiers of legal provisions, assumptions, behavioral patterns, and legal consequences are encapsulated into independent legal knowledge sub-units. The judicial interpretations and case summary texts are semantically segmented according to their argumentation logic and the main points of the judgments, and each segment is encapsulated as a case knowledge subunit; Each legal knowledge subunit and case law knowledge subunit is assigned a globally unique knowledge unit identifier code, and its legal domain level and validity level are marked accordingly; Semantic anchors are established between knowledge units, including synonyms of legal concepts, citation relationships of provisions, and similarity associations of cases; Initial association strength coefficients between knowledge units are generated based on semantic anchors, and all knowledge units and their relationships are stored in the agricultural law knowledge unit database.

4. The intelligent interactive system for agricultural legal question-and-answer based on a large model as described in claim 3, characterized in that, The legal knowledge units formed are input into a large language model for deep semantic fusion to generate a knowledge graph network with contextual association. Specifically: All knowledge unit description texts in the agricultural law knowledge unit library are input into a pre-trained large language model in batches. The deep semantic vector representation of each knowledge unit is extracted from the text using a large language model. The deep semantic vector representation contains the abstract features and contextual meaning of legal concepts. Calculate the cosine similarity between the deep semantic vectors of any two knowledge units as a supplementary measure of their potential semantic relevance. The initial association strength coefficient based on semantic anchors and the latent semantic association degree based on deep semantic vectors are weighted and fused to generate a comprehensive association weight between knowledge units. Using knowledge units as nodes and comprehensive association weights as edges, an agricultural legal knowledge graph network is constructed and stored in a graph database.

5. The intelligent interactive system for agricultural legal question-and-answer based on a large model as described in claim 1, characterized in that, The process of receiving agricultural legal consultation questions input by users in natural language involves performing multi-round intent matching and context retrieval with a knowledge graph network, specifically: The system performs word segmentation and part-of-speech tagging on the natural language consultation questions entered by users, removes stop words, and extracts core legal consultation terms. Core legal consulting terms are converted into query vectors, and preliminary node matching is performed in the agricultural law knowledge graph network to retrieve first-level related knowledge units whose similarity to the query vectors exceeds a threshold. Starting with the first-level related knowledge unit, the graph is traversed along the edges of the knowledge graph network. Based on the comprehensive association weight, the second-level and third-level related knowledge units are selected to form a preliminary set of related knowledge units. The descriptive text of the initially associated knowledge unit set is combined with the user's original inquiry to form an enhanced contextual query statement; The enhanced contextual query statement is input again into the large language model to generate a more accurate secondary query vector. The secondary query vector is then used to perform a refined retrieval in the initial set of associated knowledge units to determine the final set of matching target knowledge units.

6. The intelligent interactive system for agricultural legal question-and-answer based on a large model as described in claim 5, characterized in that, The process involves using the legal knowledge units extracted through matching, leveraging the reasoning and generation capabilities of a large language model, to construct a multi-path answer sequence that conforms to agricultural legal norms. Specifically: The description text of each knowledge unit in the target knowledge unit set is sorted according to its legal validity level and logical relevance. The sorted knowledge unit description text is used as the basis for reasoning, and combined with the legal reasoning rules built into the big language model, the analysis is carried out from multiple reasoning perspectives, including rights recognition, obligation performance, remedies and risk prevention. For each reasoning perspective, the large language model generates an independent answer path that includes legal basis, applicable facts, and key conclusions; All independent answer paths generated from different reasoning perspectives are aggregated to form a multi-path answer sequence for the same consultation question; In the multi-path answer sequence, record the original knowledge unit identifier code and its reasoning angle label that each answer path depends on.

7. The intelligent interactive system for agricultural legal question-and-answer based on a large model as described in claim 6, characterized in that, The verification of legal and logical consistency and factual accuracy of the multi-path answer sequence specifically includes: Establish an agricultural legal logic rule base, which includes the hierarchical relationship between legal concepts, the preconditions for legal acts, and the criteria for determining conflict clauses; The legal conclusion stated by each answer path in the multi-path answer sequence is compared with the rules in the agricultural legal logic rule base to detect whether there are any violations of logical rules or conceptual contradictions. The original legal provisions and case facts in the agricultural law knowledge unit database are retrieved to verify the original text of the factual descriptions and legal applications cited in the answer path. When a logical inconsistency or inaccurate factual reference is detected in an answer path, a verification failure flag and the specific reason for the conflict are marked on the answer path. Only the answer paths that pass the checks for logical consistency and factual accuracy are retained, forming a refined sequence of verified answers.

8. The intelligent interactive system for agricultural legal question-and-answer based on a large model as described in claim 7, characterized in that, The method of dynamically optimizing the semantic association weights in the knowledge graph network based on the verification results is as follows: Extract the original knowledge unit identifier code on which the failed verification answer path depends and the reason for its conflict; Analyze the causes of the conflict. If the incorrect reasoning is caused by an excessively high initial association strength coefficient between knowledge units, then reduce the overall association weight between the corresponding knowledge unit nodes. Analyze the causes of the conflict. If the key knowledge units are not retrieved due to low potential semantic relevance, then increase the comprehensive relevance weight between the corresponding nodes based on the knowledge unit relevance of the successful path in the refined answer sequence. The optimized and adjusted comprehensive correlation weights will be synchronously updated to the agricultural law knowledge graph network stored in the graph database; Record the log of this optimization adjustment, including the knowledge unit identifier code involved, the direction and magnitude of weight adjustment, for subsequent model iteration analysis.

9. The intelligent interactive system for agricultural legal question-and-answer based on a large model as described in claim 1, characterized in that, The process of generating the final legal question-and-answer response based on the optimized semantic association weights and outputting it to the interactive interface is as follows: The validated and refined answer sequence is associated with the current optimized agricultural law knowledge graph network status; Based on the preset response format template of the user interface, each answer path in the refined answer sequence is converted into a natural language paragraph that the user can read. At the end of each natural language paragraph, a source note for the core legal knowledge unit on which it is based is attached; All the converted natural language paragraphs are arranged in a logical order according to their reasoning perspective, and combined into a structurally complete final legal Q&A response document; The final legal Q&A response document is pushed to the user's device for display through the response output interface of the interactive interface.

10. The intelligent interactive system for agricultural legal question-and-answer based on a large model according to claim 4, characterized in that, The large language model is constructed through the following steps: Collect professional textual data in the field of agricultural law, including full texts of laws and regulations, judicial interpretations, academic papers, and case analyses; Clean and preprocess professional text corpora to remove irrelevant characters and formatting marks, and retain plain text content; The text was segmented using a legal dictionary to ensure the completeness and accuracy of the technical terms. Construct a word vector table specific to the legal field, mapping legal terms into vector representations in a high-dimensional space; The Transformer architecture is used to build the basic network of a large language model, and a multi-layer self-attention mechanism is set up. The basic network is pre-trained using a masked language model task, enabling the model to learn the contextual semantic relationships of legal texts; By fine-tuning the model through legal reasoning tasks, the model's ability to understand legal logical relationships can be improved. The model is trained using legal question-and-answer tools to enhance the accuracy and standardization of the legal answers it generates.

Citation Information

Cited By

  • Scenic area intelligent question answering and recommendation method based on integration of knowledge graph and large model

    CN121880532A

  • Scenic spot intelligent question answering and recommendation method based on knowledge graph and large model fusion

    CN121880532B