Instructions to use bratao/Qwen3OIE-0.6B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bratao/Qwen3OIE-0.6B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="bratao/Qwen3OIE-0.6B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("bratao/Qwen3OIE-0.6B") model = AutoModelForCausalLM.from_pretrained("bratao/Qwen3OIE-0.6B", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use bratao/Qwen3OIE-0.6B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "bratao/Qwen3OIE-0.6B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bratao/Qwen3OIE-0.6B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/bratao/Qwen3OIE-0.6B
- SGLang
How to use bratao/Qwen3OIE-0.6B 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 "bratao/Qwen3OIE-0.6B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bratao/Qwen3OIE-0.6B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "bratao/Qwen3OIE-0.6B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bratao/Qwen3OIE-0.6B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use bratao/Qwen3OIE-0.6B with Docker Model Runner:
docker model run hf.co/bratao/Qwen3OIE-0.6B
Qwen3OIE-0.6B
Qwen3OIE-0.6B is a Portuguese abstractive Open Information Extraction (OpenIE)
model fine-tuned from Qwen/Qwen3-0.6B.
Given one sentence, it generates one or more binary extractions with the fields
ARG0, V, and ARG1 in JSON.
This is the smallest published Qwen3OIE checkpoint and the recommended first model for local experiments. It may normalize or infer wording instead of copying every span literally from the source; applications that require strict provenance should validate every generated field against the input or use an extractive model.
Model details
| Field | Value |
|---|---|
| Public repository | bratao/Qwen3OIE-0.6B |
| Base model | Qwen/Qwen3-0.6B |
| Architecture | decoder-only causal language model |
| Task | Portuguese abstractive OpenIE |
| Parameters | 596,049,920 |
| Published weight precision | bfloat16 |
| Approximate repository size | 1.21 GB |
| Audited revision | 140ed13943b107f281600ddc2d3caa37f4a4d062 (2026-08-30) |
The thesis reports this model as “Qwen 0.5B”, following the label used during the experiments. The public upstream checkpoint and this repository are named 0.6B; the parameter count above comes from the published configuration.
Use with portuguese-openie
pip install "portuguese-openie[transformers]"
from portuguese_openie import Model, PortugueseOpenIE
extractor = PortugueseOpenIE(Model.QWEN3_OIE_0_6B)
triples = extractor.extract("A UFBA está localizada em Salvador.")
print([triple.to_dict() for triple in triples])
No model path is required. On first use, the library downloads the public model files from Hugging Face and stores them in the standard local Hugging Face cache; later runs reuse that cache.
Validated output at the audited revision:
[{"ARG0": "A UFBA", "V": "está localizada em", "ARG1": "Salvador"}]
The end-to-end validation used Python 3.12.9, PyTorch 2.13, Transformers 4.57.6, and Accelerate 1.14 on CPU. Model loading took about 8.5 seconds, generation plus parsing about 4.1 seconds, and peak process RSS was about 1.58 GB. These are a single-machine smoke test, not a benchmark.
Direct Transformers use
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "bratao/Qwen3OIE-0.6B"
revision = "140ed13943b107f281600ddc2d3caa37f4a4d062"
tokenizer = AutoTokenizer.from_pretrained(model_id, revision=revision)
model = AutoModelForCausalLM.from_pretrained(
model_id,
revision=revision,
dtype="auto",
device_map="auto",
)
sentence = "A UFBA está localizada em Salvador."
messages = [
{
"role": "system",
"content": (
"Dada uma frase S você consegue fazer extrações em JSON no formato "
"ARG0 , V, ARG1. Realize a extração para a frase abaixo:"
),
},
{"role": "user", "content": f"S: {sentence}"},
]
prompt = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
enable_thinking=False,
)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.inference_mode():
output = model.generate(
**inputs,
max_new_tokens=512,
do_sample=False,
pad_token_id=tokenizer.eos_token_id,
)
generated = output[0, inputs["input_ids"].shape[-1]:]
print(tokenizer.decode(generated, skip_special_tokens=True))
Keep the system prompt, S: prefix, chat template, and enable_thinking=False.
The fine-tuning configuration used a sequence length of 2,048 tokens. Longer task
contexts, even if accepted by the base architecture, were not evaluated here.
Evaluation
The thesis evaluates the public model family on 100 Portuguese test sentences with 238 reference extractions from WikiPUD-Portuguese-Abstractive. The reference set was generated with an LLM from OIEC-PT Gold source sentences and manually spot-checked; it is therefore described as silver-standard, not fully human-authored gold data.
| Criterion | Precision | Recall | F1 |
|---|---|---|---|
| Perfect match | 0.1136 | 0.1723 | 0.1369 |
| Lexical match | 0.2493 | 0.3782 | 0.3005 |
Perfect match requires an exact triple match. Lexical match gives partial credit for token overlap. Precision and recall come from the associated local evaluation summary; the F1 values are also reported in the thesis. These are research results on one small dataset, not general Portuguese language guarantees.
Training-data provenance
The abstractive OpenIE training corpus described in the thesis contains 29,026
Portuguese sentences and 102,788 synthetic extractions derived from 2,015 Portuguese
Wikipedia paragraphs with Gemini 2.5 Flash. The public model repository does not
declare a Hugging Face dataset identifier and does not include that training corpus;
accordingly, this card deliberately omits a datasets field.
Requirements and hardware
- Python 3.10+ with recent
torch,transformers, andaccelerate. - The bfloat16 weights occupy about 1.2 GB. Around 4 GB of system RAM is a practical starting point for CPU inference; GPU execution is optional.
- Actual memory and latency depend on sequence length, software versions, and device.
Limitations and responsible use
- Generative OpenIE can omit relations, duplicate extractions, hallucinate content, or emit malformed JSON. Always parse defensively and retain the source sentence.
- The model was evaluated on only 100 mostly encyclopedic Portuguese sentences.
- It may perform poorly on dialectal, conversational, specialized, very long, or adversarial text and has not been audited for demographic bias.
- An extraction is not a verified fact. Do not use it as the sole basis for medical, legal, financial, or other high-impact decisions.
License
This repository declares the Apache License 2.0. Use also remains subject to the terms of the upstream Qwen model and to any applicable rights in input or training data. The training dataset itself is not distributed by this model card.
Citation
@phdthesis{cabral2025evolving,
author = {Cabral, Bruno Souza},
title = {Evolving Open Information Extraction for Portuguese employing Language Models},
school = {Universidade Federal da Bahia},
year = {2025}
}
@inproceedings{cabral2022portnoie,
author = {Cabral, Bruno and Souza, Marlo and Claro, Daniela Barreiro},
title = {PortNOIE: A Neural Framework for Open Information Extraction for the Portuguese Language},
booktitle = {Computational Processing of the Portuguese Language (PROPOR 2022)},
year = {2022},
doi = {10.1007/978-3-030-98305-5_23}
}
Project: Portuguese-OpenIE · PortNOIE paper · Generative OpenIE paper
- Downloads last month
- 158