Skip to content
Merged
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
3 changes: 2 additions & 1 deletion libmultilabel/linear/preprocessor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import csv
import logging
import re
from array import array
Expand Down Expand Up @@ -141,7 +142,7 @@ def _generate_label_mapping(self, labels, classes=None):
def read_libmultilabel_format(path: str) -> 'dict[str,list[str]]':
data = pd.read_csv(path, sep='\t', header=None,
dtype=str,
on_bad_lines='skip').fillna('')
on_bad_lines='skip', quoting=csv.QUOTE_NONE).fillna('')
if data.shape[1] == 2:
data.columns = ['label', 'text']
data = data.reset_index()
Expand Down
3 changes: 2 additions & 1 deletion libmultilabel/nn/data_utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import csv
import gc
import logging
import warnings
Expand Down Expand Up @@ -136,7 +137,7 @@ def _load_raw_data(path, is_test=False, tokenize_text=True, remove_no_label_data
"""
logging.info(f'Load data from {path}.')
data = pd.read_csv(path, sep='\t', header=None,
error_bad_lines=False, warn_bad_lines=True).fillna('')
error_bad_lines=False, warn_bad_lines=True, quoting=csv.QUOTE_NONE).fillna('')
if data.shape[1] == 2:
data.columns = ['label', 'text']
data = data.reset_index()
Expand Down