We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b4d40d4 commit 166b256Copy full SHA for 166b256
05-cnn-pytorch/cnn-activation.py
@@ -48,10 +48,11 @@ def read_dataset(filename):
48
words = words.split(" ")
49
yield (words, [w2i[x] for x in words], int(tag))
50
51
+
52
# Read in the data
-train = list(read_dataset("../data/classes/train.txt"))[:50]
53
+train = list(read_dataset("../data/classes/train.txt"))
54
w2i = defaultdict(lambda: UNK, w2i)
-dev = list(read_dataset("../data/classes/test.txt"))[:10]
55
+dev = list(read_dataset("../data/classes/test.txt"))
56
nwords = len(w2i)
57
ntags = 5
58
@@ -105,6 +106,7 @@ def display_activations(words, activations):
105
106
107
return ngrams
108
109
110
for ITER in range(10):
111
# Perform training
112
random.shuffle(train)
0 commit comments