<jupyter_start><jupyter_text>InferenceThis notebook contains all the commands for model inference used in Fig. 2 of the following paper:```<NAME> and <NAME> (2020), DeezyMatch: A Flexible Deep Learning Approach to Fuzzy String Matching, EMNLP: System Demonstrations.```Refer to the `Fig2_EMNLP_train` notebook where we train and fine-tune the models.---In this notebook:* skyline1: trained on *OCR* dataset* skyline2: trained on *WG:en+OCR* dataset* baseline: trained on *WG:en* dataset---* model A: both embedding and recurrent units are frozen (i.e., their parameters are not updated during fine-tuning).* model B: only the embedding layer is frozen. ---To show the impact of fine-tuning and choice of architecture on the model performance, we trained various models starting with the baseline model and included more training instances from the training set of *OCR*.The performance of these models is then assessed on the *OCR* test set. Refer to the paper for more information.  skyline1<jupyter_code>from DeezyMatch import inference as dm_inference

# model inference using a model stored at pretrained_model_path and pretrained_vocab_path 
dm_inference(input_file_path="./inputs/input_dfm.yaml",
             dataset_path="./dataset/ocr_test.txt", 
             pretrained_model_path="./models/ocr_001/ocr_001.model", 
             pretrained_vocab_path="./models/ocr_001/ocr_001.vocab")

from DeezyMatch import inference as dm_inference

