Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers import pipeline, BertTokenizer
|
| 2 |
+
import streamlit as st
|
| 3 |
+
|
| 4 |
+
model = pipeline("text-classification", model="/home/user/app/MendoBERT/", tokenizer="indolem/indobert-base-uncased")
|
| 5 |
+
basemodel = pipeline("text-classification", model="/home/user/app/IndoLEM/", tokenizer="indolem/indobert-base-uncased")
|
| 6 |
+
|
| 7 |
+
if 'options' not in st.session_state:
|
| 8 |
+
st.session_state['options'] = ""
|
| 9 |
+
|
| 10 |
+
with placeholder:
|
| 11 |
+
text = st.text_area('Enter some text: ', key = 'options')
|
| 12 |
+
|
| 13 |
+
if text:
|
| 14 |
+
st.write(model(text))
|
| 15 |
+
st.write("\n")
|
| 16 |
+
st.write(basemodel(text))
|