-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrun.py
42 lines (31 loc) · 1023 Bytes
/
run.py
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
34
35
36
37
38
39
40
41
42
import json
import logging
import sys
sys.path.append("../..")
from src.loader import load_data
from src.run import run_algorithm
# logging settings
logger = logging.getLogger(__name__)
logging.basicConfig(
filename="../../logs.log",
level=logging.INFO,
format="%(asctime)s - %(levelname)s - %(lineno)d - %(name)s: %(message)s",
datefmt="%y-%m-%d %H:%M:%S"
)
DATASETSPATH = "../../datasets"
import warnings
warnings.filterwarnings("ignore")
def predict(x_test, y_test, z_test, z_test_xpos, dname):
"""Perform baseline lemmatization: lemma = token."""
return x_test
# run all benchmarks
results = []
for x_test, y_test, z_test, z_test_xpos, dname in load_data(DATASETSPATH):
try:
results.append(run_algorithm(predict, x_test, y_test, z_test,
z_test_xpos, dname, 'baseline'))
except Exception as err:
logger.error(err)
# store results
with open("../../nbs/results-baseline.json", "w") as fp:
json.dump(results, fp, indent=4)