Skip to content

Commit b8080f6

Browse files
committed
fix binary labels
1 parent 00c488d commit b8080f6

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/data_loader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def load_data(args):
5252
labels = [label for (text, label) in clean_data]
5353

5454
labels = list(
55-
map(lambda l: {1: 0, 2: 0, 4: 2, 5: 2}[l], labels))
55+
map(lambda l: {1: 0, 2: 0, 4: 1, 5: 1}[l], labels))
5656

5757
else:
5858
labels = list(
@@ -80,7 +80,7 @@ def load_data(args):
8080
print(
8181
f'data loaded successfully with {len(texts)} rows and {number_of_classes} labels')
8282
print('Distribution of the classes', Counter(labels))
83-
83+
8484
sample_weights = get_sample_weights(labels)
8585

8686
return texts, labels, number_of_classes, sample_weights

train.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,6 @@ def run(args, both_cases=False):
368368
parser.add_argument('--group_labels', type=int, default=1, choices=[0, 1])
369369
parser.add_argument('--ignore_center', type=int, default=1, choices=[0, 1])
370370
parser.add_argument('--label_ignored', type=int, default=None)
371-
372371
parser.add_argument('--ratio', type=float, default=1)
373372
parser.add_argument('--balance', type=int, default=0, choices=[0, 1])
374373
parser.add_argument('--use_sampler', type=int,

0 commit comments

Comments
 (0)