Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 42 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
# Prompt-classification
# Boosting Meta-Learning for Few-Shot Text Classification via Label-guided Distance Scaling

The code will be released soon.
## Create python env

```
conda create -n LDS python=3.7
source activate LDS
pip install requirements.txt -r
```

## Model
![](./vis/overall.png)


## Data
```
cd data
unzip data.zip
```

## Quick start

```
cd scripts
sh ours_all.sh
```
The specific parameters in the paper are consistent with ours_all.sh.

**Noting:** before you start, you should download bert-base-uncased from https://huggingface.co/google-bert/bert-base-uncased, and change the path in the ours_all.sh file to your own file path.

## Citation

```
@article{LIU2025111497,
title = {Guiding Prototype Networks with label semantics for few-shot text classification},
journal = {Pattern Recognition},
volume = {164},
pages = {111497},
year = {2025},
issn = {0031-3203},
doi = {https://doi.org/10.1016/j.patcog.2025.111497},
}
```
Binary file added data/data.zip
Binary file not shown.
7 changes: 7 additions & 0 deletions prompt_template.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dataset, template,
HuffPost,This is a [MASK] news: [sentence],
Reuters,This is a [MASK] news: [sentence],
20newsgroup,This is a [MASK] news: [sentence],
Amazon,This is a [MASK] review: [sentence],
Clinc150,This is a [MASK] intent: [sentence],
Banking77,This is a [MASK] intent: [sentence],
8 changes: 8 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
matplotlib==3.7.1
numpy==1.24.3
pandas==2.0.1
scikit_learn==1.2.2
termcolor==2.3.0
torch==1.11.0+cu113
tqdm==4.65.0
transformers==4.28.1
Loading