Skip to content

Commit cf8c09e

Browse files
committed
Added presentation, report; Cleaned
1 parent 56c384c commit cf8c09e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1431
-85
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@
1717

1818
*.tar.*
1919
*.zip
20+
*.gz*
21+
22+
*-env*

code/includes/config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
clustering = True
3232

33-
model_name = "k-match-lstm"
33+
model_name = "weighted-k-match-lstm"
3434

3535
data_dir = "data/squad/"
3636
train_dir = "model/" + model_name + "/"

code/includes/utils.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44

55
class squad_dataset(object):
6-
def __init__(self, question_file, context_file, answer_file, label_file, root="", batch_size=1):
6+
def __init__(self, question_file, context_file, answer_file, label_file, root="", batch_size=1, split=True):
77
self.question_file = root + question_file
88
self.context_file = root + context_file
99
self.answer_file = root + answer_file
@@ -12,12 +12,14 @@ def __init__(self, question_file, context_file, answer_file, label_file, root=""
1212
self.batch_size = batch_size
1313

1414
self.length = None
15+
self.split = split
1516

1617
def __iter_file(self, filename):
1718
with open(filename) as f:
1819
for line in f:
19-
line = line.strip().split(" ")
20-
line = map(lambda tok: int(tok), line)
20+
if self.split:
21+
line = line.strip().split(" ")
22+
line = map(lambda tok: int(tok), line)
2123
yield line
2224

2325
def __iter__(self):

0 commit comments

Comments
 (0)