# Fine-Tuning Language Models for Structured Botanical Trait Extraction and Species Comparison

Ayoub Nainia, Régine Vignes Lebbe, Jihad Zahir

► To cite this version:

Ayoub Nainia, Régine Vignes Lebbe, Jihad Zahir. Fine-Tuning Language Models for Structured Botanical Trait Extraction and Species Comparison. Biodiversity Information Science and Standards, 2026, 10, pp.e183035. 10.3897/biss.10.183035. hal-05468241

HAL Id: hal-05468241

https://hal.science/hal-05468241v1

Submitted on 20 Jan 2026

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons CC BY 4.0 - Attribution - International License
# Fine-Tuning Language Models for Structured
Botanical Trait Extraction and Species Comparison

Ayoub Nainia‡, Régine Vignes Lebbe‡, Jihad Zahir§

Corresponding author: Ayoub Nainia (ayoub.nainia@sorbonne-universite.fr)

Received: 19 Dec 2025 | Published: 16 Jan 2026

Citation: Nainia A, Vignes Lebbe R, Zahir J (2026) Fine-Tuning Language Models for Structured Botanical Trait Extraction and Species Comparison. Biodiversity Information Science and Standards 10: e183035.
https://doi.org/10.3897/biss.10.183035

## Abstract

As artificial intelligence (AI) becomes central to biodiversity research, transforming morphological descriptions of species into structured data remains a challenge, particularly in botany, where species descriptions are rich in detail but lack formal structure. Despite the progress brought by transformer architectures (Vaswani et al. 2017) and their multilingual variants such as *Camembert* (Martin et al. 2020), most large language models (LLMs) are trained on general-domain English corpora, limiting their effectiveness for non-English biodiversity applications.

We present a two-stage information extraction pipeline that fine-tunes LLaMA (Large Language Model Meta AI)- based LLMs (Touvron et al. 2023) to extract botanical traits from French floristic texts and enable species-level comparison at scale. Trained on a curated corpus of legacy botanical descriptions and expert-validated French question-answer pairs, the system demonstrates how domain-specific fine-tuning can bridge the gap between narrative botanical knowledge and structured trait data (Fig. 1). At the user-interface layer, we add a third stage that automatically converts the trait-value pairs generated by the question-answering module into a structured CSV table for downstream use.

<footnote>‡ Institut de Systématique, Evolution, Biodiversité (ISYEB), Muséum national d'Histoire naturelle, CNRS, Sorbonne Université, EPHE, Université des Antilles, Paris, France</footnote>

<footnote>§ UMMISCO, IRD, Computer Science Department, LISI, CADI Ayyad University, Faculty of Sciences, Marrakech, Morocco, Marrakech, Morocco</footnote>
<figure><img src="image_2.png" /></figure>

Our approach unifies question generation and trait extraction within a single information extraction workflow. First, predefined botanical traits (e.g., leaf shape, flower color) are reformulated as natural-language questions tailored to each species description. Then, using these questions as prompts, the model identifies and extracts the corresponding trait values: for example, extracting "lanceolate" as the standardized leaf shape from "lanceolate leaves." This converts unstructured text into consistent character-state pairs aligned with botanical ontologies. A proof-of-concept showing the input species descriptions processed by the pipeline is shown in Fig. 2.

<figure><img src="image_3.png" /></figure>

The LLaMA model was fine-tuned via Low-Rank Adaptation (LoRA) (Hu et al. 2021) on ~17,000 manually verified French question-answer pairs derived from floristic
descriptions across multiple French-language flora, including: *Flore de Nouvelle-Calédonie* and *Flore du Cameroun*. Building on FloraNER (Named Entity Recognition) (Nainia et al. 2024a) and earlier CamemBERT-based pipelines (Nainia et al. 2024b), the current system, F-LoRA-QA (Nainia et al. 2025b), substantially improves structured trait generation from domain-specific descriptions.

In evaluation, F-LoRA-QA outperformed an untuned LLaMA baseline with ~4x higher BLEU score (Bilingual Evaluation Understudy), a 16% gain in semantic similarity, and exact-match accuracy rising from 2% to 24%. Expert botanists further validated trait accuracy, completeness, fluency, and terminology, supporting critiques of over-reliance on automatic metrics for domain question answering (Nainia et al. 2025a).

