How to Use the Global-Locally Self-Attentive Dialogue State Tracker (GLAD)

Mar 26, 2021 | Data Science

The Global-Locally Self-Attentive Dialogue State Tracker (GLAD) is an innovative tool designed to enhance dialogue state tracking (DST) using self-attentive mechanisms. In this blog, we will guide you through the installation and utilization of GLAD. By the end, you’ll be able to run and evaluate your own dialogue tracking models seamlessly.

Table of Contents

Installation of Dependencies

To kick things off, you need to install the required dependencies. There are two methods to do this: using Docker or setting up without Docker.

Using Docker

Follow these steps to set up GLAD using Docker:

docker build -t glad:0.4 .
docker run --name embeddings -d vzhong/embeddings:0.0.5

To get the embeddings, run the following command:

env NV_GPU=0 nvidia-docker run --name glad -d -t --net host --volumes-from embeddings glad:0.4

Without Docker

If you prefer not to build a Docker image, you can install the required packages using:

pip install -r requirements.txt

Downloading and Annotating Data

This project relies on Stanford CoreNLP to annotate the dataset. Here’s how to get started:

  1. Run the CoreNLP server:
  2. docker run --name corenlp -d -p 9000:9000 vzhong/corenlp-server
  3. Preprocess the raw data:
  4. This will download necessary word embeddings and save them into an SQLite database. Run:

    docker exec glad python preprocess_data.py

    The resultant raw and annotated data will be stored in data/woz/raw and data/woz/ann directories, respectively.

Training the Model

Training your model is straightforward. You can check available options using:

python train.py -h

The code will save checkpoints to exp/glad/default. Start the training process with:

docker exec glad python train.py --gpu 0

To see what’s inside the container or to retrieve your experiment results, use:

docker exec glad -it /bin/bash
docker cp glad:/opt/glad/exp exp

Evaluation of the Model

Evaluating your model’s performance can be done as follows:

docker exec glad python evaluate.py --gpu 0 --split test exp/glad/default

To create a predictions file, include the --fout flag. Refer to evaluate.py for instructions on linking predictions to dialogues.

Troubleshooting

If you encounter issues while running GLAD, here are some troubleshooting tips:

  • Ensure Docker is running and configured correctly on your machine.
  • Double-check the Docker commands – a common error occurs with misplaced tags or wrong container names.
  • If you run into memory issues, consider reducing the batch size during training.

For additional guidance, tips, or to collaborate on AI development projects, stay connected with fxis.ai.

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox