|
import os |
|
from pathlib import Path |
|
|
|
import streamlit as st |
|
|
|
x = st.slider('Select a value') |
|
st.write(x, 'squared is', x * x) |
|
from huggingface_hub import login |
|
|
|
login(os.getenv('HF_TOKEN')) |
|
|
|
|
|
|
|
|
|
|
|
from transformers import AutoModelForSequenceClassification |
|
from transformers import AutoTokenizer |
|
from transformers import TextClassificationPipeline |
|
|
|
model = AutoModelForSequenceClassification.from_pretrained( |
|
"issai/rembert-sentiment-analysis-polarity-classification-kazakh") |
|
tokenizer = AutoTokenizer.from_pretrained("issai/rembert-sentiment-analysis-polarity-classification-kazakh") |
|
|
|
pipe = TextClassificationPipeline(model=model, tokenizer=tokenizer) |
|
|
|
reviews = ["Бұл бейнефильм маған түк ұнамады.", "Осы кітап қызық сияқты."] |
|
|
|
for review in reviews: |
|
st.write(pipe(review)) |
|
|