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

Update pages/imdb.py

Browse files
Files changed (1) hide show
  1. pages/imdb.py +11 -7
pages/imdb.py CHANGED
@@ -14,13 +14,6 @@ from data.rnn_preprocessing import (
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))
@@ -32,6 +25,17 @@ for word, i in vocab_to_int.items():
32
  except KeyError:
33
  pass
34
 
 
 
 
 
 
 
 
 
 
 
 
35
  # Load TF-IDF model
36
  tfidf_model = pickle.load(open('models/modeltfidf.sav', 'rb'))
37
 
 
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))
 
25
  except KeyError:
26
  pass
27
 
28
+
29
+
30
+ # Load LSTM model
31
+ embedding_layer32 = nn.Embedding.from_pretrained(torch.FloatTensor(embedding_matrix))
32
+ VOCAB_SIZE = len(vocab_to_int) + 1 # add 1 for the padding token
33
+ HIDDEN_DIM = 64
34
+ SEQ_LEN = 32
35
+
36
+
37
+
38
+
39
  # Load TF-IDF model
40
  tfidf_model = pickle.load(open('models/modeltfidf.sav', 'rb'))
41