File size: 652 Bytes
7e3c514
3f8d76d
10a5b65
9d5ed04
410b92f
940c82c
96c4203
3f8d76d
96c4203
 
904cf68
96c4203
3f8d76d
 
 
f9d6102
96c4203
515949b
3f8d76d
 
7e3c514
 
940c82c
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from dagshub import dagshub_logger
import yaml

from model import Summarization
import pandas as pd
import json


def evaluate_model():
    """
    Evaluate model using rouge measure
    """
    with open("params.yml") as f:
        params = yaml.safe_load(f)

    test_df = pd.read_csv('data/processed/test.csv')[:25]
    model = Summarization()
    model.load_model(model_type=params['model_type'], model_dir=params['model_dir'])
    results = model.evaluate(test_df=test_df, metrics=params['metric'])

    with dagshub_logger(should_log_hparams=False) as logger:
        logger.log_metrics(results)


if __name__ == '__main__':
    evaluate_model()