LLM-based agricultural intelligent question and answer optimization method

By applying LLM-based optimization methods in the agricultural intelligent question-and-answer system, the limitations of the system in understanding and answering complex agricultural questions are solved, and more efficient, accurate and personalized agricultural intelligent question-and-answer services are achieved, and the technical level of agricultural production has been promoted. and the improvement of sustainable development.

CN119396972APending Publication Date: 2025-02-07GANSU WANWEI INFORMATION TECH CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411453822.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-17
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

The existing agricultural intelligent question-and-answer system has limitations in understanding and answering complex agricultural questions. The accuracy and efficiency of answers need to be improved, the knowledge base is difficult to update and expand, and the answers lack personalization.

Method used

Adopting an optimization method based on large language model (LLM), building an agricultural knowledge corpus through steps such as data preprocessing, model training, problem analysis and intention recognition, knowledge inference and answer generation, answer optimization and user feedback, etc., to build an agricultural knowledge corpus to improve the system's understanding ability. and answer accuracy, improve answer efficiency and personalization.

Benefits of technology

It has improved the efficiency of obtaining agricultural knowledge, improved the technical level of agricultural production, promoted the sustainable development of agriculture, and provided more accurate, efficient and personalized intelligent agricultural Q&A services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119396972A_ABST
    Figure CN119396972A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence data processing, in particular to an optimization method for agricultural intelligent questions and answers based on LLM. By combining natural language processing, deep learning and agricultural knowledge, the invention aims to improve the performance of the agricultural intelligent question-answering system and provide more accurate, efficient and personalized services for users. Farmers can quickly obtain required agricultural knowledge and technology through the intelligent question-answering system without looking up a large number of literatures or asking for experts.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence data processing technology, and in particular to an optimization method for agricultural intelligent question answering based on LLM. By combining natural language processing, deep learning and agricultural knowledge, this paper aims to improve the performance of the agricultural intelligent question answering system and provide users with more accurate, efficient and personalized services. Background Art

[0002] With the rapid development of artificial intelligence technology, agricultural intelligent question-answering systems have become an important tool in the agricultural field. However, existing agricultural intelligent question-answering systems still have some problems and challenges. First, for complex agricultural problems, the system's understanding ability and answer accuracy need to be improved. Second, there are too many factors affecting agricultural problems (such as temperature, precipitation, terrain, water sources, soil, etc.). Third, the updating and expansion of the knowledge base is also an important issue, and new agricultural knowledge and information need to be continuously incorporated. In addition, the system's answer efficiency and personalization level also need to be improved.

[0003] In order to solve the above problems, we began to explore the optimization method of agricultural intelligent question answering based on large language models (LLM). The LLM model has powerful language processing and knowledge learning capabilities, which can improve the system's understanding ability and answer accuracy. At the same time, the LLM model can also extract and integrate knowledge from a large-scale corpus, providing strong support for the update and expansion of the knowledge base. The LLM model can also integrate in multiple dimensions. For the user's agricultural-related input, the multi-dimensional comprehensive analysis (meteorology, region, etc.) gives the output answer. In addition, by optimizing the reasoning speed and personalized answer strategy of the LLM model, the system's answer efficiency and personalization can also be improved.

[0004] Therefore, the agricultural intelligent question answering optimization method based on LLM has important research significance and application value, and is helpful to promote the development and application of agricultural intelligent question answering system. Summary of the invention

[0005] The purpose of the present invention is to provide an intelligent question-answering optimization system and method based on LLM, aiming to solve the limitations of existing intelligent question-answering systems in understanding and answering complex questions, improve the accuracy and efficiency of the question-answering system, and provide users with a better information query experience.

