Spaces:
Sleeping
Sleeping
Download src/streamlit_app.py from oguztoy/LanguageDetection: direct link, hf CLI and curl.
- Browser
- Download file 461 Bytes
-
https://huggingface.co/spaces/oguztoy/LanguageDetection/resolve/main/src/streamlit_app.py
- Command line
-
hf download hf://spaces/oguztoy/LanguageDetection/src/streamlit_app.py
-
curl -L -o streamlit_app.py https://huggingface.co/spaces/oguztoy/LanguageDetection/resolve/main/src/streamlit_app.py
461 Bytes
| import streamlit as st | |
| import joblib | |
| st.title("Language Detection") | |
| def load_model(): | |
| return joblib.load('src/language_pipeline.pkl') | |
| pipeline = load_model() | |
| text = st.text_area("Enter text to detect language:", height=100) | |
| if st.button("Detect Language"): | |
| if text: | |
| prediction = pipeline.predict([text])[0] | |
| st.success(f"Detected Language: **{prediction}**") | |
| else: | |
| st.warning("Please enter some text") |