File size: 763 Bytes
6ce9fac
 
 
 
 
 
 
 
6a3e9c9
 
6ce9fac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import streamlit as st
from indexer import FAISS
# from annotated_text import annotated_text
import pymorphy2

morph = pymorphy2.MorphAnalyzer()
indexer_vector_dim = 384
indexer = FAISS(indexer_vector_dim)
indexer.init_index('new_index.index')
indexer.init_vectors('new_vectors.pkl')


def main():
    st.set_page_config(layout="wide")
    st.header('Модель предложения тэгов')

    x = st.text_input(label='Введите запрос')
    if x != '':
        # result = indexer.suggest_tags(x)
        st.write(" / ".join(indexer.suggest_tags(x)))
        # cols = st.beta_columns((1, 1, 1, 1, 1, 1, 1, 1, 1, 1))
        # for i in range(len(result)):
            #     cols[i].subheader(result[i])


if __name__ == '__main__':
    main()