[0006] An optimization method for agricultural intelligent question answering based on LLM includes the following steps: S1. Data preprocessing First, a large amount of text data is collected, including agricultural books, papers, news reports, and agricultural websites; the text data is cleaned, denoised, segmented, and part-of-speech tagged to construct a corpus; S2. Model training Choose an LLM model, such as GPT or BERT, and train it on the preprocessed corpus, optimizing the training strategy by adjusting model parameters; S3. Question analysis and intention recognition When a user inputs a question, the LLM model is first used to analyze the question and extract key information and keywords. Then, the intent recognition algorithm is used to determine the specific intent and needs of the user's question. Through the above means, multi-dimensional content integration is achieved, and for agricultural-related questions input by users, a multi-dimensional comprehensive analysis is performed to obtain answers. S4. Knowledge Reasoning and Answer Generation After the user inputs a question, LLM first parses the question to extract key information and keywords. Then, LLM performs intent recognition to analyze the specific content the user wants to know or the type of answer the user expects. Based on the parsed question keywords and recognized intent, LLM retrieves relevant information from the knowledge base, including structured database records or unstructured documents and articles, and performs reasoning and association analysis in the retrieved knowledge to find the knowledge points and logical relationships that are most relevant to the question. S5. Answer optimization and user feedback After grammar checking and semantic adjustment operations, readability is improved, user feedback is collected, and answers are trained and adjusted in real time; first, grammatical errors in the answers are automatically checked and corrected accordingly. Secondly, semantic adjustment is to optimize the answer content and adjust the vocabulary and expressions in the answers to improve the readability of the answers.

[0007] The beneficial effects of the present invention are: 1. Improved the efficiency of agricultural knowledge acquisition: Farmers can quickly obtain the required agricultural knowledge and technology through the intelligent question-and-answer system without having to consult a large amount of literature or consult experts.

[0008] Improved the technical level of agricultural production: The professional answers and suggestions provided by the system can help farmers solve practical problems and improve the technical level and efficiency of agricultural production.

[0009] Promoted the sustainable development of agriculture: Through the application of the intelligent question-answering system, farmers can better master agricultural knowledge and technology and achieve sustainable development of agriculture.

[0010] In summary, the agricultural intelligent question-answering optimization system and method based on LLM integrates problems in multiple dimensions and answers user questions after comprehensive analysis in multiple dimensions. It has significant technical innovation and practicality, and is expected to bring important impetus and breakthroughs to the intelligent development of the agricultural field. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Figure 1This is a flow chart of the optimization method of the present invention; Figure 2 This is the data preprocessing flow chart; Figure 3 Flowchart for model training; Figure 4 Flowchart for problem parsing and intent identification; Figure 5 Generate flowcharts for knowledge reasoning and answers. DETAILED DESCRIPTION

[0012] To achieve the above purpose, the present invention adopts the following detailed technical solutions An optimization method for agricultural intelligent question answering based on LLM includes the following steps: S1. Data preprocessing First, collect a large amount of text data (including agricultural books, papers, news reports, agricultural websites, etc., and perform preprocessing operations such as cleaning, denoising, word segmentation, and part-of-speech tagging on these data) to build a rich corpus covering knowledge in multiple fields. The process is as follows: The relevant code for data cleaning is as follows: public class DataCleaner { / / Regular expression used to match URLs private static final Pattern URL_PATTERN = Pattern.compile("https?: / / \\S+"); / / Remove HTML tags public static String cleanHtml(String html) { return Jsoup.clean(html, Whitelist.none()); / / Using Whitelist.none() will remove all HTML tags } / / Remove special characters (assuming you want to remove all non-alphanumeric characters) public static String cleanSpecialCharacters(String input) { return input.replaceAll("[^a-zA-Z0-9]", ""); } / / Remove the URL (optional) public static String removeUrls(String input) { return URL_PATTERN.matcher(input).replaceAll(""); } / / Cleaning method combining all the above steps public static String cleanData(String input) { String cleanedHtml = cleanHtml(input); String cleanedSpecialChars= cleanSpecialCharacters(cleanedHtml); String cleanedData = removeUrls(cleanedSpecialChars); return cleanedData; } } Text Normalization: Remove punctuation: You can use regular expressions and the String.replaceAll() method.

[0013] Dealing with numbers: If you want to replace or tokenize numbers, you can also use regular expressions.

[0014] Dealing with dates: This usually involves date parsing, using java.time.format.DateTimeFormatter or similar tools. But in this example, we will simply look for and mark some predefined date formats.

