Qwen3OIE-8B is a Portuguese abstractive Open Information Extraction (OpenIE)
model fine-tuned from Qwen/Qwen3-8B. It
generates one or more binary extractions in JSON with fields ARG0, V, and ARG1.
It obtained the highest lexical-match F1 in the doctoral evaluation.
The published trainer_state.json records epoch 2.0 and step 1,572 of a nominal
2,358-step, three-epoch run, with no best checkpoint or metric. This may be a stale
state file rather than proof that the weights are incomplete, but the repository
does not contain enough evidence to resolve that ambiguity. Treat the artifact as a
research checkpoint and pin a revision in reproducible work.
Use with portuguese-openie
pip install "portuguese-openie[transformers]"
python
1from portuguese_openie import Model, PortugueseOpenIE
23extractor = PortugueseOpenIE(Model.QWEN3_OIE_8B)4triples = extractor.extract("A UFBA está localizada em Salvador.")5print([triple.to_dict()for triple in triples])
No model path is required. The first call downloads public files from Hugging Face
into its standard local cache; subsequent runs reuse the cached snapshot.
Expected output shape (illustrative; exact wording can vary by runtime):
[{"ARG0": "A UFBA", "V": "está localizada em", "ARG1": "Salvador"}]
Direct Transformers use
python
1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
34model_id ="bratao/Qwen3OIE-8B"5revision ="5327c23f603944851f94df9cf0b3580dcf70de19"6tokenizer = AutoTokenizer.from_pretrained(model_id, revision=revision)7model = AutoModelForCausalLM.from_pretrained(8 model_id, revision=revision, dtype="auto", device_map="auto"9)1011sentence ="A UFBA está localizada em Salvador."12messages =[13{14"role":"system",15"content":(16"Dada uma frase S você consegue fazer extrações em JSON no formato "17"ARG0 , V, ARG1. Realize a extração para a frase abaixo:"18),19},20{"role":"user","content":f"S: {sentence}"},21]22prompt = tokenizer.apply_chat_template(23 messages,24 tokenize=False,25 add_generation_prompt=True,26 enable_thinking=False,27)28inputs = tokenizer(prompt, return_tensors="pt").to(model.device)29with torch.inference_mode():30 output = model.generate(31**inputs,32 max_new_tokens=512,33 do_sample=False,34 pad_token_id=tokenizer.eos_token_id,35)36generated = output[0, inputs["input_ids"].shape[-1]:]37print(tokenizer.decode(generated, skip_special_tokens=True))
Use the exact system prompt, S: prefix, chat template, and
enable_thinking=False. The fine-tuning configuration used sequence length 2,048;
larger contexts permitted by the base configuration were not evaluated for OpenIE.
Evaluation
The thesis reports results on 100 Portuguese sentences and 238 reference extractions
from WikiPUD-Portuguese-Abstractive. These targets were generated with an LLM from
OIEC-PT Gold source sentences and manually spot-checked, so this is a
silver-standard, not a fully human-authored gold test set.
Criterion
Precision
Recall
F1
Perfect match
0.3412
0.3025
0.3207
Lexical match
0.5972
0.5294
0.5612
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, while F1 is also reproduced in the thesis. Evaluation was not rerun for
this card.
Training-data provenance
The thesis describes 29,026 Portuguese sentences and 102,788 synthetic OpenIE
extractions derived from 2,015 Portuguese Wikipedia paragraphs with Gemini 2.5
Flash. The repository does not declare a public Hugging Face dataset identifier and
does not bundle the corpus, so this YAML intentionally has no datasets entry.
Requirements and hardware
Recent Python, PyTorch, Transformers, and Accelerate.
The bfloat16 repository is about 16.4 GB. Roughly 20 GB or more of free VRAM is a
practical starting point for unquantized GPU inference; CPU/offload is possible
but slower. This is an estimate, not a guaranteed minimum.
No official quantized artifact is supplied here; re-evaluate extraction quality
after third-party quantization.
Limitations and responsible use
Generative output may omit, duplicate, or hallucinate relations and may violate
the requested JSON schema.
Abstractive fields need not be literal spans of the source sentence.
The test set is small and mostly encyclopedic. Performance on dialectal,
conversational, specialized, long, or adversarial Portuguese is unknown.
The publication state does not establish full training completion; pin revisions.
An extraction is not fact verification and must not alone drive high-impact uses.
License
This repository declares Apache-2.0. Users must also follow the upstream Qwen terms
and rights applicable to their input and data. The training corpus is not included.
Citation
bibtex
1@phdthesis{cabral2025evolving,
2 author = {Cabral, Bruno Souza},
3 title = {Evolving Open Information Extraction for Portuguese employing Language Models},
4 school = {Universidade Federal da Bahia},
5 year = {2025}
6}
78@inproceedings{cabral2022portnoie,
9 author = {Cabral, Bruno and Souza, Marlo and Claro, Daniela Barreiro},
10 title = {PortNOIE: A Neural Framework for Open Information Extraction for the Portuguese Language},
11 booktitle = {Computational Processing of the Portuguese Language (PROPOR 2022)},
12 year = {2022},
13 doi = {10.1007/978-3-030-98305-5_23}
14}