Commit
·
0ae7dcb
1
Parent(s):
504dd89
Update app.py
Browse files
app.py
CHANGED
@@ -56,11 +56,9 @@ if form_button:
|
|
56 |
else:
|
57 |
model = load_w2v('models/stihi_ru_word2vec.bin')
|
58 |
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
# st.error("The word you entered is not present in the model")
|
63 |
-
# st.stop()
|
64 |
|
65 |
try:
|
66 |
restrict_vocab = int(restrict_vocab.strip())
|
|
|
56 |
else:
|
57 |
model = load_w2v('models/stihi_ru_word2vec.bin')
|
58 |
|
59 |
+
if '_'.join((target_word, target_word_pos)) not in model.vocab:
|
60 |
+
st.error("The word you entered is not present in the model")
|
61 |
+
st.stop()
|
|
|
|
|
62 |
|
63 |
try:
|
64 |
restrict_vocab = int(restrict_vocab.strip())
|