[0015] The specific implementation code is as follows: / / Define a regular expression to match punctuation marks private static final Pattern PUNCTUATION_PATTERN =Pattern.compile("[\\p{Punct}]+"); / / Define a regular expression to match numbers private static final Pattern NUMBER_PATTERN = Pattern.compile("\\d+"); / / Assumed date format, this is just an example private static final String[]DATE_FORMATS = {"dd-MM-yyyy", "yyyy-MM-dd"}; / / Remove punctuation and process numbers and dates (here simply replaced with placeholders) public static String normalizeText(String text) { / / Remove punctuation text = PUNCTUATION_PATTERN.matcher(text).replaceAll(""); / / Process numbers (replace with NUM) Matcher numberMatcher = NUMBER_PATTERN.matcher(text); while (numberMatcher.find()) { text = text.replaceFirst(Matcher.quoteReplacement(numberMatcher.group()), "NUM"); } / / Process the date (this is just an example, you may need more complex logic) for (String dateFormat : DATE_FORMATS) { / / In actual applications, you may need to use DateTimeFormatter to parse and replace dates String datePattern = "\\b" + Pattern.quote(dateFormat.replace("yyyy", "\\d{4}").replace("MM","\\d{2}").replace("dd","\\d{2}")) + "\\b"; text = text.replaceAll(datePattern, "DATE"); } return text; } S2. Model training Select a suitable LLM model, such as GPT, BERT, etc., and train it on the preprocessed agricultural corpus. By adjusting the model parameters and optimizing the training strategy, the model can fully learn the knowledge and language structure in the agricultural field and have strong language generation and comprehension capabilities. During the pre-training process, the model's performance can also be optimized by adjusting the model's parameters and structure.

[0016] Model selection: Classification is the problem of classifying instances into predefined categories. For classification problems, the model structures that can be selected include but are not limited to.

[0017] 1) Classification problem is to classify instances into predefined categories. For classification problems, the model structures that can be selected include but are not limited to logistic regression, decision tree, random forest, support vector machine (SVM), neural network.

[0018] 2) Regression problem is the problem of predicting one or more continuous values. In regression problem, the following model structures can be considered: Linear regression, polynomial regression, decision tree regression, random forest regression, neural network.

[0019] 3) The clustering problem is to group the samples in the data set so that the similarity between samples in the same group is high, while the similarity between samples in different groups is low. Common clustering algorithms include: K-means clustering, hierarchical clustering, DBSCAN, and spectral clustering.

[0020] Model training: During the model training process, choosing an appropriate loss function is very important because it is directly related to the learning effect and prediction performance of the model.

[0021] 1) Mean square error, suitable for regression problems, with fewer outliers in the data.

[0022] 2) Cross entropy loss, classification problems, especially binary and multi-classification problems.

[0023] During model training, setting training parameters properly is also the key to improving model performance. The learning rate should start from an empirical value and be adjusted through a learning rate scheduling strategy; the batch size should be experimentally selected based on GPU memory and model stability; the number of iterations should be determined in combination with an early stopping mechanism and model performance monitoring.

[0024] Model adjustment: During model training, regularization can be used to prevent overfitting.

[0025] 1) L1 regularization: By adding the L1 norm penalty term to the loss function, the model weights are constrained so that some weights tend to zero, thereby reducing the model complexity and improving the model generalization ability.

[0026] 2) L2 regularization: By adding the L2 norm penalty term to the loss function, the model weights are constrained to make the weight values ​​smaller, reduce the model's sensitivity to training data, and prevent overfitting.

[0027] 3) Dropout: During the training process, the output of some neurons is randomly discarded to reduce the dependency between neurons and improve the robustness of the model. Regularly retraining the model with new data is of great significance to the long-term performance and reliability of the model. This process ensures that the model keeps up with changes in data distribution and captures new patterns in a timely manner, thereby effectively preventing model degradation, maintaining its prediction accuracy and business applicability, and ensuring that the model continues to play its value in a changing environment.

[0028] S3. Question analysis and intention recognition When a user enters a question, the system first uses the LLM model to parse the question (parse out the area and other information contained in the question) and extract key information and keywords. Then, through the intent recognition algorithm, the specific intent and needs of the user's question are determined. This helps the system understand the user's question more accurately and provides strong support for subsequent answer generation.

[0029] For example: User input: How to grow rice? Processing steps: 1. Extract agricultural related factors, such as geographical information and crop information 2. Query relevant data based on agricultural factors, such as regional climate, soil, water resources and other information; crop variety information, market prices, economic benefits, pests and diseases and other information 3. Integrate the above information and finally output the generated content.

