PortNOIE

The historical PortNOIE neural Open Information Extraction checkpoint for Portuguese, accompanied by its vocabulary, provenance, checksums, and a modern Python interface. Given a sentence, it extracts (ARG0, V, ARG1) triples.

This is the 2022 LSTM + Flair sequence-labeling checkpoint, not the best BERT model reported later in the doctoral thesis. The modern PyTorch migration is experimental: real inference works, but numerical equivalence to the original AllenNLP pipeline has not been established.

Quick start: select an enum, no model paths

Python 3.10–3.13:

pip install "portuguese-openie[portnoie]"
from portuguese_openie import Model, PortugueseOpenIE

extractor = PortugueseOpenIE(Model.PORTNOIE)
triples = extractor.extract("Maria escreveu um livro.")
print([triple.to_dict() for triple in triples])

The first extraction downloads the checkpoint from this public repository and installs the pinned Portuguese spaCy annotation model if it is absent. Later calls reuse those local files. A Hugging Face account or access token is not required. Allow internet access, sufficient disk space, and a few minutes for the first run; model/runtime downloads depend on your connection.

Recorded modern-backend smoke-test output:

[{"ARG0": "Maria", "V": "escreveu", "ARG1": "um livro"}]

The checkpoint is approximately 75 MB; the external pt_core_news_lg 3.8.0 wheel is approximately 568 MB, in addition to PyTorch/spaCy and their dependencies. Tests used Python 3.12, CPU PyTorch, and spaCy 3.8.14/3.8.16. This simple sentence checks installation and inference, not accuracy on an evaluation corpus.

Standalone PortNOIE package

pip install "portnoie[modern]"
portnoie extract "Maria escreveu um livro."
from portnoie import PortNOIE, download_model

download_model()  # optional checkpoint prefetch; otherwise first use downloads it
model = PortNOIE()
print(model.extract("Maria escreveu um livro.").as_dict())

For offline use, complete one online extraction first so both the checkpoint and spaCy model are available, then select local_files_only=True:

from portuguese_openie import Model, PortugueseOpenIE

extractor = PortugueseOpenIE(Model.PORTNOIE, local_files_only=True)
print(extractor.extract("Maria escreveu um livro."))

An optional cache_dir changes the Hugging Face cache; users do not need to locate or pass the checkpoint themselves. portnoie doctor inspects local files without downloading anything. portnoie download explicitly prefetches and verifies the checkpoint, but does not install spaCy's annotation model.

Prompt and output

No prompt is used. PortNOIE is a supervised sequence labeler, not an instruction-following language model. Supply plain Portuguese text; do not wrap it in the Qwen/T5 prompts used by the other project models.

The unified interface returns Triple objects with subject, relation, and object attributes. to_dict() serializes them as ARG0, V, and ARG1. This repository is not a Transformers AutoModel checkpoint: use the packages above instead of AutoModel.from_pretrained() or the hosted inference widget.

Files and reproducibility

Field Value
Repository bratao/PortNOIE
Audited revision 124b1c741629e90857bc932ad18ffd16794bedba (2026-08-30)
Checkpoint model_final/model.th — 74,832,847 bytes
Checkpoint SHA-256 7df24bd3a45143bcf3d66496aa1b378a9fee8108d6db13f9c956f6192e5bcbe5
Historical parameters model_final/model_params.pkl — legacy backend only
Parameters SHA-256 a313b0a51449f2d34f7cacaaf09747385619a97ba9ea28af585f90080a84de5c
Vocabulary and manifest model_final/vocabulary/, model_final/model_manifest.json
Flair character metadata modern_data/flair_metadata.json
Metadata SHA-256 (LF) 6f614f927f94e8a2c00b94b8edcef7b02bd1b7a94fe6e8a12d475a043641bb35

The library pins a Hub revision and independently verifies the official file hashes compiled into its release. A remote manifest does not replace those trust anchors. The modern backend uses torch.load(..., weights_only=True) and does not unpickle model_params.pkl, import repository code, or require AllenNLP/Flair. Fourteen Flair Diário tensors are already embedded in the historical checkpoint; the sidecar preserves the character mapping and upstream provenance.

Limitations and security

  • The modern migration has not been established as equivalent to the original AllenNLP model, and no full-corpus accuracy result is claimed for the migration.
  • The historical checkpoint is not the thesis's best BERT checkpoint.
  • Extraction may be incomplete or incorrect. It is not fact verification.
  • Keep the package's current supported PyTorch stack. The optional legacy backend has end-of-life dependencies with known vulnerabilities; use it only for isolated, offline research reproduction, never production or untrusted inputs.
  • Do not load arbitrary pickle/checkpoint files or disable checksum validation without understanding the security implications.

License and attribution

GPL-3.0-only for this release, as confirmed by maintainer/co-author Bruno Souza Cabral on 2026-08-30, including the historical checkpoint and embedded matrices. See LICENSE and NOTICE. Third-party software, pretrained assets, and datasets retain their own terms. The external spaCy pt_core_news_lg model is CC BY-SA 4.0 and is downloaded separately from the official Explosion/spaCy distribution.

Citation

@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}
}

@phdthesis{cabral2025evolving,
  author = {Cabral, Bruno Souza},
  title = {Evolving Open Information Extraction for Portuguese employing Language Models},
  school = {Universidade Federal da Bahia},
  year = {2025}
}

Code and documentation: PortNOIE · Portuguese OpenIE · PortNOIE paper

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support