A feedback method for adjusting agricultural AI question-answering results
By constructing the agricultural knowledge base and user recommendation library, analyzing and recommending pesticides that meet the needs of user and regional regulations, the problems of pesticide recommendations in the agricultural AI Q & A system are not in line with the actual situation, and improved the quality and practicality of recommendation.
Patent Information
- Application Number
- CN202410554658.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-07
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-05-07
AI Technical Summary
When giving pesticide recommendations, it is difficult to take into account factors such as regulations, environmental conditions and crop types in different regions, which leads to the recommended pesticides being banned or unavailable.
By constructing agricultural knowledge bases, obtaining user information and establishing a user recommendation library, analyzing the types of pesticides in the preliminary answers of users, matching the disable status data in the global pesticide depot, and using the recommendation algorithm in the user recommendation library to obtain the most suitable pesticide Select and adjust and evaluate the input when necessary.
It improves the quality and practicality of the recommendation results of pesticides, avoids the recommended or unable to obtain pesticides, and ensures the actual application value of the answer and the satisfaction of users.
Smart Images

Figure CN118467692B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a feedback method for adjusting agricultural AI question-answering results. Background Art
[0002] In the AI question-answering system in the agricultural field, after users ask questions, the answers given by the system may not be in line with the actual situation, such as the recommended pesticides have been banned or are not available in the user's area. This may cause users to encounter difficulties in actual operations or be unable to effectively solve the problem, affecting the efficiency and quality of agricultural production.
[0003] In real agricultural production, the choice of pesticides plays a vital role in crop growth and pest control. However, due to differences in regulatory standards, environmental conditions, and crop types in different regions, some pesticides may be banned or restricted in certain areas. In addition, there may also be regional differences in the supply chain of pesticides, resulting in some pesticides being unavailable or unstable in supply in the user's area.
[0004] Therefore, AI question-answering systems in the agricultural field need to take these realities into account when giving answers to avoid recommending pesticides that are inappropriate or unavailable. Summary of the invention
[0005] In view of this, the present invention provides a feedback method for adjusting agricultural AI question-answering results, which can more accurately understand the needs of users and provide the most appropriate pesticide selection. This method improves the quality and practicality of recommendation results by adjusting and re-evaluating the input when necessary, without the need to reorganize data and train large language models.
[0006] The technical purpose of the present invention is achieved in this way:
[0007] The present invention provides a feedback method for adjusting agricultural AI question-answering results, comprising the following steps:
[0008] S1: Build agricultural knowledge base;
[0009] S2: Obtain user information and establish a user recommendation database based on the user information and agricultural knowledge base;
[0010] S3: The user inputs the initial question, which is fed into the agricultural language model, and the output is a preliminary answer;
[0011] S4: Identify the preliminary answer to obtain target information, make a recommendation in the user recommendation library based on the target information, and obtain recommended information of the target information;
[0012] S5: Convert the recommendation information into constraints and add them to the initial question to generate new questions. Input the new questions into the agricultural big language model to get the final answer.
[0013] On the basis of the above technical solution, preferably, the agricultural knowledge base includes a global pesticide library and a recommended pesticide library, the global pesticide library contains a data set of pesticide names, control objects and prohibited status, and the recommended pesticide library is a subset of pesticides in the global pesticide library that matches the recommended pesticide list, wherein the recommended pesticide library does not intersect with the data set of pesticides in prohibited status.
[0014] Based on the above technical solution, preferably, step S2 includes:
[0015] S21: obtaining user information, including user personal information and user purchase information, wherein the user personal information includes the user address and the user questionnaire score, the user questionnaire score includes the user's score on the similarity, reliability and resistance of pesticides, and the user purchase information includes a record set of pesticide purchases by the user;
[0016] S22: querying according to the user address, taking the supply and marketing cooperatives at all levels of the village, town, county, and city where the user address is located as the query target, and obtaining a pesticide sales list related to the user address, wherein the pesticide sales list includes the pesticide types and their sales supply and marketing cooperatives;
[0017] S23: Based on the pesticide sales list, establish a user local pesticide library, which includes pesticide types, pesticide sales supply and marketing agencies, and the distance between the sales supply and marketing agencies and the user address;
[0018] S24: The user's local pesticide library and the recommended pesticide library are combined and deduplicated to obtain a user recommended library.
[0019] Based on the above technical solution, preferably, step S23 includes:
[0020] S231: Quantify the user address and the addresses of supply and marketing cooperatives at all levels in terms of longitude and latitude;
[0021] S232: Select a pesticide from the pesticide sales list;
[0022] S233: Search for the sales supply and marketing cooperatives of the pesticide and determine the number of the sales supply and marketing cooperatives:
[0023] If the quantity is 1, the distance between the address of the sales supply and marketing agency and the user address is calculated using the longitude and latitude, the sales supply and marketing agency is bound to the pesticide, and step S234 is executed;
[0024] If the number is greater than 1, the distance between the addresses of each sales and marketing agency and the user's address is calculated using the longitude and latitude, the nearest sales and marketing agency is selected, it is bound to the pesticide, and step S234 is executed;
[0025] S234: Create a record for the pesticide, including the type of pesticide, the sales and marketing agency of the pesticide, and the distance between the sales and marketing agency and the user's address;
[0026] S235: repeating steps S232-S234 until all pesticides in the pesticide sales list are traversed to obtain a preliminary pesticide library;
[0027] S236: Match the pesticides in the preliminary pesticide library with the pesticide data set in the disabled state in the global pesticide library, remove the successfully matched pesticides from the preliminary pesticide library, and obtain the user's local pesticide library.
[0028] On the basis of the above technical solution, preferably, step S4 includes:
[0029] S41: Analyze the preliminary responses to identify the types of pesticides mentioned;
[0030] S42: Match the pesticide type mentioned in the preliminary answer with the pesticide data set in the prohibited state in the global pesticide library. When the match is successful, the pesticide type mentioned in the preliminary answer is used as the target information;
[0031] S43: Recommend the pesticide type of the target information in the user recommendation library using a recommendation algorithm to obtain recommended pesticides, which are the recommended information of the target information.
[0032] Based on the above technical solution, preferably, step S43 includes:
[0033] S431: setting variables temp and Name, where the variable Temp is used to store the recommended value, and the variable Name is used to store the name of the pesticide corresponding to the maximum recommended value, and initializing the variables temp and Name;
[0034] S432: Select a record in the user recommendation library. If it is the first time to select, the first record is selected. If it is not the first time to select, the next record of the previous record is selected. Each record in the user recommendation library includes the name of the pesticide, the type of pesticide, the control target and the distance value. The distance value is the distance between the pesticide sales place and the user address.
[0035] S433: Calculate the similarity S between the pesticide in the current record and the pesticide in the target information;
[0036] S434: Calculate the reliability A of the pesticide in the current record according to the distance value;
[0037] S435: obtaining the number of times T of use of the pesticide in the current record according to the user's purchase information, and calculating the pesticide resistance R of the pesticide in the current record according to the number of times T;
[0038] S436: Based on the resistance R, similarity S and reliability A, the recommendation coefficient score of the pesticide in the current record is calculated;
[0039] S437: Compare the recommendation coefficient score with the variable temp. If score>temp, it is determined that the recommendation coefficient of the pesticide in the current record is high, and the variable temp is updated to the score value of the pesticide in the current record, and the name of the pesticide is stored in the variable Name. Otherwise, execute step S438;
[0040] S438: Determine whether all records in the user recommendation library have been traversed. If so, output Name as the recommended pesticide. If not, return to step S432.
[0041] Based on the above technical solution, preferably, the similarity S is calculated as follows:
[0042]
[0043] Where S is the similarity, P1 is the set of pesticide control objects and applicable crops in the target information, P2 is the set of pesticide control objects and applicable crops in the current record, |P1∩P2| is the number of elements that intersect between the P1 set and the P2 set, that is, the number of objects and crops that are commonly controlled by the two pesticides, and |P1∪P2| is the number of elements that are combined between the P1 set and the P2 set, that is, the sum of the objects controlled by the two pesticides, excluding duplicates.
[0044] Based on the above technical solution, preferably, the calculation method of reliability A is:
[0045]
[0046] Where d is the distance value in kilometers.
[0047] Based on the above technical solution, preferably, the calculation method of drug resistance R is:
[0048] R=e -0.7T
[0049] Where T represents the number of pesticide uses in the current records in the past five years.
[0050] Based on the above technical solution, preferably, the calculation method of the recommendation coefficient score is:
[0051] score=w s *S+w a *A+w r *R
[0052] In the formula, w s is the weight coefficient corresponding to similarity A, w a is the weight coefficient corresponding to reliability A, w r is the weight coefficient corresponding to drug resistance R.
[0053] The method of the present invention has the following beneficial effects compared with the prior art:
[0054] (1) The method provided by the present invention can adjust the answer without retraining the model. By analyzing the initial answer of the model, it is identified whether the recommended pesticide is a banned pesticide or one that cannot be purchased locally. A recommendation algorithm is used to select a pesticide with similar effects, local availability, and low resistance risk. This pesticide is added to the question as a restriction condition and input into the model again. The final output result is both accurate and feasible, and the purpose of optimizing the answer is achieved through this method. In this way, the problem of recommending banned or restricted pesticides is avoided, and the practical application value of the answer is ensured;
[0055] (2) The present invention provides personalized pesticide recommendations for each user based on user information and the user's local pesticide library, taking into account the sales situation and distance factors in the user's area, thereby improving the practicality and operability of the recommendations. The merge and deduplication operations ensure the real-time and accuracy of the recommendation library, accurately calculate the distance between the sales supply and marketing cooperative and the user's address, and select the nearest supply and marketing cooperative for pesticide binding, thereby improving the accuracy and practicality of the recommendations. At the same time, the pesticide data set in the disabled state in the global pesticide library is matched, and the disabled pesticides are eliminated to ensure that the pesticides in the user's local pesticide library are all available and compliant with regulations, thereby ensuring the legality and safety of the user's pesticide use;
[0056] (3) The present invention analyzes the types of pesticides mentioned in the user's preliminary answer and matches the disabled status data in the global pesticide library, takes the mentioned pesticide types as target information, and uses the recommendation algorithm to recommend in the user recommendation library to obtain accurate target pesticide recommendations. In the optimization recommendation algorithm, the system considers factors such as similarity, reliability, and pesticide resistance, calculates the recommendation coefficient, and selects pesticides with high recommendation coefficients as recommendation results, thereby improving the accuracy of recommendations and user satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0058] Figure 1 is a flow chart of a method according to an embodiment of the present invention;
[0059] Figure 2 It is a schematic diagram of the implementation principle of an embodiment of the present invention;
[0060] Figure 3 It is a technical implementation diagram of an embodiment of the present invention;
[0061] Figure 4 A recommended flow chart of an embodiment of the present invention. DETAILED DESCRIPTION
[0062] The following will be combined with the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0063] like Figure 1 As shown, the present invention provides a feedback method for adjusting agricultural AI question-answering results, comprising the following steps:
[0064] S1: Build agricultural knowledge base;
[0065] S2: Obtain user information and establish a user recommendation database based on the user information and agricultural knowledge base;
[0066] S3: The user inputs the initial question, which is fed into the agricultural language model, and the output is a preliminary answer;
[0067] S4: Identify the preliminary answer to obtain target information, make a recommendation in the user recommendation library based on the target information, and obtain recommended information of the target information;
[0068] S5: Convert the recommendation information into constraints and add them to the initial question to generate new questions. Input the new questions into the agricultural big language model to get the final answer.
[0069] See also Figure 2 , the principle of the present invention is as follows:
[0070] In the application scenario of agriculture, when the user asks a question to the agricultural consulting model for the first time, the model will analyze the question content and provide corresponding answers, which constitutes the first round of answers. In this process, an important step is to check whether the answer content contains recommendations for specific pesticides. To this end, keyword search, regular expressions and other methods can be used to identify whether specific pesticide names are mentioned in the text.
[0071] If no mention of a specific pesticide is found in the answer, the output of the model can be presented directly to the user. Conversely, if information about specific pesticides is detected, the next steps involve the evaluation and recommendation of these pesticides. In order to conduct an effective evaluation, the recommendation algorithm uses a special pesticide library. This library brings together a list of pesticides recommended by the national agricultural department and various types of pesticide information provided by local pesticide supply and marketing cooperatives. If the agricultural department prohibits or restricts the use of a certain type of pesticide, it needs to be deleted from here; if a new pesticide is added, it needs to be added to the library. It is worth noting that the pesticide library only contains information on the types of pesticides, and does not include specific production brands or manufacturer information. This approach not only ensures the provision of professional and reliable advice, but also takes into account regionality and practicality, providing users with more accurate and practical pesticide use advice.
[0072] Specifically, in one embodiment of the present invention, the agricultural knowledge base includes a global pesticide library and a recommended pesticide library. The global pesticide library contains a data set of pesticide names, control objects, and prohibited states. The recommended pesticide library is a subset of pesticides in the global pesticide library that matches the recommended pesticide list, wherein the recommended pesticide library does not intersect with the data set of pesticides in prohibited states.
[0073] In this recommendation algorithm, for each candidate pesticide in the pesticide library, the algorithm calculates its score to evaluate its suitability. The score is calculated based on the similarity of the pesticides, the reliability of the pesticide in the user's area, and whether there is resistance to the pesticide. Among all the candidate pesticides, the pesticide with the highest score will be recommended as the best choice.
[0074] It should be noted that this recommendation process mainly considers the similarity, regional reliability and resistance of pesticides, and is a simplified example. In actual application scenarios, more factors may need to be considered, such as the cost of pesticides, environmental impact, etc., to ensure that the recommendations are not only effective, but also economical and environmentally friendly. This comprehensive evaluation method can help users obtain more comprehensive pesticide recommendations that are more suitable for their specific circumstances.
[0075] In order to accurately meet the needs of different users, we collect users' preferences in the form of questionnaires before they start using the agricultural big language model. By asking users to score these three aspects, we customize the weight coefficients that each user relies on when making recommendations. This ensures that the recommendation system can provide the most suitable pesticide recommendations for each user based on their specific needs and preferences.
[0076] If the pesticides recommended by the algorithm are the same as those in the first round of output, the first round of output will be used directly as the final answer. If they are different, a specific question will be added to the original question to allow the large language model to conduct a deeper analysis. This additional question follows the template: "If {recommended pesticide} is used, how will it solve the current problem?" Where {recommended pesticide} is the pesticide recommended by the algorithm in the current round.
[0077] Finally, the Agricultural Big Language Model is run again with this newly formed question as input. The model performs a second round of calculations based on this more specific question and outputs the final answer. This final answer is fed back directly to the user, ensuring that the advice the user receives is doubly verified, more accurate, and applicable to their specific situation.
[0078] Through the above process, it is ensured that the recommendation system can more accurately understand the user's needs and provide the most appropriate pesticide selection. This method improves the quality and practicality of the recommendation results by adjusting and re-evaluating the input when necessary, without the need to reorganize the data and train a large language model.
[0079] Specifically, in one embodiment of the present invention, the agricultural knowledge base includes a global pesticide library and a recommended pesticide library. The global pesticide library contains a data set of pesticide names, control objects, and prohibited states. The recommended pesticide library is a subset of pesticides in the global pesticide library that matches the recommended pesticide list, wherein the recommended pesticide library does not intersect with the data set of pesticides in prohibited states.
[0080] In this embodiment, step S2 includes:
[0081] S21: obtaining user information, including user personal information and user purchase information, wherein the user personal information includes the user address and the user questionnaire score, the user questionnaire score includes the user's score on the similarity, reliability and resistance of pesticides, and the user purchase information includes a record set of pesticide purchases by the user;
[0082] User personal information includes the user's address information, which provides a basis for subsequent inquiries into pesticide sales in the user's area and for establishing the user's local pesticide library.
[0083] User questionnaire ratings include users’ ratings of pesticide similarity, reliability, and resistance, which can help the system better understand users’ needs and preferences for pesticides.
[0084] User purchase information includes a record set of users' purchases of pesticides. This information can reflect the user's past purchase behavior and preferences, and provide a reference for recommendations.
[0085] S22: querying according to the user address, taking the supply and marketing cooperatives at all levels of the village, town, county, and city where the user address is located as the query target, and obtaining a pesticide sales list related to the user address, wherein the pesticide sales list includes the pesticide types and their sales supply and marketing cooperatives;
[0086] Based on the address information provided by the user, the system will query the supply and marketing cooperatives at all levels, such as the village, town, county, and city where the user is located, to obtain a list of pesticide sales related to the user's address.
[0087] The pesticide sales list includes the types of pesticides sold in the user's area and the information of the supply and marketing cooperatives that sell these pesticides.
[0088] S23: Based on the pesticide sales list, establish a user local pesticide library, which includes pesticide types, pesticide sales supply and marketing agencies, and the distance between the sales supply and marketing agencies and the user address;
[0089] S24: The user's local pesticide library and the recommended pesticide library are combined and deduplicated to obtain a user recommended library.
[0090] Wherein, step S23 comprises:
[0091] S231: Quantify the user address and the addresses of supply and marketing cooperatives at all levels in terms of longitude and latitude.
[0092] First, the address information provided by the user is converted into longitude and latitude coordinates, which helps in the subsequent calculation of the distance between the addresses.
[0093] At the same time, the address information of supply and marketing cooperatives at all levels is also quantified in terms of longitude and latitude to ensure that the address information can be accurately represented and compared.
[0094] S232: Select a pesticide from the pesticide sales list;
[0095] S233: Search for the sales supply and marketing cooperatives of the pesticide and determine the number of the sales supply and marketing cooperatives:
[0096] If the quantity is 1, the distance between the address of the sales supply and marketing agency and the user address is calculated using the longitude and latitude, the sales supply and marketing agency is bound to the pesticide, and step S234 is executed;
[0097] If the number is greater than 1, the distance between the addresses of each sales and marketing agency and the user's address is calculated using the longitude and latitude, the nearest sales and marketing agency is selected, it is bound to the pesticide, and step S234 is executed;
[0098] S234: Create a record for the pesticide, including the type of pesticide, the sales and marketing agency of the pesticide, and the distance between the sales and marketing agency and the user's address;
[0099] S235: repeating steps S232-S234 until all pesticides in the pesticide sales list are traversed to obtain a preliminary pesticide library;
[0100] S236: Match the pesticides in the preliminary pesticide library with the banned pesticide data set in the global pesticide library, remove the successfully matched pesticides from the preliminary pesticide library, and obtain the user's local pesticide library. Ensure that the user's local pesticide library does not contain banned pesticides, and ensure that the recommendations obtained by the user comply with regulations and safety standards.
[0101] Specifically, in one embodiment of the present invention, step S3 includes:
[0102] Users input agriculture-related questions or queries through the interface or input box provided by the system, such as questions about pesticide use, crop planting, pest and disease control, etc.
[0103] The system passes the initial question entered by the user to the Agriculture Big Language Model, a powerful language model trained to understand and answer a variety of agriculture-related questions.
[0104] After receiving the questions input by the user, the agricultural big language model will perform semantic understanding, information retrieval and reasoning on the questions to generate preliminary answers.
[0105] Specifically, in one embodiment of the present invention, step S4 includes:
[0106] S41: Analyze the preliminary responses to identify the types of pesticides mentioned.
[0107] Specifically, the types of pesticides involved in the preliminary answers were identified through text analysis and keyword extraction methods.
[0108] S42: Match the pesticide type mentioned in the preliminary answer with the pesticide data set in the disabled state in the global pesticide library. When the match is successful, the pesticide type mentioned in the preliminary answer is used as the target information.
[0109] The pesticide types identified from the preliminary answers were matched with the pesticide dataset with prohibited status in the global pesticide library.
[0110] If the match is successful, that is, the pesticide types with a disabled status in the global pesticide library are found, these pesticide types will be marked as target information.
[0111] S43: Recommend the pesticide type of the target information in the user recommendation library using a recommendation algorithm to obtain recommended pesticides, which are the recommended information of the target information.
[0112] Wherein, step S43 comprises:
[0113] S431: setting variables temp and Name, where the variable Temp is used to store the recommended value, and the variable Name is used to store the name of the pesticide corresponding to the maximum recommended value, and initializing the variables temp and Name;
[0114] S432: Select a record in the user recommendation library. If it is the first time to select, the first record is selected. If it is not the first time to select, the next record of the previous record is selected. Each record in the user recommendation library includes the name of the pesticide, the type of pesticide, the control target and the distance value. The distance value is the distance between the pesticide sales place and the user address.
[0115] S433: Calculate the similarity S between the pesticide in the current record and the pesticide in the target information;
[0116] S434: Calculate the reliability A of the pesticide in the current record according to the distance value;
[0117] S435: obtaining the number of times T of use of the pesticide in the current record according to the user's purchase information, and calculating the pesticide resistance R of the pesticide in the current record according to the number of times T;
[0118] S436: Based on the resistance R, similarity S and reliability A, the recommendation coefficient score of the pesticide in the current record is calculated;
[0119] S437: Compare the recommendation coefficient score with the variable temp. If score>temp, it is determined that the recommendation coefficient of the pesticide in the current record is high, and the variable temp is updated to the score value of the pesticide in the current record, and the name of the pesticide is stored in the variable Name. Otherwise, execute step S438;
[0120] S438: Determine whether all records in the user recommendation library have been traversed. If so, output Name as the recommended pesticide. If not, return to step S432.
[0121] The calculation of the recommendation coefficient algorithm is as follows:
[0122] score=w s *S+w a *A+w r *R
[0123] In the formula, w s is the weight coefficient corresponding to similarity A, w a is the weight coefficient corresponding to reliability A, w r is the weight coefficient corresponding to drug resistance R.
[0124] The similarity S is calculated as:
[0125]
[0126] In the formula, S is similarity, P1 is the set of pesticide control objects and applicable crops in the target information, P2 is the set of pesticide control objects and applicable crops in the current record, |P1∩P2| is the number of elements that intersect between the P1 set and the P2 set, that is, the number of objects and crops that are commonly controlled by the two pesticides, and |P1∪P2| is the number of elements that are combined between the P1 set and the P2 set, that is, the sum of the control objects of the two pesticides, excluding duplicates. By calculating this similarity value, the similarity between the two pesticides in terms of control objects can be quantitatively evaluated, thereby providing more accurate pesticide selection recommendations for agricultural production.
[0127] Reliability A is used to measure the reliability of a certain pesticide in the user's location. If the pesticide is available at the local supply and marketing agency, A is 1, indicating easy access. If it needs to be purchased from other places, the A value decreases with increasing distance, and is 0 when it exceeds 20 kilometers, meaning it is difficult to obtain. In short, A is an indicator that reflects the difficulty of obtaining pesticides. The calculation method of reliability A is:
[0128]
[0129] Where d is the distance value in kilometers.
[0130] For users who are used to buying pesticides online, the minimum value of their regional reliability score (A) is set to 0.5. This means that even if the actual reliability score of a pesticide is lower than 0.5, it is still calculated as 0.5 for these users. This is because even if a pesticide is not available locally, these users can still purchase it online, ensuring that the recommendation is more in line with the user's actual situation.
[0131] The resistance risk index R is used to evaluate the resistance level of a certain pesticide. The design principle of this index is: the lower the R value, the stronger the resistance of the pesticide, that is, the higher the tolerance of the crop to the pesticide, and vice versa. Specifically, if a pesticide has never been used, its resistance is considered to be the lowest, and the corresponding R value is set to 1. With the continuous use of the pesticide, the resistance of the crop to it increases exponentially, and the R value will decrease exponentially accordingly. The calculation method of resistance R is:
[0132] R=e -0.7T
[0133] In the formula, T represents the number of pesticide uses in the current record in the past five years. That is, when T = 0, R = 1; when T = 1, R = 0.5.
[0134] The values of S, A, and R are obtained through three calculation formulas respectively. The range of these three values is between 0 and 1. To determine the corresponding weight coefficient w s , w a and w r In order to calculate the recommendation coefficient score.
[0135] If the user is particularly concerned about the similarity of the pesticide to the banned pesticides, then the user can increase the w s The model is adjusted by using the value of , so that similarity accounts for a larger proportion in the final recommendation coefficient.
[0136] If the user considers regional reliability to be the most important consideration, then w should be increased. a to ensure that this factor is given adequate weight in the recommendation process.
[0137] If the user is mainly concerned about drug resistance, then increasing w r The weight of will make drug resistance occupy a more important position in the comprehensive evaluation.
[0138] See also Figure 3 In a specific example, the specific process of the present invention is as follows:
[0139] Step 1, establish a global pesticide library and a recommended pesticide library: build a comprehensive pesticide dataset that includes the full name of the pesticide, the target of prevention and control, and the banned status. This dataset focuses on the types of pesticides and does not need to cover brand or manufacturer information. It includes both currently used pesticides and products that have been restricted or banned in history. Then obtain a list of recommended pesticides by visiting the official website of the agricultural department, and select a subset of recommended pesticides from this comprehensive pesticide library as the recommended pesticide library. If a new type of pesticide is newly registered, the global pesticide library must be updated in real time; if there are new recommended pesticides or the recommendation is deleted, this information will also be updated to the recommended pesticide library in a timely manner. After completion, proceed to step 2.
[0140] Step 2, user login: When the user enters the account to log in, such as entering a system, the system will provide large language model services. After completion, proceed to step 3.
[0141] Step 3, obtain user information: obtain the user's personal information, including home address, through the user's login account. Also obtain the user's scores on the similarity, reliability and resistance risk of pesticides in the questionnaire. These scores will directly correspond to the weight coefficients in the recommendation algorithm, which will be used to adjust and optimize the pesticide recommendation results and obtain whether the user has the habit of purchasing pesticides online. After completion, proceed to step 4.
[0142] Step 4, obtain the pesticides and locations of the supply and marketing cooperatives at the village, town, county and city levels: Using the user's home address information, you can query the types of pesticides currently sold by the supply and marketing cooperatives at the village, town, county and city levels, as well as the specific location information of these supply and marketing cooperatives. After completion, proceed to step 5.
[0143] Step 5, establish a user's local pesticide library: Based on the pesticide type information provided by the supply and marketing cooperative, first establish a user's local pesticide library. The information in this library should include the type of pesticide and its distance from the user's home address. The distance is calculated using the longitude and latitude of the user's home address and the supply and marketing cooperative's location. If supply and marketing cooperatives of different levels sell the same pesticide, select the supply and marketing cooperative closest to the user and create a record for the pesticide type. It is particularly important to note that if the user's local pesticide library contains banned or restricted pesticides, these pesticides must be removed. After completion, proceed to step 6.
[0144] Step 6, establish user recommendation library: To establish user recommendation library, first add all the data in the user's local pesticide library. Then, select those pesticides that do not appear in the user's local pesticide library from the recommended pesticide library and add them to the user recommendation library. For these newly added recommended pesticides, due to the lack of specific distance information, a default distance value will be set, such as 50 kilometers, for easy distinction. After completion, proceed to step 7.
[0145] Step 7, obtain the user's purchase records of pesticides in recent years: To obtain the user's purchase records of a certain type of pesticide in the past five years, assume that the user will use the pesticide every time after purchase. Based on this assumption, process the data according to the following rules: If the user purchases the same pesticide multiple times in the same year, these purchases are combined and recorded as 1 time. If the user purchases the same pesticide in different years, the purchase behavior of each year is accumulated separately to form a record set to represent the number of years the user has used this type of pesticide. After completion, proceed to step 8.
[0146] Step 8: User inputs question: User asks question to the big agricultural model, expecting the big agricultural model to answer and solve their doubts. After completion, proceed to step 9.
[0147] Step 9, agricultural model output: In response to the questions raised by the user, the agricultural model outputs the results for the first time, and then proceeds to step 10.
[0148] Step 10, whether there are target pesticides: When processing the output results, use keyword search or regular expressions to determine whether the target pesticides in the output results exist in the global pesticide library. If the search results show that no relevant pesticide types are found, go to step 12. On the contrary, if one or more target pesticides are found, go to step 11.
[0149] Step 11, pesticide recommendation algorithm: input the target pesticide and use the recommendation algorithm to select a pesticide with similar effect, local availability and low resistance risk from the user recommendation library.
[0150] Step 12, the output result is the user's final result: the user inputs the question, and the agricultural language model directly provides the final answer as the output result. At this time, the system does not require additional processing.
[0151] Step 13, whether the recommended pesticide is the same as the target pesticide: Determine whether the recommended pesticide is the same as the target pesticide. If the recommended pesticide is the same as the target pesticide, proceed to step 12. Otherwise, if the recommended pesticide is different from the target pesticide, proceed to step 14.
[0152] Step 14, generate new questions: When the answer given by the agricultural language model does not meet the user's needs for the question input by the user, it is necessary to further ask a more detailed question based on the user's initial question. In order to allow the agricultural language model to provide a more accurate answer. The format of the detailed question is usually: "If {recommended pesticide} is used, how will the current problem be solved?" {recommended pesticide} is the recommended pesticide. The new question is added after the original question. After completion, proceed to step 15.
[0153] Step 15, the secondary output of the agricultural model is the final result for the user: after the newly formed question is input into the agricultural language model, the model will generate an answer based on the input information and directly feedback the result to the user. This process ensures that the user can get a detailed, more accurate and reliable answer for them.
[0154] Specifically, in this embodiment, the recommended process of step 11 is as follows: Figure 4 As shown, the recommended process is as follows:
[0155] Sub-step 1), set variable temp=0, Name=”: variable temp is used to store the recommended value, and Name is the type of pesticide corresponding to the maximum recommended value. The initial value temp=0, Name=”, after completion, proceed to sub-step 2).
[0156] Sub-step 2), user recommendation library: obtain the information of the user recommendation library, each record in the library includes information such as pesticide name, control object, distance from the user, etc. After completion, proceed to sub-step 3).
[0157] Sub-step 3), select a record: select a record in the user recommendation library. If it is the first time to select, select the first record; if it is not the first time, select the next record immediately following the previous record. After completion, proceed to sub-step 4).
[0158] Sub-step 4), calculate the similarity S with the target pesticide: To calculate the similarity of the control objects of the two pesticides, the specific pesticide is methyl parathion, and this record is cypermethrin as an example. List their main control objects respectively and calculate their similarity. The main control objects of methyl parathion (which has been banned) are: red spider mites, aphids, thrips, borers, planthoppers, cotton bollworms, grubs, mole crickets, armyworms, and leaf rollers. The main control objects of cypermethrin are: aphids, thrips, planthoppers, whiteflies, stem borers, grubs, mole crickets, cutworms, borers, and armyworms. The objects that the two pesticides jointly control are: aphids, thrips, planthoppers, grubs, mole crickets, borers, and armyworms, a total of 7 species. According to the similarity formula, the total number of control target species is the number of the combined control targets of the two, that is, 13 species (red spiders, whiteflies, cotton bollworms, leaf rollers, cutworms, and stem borers) plus the common 7 species. Therefore, the similarity between methamidophos and deltamethrin is S=0.5385. Complete and proceed to sub-step 5).
[0159] Sub-step 5), obtain the distance d between the pesticide location and the user address: From this record, the distance d between the pesticide and the user can be known. After completion, proceed to sub-step 6).
[0160] Sub-step 6), calculate agricultural reliability A: use the reliability segmentation formula and the distance d to calculate the original reliability score A of the pesticide. If the user has the habit of online shopping: if the original score A<0.5, adjust A to 0.5; otherwise, keep A unchanged. If the user does not have the habit of online shopping: there is no need to adjust the value of A according to the online shopping habit. This adjustment is based on the assumption that users who have the habit of online shopping may be more likely to be exposed to products with higher ratings or more reliable, so a certain degree of positive adjustment is made when the local reliability is low. After completion, proceed to sub-step 7).
[0161] Sub-step 7), find the number of times the pesticide has been used in recent years T: query the number of records obtained in step 7 of the main process for the number of times the user has purchased the pesticide, and this number is the number of times the user has used the pesticide T. After completion, proceed to sub-step 8).
[0162] Sub-step 8), calculating the pesticide resistance R: according to the number of times the user uses T, a specific formula is applied to calculate the pesticide resistance R of the pesticide. After completion, proceed to sub-step 9).
[0163] Sub-step 9) Calculate the pesticide score using the formula: known resistance R, similarity S and reliability A, combined with the weight w determined by user information s , w a and w r , use these data to calculate the score of the pesticide through the formula. After completion, proceed to sub-step 10).
[0164] Sub-step 10), score>temp: compare the calculated score with the temporary variable temp. If score>temp, it means that the current pesticide recommendation coefficient is high, and proceed to sub-step 11); otherwise, proceed to step 12).
[0165] Sub-step 11), temp=score, Name=name of pesticide: update temp to the current highest score value, and store the name of the pesticide in the variable Name for subsequent use. Then proceed to sub-step 12).
[0166] Sub-step 12), whether all records have been traversed: Check whether all records in the user recommendation library have been traversed. If yes, proceed to sub-step 13; otherwise, proceed to sub-step 3).
[0167] Sub-step 13), Name is the recommended pesticide: after completing all steps, the variable Name stores the name of the pesticide recommended to the user.
[0168] After all sub-steps are completed, it means that the recommendation algorithm is executed, and then it will enter step 12.
[0169] In summary, when processing agricultural-related questions raised by users, the present invention first analyzes the initial output results of the user's questions, and identifies the mentioned pesticide types from the global pesticide library through keyword search or regular expression matching. This pesticide library contains all the pesticide information registered and filed with the agricultural department, including banned and restricted pesticides. Then the result is judged. If no pesticide type is mentioned in the output, the output is regarded as the final answer to the user's question. If the pesticide type is identified, the identified pesticide type and user information are used as input to run the pesticide recommendation algorithm to obtain the most suitable pesticide recommendation. If the pesticide obtained by the recommendation algorithm is the same as the pesticide identified in the preliminary analysis, the result is the final answer. If different, a specific question is added after the user's original question: "If {recommended pesticide} is used, how to solve the current problem?" Where {recommended pesticide} is the pesticide recommended by the algorithm. This modified question is re-input into the agricultural large language model, and the result obtained is used as the final answer to the user's question. Through this process, a more accurate and applicable answer to the user's specific situation is provided, avoiding the output of banned or restricted pesticides or unavailable pesticides.
[0170] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A feedback method for adjusting agricultural AI question-answering results, characterized in that: The following steps are involved: S1: Build an agricultural knowledge base, which includes a global pesticide library and a recommended pesticide library. The global pesticide library contains a data set of pesticide names, control targets, and banned pesticides. The recommended pesticide library is a subset of pesticides in the global pesticide library that matches the recommended pesticide list. The recommended pesticide library does not intersect with the banned pesticide data set. S2: Obtain user information and establish a user recommendation database based on the user information and agricultural knowledge base; Step S2 includes: S21: obtaining user information, including user personal information and user purchase information, wherein the user personal information includes the user address and the user questionnaire score, the user questionnaire score includes the user's score on the similarity, reliability and resistance of pesticides, and the user purchase information includes a record set of pesticide purchases by the user; The similarity S is calculated as: Where S is similarity, P1 is the set of pesticide control objects and applicable crops in the target information, P2 is the set of pesticide control objects and applicable crops in the current record, |P1∩P2| is the number of elements that intersect between the P1 set and the P2 set, that is, the number of objects and crops that are jointly controlled by the two pesticides, |P1∪P2| is the number of elements that are combined between the P1 set and the P2 set, that is, the sum of the control objects of the two pesticides, excluding duplicates; The calculation method of reliability A is: Where d represents the distance value in kilometers; The calculation method of drug resistance R is: R=e -0.7T In the formula, T represents the number of pesticide uses in the current record in the past five years; S22: querying according to the user address, taking the supply and marketing cooperatives at all levels of the village, town, county, and city where the user address is located as the query target, and obtaining a pesticide sales list related to the user address, wherein the pesticide sales list includes the pesticide types and their sales supply and marketing cooperatives; S23: Based on the pesticide sales list, establish a user local pesticide library, which includes pesticide types, pesticide sales supply and marketing agencies, and the distance between the sales supply and marketing agencies and the user address; Step S23 includes: S231: Quantify the user address and the addresses of supply and marketing cooperatives at all levels in terms of longitude and latitude; S232: Select a pesticide from the pesticide sales list; S233: Search for the sales supply and marketing cooperatives of the pesticide and determine the number of the sales supply and marketing cooperatives: If the quantity is 1, the distance between the address of the sales supply and marketing agency and the user address is calculated using the longitude and latitude, the sales supply and marketing agency is bound to the pesticide, and step S234 is executed; If the number is greater than 1, the distance between the addresses of each sales and marketing agency and the user's address is calculated using the longitude and latitude, the nearest sales and marketing agency is selected, it is bound to the pesticide, and step S234 is executed; S234: Create a record for the pesticide, including the type of pesticide, the sales and marketing agency of the pesticide, and the distance between the sales and marketing agency and the user's address; S235: repeating steps S232-S234 until all pesticides in the pesticide sales list are traversed to obtain a preliminary pesticide library; S236: Match the pesticides in the preliminary pesticide library with the pesticide data set in the disabled state in the global pesticide library, remove the successfully matched pesticides from the preliminary pesticide library, and obtain the user's local pesticide library; S24: merging the user's local pesticide library and the recommended pesticide library to remove duplicates, thereby obtaining a user recommended library; S3: The user inputs the initial question, which is fed into the agricultural language model, and the output is a preliminary answer; S4: Identify the preliminary answer to obtain target information, make a recommendation in the user recommendation library based on the target information, and obtain recommended information of the target information; Step S4 includes: S41: Analyze the preliminary responses to identify the types of pesticides mentioned; S42: Match the pesticide type mentioned in the preliminary answer with the pesticide data set in the prohibited state in the global pesticide library. When the match is successful, the pesticide type mentioned in the preliminary answer is used as the target information; S43: recommending the pesticide type of the target information in the user recommendation database using a recommendation algorithm to obtain a recommended pesticide, i.e., the recommended information of the target information; Step S43 includes: S431: setting variables temp and Name, where the variable temp is used to store the recommended value, and the variable Name is used to store the name of the pesticide corresponding to the maximum recommended value, and initializing the variables temp and Name; S432: Select a record in the user recommendation database. If it is the first time to select, the first record is selected. If it is not the first time to select, the next record of the previous record is selected. Each record in the user recommendation database includes the name of the pesticide, the type of pesticide, the control target and the distance value. The distance value is the distance between the pesticide sales place and the user address. S433: Calculate the similarity S between the pesticide in the current record and the pesticide in the target information; S434: Calculate the reliability A of the pesticide in the current record according to the distance value; S435: obtaining the number of times T of use of the pesticide in the current record according to the user's purchase information, and calculating the pesticide resistance R of the pesticide in the current record according to the number of times T; S436: Based on the resistance R, similarity S and reliability A, the recommendation coefficient score of the pesticide in the current record is calculated; S437: Compare the recommendation coefficient score with the variable temp. If score>temp, it is determined that the recommendation coefficient of the pesticide in the current record is high, and the variable temp is updated to the score value of the pesticide in the current record, and the name of the pesticide is stored in the variable Name. Otherwise, execute step S438; The calculation method of recommendation coefficient score is: score=w s *S+w a *A+w r *R In the formula, w s is the weight coefficient corresponding to similarity A, w a is the weight coefficient corresponding to reliability A, w r is the weight coefficient corresponding to drug resistance R; S438: Determine whether all records in the user recommendation database have been traversed. If so, output Name as the recommended pesticide. If not, return to step S432. S5: Convert the recommendation information into constraints and add them to the initial question to generate new questions. Input the new questions into the agricultural big language model to get the final answer.
Citation Information
Patent Citations
Use method of intelligent agricultural material pesticide platform
CN111539838A
LLM-based question and answer enhancement method
CN117290485A
Agricultural intelligent question and answer method and system supporting multi-mode and multi-round dialogues
CN117370506A