Instructions to use datagero/qwen3.5-9b-ontology-extraction-baseft-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use datagero/qwen3.5-9b-ontology-extraction-baseft-mlx with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download datagero/qwen3.5-9b-ontology-extraction-baseft-mlx --local-dir qwen3.5-9b-ontology-extraction-baseft-mlx
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
Upload folder using huggingface_hub
Browse files- README.md +68 -0
- adapter_config.json +41 -0
- adapters.safetensors +3 -0
README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: mlx-community/Qwen3.5-9B-4bit
|
| 3 |
+
library_name: mlx
|
| 4 |
+
license: other
|
| 5 |
+
license_name: qwen
|
| 6 |
+
tags:
|
| 7 |
+
- lora
|
| 8 |
+
- ontology-learning
|
| 9 |
+
- ontology-extraction
|
| 10 |
+
- text2onto
|
| 11 |
+
- llms4ol-2026
|
| 12 |
+
- qwen3.5
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# qwen3.5-9b-ontology-extraction-baseft-mlx
|
| 16 |
+
|
| 17 |
+
A LoRA adapter for **`Qwen/Qwen3.5-9B`** that extracts a *primitive ontology* — `[subject,
|
| 18 |
+
relation, object]` triples — from a raw text document.
|
| 19 |
+
|
| 20 |
+
Built by **Semantic Swingers** for the **LLMs4OL 2026** shared task (Task A, "flagship":
|
| 21 |
+
text → ontology triples, scored by graph similarity). If you have not heard of the challenge, the
|
| 22 |
+
short version: given a document, produce the taxonomy/typing triples it implies. This adapter is the
|
| 23 |
+
fine-tuned generator behind our submission.
|
| 24 |
+
|
| 25 |
+
## Which adapter is this
|
| 26 |
+
|
| 27 |
+
- **Regime:** base-FT (no exemplars).
|
| 28 |
+
- **Use `top_k = 0` at inference.** base-FT was trained without exemplars, so it is best run retrieval-free. Using the wrong `k` understates the adapter.
|
| 29 |
+
- **Hardware:** Apple Silicon (MLX). Runs natively on Apple Silicon via MLX.
|
| 30 |
+
|
| 31 |
+
- **Score:** this is the Apple-Silicon 4-bit MLX variant, a *separate artifact* from the bf16 champions — its score differs and is **not** the reported number.
|
| 32 |
+
|
| 33 |
+
## How to run it
|
| 34 |
+
|
| 35 |
+
Through our OntoLearner integration (the learner ships in the fork below):
|
| 36 |
+
|
| 37 |
+
```python
|
| 38 |
+
from ontolearner.learner.text2onto import SemanticSwingersText2OntoLearner
|
| 39 |
+
|
| 40 |
+
learner = SemanticSwingersText2OntoLearner(
|
| 41 |
+
adapter="datagero/qwen3.5-9b-ontology-extraction-baseft-mlx",
|
| 42 |
+
base_model_id="mlx-community/Qwen3.5-9B-4bit",
|
| 43 |
+
backend="mlx",
|
| 44 |
+
top_k=0,
|
| 45 |
+
)
|
| 46 |
+
learner.load()
|
| 47 |
+
# learner.fit(train_docs, task="text2onto"); learner.predict(eval_docs, task="text2onto")
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
## How it was made (the training code is part of the integration)
|
| 51 |
+
|
| 52 |
+
This adapter was produced by the **same package** that serves it — training is a first-class part
|
| 53 |
+
of the OntoLearner integration, not a separate script:
|
| 54 |
+
|
| 55 |
+
- **Training code:** [`semanticswingers_train.py`](https://github.com/matias-vizcaino/OntoLearner-semanticswingers/blob/feat/semanticswingers-llms4ol2026/ontolearner/learner/text2onto/semanticswingers_train.py) — LoRA SFT with prompt masking
|
| 56 |
+
(loss on completion tokens only) and, for RA-FT, **leave-one-out** exemplar retrieval so a
|
| 57 |
+
training document never sees its own gold.
|
| 58 |
+
- **Integration + reproduction:** [OntoLearner fork, PR #1](https://github.com/matias-vizcaino/OntoLearner-semanticswingers/pull/1) and the replication notebook
|
| 59 |
+
therein (`notebooks/pipeline_ontolearner.ipynb`), which runs Tasks A/B/C end-to-end.
|
| 60 |
+
|
| 61 |
+
To reproduce: `learner = SemanticSwingersText2OntoLearner(train_mode="baseft",
|
| 62 |
+
train_backend="mlx", output_dir=...)` then `learner.fit(train_docs, task="text2onto")`.
|
| 63 |
+
|
| 64 |
+
## Intended use & limitations
|
| 65 |
+
|
| 66 |
+
Research replication for the LLMs4OL 2026 shared task. Domain: general ontology construction from
|
| 67 |
+
text; the training data is the challenge's Task A split. Not intended for production ontology
|
| 68 |
+
engineering without validation. Inherits the base model's license and limitations.
|
adapter_config.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"adapter_path": "/Users/matias.vizcaino/Documents/datagero_repos/llms4ol-2026/data/ft/adapters_9b_full/seg_04",
|
| 3 |
+
"batch_size": 1,
|
| 4 |
+
"clear_cache_threshold": 1,
|
| 5 |
+
"config": null,
|
| 6 |
+
"data": "/Users/matias.vizcaino/Documents/datagero_repos/llms4ol-2026/data/ft/mlx35_nothink_full",
|
| 7 |
+
"fine_tune_type": "lora",
|
| 8 |
+
"grad_accumulation_steps": 4,
|
| 9 |
+
"grad_checkpoint": true,
|
| 10 |
+
"iters": 950,
|
| 11 |
+
"learning_rate": 7e-06,
|
| 12 |
+
"lora_parameters": {
|
| 13 |
+
"rank": 8,
|
| 14 |
+
"dropout": 0.0,
|
| 15 |
+
"scale": 20.0
|
| 16 |
+
},
|
| 17 |
+
"lr_schedule": null,
|
| 18 |
+
"mask_prompt": true,
|
| 19 |
+
"max_seq_length": 1024,
|
| 20 |
+
"model": "mlx-community/Qwen3.5-9B-4bit",
|
| 21 |
+
"num_layers": 8,
|
| 22 |
+
"optimizer": "adamw",
|
| 23 |
+
"optimizer_config": {
|
| 24 |
+
"adam": {},
|
| 25 |
+
"adamw": {},
|
| 26 |
+
"muon": {},
|
| 27 |
+
"sgd": {},
|
| 28 |
+
"adafactor": {}
|
| 29 |
+
},
|
| 30 |
+
"project_name": null,
|
| 31 |
+
"report_to": null,
|
| 32 |
+
"resume_adapter_file": "/Users/matias.vizcaino/Documents/datagero_repos/llms4ol-2026/data/ft/adapters_9b_full/seg_03/0000800_adapters.safetensors",
|
| 33 |
+
"save_every": 50,
|
| 34 |
+
"seed": 46,
|
| 35 |
+
"steps_per_eval": 400,
|
| 36 |
+
"steps_per_report": 25,
|
| 37 |
+
"test": false,
|
| 38 |
+
"test_batches": 500,
|
| 39 |
+
"train": true,
|
| 40 |
+
"val_batches": 10
|
| 41 |
+
}
|
adapters.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5835fd0711b95d40b39f35807d30af4d7976371aa6650ce87071de8be773bcae
|
| 3 |
+
size 21654694
|