Hi ! To speed up the processing you can pass keep_in_memory=True to load_metric to keep each sample in memory (by default it writes them on disk to save memory, but since you’re passing the examples one by one to compute you don’t need this). This should speed up your computation significantly.
Moreover feel free to use python multiprocessing to parallelize this (using multiprocessing.Pool and Pool.imap for example)