# model inference using a model stored at pretrained_model_path and pretrained_vocab_path 
dm_inference(input_file_path="./inputs/input_dfm.yaml",
             dataset_path="./dataset/wikigaz_en_test.txt", 
             pretrained_model_path="./models/ocr_001/ocr_001.model", 
             pretrained_vocab_path="./models/ocr_001/ocr_001.vocab")<jupyter_output>[92m2020-09-10 18:19:01[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [2;32mread input file: ./inputs/input_dfm.yaml[0m
[92m2020-09-10 18:19:01[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [1;32mpytorch will use: cuda:1[0m
[92m2020-09-10 18:19:01[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [2;32mread CSV file: ./dataset/wikigaz_en_test.txt[0m
[92m2020-09-10 18:19:02[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [1;32mnumber of labels, True: 33469 and False: 33469[0m<jupyter_text>skyline1b<jupyter_code>from DeezyMatch import inference as dm_inference

# model inference using a model stored at pretrained_model_path and pretrained_vocab_path 
dm_inference(input_file_path="./inputs/input_dfm_b.yaml",
             dataset_path="./dataset/ocr_test.txt", 
             pretrained_model_path="./models/ocr_001b/ocr_001b.model", 
             pretrained_vocab_path="./models/ocr_001b/ocr_001b.vocab")

from DeezyMatch import inference as dm_inference

# model inference using a model stored at pretrained_model_path and pretrained_vocab_path 
dm_inference(input_file_path="./inputs/input_dfm_b.yaml",
             dataset_path="./dataset/wikigaz_en_test.txt", 
             pretrained_model_path="./models/ocr_001b/ocr_001b.model", 
             pretrained_vocab_path="./models/ocr_001b/ocr_001b.vocab")<jupyter_output>[92m2020-09-10 22:17:07[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [2;32mread input file: ./inputs/input_dfm_b.yaml[0m
[92m2020-09-10 22:17:07[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [1;32mpytorch will use: cuda:1[0m
[92m2020-09-10 22:17:07[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [2;32mread CSV file: ./dataset/wikigaz_en_test.txt[0m
[92m2020-09-10 22:17:08[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [1;32mnumber of labels, True: 33469 and False: 33469[0m<jupyter_text>skyline2<jupyter_code>from DeezyMatch import inference as dm_inference

# model inference using a model stored at pretrained_model_path and pretrained_vocab_path 
dm_inference(input_file_path="./inputs/input_dfm.yaml",
             dataset_path="./dataset/ocr_test.txt", 
             pretrained_model_path="./models/wikigaz_en_ocr_gru_001/wikigaz_en_ocr_gru_001.model", 
             pretrained_vocab_path="./models/wikigaz_en_ocr_gru_001/wikigaz_en_ocr_gru_001.vocab")


from DeezyMatch import inference as dm_inference

# model inference using a model stored at pretrained_model_path and pretrained_vocab_path 
dm_inference(input_file_path="./inputs/input_dfm.yaml",
             dataset_path="./dataset/wikigaz_en_test.txt", 
             pretrained_model_path="./models/wikigaz_en_ocr_gru_001/wikigaz_en_ocr_gru_001.model", 
             pretrained_vocab_path="./models/wikigaz_en_ocr_gru_001/wikigaz_en_ocr_gru_001.vocab")<jupyter_output>[92m2020-09-10 18:20:56[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [2;32mread input file: ./inputs/input_dfm.yaml[0m
[92m2020-09-10 18:20:56[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [1;32mpytorch will use: cuda:1[0m
[92m2020-09-10 18:20:56[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [2;32mread CSV file: ./dataset/wikigaz_en_test.txt[0m
[92m2020-09-10 18:20:56[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [1;32mnumber of labels, True: 33469 and False: 33469[0m<jupyter_text>skyline2b<jupyter_code>from DeezyMatch import inference as dm_inference

# model inference using a model stored at pretrained_model_path and pretrained_vocab_path 
dm_inference(input_file_path="./inputs/input_dfm_b.yaml",
             dataset_path="./dataset/ocr_test.txt", 
             pretrained_model_path="./models/wikigaz_en_ocr_gru_001b/wikigaz_en_ocr_gru_001b.model", 
             pretrained_vocab_path="./models/wikigaz_en_ocr_gru_001b/wikigaz_en_ocr_gru_001b.vocab")


from DeezyMatch import inference as dm_inference

# model inference using a model stored at pretrained_model_path and pretrained_vocab_path 
dm_inference(input_file_path="./inputs/input_dfm_b.yaml",
             dataset_path="./dataset/wikigaz_en_test.txt", 
             pretrained_model_path="./models/wikigaz_en_ocr_gru_001b/wikigaz_en_ocr_gru_001b.model", 
             pretrained_vocab_path="./models/wikigaz_en_ocr_gru_001b/wikigaz_en_ocr_gru_001b.vocab")<jupyter_output>[92m2020-09-10 23:01:23[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [2;32mread input file: ./inputs/input_dfm_b.yaml[0m
[92m2020-09-10 23:01:23[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [1;32mpytorch will use: cuda:1[0m
[92m2020-09-10 23:01:23[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [2;32mread CSV file: ./dataset/wikigaz_en_test.txt[0m
[92m2020-09-10 23:01:24[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [1;32mnumber of labels, True: 33469 and False: 33469[0m<jupyter_text>baseline1_gru<jupyter_code># model inference using a model stored at pretrained_model_path and pretrained_vocab_path 
dm_inference(input_file_path="./inputs/input_dfm.yaml",
             dataset_path="./dataset/ocr_test.txt", 
             pretrained_model_path="./models/wikigaz_en_gru_001/wikigaz_en_gru_001.model", 
             pretrained_vocab_path="./models/wikigaz_en_gru_001/wikigaz_en_gru_001.vocab")


# model inference using a model stored at pretrained_model_path and pretrained_vocab_path 
dm_inference(input_file_path="./inputs/input_dfm.yaml",
             dataset_path="./dataset/wikigaz_en_test.txt", 
             pretrained_model_path="./models/wikigaz_en_gru_001/wikigaz_en_gru_001.model", 
             pretrained_vocab_path="./models/wikigaz_en_gru_001/wikigaz_en_gru_001.vocab")<jupyter_output>[92m2020-09-10 18:23:09[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [2;32mread input file: ./inputs/input_dfm.yaml[0m
[92m2020-09-10 18:23:09[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [1;32mpytorch will use: cuda:1[0m
[92m2020-09-10 18:23:09[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [2;32mread CSV file: ./dataset/wikigaz_en_test.txt[0m
[92m2020-09-10 18:23:09[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [1;32mnumber of labels, True: 33469 and False: 33469[0m<jupyter_text>baseline1_lstm<jupyter_code># model inference using a model stored at pretrained_model_path and pretrained_vocab_path 
dm_inference(input_file_path="./inputs/input_dfm_lstm.yaml",
             dataset_path="./dataset/ocr_test.txt", 
             pretrained_model_path="./models/wikigaz_en_lstm_001/wikigaz_en_lstm_001.model", 
             pretrained_vocab_path="./models/wikigaz_en_lstm_001/wikigaz_en_lstm_001.vocab")



# model inference using a model stored at pretrained_model_path and pretrained_vocab_path 
dm_inference(input_file_path="./inputs/input_dfm_lstm.yaml",
             dataset_path="./dataset/wikigaz_en_test.txt", 
             pretrained_model_path="./models/wikigaz_en_lstm_001/wikigaz_en_lstm_001.model", 
             pretrained_vocab_path="./models/wikigaz_en_lstm_001/wikigaz_en_lstm_001.vocab")<jupyter_output>[92m2020-09-10 18:25:45[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [2;32mread input file: ./inputs/input_dfm_lstm.yaml[0m
[92m2020-09-10 18:25:45[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [1;32mpytorch will use: cuda:1[0m
[92m2020-09-10 18:25:45[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [2;32mread CSV file: ./dataset/wikigaz_en_test.txt[0m
[92m2020-09-10 18:25:45[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [1;32mnumber of labels, True: 33469 and False: 33469[0m<jupyter_text>baseline1_rnn<jupyter_code># model inference using a model stored at pretrained_model_path and pretrained_vocab_path 
dm_inference(input_file_path="./inputs/input_dfm_rnn.yaml",
             dataset_path="./dataset/ocr_test.txt", 
             pretrained_model_path="./models/wikigaz_en_rnn_001/wikigaz_en_rnn_001.model", 
             pretrained_vocab_path="./models/wikigaz_en_rnn_001/wikigaz_en_rnn_001.vocab")



# model inference using a model stored at pretrained_model_path and pretrained_vocab_path 
dm_inference(input_file_path="./inputs/input_dfm_rnn.yaml",
             dataset_path="./dataset/wikigaz_en_test.txt", 
             pretrained_model_path="./models/wikigaz_en_rnn_001/wikigaz_en_rnn_001.model", 
             pretrained_vocab_path="./models/wikigaz_en_rnn_001/wikigaz_en_rnn_001.vocab")<jupyter_output>[92m2020-09-10 18:27:42[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [2;32mread input file: ./inputs/input_dfm_rnn.yaml[0m
[92m2020-09-10 18:27:42[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [1;32mpytorch will use: cuda:1[0m
[92m2020-09-10 18:27:42[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [2;32mread CSV file: ./dataset/wikigaz_en_test.txt[0m
[92m2020-09-10 18:27:42[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [1;32mnumber of labels, True: 33469 and False: 33469[0m<jupyter_text>Fine-Tuned, model A, GRU<jupyter_code>from DeezyMatch import finetune as dm_finetune

for n_ft_examples in [250, 500, 1000, 2000, 4000, 8000, 16000, 32000, 64000, 84000]:
    print("---------", n_ft_examples)
    # model inference using a model stored at pretrained_model_path and pretrained_vocab_path 
    dm_inference(input_file_path="./inputs/input_dfm_gru_model_A.yaml",
             dataset_path="./dataset/ocr_test.txt", 
             pretrained_model_path=f"./models/wikigaz_en_ft_ocr_gru_v001_n{n_ft_examples}/wikigaz_en_ft_ocr_gru_v001_n{n_ft_examples}.model", 
             pretrained_vocab_path=f"./models/wikigaz_en_ft_ocr_gru_v001_n{n_ft_examples}/wikigaz_en_ft_ocr_gru_v001_n{n_ft_examples}.vocab")
    
    
from DeezyMatch import finetune as dm_finetune

for n_ft_examples in [250, 500, 1000, 2000, 4000, 8000, 16000, 32000, 64000, 84000]:
    print("---------", n_ft_examples)
    # model inference using a model stored at pretrained_model_path and pretrained_vocab_path 
    dm_inference(input_file_path="./inputs/input_dfm_gru_model_A.yaml",
             dataset_path="./dataset/wikigaz_en_test.txt", 
             pretrained_model_path=f"./models/wikigaz_en_ft_ocr_gru_v001_n{n_ft_examples}/wikigaz_en_ft_ocr_gru_v001_n{n_ft_examples}.model", 
             pretrained_vocab_path=f"./models/wikigaz_en_ft_ocr_gru_v001_n{n_ft_examples}/wikigaz_en_ft_ocr_gru_v001_n{n_ft_examples}.vocab")<jupyter_output>--------- 250
[92m2020-09-10 18:33:32[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [2;32mread input file: ./inputs/input_dfm_gru_model_A.yaml[0m
[92m2020-09-10 18:33:32[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [1;32mpytorch will use: cuda:1[0m
[92m2020-09-10 18:33:32[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [2;32mread CSV file: ./dataset/wikigaz_en_test.txt[0m
[92m2020-09-10 18:33:32[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [1;32mnumber of labels, True: 33469 and False: 33469[0m<jupyter_text>Fine-Tuned, model A, LSTM<jupyter_code>from DeezyMatch import finetune as dm_finetune

for n_ft_examples in [250, 500, 1000, 2000, 4000, 8000, 16000, 32000, 64000, 84000]:
    print("---------", n_ft_examples)
    # model inference using a model stored at pretrained_model_path and pretrained_vocab_path 
    dm_inference(input_file_path="./inputs/input_dfm_lstm_model_A.yaml",
             dataset_path="./dataset/ocr_test.txt", 
             pretrained_model_path=f"./models/wikigaz_en_ft_ocr_lstm_v001_n{n_ft_examples}/wikigaz_en_ft_ocr_lstm_v001_n{n_ft_examples}.model", 
             pretrained_vocab_path=f"./models/wikigaz_en_ft_ocr_lstm_v001_n{n_ft_examples}/wikigaz_en_ft_ocr_lstm_v001_n{n_ft_examples}.vocab")
    
    
from DeezyMatch import finetune as dm_finetune

for n_ft_examples in [250, 500, 1000, 2000, 4000, 8000, 16000, 32000, 64000, 84000]:
    print("---------", n_ft_examples)
    # model inference using a model stored at pretrained_model_path and pretrained_vocab_path 
    dm_inference(input_file_path="./inputs/input_dfm_lstm_model_A.yaml",
             dataset_path="./dataset/wikigaz_en_test.txt", 
             pretrained_model_path=f"./models/wikigaz_en_ft_ocr_lstm_v001_n{n_ft_examples}/wikigaz_en_ft_ocr_lstm_v001_n{n_ft_examples}.model", 
             pretrained_vocab_path=f"./models/wikigaz_en_ft_ocr_lstm_v001_n{n_ft_examples}/wikigaz_en_ft_ocr_lstm_v001_n{n_ft_examples}.vocab")<jupyter_output>--------- 250
[92m2020-09-10 18:46:27[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [2;32mread input file: ./inputs/input_dfm_lstm_model_A.yaml[0m
[92m2020-09-10 18:46:27[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [1;32mpytorch will use: cuda:1[0m
[92m2020-09-10 18:46:27[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [2;32mread CSV file: ./dataset/wikigaz_en_test.txt[0m
[92m2020-09-10 18:46:27[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [1;32mnumber of labels, True: 33469 and False: 33469[0m<jupyter_text>Fine-Tuned, model A, RNN<jupyter_code>from DeezyMatch import finetune as dm_finetune

for n_ft_examples in [250, 500, 1000, 2000, 4000, 8000, 16000, 32000, 64000, 84000]:
    print("---------", n_ft_examples)
    # model inference using a model stored at pretrained_model_path and pretrained_vocab_path 
    dm_inference(input_file_path="./inputs/input_dfm_rnn_model_A.yaml",
             dataset_path="./dataset/ocr_test.txt", 
             pretrained_model_path=f"./models/wikigaz_en_ft_ocr_rnn_v001_n{n_ft_examples}/wikigaz_en_ft_ocr_rnn_v001_n{n_ft_examples}.model", 
             pretrained_vocab_path=f"./models/wikigaz_en_ft_ocr_rnn_v001_n{n_ft_examples}/wikigaz_en_ft_ocr_rnn_v001_n{n_ft_examples}.vocab")
    
    
from DeezyMatch import finetune as dm_finetune

for n_ft_examples in [250, 500, 1000, 2000, 4000, 8000, 16000, 32000, 64000, 84000]:
    print("---------", n_ft_examples)
    # model inference using a model stored at pretrained_model_path and pretrained_vocab_path 
    dm_inference(input_file_path="./inputs/input_dfm_rnn_model_A.yaml",
             dataset_path="./dataset/wikigaz_en_test.txt", 
             pretrained_model_path=f"./models/wikigaz_en_ft_ocr_rnn_v001_n{n_ft_examples}/wikigaz_en_ft_ocr_rnn_v001_n{n_ft_examples}.model", 
             pretrained_vocab_path=f"./models/wikigaz_en_ft_ocr_rnn_v001_n{n_ft_examples}/wikigaz_en_ft_ocr_rnn_v001_n{n_ft_examples}.vocab")<jupyter_output>--------- 250
[92m2020-09-10 18:57:23[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [2;32mread input file: ./inputs/input_dfm_rnn_model_A.yaml[0m
[92m2020-09-10 18:57:23[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [1;32mpytorch will use: cuda:1[0m
[92m2020-09-10 18:57:23[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [2;32mread CSV file: ./dataset/wikigaz_en_test.txt[0m
[92m2020-09-10 18:57:24[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [1;32mnumber of labels, True: 33469 and False: 33469[0m<jupyter_text>Fine-Tuned, model B, GRU<jupyter_code>from DeezyMatch import finetune as dm_finetune

for n_ft_examples in [250, 500, 1000, 2000, 4000, 8000, 16000, 32000, 64000, 84000]:
    print("---------", n_ft_examples)
    # model inference using a model stored at pretrained_model_path and pretrained_vocab_path 
    dm_inference(input_file_path="./inputs/input_dfm_gru_model_B.yaml",
             dataset_path="./dataset/ocr_test.txt", 
             pretrained_model_path=f"./models/wikigaz_en_ft_ocr_gru_v002_n{n_ft_examples}/wikigaz_en_ft_ocr_gru_v002_n{n_ft_examples}.model", 
             pretrained_vocab_path=f"./models/wikigaz_en_ft_ocr_gru_v002_n{n_ft_examples}/wikigaz_en_ft_ocr_gru_v002_n{n_ft_examples}.vocab")
    
    
from DeezyMatch import finetune as dm_finetune

for n_ft_examples in [250, 500, 1000, 2000, 4000, 8000, 16000, 32000, 64000, 84000]:
    print("---------", n_ft_examples)
    # model inference using a model stored at pretrained_model_path and pretrained_vocab_path 
    dm_inference(input_file_path="./inputs/input_dfm_gru_model_B.yaml",
             dataset_path="./dataset/wikigaz_en_test.txt", 
             pretrained_model_path=f"./models/wikigaz_en_ft_ocr_gru_v002_n{n_ft_examples}/wikigaz_en_ft_ocr_gru_v002_n{n_ft_examples}.model", 
             pretrained_vocab_path=f"./models/wikigaz_en_ft_ocr_gru_v002_n{n_ft_examples}/wikigaz_en_ft_ocr_gru_v002_n{n_ft_examples}.vocab")<jupyter_output>--------- 250
[92m2020-09-10 21:46:20[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [2;32mread input file: ./inputs/input_dfm_gru_model_B.yaml[0m
[92m2020-09-10 21:46:20[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [1;32mpytorch will use: cuda:1[0m
[92m2020-09-10 21:46:20[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [2;32mread CSV file: ./dataset/wikigaz_en_test.txt[0m
[92m2020-09-10 21:46:21[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [1;32mnumber of labels, True: 33469 and False: 33469[0m<jupyter_text>Fine-Tuned, model B, LSTM<jupyter_code>from DeezyMatch import finetune as dm_finetune

for n_ft_examples in [250, 500, 1000, 2000, 4000, 8000, 16000, 32000, 64000, 84000]:
    print("---------", n_ft_examples)
    # model inference using a model stored at pretrained_model_path and pretrained_vocab_path 
    dm_inference(input_file_path="./inputs/input_dfm_lstm_model_B.yaml",
             dataset_path="./dataset/ocr_test.txt", 
             pretrained_model_path=f"./models/wikigaz_en_ft_ocr_lstm_v002_n{n_ft_examples}/wikigaz_en_ft_ocr_lstm_v002_n{n_ft_examples}.model", 
             pretrained_vocab_path=f"./models/wikigaz_en_ft_ocr_lstm_v002_n{n_ft_examples}/wikigaz_en_ft_ocr_lstm_v002_n{n_ft_examples}.vocab")
    
    
from DeezyMatch import finetune as dm_finetune

for n_ft_examples in [250, 500, 1000, 2000, 4000, 8000, 16000, 32000, 64000, 84000]:
    print("---------", n_ft_examples)
    # model inference using a model stored at pretrained_model_path and pretrained_vocab_path 
    dm_inference(input_file_path="./inputs/input_dfm_lstm_model_B.yaml",
             dataset_path="./dataset/wikigaz_en_test.txt", 
             pretrained_model_path=f"./models/wikigaz_en_ft_ocr_lstm_v002_n{n_ft_examples}/wikigaz_en_ft_ocr_lstm_v002_n{n_ft_examples}.model", 
             pretrained_vocab_path=f"./models/wikigaz_en_ft_ocr_lstm_v002_n{n_ft_examples}/wikigaz_en_ft_ocr_lstm_v002_n{n_ft_examples}.vocab")<jupyter_output>--------- 250
[92m2020-09-10 21:51:58[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [2;32mread input file: ./inputs/input_dfm_lstm_model_B.yaml[0m
[92m2020-09-10 21:51:58[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [1;32mpytorch will use: cuda:1[0m
[92m2020-09-10 21:51:58[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [2;32mread CSV file: ./dataset/wikigaz_en_test.txt[0m
[92m2020-09-10 21:51:59[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [1;32mnumber of labels, True: 33469 and False: 33469[0m<jupyter_text>Fine-Tuned, model B, RNN<jupyter_code>from DeezyMatch import finetune as dm_finetune

for n_ft_examples in [250, 500, 1000, 2000, 4000, 8000, 16000, 32000, 64000, 84000]:
    print("---------", n_ft_examples)
    # model inference using a model stored at pretrained_model_path and pretrained_vocab_path 
    dm_inference(input_file_path="./inputs/input_dfm_rnn_model_B.yaml",
             dataset_path="./dataset/ocr_test.txt", 
             pretrained_model_path=f"./models/wikigaz_en_ft_ocr_rnn_v002_n{n_ft_examples}/wikigaz_en_ft_ocr_rnn_v002_n{n_ft_examples}.model", 
             pretrained_vocab_path=f"./models/wikigaz_en_ft_ocr_rnn_v002_n{n_ft_examples}/wikigaz_en_ft_ocr_rnn_v002_n{n_ft_examples}.vocab")
    
    
from DeezyMatch import finetune as dm_finetune

for n_ft_examples in [250, 500, 1000, 2000, 4000, 8000, 16000, 32000, 64000, 84000]:
    print("---------", n_ft_examples)
    # model inference using a model stored at pretrained_model_path and pretrained_vocab_path 
    dm_inference(input_file_path="./inputs/input_dfm_rnn_model_B.yaml",
             dataset_path="./dataset/wikigaz_en_test.txt", 
             pretrained_model_path=f"./models/wikigaz_en_ft_ocr_rnn_v002_n{n_ft_examples}/wikigaz_en_ft_ocr_rnn_v002_n{n_ft_examples}.model", 
             pretrained_vocab_path=f"./models/wikigaz_en_ft_ocr_rnn_v002_n{n_ft_examples}/wikigaz_en_ft_ocr_rnn_v002_n{n_ft_examples}.vocab")<jupyter_output>--------- 250
[92m2020-09-10 21:58:02[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [2;32mread input file: ./inputs/input_dfm_rnn_model_B.yaml[0m
[92m2020-09-10 21:58:02[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [1;32mpytorch will use: cuda:1[0m
[92m2020-09-10 21:58:02[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [2;32mread CSV file: ./dataset/wikigaz_en_test.txt[0m
[92m2020-09-10 21:58:02[0m [95mlwm-embeddings[0m [1m[90m[INFO][0m [1;32mnumber of labels, True: 33469 and False: 33469[0m
{'fraction_non_alphanumeric': 0.13938905312192063, 'fraction_numerical': 0.10964794410104811, 'mean_word_length': 5.287524640946212, 'pattern_counts': {'":': 0, '<': 42, '<?xml version=': 0, '>': 42, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '13', 'dir': 'jupyter-structured-clean-dedup', 'id': '333568', 'license': 'MIT', 'n_tokens_mistral': 11339, 'n_tokens_neox': 9150, 'n_words': 1279, 'path': 'figs/EMNLP2020_figures/fig2/Fig2_EMNLP_inference.ipynb', 'repo_name': 'Fourthought/DeezyMatch', 'size': '22341'}