File size: 615 Bytes
3d2162d
bc61241
350cc95
6b7d44b
28a91ce
3ee9987
2fbc388
850c04b
725b6f2
83f1fd9
bb18a30
f3aa86c
d2eb2c0
724ffea
043db65
3f9b6df
9008f44
e0e7978
717b039
708802e
fc0c429
778776e
45007bc
19a20ae
24a3999
02f4cef
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
import dagshub
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 open("reports/metrics.csv", "w") as fp:
        json.dump(results, fp)


if __name__ == "__main__":
    evaluate_model()