Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,6 +10,8 @@ model = fasttext.load_model(model_path)
|
|
| 10 |
# Load the FastText model
|
| 11 |
#model = fasttext.FastText(model_path)
|
| 12 |
#model = FastText.load(model_path)
|
|
|
|
|
|
|
| 13 |
|
| 14 |
st.title("_Text classification Using Fastext_")
|
| 15 |
st.header("_write the description inside the box_")
|
|
@@ -32,13 +34,13 @@ def output_pre(output):
|
|
| 32 |
if Predict:
|
| 33 |
output=model.predict(input_des)
|
| 34 |
st.write(output,'111')
|
| 35 |
-
|
| 36 |
st.write(crt_out,'222')
|
| 37 |
|
| 38 |
Diagonis=st.button("Diagonised result :point_down: ",help = "Press it to show result")
|
| 39 |
|
| 40 |
if Diagonis:
|
| 41 |
st.subheader('_Predicted Related meshroot:point_down: ')
|
| 42 |
-
st.write(
|
| 43 |
-
st.write(
|
| 44 |
|
|
|
|
| 10 |
# Load the FastText model
|
| 11 |
#model = fasttext.FastText(model_path)
|
| 12 |
#model = FastText.load(model_path)
|
| 13 |
+
if 'ctr_out' not in st.session_state:
|
| 14 |
+
st.session_state['ctr_out'] = ['','']
|
| 15 |
|
| 16 |
st.title("_Text classification Using Fastext_")
|
| 17 |
st.header("_write the description inside the box_")
|
|
|
|
| 34 |
if Predict:
|
| 35 |
output=model.predict(input_des)
|
| 36 |
st.write(output,'111')
|
| 37 |
+
st.session_state['ctr_out'] =output_pre(output)
|
| 38 |
st.write(crt_out,'222')
|
| 39 |
|
| 40 |
Diagonis=st.button("Diagonised result :point_down: ",help = "Press it to show result")
|
| 41 |
|
| 42 |
if Diagonis:
|
| 43 |
st.subheader('_Predicted Related meshroot:point_down: ')
|
| 44 |
+
st.write(st.session_state['ctr_out'][0])
|
| 45 |
+
st.write(st.session_state['ctr_out'][1])
|
| 46 |
|