Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?


Failed to load latest commit information.
Latest commit message
Commit time


PyTorch implementation of the paper Dialogue Act Classification with Context-Aware Self-Attention for dialogue act classification with a generic dataset class and PyTorch-Lightning trainer. This implementation has following differences compare to the actual paper

  • In this implementation contextualized embedding (ie: BERT, RoBERta, etc ) (freezed hence not trainable) is used while paper uses combination of GloVe and ELMo.
  • This implementation has simple softmax classifier but paper has CRF classifier.

Kaggle Kernel to train it on switchboard dialogue act corpus

To train this on switchboard dialogue act dataset:

  1. Navigate to data/ using: cd data/
  2. Unzip the dataset: unzip
  3. Navigate to the main dir: cd ..
  4. Install the dependencies in a separate python environment.
  5. [Optional] Change the project_name and run_name in the logger or disable the wandb logger if you don't want to use it by commenting the logger code (line 15-20 in and don't pass it to Lightning trainer (line 32 in, and then comment the logging code in (line 70 and 95). By default Lightning will log to tensorboard logger.
  6. [Optional] Change the parameters (batch_size, lr, epochs etc) in
  7. Run using python
  8. Model will be trained and best checkpoint will be saved.

To train this on any dialogue act dataset

  1. Paste your data into data/, your dataset should have following structure
    • dataset_name
      • dataset_name_train.csv
      • dataset_name_valid.csv
      • dataset_name_test.csv
  2. [Optional] If you don't have separate test and validation data, copy the test/valid and rename it as valid/test, this both validation and test data will be same.
  3. Update the num_classes param in line 18 according to your dataset.
  4. Follow from steps 5 of the switchboard.

Note: Feel free to create to an issue if you find any problem. Also you're welcome to create PR if you want to add something. Here is the list of components one can add:

  • Hyperparameter Search
  • More dialogue act classification models which are not open-sourced.


[1]: Raheja, V., & Tetreault, J. (2019). Dialogue Act Classification with Context-Aware Self-Attention. ArXiv, abs/1904.02594.

[2]: Lin, Z., Feng, M., Santos, C.D., Yu, M., Xiang, B., Zhou, B., & Bengio, Y. (2017). A Structured Self-attentive Sentence Embedding. ArXiv, abs/1703.03130.

[3]: Switchboard Dialogue Act corpus:


PyTorch implementation of the paper "Dialogue Act Classification with Context-Aware Self-Attention" for dialogue act classification with a generic dataset class and PyTorch-Lightning trainer







No releases published


No packages published