Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reproducibility for slot filling task #8

Open
libing125 opened this issue Oct 22, 2020 · 7 comments
Open

reproducibility for slot filling task #8

libing125 opened this issue Oct 22, 2020 · 7 comments

Comments

@libing125
Copy link

libing125 commented Oct 22, 2020

in

slots = set([slot['slot'] for row in train_data for slot in row.get('labels', [])])
vocab = ["O"] + [prefix + slot for slot in slots for prefix in ["B-", "I-"]]
json.dump(vocab, open(dataset + "vocab.txt", "w+"))

Slot BIO labels are stored in a python set, then saved into a python list using a for loop.
But set is unordered. In my experiment, vocab.txt is different in two runs. So I changed the code to

slots = set([slot['slot'] for row in train_data for slot in row.get('labels', [])])
slots = sorted(list(slots))
vocab = ["O"] + [prefix + slot for slot in slots for prefix in ["B-", "I-"]]
json.dump(vocab, open(dataset + "vocab.txt", "w+"))

and get the same vocab.txt for every run.

@libing125
Copy link
Author

After changing the code, I ran slot filling on dstc8 fulll data, got 86.93 accuracy, lower than 90.05(the 'BERT' setting) reported in your article. I also tried run few-shot setting on dstc8, and got 42.28, lower than 45.05 as reported. I wonder why one line of code brings such big difference. Also in my previous experiments, if I use a different 'vocab.txt', the performance dropped about 3 percent.
Thanks!

@libing125
Copy link
Author

my script:

export BERT_MODEL_DIR=pretrained_models/bert-base-uncased
export BERT_VOCAB_PATH=$BERT_MODEL_DIR/vocab.txt

CUDA_VISIBLE_DEVICES=3 python3 run.py \
        --train_data_path data_utils/dialoglue/dstc8_sgd/train.json \
        --val_data_path data_utils/dialoglue/dstc8_sgd/val.json \
        --test_data_path data_utils/dialoglue/dstc8_sgd/test.json \
        --token_vocab_path $BERT_MODEL_DIR/vocab.txt \
        --train_batch_size 64 --dropout 0.1 --num_epochs 100 --learning_rate 6e-5 \
        --model_name_or_path $BERT_MODEL_DIR --task slot --do_lowercase --max_seq_length 50 --dump_outputs \

@libing125
Copy link
Author

My scikit-learn and numpy version are not identical to yours. I updated them and got 44.61(45.05 reported) few-shot accuracy, But only got 85.8 on full dstc8 data. I‘m confused.

@mihail-amazon
Copy link
Contributor

hey we'll look into this discrepancy in the next few days. thanks for your note.

@zqwerty
Copy link

zqwerty commented Nov 10, 2020

hey we'll look into this discrepancy in the next few days. thanks for your note.

Any idea?

@nlpist
Copy link

nlpist commented Jan 15, 2021

Hey @zqwerty
I wonder if you are able to reproduce the score of the original model (without your changes)?

The problem is with the original code, default running scripts, and packages from the requirements.txt my score is much lower than the score reported in the paper.

@Shikib
Copy link

Shikib commented May 2, 2021

Hello,

Apologies for the long delay in dealing with this issue. It seems that you are trying to reproduce our result with BERT on the DSTC8 dataset. I pulled the training logs from our saved models, and below are the exact values of hyperparameters that are used:

 "model_name_or_path": "bert-base-uncased", "task": "slot", "mlm_pre": false, "mlm_during": false, "example": false, "use_observers": false, "repeat": 1, "grad_accum": 1, "train_batch_size": 64, "max_seq_length": 50, "num_epochs": 100, "patience": 20, "logging_steps": 100, "do_lowercase": true, "dropout": 0.1, "learning_rate": 6e-05, "adam_epsilon": 1e-08, "weight_decay": 0.0, "device": 0, "max_grad_norm": -1.0, "seed": 33

Perhaps the different random seed is impacting the results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants