Instructions to use datagero/qwen3.5-9b-ontology-extraction-raft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use datagero/qwen3.5-9b-ontology-extraction-raft with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.5-9B") model = PeftModel.from_pretrained(base_model, "datagero/qwen3.5-9b-ontology-extraction-raft") - Notebooks
- Google Colab
- Kaggle
qwen3.5-9b-ontology-extraction-raft
A LoRA adapter for Qwen/Qwen3.5-9B that extracts a primitive ontology โ [subject, relation, object] triples โ from a raw text document.
Built by Semantic Swingers for the LLMs4OL 2026 shared task (Task A, "flagship": text โ ontology triples, scored by graph similarity). If you have not heard of the challenge, the short version: given a document, produce the taxonomy/typing triples it implies. This adapter is the fine-tuned generator behind our submission.
Which adapter is this
Regime: RA-FT (retrieval-aware).
Use
top_k = 10at inference. RA-FT was trained with retrieved exemplars in the prompt, so it expects exemplars at inference. Using the wrongkunderstates the adapter.Hardware: CUDA GPU. The
qwen3_5hybrid needs CUDA fast-attention kernels; on Apple Silicon they fall back to CPU.graph_similarity(organizer v2, exact) onval_20: 0.7000
How to run it
Through our OntoLearner integration (the learner ships in the fork below):
from ontolearner.learner.text2onto import SemanticSwingersText2OntoLearner
learner = SemanticSwingersText2OntoLearner(
adapter="datagero/qwen3.5-9b-ontology-extraction-raft",
base_model_id="Qwen/Qwen3.5-9B",
backend="peft",
top_k=10,
)
learner.load()
# learner.fit(train_docs, task="text2onto"); learner.predict(eval_docs, task="text2onto")
How it was made (the training code is part of the integration)
This adapter was produced by the same package that serves it โ training is a first-class part of the OntoLearner integration, not a separate script:
- Training code:
semanticswingers_train.pyโ LoRA SFT with prompt masking (loss on completion tokens only) and, for RA-FT, leave-one-out exemplar retrieval so a training document never sees its own gold. - Integration + reproduction: OntoLearner fork, PR #1 and the replication notebook
therein (
notebooks/pipeline_ontolearner.ipynb), which runs Tasks A/B/C end-to-end.
To reproduce: learner = SemanticSwingersText2OntoLearner(train_mode="raft", train_backend="peft", output_dir=...) then learner.fit(train_docs, task="text2onto").
Intended use & limitations
Research replication for the LLMs4OL 2026 shared task. Domain: general ontology construction from text; the training data is the challenge's Task A split. Not intended for production ontology engineering without validation. Inherits the base model's license and limitations.
- Downloads last month
- 4