Instructions to use gplsi/Gemma-3-1B-OntologyLearning-DBpediaArchivo-StructSelect-Q1-e2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gplsi/Gemma-3-1B-OntologyLearning-DBpediaArchivo-StructSelect-Q1-e2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="gplsi/Gemma-3-1B-OntologyLearning-DBpediaArchivo-StructSelect-Q1-e2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("gplsi/Gemma-3-1B-OntologyLearning-DBpediaArchivo-StructSelect-Q1-e2") model = AutoModelForCausalLM.from_pretrained("gplsi/Gemma-3-1B-OntologyLearning-DBpediaArchivo-StructSelect-Q1-e2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use gplsi/Gemma-3-1B-OntologyLearning-DBpediaArchivo-StructSelect-Q1-e2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "gplsi/Gemma-3-1B-OntologyLearning-DBpediaArchivo-StructSelect-Q1-e2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gplsi/Gemma-3-1B-OntologyLearning-DBpediaArchivo-StructSelect-Q1-e2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/gplsi/Gemma-3-1B-OntologyLearning-DBpediaArchivo-StructSelect-Q1-e2
- SGLang
How to use gplsi/Gemma-3-1B-OntologyLearning-DBpediaArchivo-StructSelect-Q1-e2 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "gplsi/Gemma-3-1B-OntologyLearning-DBpediaArchivo-StructSelect-Q1-e2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gplsi/Gemma-3-1B-OntologyLearning-DBpediaArchivo-StructSelect-Q1-e2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "gplsi/Gemma-3-1B-OntologyLearning-DBpediaArchivo-StructSelect-Q1-e2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gplsi/Gemma-3-1B-OntologyLearning-DBpediaArchivo-StructSelect-Q1-e2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use gplsi/Gemma-3-1B-OntologyLearning-DBpediaArchivo-StructSelect-Q1-e2 with Docker Model Runner:
docker model run hf.co/gplsi/Gemma-3-1B-OntologyLearning-DBpediaArchivo-StructSelect-Q1-e2
Gemma-3-1B-DBpediaArchivo-StructSelect-Q1-e2
This causal language model starts from google/gemma-3-1b-pt and was adapted with two epochs of continual pretraining (CPT) on Q1, a structurally selected subset of DBpedia Archivo. It was developed for Quality over Quantity: Ontology Dataset Selection for Efficient Triple Generation in LLMs (Canal-Esteve et al., 2026), where it was first introduced and evaluated. It is intended for research on ontology-to-ontology generation, where the model continues an RDF/OWL fragment serialized as Turtle.
Training data
Q1 was drawn from the 15 July 2025 DBpedia Archivo snapshot. The selection score sums three min–max-normalized measures: mean subclasses per class, mean non-taxonomic relations per class, and property density. Ontologies were added in score order until the selection reached the 25% token budget. Including the last ontology in full yielded 37 ontologies and about 389 million tokens, or about 31% of the full corpus. CPT used a causal language-modeling objective on Turtle text, with the model's own tokenizer.
Source corpus and Q1 ranking · Data preparation and evaluation
Evaluation
The evaluation used 12 Turtle prefixes from AGRO, EDAM, MDS and SWEET, with six sampled continuations per prefix and 72 continuations per configuration. The table reports manually assessed error rates. The final column is the arithmetic mean of the seven category rates. The CPT checkpoint used 29.50 GPU hours on NVIDIA A100 40 GB GPUs.
| Model | Syntax | Triple repetition | Text repetition | Redundancy | Ambiguity | Semantic contradiction | Vocabulary | Mean error rate ↓ |
|---|---|---|---|---|---|---|---|---|
| Original base model | 1.4% | 35.9% | 3.6% | 3.6% | 0.9% | 0.6% | 0.1% | 6.6% |
| Q1 after two epochs | 2.8% | 4.8% | 2.0% | 0.5% | 2.3% | 0.9% | 0.0% | 1.9% |
Usage
Pass a Turtle prefix directly to the model. For ontology editing workflows, parse the completed Turtle and review the generated statements before adding them to an ontology.
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "gplsi/Gemma-3-1B-OntologyLearning-DBpediaArchivo-StructSelect-Q1-e2"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
prompt = """@prefix ex: <https://example.org/ontology/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
ex:Material a owl:Class .
ex:Metal a owl:Class ;
rdfs:subClassOf ex:Material .
"""
inputs = tokenizer(prompt, return_tensors="pt")
output = model.generate(
**inputs, max_new_tokens=100, do_sample=True,
temperature=0.7, top_k=50, top_p=0.95,
)
continuation = output[0, inputs["input_ids"].shape[1]:]
print(tokenizer.decode(continuation, skip_special_tokens=True))
License
This checkpoint is distributed under the Gemma Terms of Use.
Citation
When reporting results with this checkpoint, cite the model repository and Miquel Canal Esteve’s doctoral thesis, Aprender del conocimiento ontológico: Selección eficiente de datos para la adaptación semántica de modelos de lenguaje, Universidad de Alicante.
@article{canal2026quality,
title = {Quality over Quantity: Ontology Dataset Selection for Efficient Triple Generation in LLMs},
author = {Canal-Esteve, Miquel and Abreu, José I. and Gutiérrez, Yoan and Muñoz, Rafael},
journal = {Procesamiento del Lenguaje Natural},
volume = {77},
pages = {275--288},
year = {2026}
}
@misc{canal_gemma_3_1b_dbpediaarchivo_structselect_q1_e2,
author = {Canal Esteve, Miquel},
title = {{Gemma-3-1B-DBpediaArchivo-StructSelect-Q1-e2}},
howpublished = {Hugging Face model checkpoint},
url = {https://huggingface.co/gplsi/Gemma-3-1B-OntologyLearning-DBpediaArchivo-StructSelect-Q1-e2}
}
This research has been partially funded by the University of Alicante, the Spanish Ministry of Science and Innovation (MICIU), and the European Regional Development Fund (ERDF) through the project HEART-NLP (PID2024-156263OB-C22); funded by MICIU/AEI/10.13039/501100011033 / “ERDF, EU”.
- Downloads last month
- 407
Model tree for gplsi/Gemma-3-1B-OntologyLearning-DBpediaArchivo-StructSelect-Q1-e2
Base model
google/gemma-3-1b-pt