[0030] For example, we can extract the relevant factors affecting agriculture from the user input content through semantic analysis. In the above text, the crop information is 'rice', and the user did not enter the region information. We can obtain the corresponding region information through the IP address where the user logged in. As shown below: String ipAddresses = request.getHeader("X-Forwarded-For"); if (ipAddresses == null || ipAddresses.length() == 0 ||UNKNOWN.equalsIgnoreCase(ipAddresses)){ ipAddresses = request.getHeader("Proxy-Client-IP"); } if (ipAddresses == null || ipAddresses.length() == 0 || UNKNOWN.equalsIgnoreCase(ipAddresses)) { ipAddresses = request.getHeader("WL-Proxy-Client-IP"); } if (ipAddresses == null || ipAddresses.length() == 0 || UNKNOWN.equalsIgnoreCase(ipAddresses)){ ipAddresses = request.getHeader("HTTP_CLIENT_IP"); } if (ipAddresses == null || ipAddresses.length() == 0 || UNKNOWN.equalsIgnoreCase(ipAddresses)){ ipAddresses = request.getHeader("X-Real-IP"); } if (ipAddresses != null && ipAddresses.length() != 0) { ip = ipAddresses.split(",")[0]; } if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ipAddresses)) { ip = request.getRemoteAddr(); } return StringUtils.equals(ip, "0:0:0:0:0:0:0:1")? DEFAULT_IP : ip; Retrieving the meteorological information of the location through the regional information: String url = MessageFormat.format(WEATHER_URL, cityId); CloseableHttpClient httpClient = HttpClientBuilder.create().build(); Through the above means, we can achieve multi-dimensional integration of content. For the agriculture-related questions input by users, we will conduct a multi-dimensional comprehensive analysis and continue to go through the following process to obtain more accurate answers.

[0031] S4. Knowledge Reasoning and Answer Generation After the user enters a question, LLM first analyzes the question to extract key information and keywords. Then, LLM performs intent recognition to analyze the specific content the user wants to know or the type of answer he or she expects to get.

[0032] Based on the parsed question keywords and identified intent, LLM retrieves relevant information from the knowledge base. This may include structured database records or unstructured documents, articles, etc. LM uses its powerful language understanding and reasoning capabilities to perform reasoning and association analysis in the retrieved knowledge to find the knowledge points and logical relationships that are most relevant to the question.

[0033] Based on the inference results, LLM starts to generate answers. The answers can be in text form or other forms (such as lists, charts, etc.), depending on the nature of the question and the needs of the user. During the answer generation process, LLM considers multiple factors, such as the completeness, accuracy, logic and fluency of the answer, to ensure that the generated answers are of high quality and easy to understand.

[0034] In some cases, the generated answers may be further validated to ensure their accuracy and reliability. This can be done by comparing them with other knowledge sources, scoring or ranking them using other models, etc.

[0035] As time goes by and data accumulates, LLM will continue to learn and optimize its knowledge reasoning and answer generation capabilities. New data and user feedback will be used to improve the parameters and structure of the model to improve its performance and accuracy.

[0036] S5. Answer optimization and user feedback The answers generated by the system will go through a series of optimization processes, including grammar checking and semantic adjustment, to improve the quality and readability of the answers. At the same time, the system will also collect user feedback information and make real-time adjustments and optimizations to the answers. This helps to continuously improve the accuracy of the question-answering system and user satisfaction.

[0037] First of all, grammar checking is the basis for ensuring smooth and fluent answers. By automatically checking grammatical errors in answers, such as typos, sentence structure problems, etc., and making corresponding corrections, the system can output more standardized answers.

[0038] Secondly, semantic adjustment is a deep optimization of the answer content. The system will adjust the vocabulary and expressions in the answer according to the context of the question and the user's intention to make it more in line with the user's needs and expectations. This includes using more accurate vocabulary and clearer expressions to improve the accuracy and readability of the answer.

[0039] In addition, the system will also consider the diversity and innovation of the answers. When generating answers, the system will try to use different expressions, provide different solutions, etc., to enrich the content of the answers and meet the diverse needs of users.

[0040] In terms of user feedback, the system collects and analyzes user feedback information to understand user satisfaction with answers, existing problems, and improvement suggestions. This information is very valuable to the system and can help the system identify deficiencies and defects in answers and make targeted improvements.

[0041] Specifically, the system can collect user feedback through questionnaires, user comments, satisfaction ratings, etc. For the collected feedback information, the system needs to conduct in-depth analysis and mining to find out the problems and patterns, and provide a basis for subsequent improvements.

[0042] Based on user feedback, the system can adjust and optimize answers in real time. For example, the system can promptly correct common problems or errors reported by users; the system can consider implementing improvement suggestions put forward by users in subsequent versions. In this way, the question-answering system can be continuously iterated and improved to improve performance and user satisfaction.