A key application is the enrichment of descriptor-based systems like Xper³ (Kerner et al. 2025), which rely on structured trait matrices to describe and differentiate taxa. Fig. 3 and Fig. 4 illustrate trait discovery, value extraction, and a comparison matrix with evidence links, supporting descriptor systems and interoperable biodiversity databases.

<figure><img src="image_4.png" /><figcaption>Figure 3.</figcaption></figure>

Trait discovery (Stage 1) and value extraction (Stage 2) for *Pinus strobus*, with answers linked to source species descriptions. Credit: A. Nainia (CC BY 4.0).

## Keywords

question answering, natural language processing, large language models, information extraction, computational biodiversity

## Presenting author

Ayoub Nainia
<figure><img src="image_5.png" /><figcaption>Figure 4.</figcaption></figure>

Species comparison matrix provided by the pipeline, showing normalized trait values across species. Credit: A. Nainia. License: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).

## Presented at

Living Data 2025

## Acknowledgements

This project was co-funded by the EU Horizon Europe programme (MSCA Cofund SOUND.AI, Grant No. 101081674) and the e-COL+ project (ANR-21-ESRE-0053).

## Conflicts of interest

The authors have declared that no competing interests exist.

## References

* Hu E, Shen Y, Wallis P, Allen-Zhu Z, Li Y, Wang S. Wang L, Chen W (2021) LoRA: Low-Rank Adaptation of Large Language Models. URL: https://doi.org/10.48550/arXiv.2106.09685

* Kerner A, Saliba EM, Bouquin S, Portier R, Vignes-Lebbe R, et al. (2025) An Xper3 reference guide for taxonomists: a collaborative system for identification keys and descriptive data. European Journal of Taxonomy 987: 281-302. https://doi.org/10.5852/ejt.2025.987.2875

* Martin L, Muller B, Ortiz Suárez PJ, Dupont Y, Romary L, de la Clergerie É, Seddah D, Sagot B (2020) CamemBERT: a Tasty French Language Model. Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics https://doi.org/10.18653/v1/2020.acl-main.645

* Nainia A, Vignes-Lebbe R, Chenin E, Sahraoui M, Mousannif H, Zahir J, et al. (2024a) FloraNER: A new dataset for species and morphological terms named entity recognition in French botanical text. Data in Brief 56 URL: https://doi.org/10.1016/j.dib.2024.110824
* Nainia A, Vignes-Lebbe R, Chenin E, Sahraoui M, Mousannif H, Zahir J, et al. (2024b) A Transformer-Based Nlp Pipeline for Enhanced Extraction of Botanical Information using Camembert on French Literature. NLP & Information Retrieval 59-78. https://doi.org/10.5121/csit.2024.140605

* Nainia A, Vignes-Lebbe R, Mousannif H, Zahir J, et al. (2025a) Beyond BLEU: Ethical Risks of Misleading Evaluation in Domain-Specific QA with LLMs. In: Picazo-Izquierdo A, Estevanell-Valladares EL, Mitkov R, Guillena RM, Cerda RG (Eds) Proceedings of the First Workshop on Comparative Performance Evaluation: From Rules to Language Models. RANLP 2025, Bulgaria. [ISBN 978-954-452-102-8]. https://doi.org/10.26615/978-954-452-102-8 009

* Nainia A, Vignes-Lebbe R, Mousannif H, Zahir J (2025b) F-LoRA-QA: Finetuning LLaMA Models with Low-Rank Adaptation for French Botanical Question Generation and Answering. In: Angelova G, Kunilovskaya M, Escribe M, Mitkov R (Eds) Proceedings of the 15th International Conference on Recent Advances in Natural Language Processing - Natural Language Processing in the Generative AI era. RANLP 2025, Bulgaria. 787--796 pp. [ISBN 978-954-452-098-4]. https://doi.org/10.26615/978-954-452-098-4 091

* Touvron H, Lavril T, Izacard G, Martinet X, Lachaux M, Lacroix T, Rozière B, Goyal N, Hambro E, Azhar F, Rodriguez A, Joulin A, Grave E, Lample G (2023) LLaMA: Open and Efficient Foundation Language Models. URL: https://arxiv.org/abs/2302.13971

* Vaswani A, Shazeer N, Parmar N, Uszkoreit J, Jones L, Gomez A, Kaiser L, Polosukhin I (2017) Attention Is All You Need. https://doi.org/10.48550/arXiv.1706.03762