-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask.py
More file actions
32 lines (20 loc) · 827 Bytes
/
Copy pathtask.py
File metadata and controls
32 lines (20 loc) · 827 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
from pathlib import Path
import numpy as np
from parse_args import args
from task_registry import run_task
def predict_crime(emb):
return run_task(args.task_package, "crime", emb, args.data_path, display=False)
def predict_checkin(emb):
return run_task(args.task_package, "checkin", emb, args.data_path, display=False)
def predict_check(emb):
return predict_checkin(emb)
def predict_servicecall(emb):
return run_task(args.task_package, "servicecall", emb, args.data_path, display=False)
if __name__ == "__main__":
emb_path = Path(args.best_emb_path)
if not emb_path.exists():
emb_path = Path("emb.npy")
emb = np.load(emb_path, allow_pickle=True)
print("crime", predict_crime(emb))
print("checkin", predict_checkin(emb))
print("servicecall", predict_servicecall(emb))