OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Data & Analytics

Fewrel

FewRel is a Python-based research dataset and benchmark for few-shot relation extraction, with annotated examples across more than one hundred relations and multiple domains. Its public repository also provides toolkits and baseline models for training and evaluating relation classifiers.

Independent OpenViST project profile, based on linked sources.

Fewrel — OpenViST project profile in AI Data & Analytics.
OpenViST project illustration. See the linked sources for product details.
Understand the project

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.
Before you choose

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.

Source-based practical guide

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

  1. Obtain the repository and its included dataset files.

  2. Run the command below from the repository.

    Documented command
    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.sh as the download script.
  • Test datasets are not released; use validation data and submit code to the relevant evaluation site for hidden-test assessment.
Evidence and transparency

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