Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
f8287f0
custom data loader
ArshdeepSekhon Oct 29, 2020
bb1e021
custom textattack dataset from local files or in memory using hugging…
ArshdeepSekhon Oct 30, 2020
9195e1e
load user dataset from local files and convert to TextAttack dataset …
ArshdeepSekhon Nov 4, 2020
c1bd607
load user dataset from local files and convert to TextAttack dataset …
ArshdeepSekhon Nov 4, 2020
157bd21
load user dataset from local files and convert to textattack dataset …
ArshdeepSekhon Nov 4, 2020
3edd74b
load user dataset from local files and convert to textattack dataset …
ArshdeepSekhon Nov 4, 2020
29b0d9a
custom dataset: add attribute error
ArshdeepSekhon Nov 4, 2020
ea15f9a
custom dataset: remove stray prints
ArshdeepSekhon Nov 4, 2020
34b02ec
fix output column for custom dataset
ArshdeepSekhon Nov 4, 2020
af379af
custom dataset: add support for dict
ArshdeepSekhon Nov 4, 2020
6e07bd5
custom dataset: checks
ArshdeepSekhon Nov 4, 2020
2105de2
option to test on entire dataset
ArshdeepSekhon Oct 22, 2020
5f9a4c2
eval on entire dataset, checks
ArshdeepSekhon Oct 22, 2020
f238449
fix failed checks
ArshdeepSekhon Oct 22, 2020
2f00e33
custom data loader
ArshdeepSekhon Oct 29, 2020
793dbe0
custom textattack dataset from local files or in memory using hugging…
ArshdeepSekhon Oct 30, 2020
ae1c1f0
load user dataset from local files and convert to TextAttack dataset …
ArshdeepSekhon Nov 4, 2020
799f29e
load user dataset from local files and convert to TextAttack dataset …
ArshdeepSekhon Nov 4, 2020
97ea615
load user dataset from local files and convert to textattack dataset …
ArshdeepSekhon Nov 4, 2020
6172e24
load user dataset from local files and convert to textattack dataset …
ArshdeepSekhon Nov 4, 2020
d3e4269
custom dataset: add attribute error
ArshdeepSekhon Nov 4, 2020
92a54a5
custom dataset: remove stray prints
ArshdeepSekhon Nov 4, 2020
7b167ca
fix output column for custom dataset
ArshdeepSekhon Nov 4, 2020
601371d
custom dataset: add support for dict
ArshdeepSekhon Nov 4, 2020
9d0ed54
custom dataset: checks
ArshdeepSekhon Nov 4, 2020
12aab83
skeleton code for custom dataset
ArshdeepSekhon Nov 24, 2020
474bfa7
Merge branch 'custom_dataset' of https://github.com/ArshdeepSekhon/Te…
ArshdeepSekhon Nov 24, 2020
7f746d1
add utils for reading from files
ArshdeepSekhon Nov 25, 2020
7d91be2
add support for reading from csv, df, txt
ArshdeepSekhon Nov 25, 2020
7d2f976
fix format errors
ArshdeepSekhon Dec 4, 2020
9222066
update the confusing word"Successes" to "True Positive/Positive"
qiyanjun Dec 4, 2020
5c172b2
update the confusing uses of "Successes" to "True Positive/Positive"
qiyanjun Dec 4, 2020
11d2930
Merge branch 'master' into custom_dataset
ArshdeepSekhon Dec 4, 2020
36c83b3
black,isort formatting
ArshdeepSekhon Dec 4, 2020
f6fb8c5
Update dataset.py
qiyanjun Dec 5, 2020
41c5ef5
fix a wrong typo
qiyanjun Dec 5, 2020
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
Prev Previous commit
Next Next commit
fix output column for custom dataset
  • Loading branch information
ArshdeepSekhon committed Nov 4, 2020
commit 34b02ecf2f7841ca384738d01fc7cd5e9e5d044f
7 changes: 4 additions & 3 deletions textattack/datasets/custom_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def __init__(
# if user hasnt specified an output column or dataset_columns is None, all dataset_columns are
# treated as input_columns
dataset_columns.append(None)
self.output_column = dataset_columns[1]

if (
dataset_columns[1] is not None
and dataset_columns[1] not in self._dataset.column_names
Expand All @@ -100,7 +100,8 @@ def __init__(
raise ValueError(
f"Could not find output column {dataset_columns[1]}. Found keys: {self._dataset.column_names}"
)

self.output_column = dataset_columns[1]
print(self.output_column)
self._i = 0
self.examples = list(self._dataset)

Expand Down Expand Up @@ -143,7 +144,7 @@ def _format_raw_example(self, raw_example):
output = self.label_map[output]
if self.output_scale_factor:
output = output / self.output_scale_factor
return (input_dict, None)
return (input_dict, output)

else:
return (input_dict,)
Expand Down