Spaces:
Build error
Build error
Download app.py from ulugbeksalaev/Uzbek-Text-Classification: direct link, hf CLI and curl.
- Browser
- Download file 498 Bytes
-
https://huggingface.co/spaces/ulugbeksalaev/Uzbek-Text-Classification/resolve/main/app.py
- Command line
-
hf download hf://spaces/ulugbeksalaev/Uzbek-Text-Classification/app.py
-
curl -L -o app.py https://huggingface.co/spaces/ulugbeksalaev/Uzbek-Text-Classification/resolve/main/app.py
498 Bytes
| import streamlit as st | |
| import pickle | |
| st.title('Uzbek Text Classification') | |
| text = st.text_area('Enter Uzbek Text') | |
| if text: | |
| with open('trained_model100.pkl', 'rb') as file: | |
| model = pickle.load(file) | |
| with open('vectorizer.pkl', 'rb') as file: | |
| vectorizer = pickle.load(file) | |
| text_vectorized = vectorizer.transform([text]) | |
| predicted_genre = model.predict(text_vectorized) | |
| st.subheader(str(predicted_genre).replace("'", '').replace('[', ''). replace(']', '')) |