nlp_project_gpt_team / pages /tg_channels_clf.py
Seppukku's picture
initial commit
8fb2bb2
raw
history blame contribute delete
671 Bytes
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)