Shiro26 commited on
Commit
99886d2
·
1 Parent(s): 48ee910

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -0
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))