-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpolish_name_model_cmd.py
More file actions
33 lines (25 loc) · 963 Bytes
/
polish_name_model_cmd.py
File metadata and controls
33 lines (25 loc) · 963 Bytes
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
28
29
30
31
32
33
import click
from config.polish_name import PolishNameConfig
from polish_name_data_loader import PolishNameDataLoader
from polish_name_model import PolishNameModel
@click.command(name="polish-name-model")
@click.option("--ignore", is_flag=True, help="Ignore refreshing data")
def polish_name_model_cmd(ignore):
"""This is the command for running the Polish Name Model"""
config = PolishNameConfig.load_config("./config/polish_name_config.yaml")
data_loader = PolishNameDataLoader(config)
if not ignore:
data_loader.refresh_data()
male, female = data_loader.load_data()
model = PolishNameModel(config)
model.build_model(male)
model.train_model()
model.loss_train()
model.loss_dev()
model.loss_test()
model.display_dimension()
for index in range(10):
model.predict(index)
click.echo("Polish Name Model has been run successfully")
if __name__ == "__main__":
polish_name_model_cmd()