A Response-by-Retrieval Chatbot for Enhancing Horticulture Extension Services in Tanzania

Authors

  • Amos R. Lubawa School of Computational and Communication Science and Engineering, The Nelson Mandela African Institution of Science and Technology, Tanzania
  • Devotha G. Nyambo School of Computational and Communication Science and Engineering, The Nelson Mandela African Institution of Science and Technology, Tanzania https://orcid.org/0000-0003-3763-9302
  • Neema Mduma School of Computational and Communication Science and Engineering, The Nelson Mandela African Institution of Science and Technology, Tanzania https://orcid.org/0000-0002-4364-3124
  • Ramadhani Sinde School of Computational and Communication Science and Engineering, The Nelson Mandela African Institution of Science and Technology, Tanzania https://orcid.org/0000-0001-8993-0332
Volume: 15 | Issue: 5 | Pages: 27703-27709 | October 2025 | https://doi.org/10.48084/etasr.12761

Abstract

Horticulture, which encompasses the cultivation of flowers, fruits, herbs, and vegetables, is a key contributor to Tanzania’s export revenue generation. Smallholder farmers are the primary producers of these crops, and they rely heavily on extension services for critical information that shapes both their economic success and long-term sustainability. However, the delivery of such services from the government and other stakeholders faces challenges, including constraints in human capital, geographic barriers, misaligned information needs, as well as issues with the timeliness of information dissemination. To address these challenges, this study developed a Swahili-language chatbot designed to provide timely, context-specific information tailored to the needs of farmers. To ensure credibility and relevance, key private and public stakeholders were consulted, and comprehensive farming guides were collected to build a custom dataset. This dataset consisted of 307 passages and 2,231 question-answer pairs. Four multilingual models, Multilingual Bidirectional Encoder Representations from Transformers (mBERT), Cross-lingual Language Model Pretraining RoBERTa (XLM-R), Multilingual Decoding-Enhanced BERT with Disentangled Attention (mDeBERTa), and Afro Cross-lingual Language Model Pretraining RoBERTa (AfroXLMR), were finetuned on this dataset for a question-answering task. Among them, the mDeBERTa model achieved the strongest performance, with an Exact Match (EM) score of 62.69% and an F1 score of 75.35%. These results demonstrate the potential of adapting advanced language models for specialized, low-resource language tasks in agriculture. The deployment of mDeBERTa in a prototype chatbot highlights a promising pathway to bridge information gaps and enhance the accessibility of extension services for Tanzania’s smallholder farmers.

Keywords:

chatbot, natural language processing, question-answering, Bidirectional Encoder Representations from Transformers (BERT)

Downloads

Download data is not yet available.

References

T. J. Maginga and M. Ally, "Adoption of ICT enabled extension support system for vegetable crop production among small holder farmers: a case of Tanzania," International Journal of Advanced Technology and Engineering Exploration, vol. 6, no. 56, pp. 186–193, Jul. 2019.

N. Mungure, "Horticulture in Tanzania: A Game Changer." Horticulture in Tanzania, pp. 8-10, Mar. 2021. [Online]. Available: https://taha.or.tz/horticulture-magazine.

Directorate of Economic Research and Policy Bank of Tanzania, "Monthly Economic Review," Tanzania, Jul. 2022. [Online]. Available: https://www.bot.go.tz/Publications/Regular/Monthly%20Economic%20Review/en/2022080417482638.pdf.

D. Msafiri and S. Mwombela, "Enhancing Competitiveness of Horticultural Industry in Tanzania," Research on Poverty Alleviation (REPOA), May 2021. [Online]. Available: https://www.repoa.or.tz/wp-content/uploads/2021/06/Horticulture-PB.pdf.

A. Ihucha, "Government, TAHA Sign MoU to Accelerate Horticulture to Earn $2 bn in 2030" Horticulture in Tanzania, pp. 20-21, Jun. 2022. [Online]. Available: https://taha.or.tz/hit-magazine-2022.

G. B. Maria, M. Olivier, R. Felix, and C. Caroline, "Agricultural Extension and Advisory Services in Low and Lower-Middle-Income Countries - Knowledge Review," European Commission, Ispra (Italy), Scientific analysis or review, 2024. [Online]. Available: https://knowledge4policy.ec.europa.eu/global-food-nutrition-security_en.

C. Busungu, A. Gongwe, D. L. Naila, and L. Munema, "Complenting Extension Officers in Technology Transfer and Extension Services: Understanding the Influence of Media as Change Agents in Modern Agriculture," Jun. 2019.

The United Republic of Tanzania, "National Sample Census of Agriculture 2019/20", The National Bureau of Statistics, Aug. 2024. [Online]. Available: https://www.nbs.go.tz/uploads/statistics/documents/sw-1705482872-2019-20_Agri_Census_%20Main_Report.pdf.

S. Jotta, "The Impact of Information and Communication Technologies in Improving Crop Productivity among Youths in Misungwi and Kilosa Districts, Tanzania," Open Journal of Social Sciences, vol. 12, no. 05, pp. 246–264, 2024.

Esoko. "Esoko - Digital Farmer Services." Esoko. [Online]. Available: https://www.esoko.com/about.

United Republic of Tanzania, Ministry of Agriculture. "Mobile Kilimo (M-Agriculture)." Ministry of Agriculture (Tanzania). [Online]. Available: https://exts.kilimo.go.tz/about-us.

