Skip to content

This hub save the code for paper "All in One: An Empirical Study of GPT for Few-Shot Aspect-Based Sentiment Anlaysis"

Notifications You must be signed in to change notification settings

BaoSir529/gpt4absa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gpt4absa

Code for our paper: All in One: An Empirical Study of GPT for Few-Shot Aspect-Based Sentiment Anlaysis

Requirements

  • Python 3.9
  • PyTorch 1.12
  • transformers
  • openai
  • tqdm

Stage 1 (Generate Candidates for ASTE and AOPE subtasks)

  • Train a suitable model to generate candidates for the corresponding dataset as required by dual-encoder4aste;
  • Please note that this step can be skipped, we have already generated suitable candidates in datasets.

Stage 2 (GPT inference)

bash ./run_with_ChatGPT.sh
  • Note: When using the GPT model, please add the correct openai.api_key and openai.api_base in ./model/model.py;
  • Note:When using the ERNIE model, please add the correct API_KEY and SECRET_KEY in ./model/model.py.

About

This hub save the code for paper "All in One: An Empirical Study of GPT for Few-Shot Aspect-Based Sentiment Anlaysis"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published