Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions deeppavlov/dataset_readers/basic_classification_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ def read(self, data_path: str, url: str = None,
file = Path(data_path).joinpath(file_name)
if file.exists():
if format == 'csv':
keys = ('sep', 'header', 'names')
keys = ('sep', 'header', 'names', 'dtype')
options = {k: kwargs[k] for k in keys if k in kwargs}
df = pd.read_csv(file, **options)
elif format == 'json':
keys = ('orient', 'lines')
keys = ('orient', 'lines', 'dtype')
options = {k: kwargs[k] for k in keys if k in kwargs}
df = pd.read_json(file, **options)
Comment on lines 80 to 87
else:
Expand Down
2 changes: 1 addition & 1 deletion deeppavlov/dataset_readers/docred_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,6 @@ def label_to_one_hot(self, labels: List[int]) -> List:
def print_statistics(self, train_stat: Dict, valid_stat: Dict, test_stat: Dict) -> None:
""" Print out the relation statistics as a markdown table """
df = pd.DataFrame([self.rel2relid, train_stat, valid_stat, test_stat]).T
df.columns = ['d{}'.format(i) for i, col in enumerate(df, 1)]
df.columns = ['rel_id', 'train', 'valid', 'test']
logger.info("\n")
logger.info(df)
Loading