Giter Site home page Giter Site logo

multi-view-prompting's Introduction

Multi-view Prompting (MvP)

PWC
PWC
PWC
PWC

Quick StartTrained ModelPaperCitation

Repo for ACL 2023 paper MvP: Multi-view Prompting Improves Aspect Sentiment Tuple Prediction.

✨ Introduction

MvP is an element order-based prompt learning method:

  • MvP unifies various tuple prediction tasks through the combination of elements:

  • MvP aggregates multi-view results by considering permutations of elements:

🎯 Results

MvP achieves state-of-the-art performance across 10 datasets encompassing 4 ABSA tasks with a single model:

MvP with T5-base outperforms large language models ChatGPT (gpt-3.5-turbo) by a large margin, even in few-shot transfer settings:

🚀 Quick Start

⚙️ Setup

conda create -n mvp python=3.8
conda activate mvp
pip install torch==1.12.1+cu116 torchvision==0.13.1+cu116 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu116
pip install -r requirements.txt

🤖 Trained Model

We release the multi-task MvP model (one seed): mvp-unified-base [Google Drive]

You may download the model with gdown (pip install gdown):

pip install gdown
mkdir -p outputs && cd outputs
gdown 1FMTuS4DRquLjZ3xWHLDh25W31d4dgQph
tar -xvf unified_model.tar.gz
mv src/outputs/unified unified
cd ..

then run evaluation:

bash scripts/eval_unified.sh

then you will get following results in outputs/unified/top5_seed10/result.txt:

aste:  laptop14:  precision: 67.64 recall: 64.14 F1 = 65.84
aste:  rest14:  precision: 74.49 recall: 77.73 F1 = 76.08
aste:  rest15:  precision: 68.73 recall: 71.13 F1 = 69.91
aste:  rest16:  precision: 72.15 recall: 72.57 F1 = 72.36
tasd:  rest15:  precision: 69.88 recall: 62.60 F1 = 66.04
tasd:  rest16:  precision: 70.15 recall: 67.57 F1 = 68.84
acos:  laptop16:  precision: 44.75 recall: 44.64 F1 = 44.69
acos:  rest16:  precision: 60.86 recall: 59.84 F1 = 60.35
asqp:  rest15:  precision: 54.77 recall: 54.84 F1 = 54.81
asqp:  rest16:  precision: 58.29 recall: 60.70 F1 = 59.47
Average F1:  63.83899277391693

⚡️ Training

  • Train unified models:
bash scripts/process_unify.sh  # process data
bash scripts/run_unified.sh
  • Train separate models:
bash scripts/run_main.sh
  • Train with low-resource or cross-task transfer settings:
bash scripts/run_low_resource.sh
  • Evaluate ChatGPT (gpt-3.5-turbo) baselines:
bash scripts/run_llms.sh
python llms/eval.py

☕️ Citation

If you find this repository helpful, please consider citing our paper:

@inproceedings{gou-etal-2023-mvp,
    title = "{M}v{P}: Multi-view Prompting Improves Aspect Sentiment Tuple Prediction",
    author = "Gou, Zhibin  and
      Guo, Qingyan  and
      Yang, Yujiu",
    booktitle = "Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)",
    month = jul,
    year = "2023",
    address = "Toronto, Canada",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2023.acl-long.240",
    pages = "4380--4397",
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.