Пример #1
0
# In[7]:

# model_path = '/disk/frameBERT/models/crosslingual/'
# models = args.model
if args.eval_model == 'all':
    models = glob.glob(args.model + '*')
else:
    models = [args.model]

result = {}

for model_path in models:
    parsed_result = test_model(model_path,
                               language=args.language,
                               test_data=args.test)
    frameid, arg_precision, arg_recall, arg_f1, full_precision, full_recall, full_f1 = eval_fn.evaluate(
        tst[args.test], parsed_result)

    d = {}
    d['frameid'] = frameid
    d['arg_precision'] = arg_precision
    d['arg_recall'] = arg_recall
    d['arg_f1'] = arg_f1
    d['full_precision'] = full_precision
    d['full_recall'] = full_recall
    d['full_f1'] = full_f1
    result[model_path] = d
    print('model:', model_path)
    print('test:', args.test)
    pprint(d)
#     break
Пример #2
0
# print('\nparsed_data')
# print(parsed[0])

# # Evaluate Models

# In[6]:

model_path = '/disk/frameBERT/models/argid-fn17-exem/'
models = glob.glob(model_path + '*')

result = {}

for model_path in models:
    print('model:', model_path)
    parsed_result = test_model(model_path, language=language)
    frameid, arg_precision, arg_recall, arg_f1, full_precision, full_recall, full_f1 = eval_fn.evaluate(
        tst, parsed_result, fnversion=fnversion)

    d = {}
    d['frameid'] = frameid
    d['arg_precision'] = arg_precision
    d['arg_recall'] = arg_recall
    d['arg_f1'] = arg_f1
    d['full_precision'] = full_precision
    d['full_recall'] = full_recall
    d['full_f1'] = full_f1
    result[model_path] = d
    pprint(d)

#     break

# pprint(result)