Skip to content

Instantly share code, notes, and snippets.

View teelinsan's full-sized avatar

Andrea Santilli teelinsan

View GitHub Profile
@teelinsan
teelinsan / calculate_mcga_mnli.py
Created March 25, 2021 13:55
Simple script to calculate the "multiple_choice_grade” accuracy for BIGBench. Run the script in the main folder of the project.
from transformers import pipeline
from tqdm import tqdm
import json
def check_mnli_benchmark(benchmark_json_path, classifier, base_path='bigbench/benchmark_tasks/', use_prefix_out=True):
"""
Function to compute the “multiple_choice_grade” accuracy of the classifier provided.
The script save in the path a result json with the score and the list of the results for the elements in the dataset
'float_time'
'many2manyattendee'
'many2many_tags'
'one2many'
'email'
'mail_followers'
'mail_thread'
'many2many_tags_avatar'
'pad'
'statinfo'