jimfhahn/bibframe-corrections
Viewer • Updated • 8.28k • 35
A fine-tuned 1B parameter language model for correcting malformed BIBFRAME RDF/XML to produce valid, well-formed output following Library of Congress conventions.
| Property | Value |
|---|---|
| Base Model | amd/AMD-OLMo-1B |
| Parameters | 1.2B |
| Training | LoRA fine-tuning, merged for deployment |
| Training Data | ~8,500 Library of Congress BIBFRAME records |
| Task | BIBFRAME RDF/XML correction |
| License | Apache 2.0 |
The easiest way to use this model is through the BIBFRAME Vibe VS Code extension:
{
"bf.huggingFaceModel": "jimfhahn/bibframe-olmo-1b",
"bf.huggingFaceToken": "hf_your_token_here"
}
@bf-vibe /correct in GitHub Copilot Chat to fix BIBFRAME recordsDeploy your own endpoint for production use:
nvidia-t4 (recommended) or cpu-xlarge{
"bf.huggingFaceEndpoint": "https://your-endpoint.us-east-1.aws.endpoints.huggingface.cloud",
"bf.huggingFaceToken": "hf_your_token_here"
}
from transformers import pipeline
pipe = pipeline("text-generation", model="jimfhahn/bibframe-olmo-1b")
prompt = (
"<|im_start|>system\n"
"You are a BIBFRAME expert. Fix the following malformed RDF/XML "
"to produce valid BIBFRAME.<|im_end|>\n"
"<|im_start|>user\n"
'<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n'
' xmlns:bf="http://id.loc.gov/ontologies/bibframe/">\n'
" <bf:Work>\n"
" <bf:title>Example Book</bf:title>\n"
" </bf:Work>\n"
"</rdf:RDF><|im_end|>\n"
"<|im_start|>assistant\n"
)
result = pipe(prompt, max_new_tokens=1024, temperature=0.1)
print(result[0]["generated_text"])
curl https://huggingface.co/proxy/router.huggingface.co/hf-inference/models/jimfhahn/bibframe-olmo-1b \
-X POST \
-H "Authorization: Bearer $HF_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"inputs": "<|im_start|>system\nFix the BIBFRAME RDF/XML.<|im_end|>\n<|im_start|>user\n<your-rdf-here><|im_end|>\n<|im_start|>assistant\n",
"parameters": {"max_new_tokens": 1024, "temperature": 0.1}
}'
This model corrects common BIBFRAME errors:
bf:title, bf:adminMetadata)bibframe: → bf:)rdf:type declarationsThe model was trained on ChatML format. Use these exact tokens:
<|im_start|>system
You are a BIBFRAME expert. Fix the following malformed RDF/XML to produce valid BIBFRAME.<|im_end|>
<|im_start|>user
[Your invalid RDF/XML here]<|im_end|>
<|im_start|>assistant
Note: The
<|im_start|>/<|im_end|>tokens are required. Using other formats (e.g.,<|system|>) will produce poor results.
Trained on jimfhahn/bibframe-corrections:
| Project | Description |
|---|---|
| BIBFRAME Vibe | VS Code extension for BIBFRAME cataloging |
| mcp4rdf-core | SHACL validation service |
| bibframe-corrections | Training dataset |
| bibframe-olmo-1b-v2 | Original LoRA adapter |
@misc{bibframe-olmo-2026,
author = {Hahn, Jim},
title = {BIBFRAME-OLMo-1B: Fine-tuned OLMo for BIBFRAME Correction},
year = {2026},
publisher = {HuggingFace},
url = {https://huggingface.co/jimfhahn/bibframe-olmo-1b}
}
Apache 2.0