File size: 554 Bytes
f19d75b
 
8b14993
3bbdfe3
8b14993
9f87b83
8b14993
 
 
1ebd2ab
f69b674
972bccc
 
7f8704f
1ebd2ab
241e6ac
1ebd2ab
 
25a8db5
0c204b8
6df7c61
dc0c603
2e3ad7f
d6b264b
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
import yaml

from .model import Summarization
import pandas as pd


def predict_model(text):
    """
    Predict the summary of the given text.
    """
    with open("params.yml") as f:
        params = yaml.safe_load(f)


    model = Summarization()
    model.load_model(model_type=params['model_type'], model_dir=params['model_dir'])
    pre_summary = model.predict(text)
    return pre_summary


if __name__ == '__main__':
    text = pd.load_csv('data/processed/test.csv')['input_text'][0]
    pre_summary = predict_model(text)
    print(pre_summary)