Skip to content

Causal language modeling and intent classification using GPT-2.

License

Notifications You must be signed in to change notification settings

samyak24jain/gpt2-intent-classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GPT2: Causal LM and Intent Classification

This repository has the code for the following tasks:

  1. Pre-training GPT-2 for the causal language modeling task.
  2. Fine-tuning GPT-2 for the intent classification task.
  • Pre-training dataset: WikiText-2
  • Fine-tuning dataset: Movie utterances - core relations dataset.

Requirements

# Ideally, do this in a new virtual environment.
pip install -r requirements.txt

Training and evaluation

# Run main.py to train your best model on the file specified by --data
python main.py --train --data "./train.csv" --save_model "./joint_trained_model.pt"

# Run main.py to test the newly trained model on the test data
python main.py --test --data "./test.csv" --model_path "./joint_trained_model.pt" --output "./preds.csv"

About

Causal language modeling and intent classification using GPT-2.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages