timestamp appended to output file name
This commit is contained in:
parent
31fc225d0e
commit
650e764864
6
infer.py
6
infer.py
|
|
@ -1,6 +1,7 @@
|
||||||
import os
|
import os
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
from dataManager.gFunDataset import SimpleGfunDataset
|
from dataManager.gFunDataset import SimpleGfunDataset
|
||||||
from gfun.generalizedFunnelling import GeneralizedFunnelling
|
from gfun.generalizedFunnelling import GeneralizedFunnelling
|
||||||
|
|
@ -87,7 +88,10 @@ def save_inference_preds(preds, dataset_name, doc_ids, targets=None, category_ma
|
||||||
mapper = pd.read_csv(category_mapper).to_dict()["category"]
|
mapper = pd.read_csv(category_mapper).to_dict()["category"]
|
||||||
df["gfun_string_prediction"] = [mapper[p] for p in _preds]
|
df["gfun_string_prediction"] = [mapper[p] for p in _preds]
|
||||||
|
|
||||||
output_file = f"{outdir}/{dataset_name}.csv"
|
timestamp = datetime.now()
|
||||||
|
formatted_timestamp = timestamp.strftime("%y%m%d_%H%M%S")
|
||||||
|
|
||||||
|
output_file = f"{outdir}/{dataset_name}_{formatted_timestamp}.csv"
|
||||||
print(f"Storing predicitons in: {output_file}")
|
print(f"Storing predicitons in: {output_file}")
|
||||||
df.to_csv(output_file, index=False)
|
df.to_csv(output_file, index=False)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue