batchscript evaluation

Hi I need to do a batchscrip thousands of gold test sets(I also ask my self the same question why? :laughing:). How can I batchscript them with the code below? Sorry I have not done this in years.

python -m spacy evaluate model-best --gpu-id 0 --output sample1.csv --gold-preproc sample2.spacy --path

thanks in advance.

Hi @vtorres ,

If I understand the problem correctly, you have thousands of gold test sets (e.g., sample2.spacy) and you want to evaluate all of them with the same model. If that's the case:

  1. If the file names are similar in format, you can use a bash for loop.
  2. You can also do this programmatically using Python, call the spacy.cli.evaluate function and apply it to a glob of files in a directory.
1 Like