Code Monkey home page Code Monkey logo

intent-classification's Introduction

Fine-tuning Pre-trained Language Models for Dialog Act Classification and Sentiment Analysis

This repository contains the code of the paper: Fine-tuning Pre-trained Language Models for Dialog Act Classification and Sentiment Analysis.

Overview

This paper presents an approach for fine-tuning pre-trained language models to perform dialog act classification or sentiment/emotion analysis. We start with a pre-trained language model and fine-tune it on task-specific datasets from SILICONE using transfer learning techniques. Our approach improve the model's ability to capture task-specific nuances while retaining its pre-existing language understanding capabilities. We experiment with different pre-trained models and compare their performances. We also perform undersampling on training data to evaluate the performance gain associated with data balancing. Overall, our findings suggest that fine-tuning pre-trained language models is an effective approach for improving the performance of dialog act classification and sentiment analysis models.

Reproduce

Data

The data used are datasets from SILICONE.

Environment

We use venv to manage the environment.

Script

train_classifier.py

Key Arguments

In the config file config.py , there are several key arguments you may change depending your choice of training:

  1. CUDA_DEVICE: number of GPU core(s) to be used for the training
  2. HOME: repository path
  3. DATASET_NAME: the name of the dataset on which the model is trained/evaluated
  4. CLASS_NUMBER: number of classes corresponding to the dataset
  5. BALANCE: True if undersampling False otherwise
  6. ENCODER_PATH/TOKENIZER_PATH: the HuggingFace name of the pre-trained model to use
  7. VERSION: number corresponding to the version of the training
  8. BATCH_SIZE, LEARNING_RATE, NUM_EPOCHS: training hyperparameters

How

  1. Set-up the environment
python -m venv training
source training/bin/activate
pip install -r requirements.txt
  1. Train a model
cd src/scripts/
python train_classifier.py after uncommenting train() and commenting verify() and test()
  1. Evaluate a model
cd src/scripts/
python train_classifier.py after uncommenting train() et commenting verify() et test()

Results

results

intent-classification's People

Contributors

taminemelissa avatar

Stargazers

Nikolaus Schlemm avatar

Watchers

 avatar

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.