File size: 671 Bytes
8fb2bb2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import streamlit as st
import joblib
from transformers import AutoTokenizer, AutoModel
from funcs.sasha_funcs import predict_class
st.title('TG channels classifier')
st.subheader('Model: Bert + LogReg')

model_clf = joblib.load('models/logistic_regression_model.pkl')
tokenizer = AutoTokenizer.from_pretrained("DeepPavlov/rubert-base-cased")
model_bert = AutoModel.from_pretrained("DeepPavlov/rubert-base-cased")


text = st.text_input("Text to classify")

if text:
    st.write(predict_class(text, model_bert, model_clf, tokenizer))

button = st.button('Show 2 components with Umap Decomposition')

if button:
    st.image('images/scatter_of_tg_channels.png', width=500)