Skip to content

Commit

Permalink
fix binary labels
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedbesbes committed Nov 1, 2019
1 parent 00c488d commit b8080f6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/data_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def load_data(args):
labels = [label for (text, label) in clean_data]

labels = list(
map(lambda l: {1: 0, 2: 0, 4: 2, 5: 2}[l], labels))
map(lambda l: {1: 0, 2: 0, 4: 1, 5: 1}[l], labels))

else:
labels = list(
Expand Down Expand Up @@ -80,7 +80,7 @@ def load_data(args):
print(
f'data loaded successfully with {len(texts)} rows and {number_of_classes} labels')
print('Distribution of the classes', Counter(labels))

sample_weights = get_sample_weights(labels)

return texts, labels, number_of_classes, sample_weights
Expand Down
1 change: 0 additions & 1 deletion train.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,6 @@ def run(args, both_cases=False):
parser.add_argument('--group_labels', type=int, default=1, choices=[0, 1])
parser.add_argument('--ignore_center', type=int, default=1, choices=[0, 1])
parser.add_argument('--label_ignored', type=int, default=None)

parser.add_argument('--ratio', type=float, default=1)
parser.add_argument('--balance', type=int, default=0, choices=[0, 1])
parser.add_argument('--use_sampler', type=int,
Expand Down

0 comments on commit b8080f6

Please sign in to comment.