Downloads · 30 days
18
100% of all-time downloads
Loria-MosAIk/xqdt-e2e-qwen3-0.6b
xqdt-e2e-qwen3-0.6b is a text generation model from Loria-MosAIk. Use it when you need the model to write or continue text. It is set up for peft.
This repository contains the LoRA adapter for the qwen3 0.6B XQDT verifier from XQDT: eXplainable and Quantitative Data-Text Alignment Metric with Feedback Signals. It is used with Qwen/Qwen3-0.6B.
Downloads · 30 days
18
100% of all-time downloads
All-time downloads
18
Public
Repo size
20.2 MB
Likes
0
Public
Click a slice to open those files.
.safetensors20.2 MB · 100%
From the Hugging Face model README
This repository contains the LoRA adapter for the qwen3 0.6B
XQDT verifier from XQDT: eXplainable and Quantitative Data-Text Alignment Metric
with Feedback Signals. It is used with
Qwen/Qwen3-0.6B.
This E2E checkpoint was trained on the joint WebNLG--E2E synthetic training set.
XQDT verifies alignment between English text and structured triples. It returns
missing, extra, and incorrect units, or All correct. missing identifies
an input unit omitted from the text, extra identifies text content unsupported
by the input, and incorrect identifies an input unit realised with incorrect
information.
Example inputs and outputs are provided in smoke_test.json.
Generated text may vary slightly across inference libraries and package versions.
Verify if the triples align with the text. Find missing, extra, or incorrect triples.
TEXT: {text}
TRIPLES:
1. [S] {subject} [P] {predicate} [O] {object}
Output as markdown table with Type and Triple columns.
import os
os.environ.setdefault("USE_HF", "1")
import torch
from swift.infer_engine import InferRequest, RequestConfig, TransformersEngine
BASE_MODEL = "Qwen/Qwen3-0.6B"
ADAPTER_ID = "Loria-MosAIk/xqdt-e2e-qwen3-0.6b"
SYSTEM_PROMPT = "Identify extra, missing and incorrect triples precisely."
QUERY = """Verify if the triples align with the text. Find missing, extra, or incorrect triples.
TEXT: Blue Spice is a coffee shop in city centre.
TRIPLES:
1. [S] Blue Spice [P] area [O] city centre
2. [S] Blue Spice [P] eat type [O] coffee shop
Output as markdown table with Type and Triple columns."""
MESSAGES = [{"role": "system", "content": SYSTEM_PROMPT}, {"role": "user", "content": QUERY}]
engine = TransformersEngine(
BASE_MODEL,
adapters=[ADAPTER_ID],
max_batch_size=1,
torch_dtype=torch.bfloat16,
device_map="auto",
template_type="qwen3",
use_hf=True,
)
response = engine.infer(
[InferRequest(messages=MESSAGES)],
RequestConfig(max_tokens=1024, temperature=0.3, seed=2023),
use_tqdm=False,
)[0]
print(response.choices[0].message.content)
import torch
from peft import PeftModel
from transformers import set_seed
BASE_MODEL = "Qwen/Qwen3-0.6B"
ADAPTER_ID = "Loria-MosAIk/xqdt-e2e-qwen3-0.6b"
SYSTEM_PROMPT = "Identify extra, missing and incorrect triples precisely."
QUERY = """Verify if the triples align with the text. Find missing, extra, or incorrect triples.
TEXT: Blue Spice is a coffee shop in city centre.
TRIPLES:
1. [S] Blue Spice [P] area [O] city centre
2. [S] Blue Spice [P] eat type [O] coffee shop
Output as markdown table with Type and Triple columns."""
MESSAGES = [{"role": "system", "content": SYSTEM_PROMPT}, {"role": "user", "content": QUERY}]
set_seed(2023)
from transformers import AutoModelForCausalLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
base = AutoModelForCausalLM.from_pretrained(
BASE_MODEL, torch_dtype=torch.bfloat16, device_map="auto"
)
model = PeftModel.from_pretrained(base, ADAPTER_ID).eval()
prompt = tokenizer.apply_chat_template(MESSAGES, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.inference_mode():
output = model.generate(**inputs, max_new_tokens=1024, do_sample=True, temperature=0.3)
generated = output[0, inputs["input_ids"].shape[-1]:]
print(tokenizer.decode(generated, skip_special_tokens=True))
from huggingface_hub import snapshot_download
from vllm import LLM, SamplingParams
from vllm.lora.request import LoRARequest
BASE_MODEL = "Qwen/Qwen3-0.6B"
ADAPTER_ID = "Loria-MosAIk/xqdt-e2e-qwen3-0.6b"
SYSTEM_PROMPT = "Identify extra, missing and incorrect triples precisely."
QUERY = """Verify if the triples align with the text. Find missing, extra, or incorrect triples.
TEXT: Blue Spice is a coffee shop in city centre.
TRIPLES:
1. [S] Blue Spice [P] area [O] city centre
2. [S] Blue Spice [P] eat type [O] coffee shop
Output as markdown table with Type and Triple columns."""
MESSAGES = [{"role": "system", "content": SYSTEM_PROMPT}, {"role": "user", "content": QUERY}]
adapter_path = snapshot_download(ADAPTER_ID)
llm = LLM(model=BASE_MODEL, enable_lora=True)
outputs = llm.chat(
MESSAGES,
SamplingParams(max_tokens=1024, temperature=0.3, seed=2023),
lora_request=LoRARequest("xqdt", 1, adapter_path),
)
print(outputs[0].outputs[0].text)
@inproceedings{efimov-zhang-etal-2026-xqdt,
title = {XQDT: eXplainable and Quantitative Data-Text Alignment Metric with Feedback Signals},
author = {Efimov-Zhang, Kun and Song, Yifei and Gardent, Claire},
booktitle = {Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing},
year = {2026}
}