urchade / GLiNER

Generalist and Lightweight Model for Named Entity Recognition (Extract any entity types from texts) @ NAACL 2024
https://arxiv.org/abs/2311.08526
Apache License 2.0
1.48k stars 127 forks source link

I wonder if you can add code to verify the F1 value in train()? #51

Closed a1stupid closed 7 months ago

urchade commented 7 months ago

You can do it, by downloading evaluation data

if (step + 1) % eval_every == 0:
            current_path = os.path.join(log_dir, f'model_{step + 1}')
            model.save_pretrained(current_path)
            #val_data_dir =  "NER_datasets" # can be obtained from "https://drive.google.com/file/d/1T-5IbocGka35I7X3CE6yKe5N_Xg2lVKT/view"
            #get_for_all_path(model, step, log_dir, val_data_dir)  # you can remove this comment if you want to evaluate the model
a1stupid commented 7 months ago

thanks, you help me a lot.