Skip to content

CharleneChar/RUCS533Project

Repository files navigation

CS533 NLP Final Project: Reimplementation - Inducing Positive Perspectives with Text Reframing

We have reimplemented the paper Inducing Positive Perspectives with Text Reframing which introduces the task of positive reframing, in which we aim to transform a negative sentence such that we introduce a positive perspective without transforming the underlying meaning. The paper also introduced a large-scale benchmark Positive Psychology Frames, which contains 8,349 sentence pairs as a parallel corpus, which will be the basis to test the performance of the current state-of-the-art text style transfer models

Steps to Run

1. Install the requirements for the project

pip install -r requirements.txt

To install pytorch, one might need to run the following command seperately

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117

If the above requirements aren't enough to work on your system, please also run the following command

pip install -r requirements_old.txt

2. Run the models

Flags               Definition Values Accepted Default Values
--train Path to the training set Any valid path (For GPT): data/wholetrain_gpt.txt
(Everything Else): data/wholetrain.csv
--dev Path to the development set Any Valid Path data/wholedev.csv
--test Path to the test set Any Valid Path data/wholetest.csv
--output_dir Path to the output directory Any Valid Path output/
-s,
--setting
Define the setting for training (Only used in BART and T5) 'unconstrained', 'controlled', 'predict' unconstrained
python3 <model_name>.py --arguments

The following are the list of files to run for a given model

1. Random Retrieval - random.py
2. SBERT Retrieval - sbert.py
3. GPT - gpt.py
4. BART - bart.py
5. T5 - t5.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages