https://github.com/xerrors/labelprompt
code for LabelPrompt: Effective Prompt-based Learning for Relation Classification
https://github.com/xerrors/labelprompt
Last synced: 3 months ago
JSON representation
code for LabelPrompt: Effective Prompt-based Learning for Relation Classification
- Host: GitHub
- URL: https://github.com/xerrors/labelprompt
- Owner: xerrors
- Created: 2023-09-03T17:00:07.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-26T15:14:39.000Z (9 months ago)
- Last Synced: 2025-01-07T22:42:54.150Z (5 months ago)
- Language: Python
- Size: 67.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LabelPrompt
code for LabelPrompt: Effective Prompt-based Learning for Relation Classification
## Setup
To set up the environment, follow these steps:
```sh
conda create -n labelprompt python=3.8
conda activate labelpromptpip install -r requirements.txt
```## Dataset
The dataset can be found at [KnowPrompt](https://github.com/zjunlp/KnowPrompt).
### for few-shot
To generate few-shot datasets, run the following command:
```sh
python genetate_k_shot.py --dataset retacred --data_file train.txt
```## Run
To run the model, use the following command:
```sh
python main.py --gpu 0 --dataset retacred --data_path ./dataset/retacred/k-shot/8-1
```