Practical overview
When it fits
Use it as a research or prototyping baseline when you want to examine joint subject, object and predicate extraction in PyTorch.
Who it is for
- NLP researchers and developers studying joint relation extraction.
- Practitioners building prototypes that convert text into structured relations or knowledge-graph triples.
Documented uses
- Identify a subject entity in text and predict its related objects and predicates.
- Use a PyTorch baseline for comparison or experimentation with joint extraction methods.
- Explore a text-to-relation pipeline using the included conversion and model scripts.
Requirements & limits
The implementation is publicly accessible on GitHub. The documented environment is Python 3.5+, PyTorch 1.0.1 and tqdm; the code requires GPU execution as written.
- The model predicts subjects first, then predicts associated objects and predicates together.
- The README documents GPU execution as the default; CPU use requires code changes.
- Only 30 example data records are included, and the README directs users to the competition organizers for more data.
- The reported F1 scores are repository claims, not independently verified results.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Convert data and run the PyTorch relation-extraction baseline
Convert the available data and run the model to observe its results.
Before you start
- Python 3.5 or later
- PyTorch 1.0.1
- tqdm
- A GPU; the code requires GPU execution.
- Input data; the repository provides only 30 example records.
Steps
Run the command below to convert the data.
python trans.pyRun the command below to run the model and observe results.
python main.py
Expected outcome
The model runs and produces results to observe. The README reports 0.73 after five epochs and a maximum of 0.75.
Guide limitations
- The repository contains only 30 example records; the competition data was provided by the organizers.
- CPU use requires removing all
.cuda()calls and changing CUDA data types to ordinary data types. - Reported scores are README claims, not independently verified.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 20 November 2026
- Original website title
- zhengyima/kg-baseline-pytorch · Official homepage title · retained in its source language
Related options
kg-2019-baseline — The README links to this Keras and TensorFlow implementation of the model that the PyTorch repository adapts.

