Git Product home page Git Product logo

jointidsf's Introduction

JointIDSF: Joint intent detection and slot filling

  • We propose a joint model (namely, JointIDSF) for intent detection and slot filling, that extends the recent state-of-the-art JointBERT+CRF model with an intent-slot attention layer to explicitly incorporate intent context information into slot filling via "soft" intent label embedding.
  • We also introduce the first public intent detection and slot filling dataset for Vietnamese.
  • Experimental results on our Vietnamese dataset show that our proposed model significantly outperforms JointBERT+CRF.

model

Details of our JointIDSF model architecture, dataset construction and experimental results can be found in our following paper:

@inproceedings{JointIDSF,
    title     = {{Intent Detection and Slot Filling for Vietnamese}},
    author    = {Mai Hoang Dao and Thinh Hung Truong and Dat Quoc Nguyen},
    booktitle = {Proceedings of the 22nd Annual Conference of the International Speech Communication Association (INTERSPEECH)},
    year      = {2021}
}

Please CITE our paper whenever our dataset or model implementation is used to help produce published results or incorporated into other software.

Dataset

statistic

By downloading our dataset, USER agrees:

  • to use the dataset for research or educational purposes only.
  • to not distribute the dataset or part of the dataset in any original or modified form.
  • and to cite our paper above whenever the dataset is employed to help produce published results.

Model installation, training and evaluation

Installation

  • Python version >= 3.6
  • PyTorch version >= 1.4.0
    git clone https://github.com/VinAIResearch/JointIDSF.git
    cd JointIDSF/
    pip3 install -r requirements.txt

Training and Evaluation

Run the following two bash files to reproduce results presented in our paper:

    ./run_jointIDSF_PhoBERTencoder.sh
    ./run_jointIDSF_XLM-Rencoder.sh
  • Here, in these bash files, we include running scripts to train both our JointIDSF and the baseline JointBERT+CRF.
  • Although we conduct experiments using our Vietnamese dataset, the running scripts in run_jointIDSF_XLM-Rencoder.sh can adapt for other languages that have gold annotated corpora available for intent detection and slot filling. Please prepare your data with the same format as in the data directory.

Inference

We also provide model checkpoints of JointBERT+CRF and JointIDSF. Please download these checkpoints if you want to make inference on a new text file without training the models from scratch.

  • JointIDSF

http://public.vinai.io/JointIDSF_PhoBERTencoder.tar.gz

http://public.vinai.io/JointIDSF_XLM-Rencoder.tar.gz

  • JointBERT+CRF

http://public.vinai.io/JointBERT-CRF_PhoBERTencoder.tar.gz

http://public.vinai.io/JointBERT-CRF_XLM-Rencoder.tar.gz

Example of tagging a new text file using JointIDSF model:

python3 predict.py  --input_file <path_to_input_file> \
                    --output_file <output_file_name> \
                    --model_dir JointIDSF_XLM-Rencoder

where the input file is a raw text file (one utterance per line).

Acknowledgement

Our code is based on the unofficial implementation of the JointBERT+CRF paper from https://github.com/monologg/JointBERT

jointidsf's People

Contributors

datquocnguyen avatar joey234 avatar maihoangdao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jointidsf's Issues

"JointBERT-CRF_PhoBERTencoder" could not be found on hugginface

Hi, I got the following error while running the run_jointIDSF_PhoBERTencoder.sh:

