See requirements.txt
python checkpoints/download_models.py
See readme.md in the data folder
Using train_single_attribute_prompt_sentiment.sh/train_single_attribute_prompt_topic.sh
Using train_food_classifier.sh/train_sentiment_classifier.sh
Using test_food_classifier.sh/test_sentiment_classifier.sh
Using test_single_attribute_prompt_sentiment.sh/test_single_attribute_prompt_topic.sh
As we mentioned in the paper, each single attribute data sample needs to be labeled again, such as the food single attribute text will get the annotation about the sentiment attribute. Here, we use the attribute classifier trained in the previous step to score the single attribute training data:
To facilitate the concatenation of single-attribute prompts, we first extract the single-attribute prompt from the checkpoint file obtained in Step 3. To do this, you need to: