From b8080f681384ae0aaf50066fa6666b839e52882a Mon Sep 17 00:00:00 2001 From: Ahmed Besbes Date: Fri, 1 Nov 2019 15:18:04 +0100 Subject: [PATCH] fix binary labels --- src/data_loader.py | 4 ++-- train.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/data_loader.py b/src/data_loader.py index 5fadfc1..b51caec 100644 --- a/src/data_loader.py +++ b/src/data_loader.py @@ -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( @@ -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 diff --git a/train.py b/train.py index cc87c6a..fbb5548 100644 --- a/train.py +++ b/train.py @@ -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,