Practical overview
When it fits
Use FewRel when a project needs a research benchmark for relation extraction under few-shot conditions, or when evaluation needs to include domain transfer or unknown-class detection.
Who it is for
- NLP researchers evaluating few-shot relation-extraction models.
- Teams comparing baseline classifiers on annotated relation data.
- Researchers studying transfer across domains or detection of examples outside known relation classes.
Documented uses
- Train and compare relation-extraction baselines using limited examples per class.
- Evaluate models against a shared benchmark with validation and hidden-test tracks.
- Study domain adaptation and none-of-the-above detection in few-shot classification.
Requirements & limits
The public GitHub repository is identified as open source and carries an MIT license.
- FewRel 1.0 separates training, validation and hidden-test relations across 64, 16 and 20 classes.
- FewRel 2.0 adds separate domain-adaptation and none-of-the-above evaluation challenges.
- The test datasets are not released; hidden-test evaluation is handled through the benchmark websites.
- The repository includes its dataset, but Glove embeddings and a BERT pretraining checkpoint require separate download.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Train and evaluate the included Prototypical Networks baseline
Run the repository's documented 5-way, 5-shot baseline training and evaluation example.
Before you start
- The FewRel GitHub repository and its included dataset.
- Python environment capable of running the repository's training code.
Steps
Obtain the repository and its included dataset files.
Run the command below from the repository.
python train_demo.py
Expected outcome
The documented example starts training and evaluation of Prototypical Networks in a 5-way, 5-shot setting.
Guide limitations
- The README does not specify a complete environment or dependency installation procedure in the provided material.
- Glove embeddings and a BERT pretraining checkpoint are not included; the README identifies
download_pretrain.shas the download script. - Test datasets are not released; use validation data and submit code to the relevant evaluation site for hidden-test assessment.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 17 October 2026
- Original website title
- thunlp/FewRel · Official homepage title · retained in its source language

