An Agricultural Policy Question Answering System Based on ChatGLM2-6B

Published in Frontiers of Data & Computing, 2024

[Objective] In order to improve the transparency of the policy, reduce the information asymmetry, and provide a convenient way for stakeholders to obtain agricultural policy information and guidance. This paper constructs an agricultural policy question and answer system combining ChatGLM2-6B and Langchain-Chatchat. [Methods] Obtain the full text of guiding agricultural policies of National Rural Revitalization Administration and Central No. 1, as well as the full text of agricultural policies of Huanghe-Nine provincial Rural Revitalization Bureau through crawler, construct the agricultural policy Q&A data set, and use the data set to fine-tune ChatGLM2-6B model by QLoRA and model consolidation and quantification. Then, the obtained ChatGLM2-6B-QLoRA-int4 model is combined with Langchain-Chatchat and local agricultural policy knowledge base to construct an agricultural policy Q&A system. [Results]Questions were asked about ChatGPT, ChatGLM2-6B, ChatGLM2-6B-QLORa and this question-and-answer system respectively, and the answer results were evaluated by expert scoring method. This system is better than ChatGLM2-6B and CHATGLM2-6B-QLORA in the field of agricultural policy, and the overall effect is better than ChatGPT. [Conclusion] The Q&A system constructed in this research performs well in the field of agricultural policy, can ensure the security of proprietary data, and can realize the local deployment of LLM-based Q&A system.

Recommended citation: Wei Yijin & Fan Jingchao. (2024). Agricultural Policy Q&A System Based on ChatGLM2-6B. Frontiers of Data and Computational Development (Chinese and English), 6(04), 116-127.
Download Paper