Home

Awesome

JointBERT

(Unofficial) Pytorch implementation of JointBERT: BERT for Joint Intent Classification and Slot Filling

Model Architecture

<p float="left" align="center"> <img width="600" src="https://user-images.githubusercontent.com/28896432/68875755-b2f92900-0746-11ea-8819-401d60e4185f.png" /> </p>

Dependencies

Dataset

TrainDevTestIntent LabelsSlot Labels
ATIS4,47850089321120
Snips13,084700700772

Training & Evaluation

$ python3 main.py --task {task_name} \
                  --model_type {model_type} \
                  --model_dir {model_dir_name} \
                  --do_train --do_eval \
                  --use_crf

# For ATIS
$ python3 main.py --task atis \
                  --model_type bert \
                  --model_dir atis_model \
                  --do_train --do_eval
# For Snips
$ python3 main.py --task snips \
                  --model_type bert \
                  --model_dir snips_model \
                  --do_train --do_eval

Prediction

$ python3 predict.py --input_file {INPUT_FILE_PATH} --output_file {OUTPUT_FILE_PATH} --model_dir {SAVED_CKPT_PATH}

Results

Intent acc (%)Slot F1 (%)Sentence acc (%)
SnipsBERT99.1496.9093.00
BERT + CRF98.5797.2493.57
DistilBERT98.0096.1091.00
DistilBERT + CRF98.5796.4691.85
ALBERT98.4397.1693.29
ALBERT + CRF99.0096.5592.57
ATISBERT97.8795.5988.24
BERT + CRF97.9895.9388.58
DistilBERT97.7695.5087.68
DistilBERT + CRF97.6595.8988.24
ALBERT97.6495.7888.13
ALBERT + CRF97.4296.3288.69

Updates

References