ows2_dataset_1 / README.md
AllTomInrae's picture
Update README.md
edb688b verified
|
Raw History Blame Contribute Delete
8.02 kB
---
language:
- en
- fr
license: cc-by-4.0
task_categories:
- text-classification
- sentence-similarity
- feature-extraction
tags:
- ontology
- semantic-alignment
- food-science
- plant-biology
- bi-encoder
- fine-tuning
- sentence-transformers
- TransformON
- Plant-Ontology
- CHEBI
size_categories:
- 10K<n<100K
dataset_info:
features:
- name: sentence_id
dtype: string
- name: model_semantique_source
dtype: string
- name: source
dtype: string
- name: sentence
dtype: string
- name: positive_terms
sequence:
- name: term
dtype: string
- name: ontology_id
dtype: string
- name: note
dtype: string
- name: negative_terms
sequence:
- name: term
dtype: string
- name: ontology_id
dtype: string
splits:
- name: train
num_examples: 14919
- name: test
num_examples: 100
---
# OWS2 Dataset 1 — Semantic Alignment for Food Transformation & Plant Ontologies
## Dataset Summary
**`ows2_dataset_1`** is a curated dataset for training and evaluating Bi-Encoder models (e.g., `all-MiniLM-L6-v2`) on **semantic ontology alignment** in the **food transformation** and plant biology domains.
Each example pairs a scientific sentence with a set of **positive** ontology terms (relevant concepts) and, when available, **negative** terms (hard distractors). The dataset is designed to bring complex scientific sentences and domain-specific ontology terms into a shared semantic vector space.
> **Note — First iteration.** This is `v1` of the dataset. The volume of real annotated data remains intentionally limited at this stage, as the dataset is expected to **grow iteratively** through successive annotation campaigns and pipeline improvements.
The dataset covers concepts from several ontologies:
- **TransformON (TFO)** — Food transformation and processing ontology
- **Plant Ontology (PO)** — Plant anatomy and developmental stages
- **Trait Ontology (TO)** — Plant traits
---
## Splits
| Split | Num. examples | Description |
|--------|:---:|---|
| `train` | 14 919 | Training split — mix of LLM-generated and real sentences |
| `test` | 100 | Gold standard — manually validated sentence-term pairs |
> **Real data volume.** As a first iteration, real annotated examples represent only a small fraction of the train split (~491 out of 14 919). The proportion of real, expert-validated data is expected to increase in future versions as annotation campaigns progress.
---
## Data Structure
Each record is a JSON object with the following fields for real data :
```json
{
"sentence_id": "ABS_10.3390/antiox11010133_3",
"model_semantique_source": "S-PubMedBert-MS-MARCO",
"source": "10.3390/antiox11010133",
"sentence": "The canonical reactive oxygen species (ROS)-scavenging mode ...",
"positive_terms": [
{"term": "antioxidants", "ontology_id": "TFO:tHfHTb"},
{"term": "flavonoid", "ontology_id": "CHEBI:47916", "note": "Proposition manuelle sans ID d'ontologie"}
],
"negative_terms": [
{"term": "xanthophyll", "ontology_id": "TFO:2zpu01"}
]
}
```
and here an example of synthetic data :
```json
{
"sentence_id": "SYNTH_v0_9241",
"model_semantique_source": "synthetic",
"source": "synthetic",
"sentence": "The experimental group consumed a diet enriched with dehulled oak seeds, demonstrating improved digestive efficiency.",
"positive_terms": [
{"term": "acorn, dehulled (feed)", "ontology_id": "TFO:TTN7SQ"}
],
"negative_terms": []
}
```
### Fields
| Field | Type | Description |
|---|---|---|
| `sentence_id` | `string` | Unique identifier. Prefix `ABS_` = real abstract sentence; `SYNTH_v0_` = synthetic sentence |
| `model_semantique_source` | `string` | Model used for candidate term retrieval (`S-PubMedBert-MS-MARCO`, `all-MiniLM-L6-v2`, `BioLORD-2023`, `synthetic`) |
| `source` | `string` | DOI of origin article, or `synthetic` for generated sentences |
| `sentence` | `string` | Scientific sentence (input text) |
| `positive_terms` | `list[dict]` | Relevant ontology terms (anchors for similarity) |
| `negative_terms` | `list[dict]` | Irrelevant terms that were rejected (hard negatives) |
---
## Train Split — Source Breakdown
| Source type | Count |
|---|:---:|
| Synthetic (LLM-generated) | 14 428 |
| Real scientific abstracts (DOI-based) | 491 |
### A note on multiple positives and unfolding
Each sentence can carry **one or more positive terms** (`positive_terms` is a list). For training with pair-based losses such as MNRL, the recommended approach is to **unfold** the dataset: each `(sentence, positive_term)` pair becomes an independent training example. This increases the effective size of the training set and ensures each ontology term is explicitly associated with its sentence during optimization.
```python
# Example unfolding
pairs = [
(example["sentence"], term["term"])
for example in dataset["train"]
for term in example["positive_terms"]
]
```
### A note on negatives
Synthetic examples (`SYNTH_v0_*`) — the vast majority of the train split — carry **no explicit negative terms** (`negative_terms` is an empty list). Hard negatives are only provided for manually annotated real examples.
To compensate for this absence during training, we rely on **in-batch negatives**: within each mini-batch, all positive terms from *other* examples act as implicit negatives for a given sentence. This strategy is made effective by using **Multiple Negatives Ranking Loss (MNRL)**, which is the recommended loss function for this dataset. The unfolding strategy described above further enriches the batch diversity, making in-batch negatives more effective.
---
## Test Split — Gold Standard
The `test` split (`dataset_goldtest.jsonl`) contains **100 manually annotated examples** drawn from real peer-reviewed scientific articles. Each sentence-term pair was validated by domain experts.
Articles covered include publications on:
- Apple polyphenols and cider chemistry
- Lentil texture and cooking behavior
- Wine oxidative stability
- Plant secondary metabolites and antioxidants
---
## Construction Pipeline
The dataset was built using the **DatasetBuilder** module of the OWS2 pipeline:
1. **Abstract extraction** — Scientific abstracts retrieved from PubMed/ISTEX
2. **Candidate term retrieval** — Top-k ontology terms retrieved via semantic similarity (Bi-Encoder)
3. **Annotation** — Manual validation and positive/negative labeling via the *Check_Annotations* Streamlit app
4. **Synthetic enrichment** — LLM-generated sentence-term pairs covering sparse ontology regions
---
## Intended Use
This dataset is intended for:
- **Fine-tuning** Bi-Encoder models (e.g., `sentence-transformers/all-MiniLM-L6-v2`) primarily with **Multiple Negatives Ranking Loss (MNRL)**, which leverages in-batch negatives to compensate for the low density of explicit hard negatives in synthetic examples
- **Evaluating** semantic alignment between scientific text and ontology terms (gold `test` split)
- **Research** on ontology-grounded sentence embeddings in **food transformation** and plant biology
---
## Citation
If you use this dataset, please cite the OWS2 project:
```bibtex
@dataset{ows2_dataset_1,
title = {OWS2 Dataset 1 — Semantic Alignment for Food and Plant Ontologies},
year = {2026},
license = {CC BY 4.0},
}
```
> **Affiliation:** This dataset was produced within the **OWS² (Ontology-based Workflow for Semantic Specialisation)** project, which was supported by **INRAE Metaprogramme DIGIT-BIO** within the framework of the **SEED** project, and was carried out within the **Plateforme de Profilage Métabolique et de Métabolomique (P2M2)** — UMR 1349 IGEPP, INRAE.
---
## License
This dataset is released under the [Creative Commons Attribution 4.0 (CC BY 4.0)](https://creativecommons.org/licenses/by/4.0/) license.