OpenNRE is an open-source neural relation extraction toolkit from Tsinghua University’s THUNLP lab, built to extract structured knowledge from plain text. It has earned more than 4,400 stars on GitHub and is part of the lab’s OpenSKL project family.
Relation extraction identifies relationships between entities in text, for example extracting the triple that Bill Gates founded Microsoft, and it is a core technique for automatically building and expanding knowledge graphs. OpenNRE provides a unified, extensible framework that standardises the input and output interfaces of different relation extraction models, with scalable options at each stage. It covers both supervised and distant supervision settings and works with conventional neural networks as well as pre-trained language models, including attention-based models highlighted in the original research. The toolkit was last updated in 2024 and stands as a complete, stable research release with documentation for training and evaluating models on standard datasets.
OpenNRE’s documentation walks through data preparation, model configuration and evaluation on widely used benchmarks, and its modular encoder and classification components make it straightforward to prototype new architectures or plug in different pre-trained backbones. As part of THUNLP’s broader open-source NLP ecosystem, it complements the laboratory’s other toolkits for knowledge representation and language understanding, and it remains a frequent baseline in academic relation extraction research.
OpenNRE is free and open source under the MIT license. The toolkit, documentation and examples are available on GitHub at no cost.
OpenNRE is for NLP researchers and engineers working on information extraction and knowledge graphs. It suits teams that need to pull structured relations from large text collections, and students learning relation extraction who want a well-organised implementation of influential models to study and extend.