File size: 443 Bytes
f2b6412 3437ef6 f2b6412 3437ef6 f2b6412 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
import streamlit as st
from pymorphy2 import MorphAnalyzer
from gensim.models import KeyedVectors
@st.cache_resource(show_spinner="Loading the collocation search model")
def load_w2v(model_path):
_w2v_model = KeyedVectors.load_word2vec_format(model_path, binary=True)
return _w2v_model
@st.cache_resource(show_spinner="Loading the morphological analyzer")
def load_morph():
_morph = MorphAnalyzer(lang='ru')
return _morph
|