[0043] Finally, the system integration and interaction design integrates the above technical solutions into the intelligent question-answering system to achieve real-time interaction with users. The system uses natural language processing technology to convert user input into a format that the system can understand, and displays the system output to the user in the form of natural language. At the same time, the system also has a friendly user interface and interactive design to provide users with a convenient and comfortable experience.

[0044] Taking the intelligent question-answering system in the field of agricultural planting as an example, the specific implementation steps are as follows: 1. Farmers use devices such as smartphones or computers to input questions about crop cultivation by voice or text, such as "How to prevent and control corn pests and diseases?" 2. The system uses the LLM model to analyze farmers’ questions and identify their intentions, and determines the relevant information that farmers need to know about corn pest control based on factors such as the farmer’s region, weather, and time.

[0045] 3. The system combines the agricultural knowledge corpus and logical reasoning methods to search for professional knowledge and experience on corn pest control. Then, the LLM model is used to generate detailed answers, including pest identification methods, prevention and control measures, and precautions.

[0046] 4. The system will display the generated answers to farmers in the form of text or voice, and farmers can perform actual operations based on the answers. At the same time, farmers can evaluate and provide feedback on the answers, and the system will optimize and improve based on the feedback. The technical point of the present invention is to use the powerful natural language processing capability of the LLM model to comprehensively optimize the agricultural intelligent question-answering system. By building an agricultural knowledge corpus, improving question parsing and intent recognition capabilities, optimizing knowledge reasoning and answer generation processes, and realizing system integration and friendly interaction, the present invention has greatly improved the accuracy and efficiency of the agricultural intelligent question-answering system.

[0047] Glossary LLM (Large Language Model): A natural language processing model based on deep learning technology. It can understand and generate human language, process large amounts of text data, and demonstrate strong performance in tasks such as question answering, text generation, and machine translation. LLM models are usually based on the Transformer architecture and learn rich language knowledge and contextual information through pre-training on a large-scale corpus.

[0048] Agricultural intelligent question-answering system: a system that uses artificial intelligence technology to provide question answering and knowledge consulting services in the agricultural field. It can parse natural language questions raised by users, find answers from agricultural-related knowledge bases, or generate answers through algorithmic reasoning.

[0049] Semantic Analysis is a key step in Natural Language Processing (NLP), which focuses on understanding and parsing the deep meaning of text or sentences. The goal of semantic analysis is to identify and understand the entities in the text, the relationships between them, and the higher-level concepts constituted by these entities and relationships.

Claims

1. An optimization method for agricultural intelligent question answering based on LLM, characterized by The steps include: S1. Data preprocessing First, a large amount of text data is collected, including agricultural books, papers, news reports, and agricultural websites; the text data is cleaned, denoised, segmented, and part-of-speech tagged to construct a corpus; S2. Model training Choose an LLM model, such as GPT or BERT, and train it on the preprocessed corpus, optimizing the training strategy by adjusting model parameters; S3. Question analysis and intention recognition When a user inputs a question, the LLM model is first used to analyze the question and extract key information and keywords. Then, the intent recognition algorithm is used to determine the specific intent and needs of the user's question. Through the above means, multi-dimensional content integration is achieved, and for agricultural-related questions input by users, a multi-dimensional comprehensive analysis is performed to obtain answers. S4. Knowledge Reasoning and Answer Generation After the user enters a question, LLM first parses the question to extract key information and keywords. Then, LLM performs intent recognition to analyze the specific content the user wants to know or the type of answer the user expects. Based on the parsed question keywords and recognized intent, LLM retrieves relevant information from the knowledge base. Including structured database records or unstructured documents and articles, reasoning and association analysis are performed in the retrieved knowledge to find the knowledge points and logical relationships that are most relevant to the problem; S5. Answer optimization and user feedback After grammar checking and semantic adjustment operations, readability is improved, user feedback is collected, and answers are trained and adjusted in real time; first, grammatical errors in the answers are automatically checked and corrected accordingly. Secondly, semantic adjustment is to optimize the answer content and adjust the vocabulary and expressions in the answers to improve the readability of the answers.

Citation Information

Cited By

  • Agricultural knowledge interaction method and system for intelligent question and answer

    CN121434411A

  • Smart city information management method and system based on GIS and AI fusion

    CN121436295A

  • system

    JP2026155587A