vasevooo commited on
Commit
5ca6507
·
1 Parent(s): b618451

Update pages/imdb.py

Browse files
Files changed (1) hide show
  1. pages/imdb.py +7 -5
pages/imdb.py CHANGED
@@ -14,6 +14,13 @@ from data.rnn_preprocessing import (
14
  preprocess_single_string
15
  )
16
 
 
 
 
 
 
 
 
17
  # Load Word2Vec model
18
  wv = Word2Vec.load('models/word2vec32.model')
19
  embedding_matrix = np.zeros((VOCAB_SIZE, EMBEDDING_DIM))
@@ -28,11 +35,6 @@ for word, i in vocab_to_int.items():
28
  # Load TF-IDF model
29
  tfidf_model = pickle.load(open('models/modeltfidf.sav', 'rb'))
30
 
31
- # Load LSTM model
32
- embedding_layer32 = nn.Embedding.from_pretrained(torch.FloatTensor(embedding_matrix))
33
- VOCAB_SIZE = len(vocab_to_int) + 1 # add 1 for the padding token
34
- HIDDEN_DIM = 64
35
- SEQ_LEN = 32
36
 
37
 
38
  class LSTMClassifierBi32(nn.Module):
 
14
  preprocess_single_string
15
  )
16
 
17
+ # Load LSTM model
18
+ embedding_layer32 = nn.Embedding.from_pretrained(torch.FloatTensor(embedding_matrix))
19
+ VOCAB_SIZE = len(vocab_to_int) + 1 # add 1 for the padding token
20
+ HIDDEN_DIM = 64
21
+ SEQ_LEN = 32
22
+
23
+
24
  # Load Word2Vec model
25
  wv = Word2Vec.load('models/word2vec32.model')
26
  embedding_matrix = np.zeros((VOCAB_SIZE, EMBEDDING_DIM))
 
35
  # Load TF-IDF model
36
  tfidf_model = pickle.load(open('models/modeltfidf.sav', 'rb'))
37
 
 
 
 
 
 
38
 
39
 
40
  class LSTMClassifierBi32(nn.Module):