404 Client Error: Not Found for url: https://huggingface.co/JointBERT-CRF_PhoBERTencoder/3e-5/0.6/100/resolve/main/config.json
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/transformers/configuration_utils.py", line 406, in get_config_dict
    use_auth_token=use_auth_token,
  File "/usr/local/lib/python3.7/dist-packages/transformers/file_utils.py", line 1085, in cached_path
    local_files_only=local_files_only,
  File "/usr/local/lib/python3.7/dist-packages/transformers/file_utils.py", line 1215, in get_from_cache
    r.raise_for_status()
  File "/usr/local/lib/python3.7/dist-packages/requests/models.py", line 941, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://huggingface.co/JointBERT-CRF_PhoBERTencoder/3e-5/0.6/100/resolve/main/config.json

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 139, in <module>
    main(args)
  File "main.py", line 17, in main
    trainer = Trainer(args, train_dataset, dev_dataset, test_dataset)
  File "/content/JointIDSF/trainer.py", line 37, in __init__
    slot_label_lst=self.slot_label_lst,
  File "/usr/local/lib/python3.7/dist-packages/transformers/modeling_utils.py", line 959, in from_pretrained
    **kwargs,
  File "/usr/local/lib/python3.7/dist-packages/transformers/configuration_utils.py", line 360, in from_pretrained
    config_dict, kwargs = cls.get_config_dict(pretrained_model_name_or_path, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/transformers/configuration_utils.py", line 418, in get_config_dict
    raise EnvironmentError(msg)
OSError: Can't load config for 'JointBERT-CRF_PhoBERTencoder/3e-5/0.6/100'. Make sure that:

- 'JointBERT-CRF_PhoBERTencoder/3e-5/0.6/100' is a correct model identifier listed on 'https://huggingface.co/models'

- or 'JointBERT-CRF_PhoBERTencoder/3e-5/0.6/100' is the correct path to a directory containing a config.json file

Chia sẻ 5 seed chạy trong paper

Mình đang muốn so sánh kết quả chạy của paper với các paper khác, bên bạn có thể share 5 seed các bạn chạy để ra kết quả như trong paper được không ? (các tham số setup chạy đều giữ nguyên trong cả 5 seed đúng không bạn), mình cảm ơn các bạn nhiều

code

Traceback (most recent call last):
File "main.py", line 139, in
main(args)
File "main.py", line 11, in main
tokenizer = load_tokenizer(args)
File "/usr/local/xww/articles/codes/JointIDSF-main/utils.py", line 43, in load_tokenizer
return MODEL_CLASSES[args.model_type][2].from_pretrained(args.model_name_or_path)
File "/home/slave4/anaconda3/envs/wpy38/lib/python3.8/site-packages/transformers/models/auto/tokenization_auto.py", line 345, in from_pretrained
config = AutoConfig.from_pretrained(pretrained_model_name_or_path, **kwargs)
File "/home/slave4/anaconda3/envs/wpy38/lib/python3.8/site-packages/transformers/models/auto/configuration_auto.py", line 349, in from_pretrained
config_dict, _ = PretrainedConfig.get_config_dict(pretrained_model_name_or_path, **kwargs)
File "/home/slave4/anaconda3/envs/wpy38/lib/python3.8/site-packages/transformers/configuration_utils.py", line 399, in get_config_dict
resolved_config_file = cached_path(
File "/home/slave4/anaconda3/envs/wpy38/lib/python3.8/site-packages/transformers/file_utils.py", line 1077, in cached_path
output_path = get_from_cache(
File "/home/slave4/anaconda3/envs/wpy38/lib/python3.8/site-packages/transformers/file_utils.py", line 1263, in get_from_cache
raise ValueError(
ValueError: Connection error, and we cannot find the requested files in the cached path. Please try again or make sure your Internet connection is on 。 I want to know how to solve this problem?thank you!

Confidence score of prediction

Thank you for your great contribution!

I using this command to infer the model:

python predict.py --input_file input.txt \
                    --output_file predictions.txt \
                    --model_dir my_model-CRF/3e-5/0.6/100

How can i get the confidence score of each slot in the result file?

reproduce results

Dear,
I run the shell script JointIDSF for both use_intent_context_concat/attention but both yielded bad results ?
Am I missing something, thanks.
image

Run inference with model checkpoints

I downloaded your model checkpoints, and ran predict.py with these checkpoints, but I got some errors:

  1. It seems that in the file training_args.bin data_path you set "data" instead "PhoATIS"
  2. OSERROR: as far as i know this error occurs when i didn't train JointBERT first, but i'm using checkpoints of JointBERT to make inference
    image
    image
    image

Did i miss any step before run predict.py ?

Intent label size PhoATIS

Hi,
I want to ask about intent label size in PhoATIS dataset, in paper you have shown that PhoATIS consists of 28 intent labels. Is this the size of the intent label in the training set or on whole dataset (including dev set and test set) ?

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.