'mint autosave'
Browse files
app.py
CHANGED
@@ -13,11 +13,13 @@ def analyze(input, model):
|
|
13 |
#text insert
|
14 |
input = st.text_area("insert text to be analyzed", value="Nice to see you today.", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, placeholder=None, disabled=False, label_visibility="visible")
|
15 |
model_name = st.text_input("choose a transformer model", value="")
|
|
|
|
|
|
|
|
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
classifier = pipeline('sentiment-analysis', model=model, tokenizer=tokenizer)
|
21 |
|
22 |
|
23 |
if st.button('Analyze'):
|
|
|
13 |
#text insert
|
14 |
input = st.text_area("insert text to be analyzed", value="Nice to see you today.", height=None, max_chars=None, key=None, help=None, on_change=None, args=None, kwargs=None, placeholder=None, disabled=False, label_visibility="visible")
|
15 |
model_name = st.text_input("choose a transformer model", value="")
|
16 |
+
if model_name:
|
17 |
+
model = TFAutoModelForSequenceClassification.from_pretrained(model_name)
|
18 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
19 |
+
classifier = pipeline('sentiment-analysis', model=model, tokenizer=tokenizer)
|
20 |
|
21 |
+
else:
|
22 |
+
classifier = pipeline('sentiment-analysis')
|
|
|
|
|
23 |
|
24 |
|
25 |
if st.button('Analyze'):
|