B. Ortiz-Crespo et al., "User-centred design of a digital advisory service: enhancing public agricultural extension for sustainable intensification in Tanzania," International Journal of Agricultural Sustainability, vol. 19, no. 5–6, pp. 566–582, Nov. 2021.

K. P. Asiimwe, D. Machuve, and M. A. Dida, "Usability Testing of a Web Portal for Ornamental Plants and Flowers in Arusha, Tanzania," Engineering, Technology & Applied Science Research, vol. 10, no. 3, pp. 5627–5631, Jun. 2020.

D. O. Okello, S. Feleke, E. Gathungu, G. Owuor, and O. I. Ayuya, "Effect of ICT tools attributes in accessing technical, market and financial information among youth dairy agripreneurs in Tanzania," Cogent Food & Agriculture, vol. 6, no. 1, Jan. 2020, Art. no. 1817287.

R. Kumar and M. M. Ali, "A Review on Chatbot Design and Implementation Techniques," International Research Journal of Engineering and Technology (IRJET), vol. 7, no. 2, pp. 2791–2800, Feb. 2020.

G. Caldarini, S. Jaf, and K. McGarry, "A Literature Survey of Recent Advances in Chatbots," Information, vol. 13, no. 1, Jan. 2022, Art. no. 41.

Z. Peng and X. Ma, "A survey on construction and enhancement methods in service chatbots design," CCF Transactions on Pervasive Computing and Interaction, vol. 1, no. 3, pp. 204–223, Nov. 2019.

D. Jurafsky and J. H. Martin, Speech and language processing: an introduction to natural language processing, computational linguistics, and speech recognition, 2nd ed., Upper Saddle River, NJ: Prentice Hall, 2009.

M. Jain, P. Kumar, I. Bhansali, Q. V. Liao, K. Truong, and S. Patel, "FarmChat: A Conversational Agent to Answer Farmer Queries," Proceedings of the ACM on Interactive, Mobile, Wearable and Ubiquitous Technologies, vol. 2, no. 4, pp. 1–22, Dec. 2018.

N. Jain et al., "AgriBot: Agriculture-Specific Question Answer System." IndiaRxiv, Jun. 11, 2019.

P. Kaviya, M. Bhavyashree, M. D. Krishnan, and M. Sugacini, "Artificial intelligence based farmer assistant chatbot," International Journal of Research in Engineering, Science and Management, vol. 4, no. 4, pp. 26-29, Apr. 2021.

V. Nayak, P. R Nayak N, Sampoorna, Aishwarya, and N. H. Sowmya, "Agroxpert - Farmer assistant," Global Transitions Proceedings, vol. 2, no. 2, pp. 506–512, Nov. 2021.

S. Kothari, P. Bagane, M. Mishra, S. Kulshrestha, Y. Asrani, and V. Maheswari, "CropGuard: Empowering Agriculture with AI driven Plant Disease Detection Chatbot," International Journal of Intelligent Systems and Applications in Engineering, vol. 12, no. 12s, pp. 530-537, Jan. 2024.

A. Lubawa, "Swahili Question-Answering Dataset for Horticulture." Harvard Dataverse, 2024.

P. Rajpurkar, J. Zhang, K. Lopyrev, and P. Liang, "SQuAD: 100,000+ Questions for Machine Comprehension of Text," in Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, Austin, Texas, 2016, pp. 2383–2392.

N. Reimers, E. Choi, A. Kayid, A. Nandula, M. Govindassamy, and A. Elkady, "Introducing Embed v3," Introducing Embed v3. https://cohere.com/blog/introducing-embed-v3.

A. Otegi, A. Gonzalez-Agirre, J. A. Campos, A. S. Etxabe, and E. Agirre, "Conversational Question Answering in Low Resource Scenarios: A Dataset and Case Study for Basque," in International Conference on Language Resources and Evaluation, 2020.

P. Lewis, B. Oguz, R. Rinott, S. Riedel, and H. Schwenk, "MLQA: Evaluating Cross-lingual Extractive Question Answering," in Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, Online, 2020, pp. 7315–7330.

H. K. Teklehaymanot, D. Fazlija, N. Ganguly, G. K. Patro, and W. Nejdl, "TIGQA: An Expert-Annotated Question-Answering Dataset in Tigrinya," in Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation (LREC-COLING 2024), Torino, Italia, May 2024, pp. 16142–16161.

H. T. Ta, A. B. S. Rahman, L. Najjar, and A. F. Gelbukh, "Transfer Learning from Multilingual DeBERTa for Sexism Identification," in IberLEF@SEPLN, A Coruña, Spain, Sept. 2022.

O. Ogundepo et al., "Cross-lingual Open-Retrieval Question Answering for African Languages," in Findings of the Association for Computational Linguistics: EMNLP 2023, Singapore, 2023, pp. 14957–14972.

T. A. Taffa, R. Usbeck, and Y. Assabie, "Low Resource Question Answering: An Amharic Benchmarking Dataset," in Proceedings of the Fifth Workshop on Resources for African Indigenous Languages @ LREC-COLING 2024, Torino, Italia, May 2024, pp. 124–132.

Downloads

How to Cite

[1]
A. R. Lubawa, D. G. Nyambo, N. Mduma, and R. Sinde, “A Response-by-Retrieval Chatbot for Enhancing Horticulture Extension Services in Tanzania”, Eng. Technol. Appl. Sci. Res., vol. 15, no. 5, pp. 27703–27709, Oct. 2025.

Metrics

Abstract Views: 42
PDF Downloads: 30

Metrics Information