PNPT
PNPT: Prototypical Network with Prompt Template for Few-Shot Relation Extraction
Install / Use
/learn @bebujoie/PNPTREADME
PNPT
The code for the paper "PNPT: Prototypical Network with Prompt Template for Few-shot Relation Extraction".
Environments
python 3.8PyTorch 1.12.0transformers 4.24.0
Code
Put all data in the data folder, CP pretrained model in the CP_model folder (you can download CP model from https://github.com/thunlp/RE-Context-or-Names/tree/master/pretrain or Google Drive), and then you can simply use script: run_main.sh for train, evaluation and test.
Set the corresponding parameter values in the script, and then run:
sh run_main.sh
