ALBERT-TF2.0 icon indicating copy to clipboard operation
ALBERT-TF2.0 copied to clipboard

SQuAD predictions fail

Open WingCode opened this issue 4 years ago • 0 comments

@kamalkraj Thank you for giving clear instructions with respect to SQuAD which wasn't available in the main repo

With the following parameters:

run_squad.py --mode=predict \
--albert_config_file=../albert_base_resources/config.json \
--model_dir=../albert_base_resources/ \
--input_meta_data_path=../squad_out_v1.1/squad_v1.1_meta_data \
--predict_file=../squad_dataset/dev_small.json.txt \
--spm_model_file=../albert_base_resources/vocab/30k-clean.model 

dev_small.json.txt

Fails with object referred before assigned

So, shouldn't this line: https://github.com/kamalkraj/ALBERT-TF2.0/blob/8d0cc211361e81a648bf846d8ec84225273db0e4/run_squad.py#L565-L567 modified to:

        if FLAGS.version_2_with_negative:
            predicted = get_raw_results_v2(predictions)
        else:
            predicted = get_raw_results(predictions)
        for result in predicted:

WingCode avatar Dec 13 '19 16:12 WingCode