Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pickle
|
| 2 |
+
import string
|
| 3 |
+
import streamlit as st
|
| 4 |
+
from PIL import Image
|
| 5 |
+
import webbrowser
|
| 6 |
+
|
| 7 |
+
global Lrdetect_Model
|
| 8 |
+
|
| 9 |
+
LrdetectFile = open('model.pckl','rb')
|
| 10 |
+
Lrdetect_Model = pickle.load(LrdetectFile)
|
| 11 |
+
LrdetectFile.close()
|
| 12 |
+
st.title("Language Detection Tool")
|
| 13 |
+
input_test = st.text_input("provide your text input here", 'Hello my name is Vishal Lazrus. ')
|
| 14 |
+
|
| 15 |
+
res = Lrdetect_Model.predict([input_test])
|
| 16 |
+
|
| 17 |
+
button_clicked = st.button("Get Language Name")
|
| 18 |
+
if button_clicked:
|
| 19 |
+
st.text(f'The language "{input_test}" is {res[0]}')
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
st.write(f'This application supports given 17 languages.')
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
#opening the image
|
| 26 |
+
image = Image.open('NLP.png')
|
| 27 |
+
#displaying the image on streamlit app
|
| 28 |
+
st.image(image, caption='Languages')
|