CoolFace
Modelpublic

IT-ZBMED/Agriculture_NER_Model_for_FAIR_Metadata_Enrichment

sourceHugging Facemitupdated 10mo agoView on Hugging Face
1likes22downloads
Model Card

Model Card

<!-- Provide a quick summary of what the model is/does. --> This model is a product of the use case "Increasing FAIRness of FAIRagro data through AI supported metadata enrichment" which is part of the FAIRagro consortium. The model is fine-tuned based on the annotated dataset where it is trained to extract entities related to crops, soil, locations, and time statements from agriculture research datasets. It is used in the use case to extract this information from the legacy research data and publications. Its application is to enrich current metadata by extracting agricultural metadata from current unstructured parts of metadata (titles and abstracts).

Model Details

Model Description

<!-- Provide a longer summary of what this model is. -->

This is the model card of a ๐Ÿค— transformers model that has been pushed on the Hub. This model card has been automatically generated.

  • โ€”Developed by: ZB MED - informationszentrum lebenswissenschaften
  • โ€”Funded by: DFG - Deutsche Forschungsgemeinschaft
  • โ€”Model type: Token-classification Model
  • โ€”Language(s) (NLP): English, German
  • โ€”License: MIT
  • โ€”Finetuned from model: FacebookAI/xlm-roberta-large

Uses

<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. --> This model is intended to be used as an NER model for agriculture research. The entities it can extract are:

json
[
  "soilReferenceGroup",
  "soilOrganicCarbon",
  "soilTexture",
  "startTime",
  "endTime",
  "city",
  "duration",
  "cropSpecies",
  "soilAvailableNitrogen",
  "soilDepth",
  "region",
  "country",
  "longitude",
  "latitude",
  "cropVariety",
  "soilPH",
  "soilBulkDensity"
]

Out-of-Scope Use

<!-- This section addresses misuse, malicious use, and uses for the model will not work well for. --> This model is not intended to be used in other domains outside of agriculture research or the English or German languages.

Bias, Risks, and Limitations

<!-- This section is meant to convey both technical and sociotechnical limitations. -->

This model is limited by its training dataset of entity-annotated agriculture titles and abstracts from a specific span of time. This may not generalize well for all use cases in different domains. Furthermore, the model occassionally tags subword tokens as entities where there are special signs (e.g., "-,/") and post-processing of results may be necessary to handle those cases.

Recommendations

<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->

Users (both direct and downstream) should be made aware of the risks, biases, and limitations of the model. It is recommended to post-process the raw outputs of the model.

How to Get Started with the Model

Code sample

Use the code below to get started with the model.

python
from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline

roberta_fairagro = AutoModelForTokenClassification.from_pretrained("IT-ZBMED/Agriculture_NER_Model_for_FAIR_Metadata_Enrichment")
tokenizer = AutoTokenizer.from_pretrained("IT-ZBMED/Agriculture_NER_Model_for_FAIR_Metadata_Enrichment")

nlp = pipeline("ner", model=roberta_fairagro, tokenizer=tokenizer, aggregation_strategy="simple")

example = (
    "In early spring 2025, maize and soybean seedlings established quickly in the loamy sand soil as warmer temperatures "
    "accelerated germination, while by late autumn, the clay loam field supported a robust barley crop that matured well despite the soilโ€™s slower drainage."
)

ner_results = nlp(example)
print(ner_results)

Output

bash
[{'entity_group': 'startTime', 'score': 0.9885543, 'word': 'spring 2025', 'start': 9, 'end': 20},
 {'entity_group': 'cropSpecies', 'score': 0.9997772, 'word': 'maize', 'start': 22, 'end': 27},
 {'entity_group': 'cropSpecies', 'score': 0.98714954, 'word': 'soybean', 'start': 32, 'end': 39},
 {'entity_group': 'soilTexture', 'score': 0.99048805, 'word': 'loamy sand', 'start': 77, 'end': 87},
 {'entity_group': 'soilTexture', 'score': 0.97245836, 'word': 'clay loam', 'start': 167, 'end': 176},
 {'entity_group': 'cropSpecies', 'score': 0.9997045, 'word': 'barley', 'start': 202, 'end': 208}]

[More Information Needed]

Training Details

Training Data

<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->

IT-ZBMED/Agriculture_NER_Dataset_for_FAIR_Metadata_Enrichment

Training Procedure

<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. --> The model was fine-tuned on the whole training dataset of the sentence-split.

Training Hyperparameters
ParameterValue
batch_size4
learning_rate2.657488681466831e-05
warmup_ratio0.09938204231729805
numtrainepochs10
weight_decay0.010599758492599783
adam_beta10.9
adam_beta20.999
adam_epsilon1e-08
metricforbest_modelf1
lrschedulertypelinear<!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->

Evaluation

<!-- This section describes the evaluation protocols and provides the results. --> The evaluation was done by the seqeval library based on precision, recall and f1 scores.

Testing Data, Factors & Metrics

Testing Data

<!-- This should link to a Dataset Card if possible. -->

The test split of the following dataset's sentence version IT-ZBMED/Agriculture_NER_Dataset_for_FAIR_Metadata_Enrichment

Metrics

<!-- These are the evaluation metrics being used, ideally with a description of why. -->

f1 score

Results

overall results
MetricValue
Precision0.7745
Recall0.7524
F1 Score0.7633
Macro F10.6189
Accuracy0.9789
Loss0.1476
label-based results
LabelPrecisionRecallF1 ScoreSupport
city0.85710.66670.750018
country0.92000.92000.920025
cropSpecies0.77420.83720.804586
cropVariety0.00000.00000.00003
duration0.63640.58330.608724
endTime0.76470.81250.787932
latitude0.00000.00000.00002
longitude0.66671.00000.80002
region0.64290.52940.580617
soilAvailableNitrogen1.00001.00001.00003
soilBulkDensity0.00000.00000.00001
soilDepth0.62500.83330.71436
soilOrganicCarbon0.78570.55000.647120
soilPH0.60000.75000.66674
soilReferenceGroup1.00001.00001.00001
soilTexture0.75000.27270.400011
startTime0.80300.88330.841360

Environmental Impact

<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->

Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).

  • โ€”Hardware Type: 1 A40 GPU
  • โ€”Hours used: less than one hour
  • โ€”Cloud Provider: High-Performance Computing (HPC) - University of Bonn

Model Card Contact

Abanoub Abdelmalak Email: abdelmalak@zbmed.de

Contributors

Murtuza Husain