Skip to content

Commit 403a53c

Browse files
author
Marcin Kardas
committed
Fix proposals caching
1 parent 2e4bc46 commit 403a53c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sota_extractor2/helpers/cache.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import pandas as pd
22
import json
3+
from collections import defaultdict
34

45

56
# these functions are used to cache various results
@@ -32,7 +33,12 @@ def save_structure(structure, path):
3233

3334

3435
def load_proposals(path):
35-
proposals = pd.read_csv(path, index_col=0)
36+
dtypes = defaultdict(lambda: str)
37+
dtypes['confidence'] = float
38+
dtypes['parsed'] = float
39+
40+
na_values = {'confidence': '', 'parsed': ''}
41+
proposals = pd.read_csv(path, index_col=0, dtype=dtypes, na_values=na_values, keep_default_na=False)
3642
return proposals
3743

3844

0 commit comments

Comments
 (0)