|
import sys |
|
import os |
|
sys.path.append("../env") |
|
import pandas as pd |
|
import numpy as np |
|
from datasets import load_dataset |
|
|
|
def get_score(submission_folder = "../env"): |
|
submission_path = os.path.join(submission_folder, "submission.csv") |
|
submission = pd.read_csv(submission_path) |
|
imdb = load_dataset("imdb") |
|
|
|
acc = 0 |
|
for idx, data in enumerate(imdb["test"]): |
|
label = data["label"] |
|
pred = submission.loc[idx].argmax() |
|
acc += int(pred == label) |
|
|
|
return acc/len(imdb["test"]) |
|
|
|
if __name__ == "__main__": |
|
print(get_score()) |
|
|