From 57433d572ef13d769b7b6376d58f6964a5837864 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Fri, 19 Oct 2018 16:28:47 +0800 Subject: [PATCH] Update data_utils.py --- NER_IDCNN_CRF/data_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NER_IDCNN_CRF/data_utils.py b/NER_IDCNN_CRF/data_utils.py index 71d7c21..a7fe708 100644 --- a/NER_IDCNN_CRF/data_utils.py +++ b/NER_IDCNN_CRF/data_utils.py @@ -290,7 +290,7 @@ def sort_and_pad(self, data, batch_size): sorted_data = sorted(data, key=lambda x: len(x[0])) batch_data = list() for i in range(num_batch): - batch_data.append(self.pad_data(sorted_data[i*batch_size : (i+1)*batch_size])) + batch_data.append(self.pad_data(sorted_data[int(i*batch_size) : int((i+1)*batch_size)])) return batch_data @staticmethod