Update app.py
Browse files
app.py
CHANGED
|
@@ -15,7 +15,7 @@ def predict_sentiment(text):
|
|
| 15 |
input_ids = tf.constant(bert_tokenizer.encode(text, add_special_tokens=True))[None, :] # Menambahkan token khusus [CLS] dan [SEP]
|
| 16 |
logits = bert_model(input_ids)[0]
|
| 17 |
probabilities = tf.nn.softmax(logits, axis=1)
|
| 18 |
-
|
| 19 |
return sentiment_score, sentiment_label
|
| 20 |
|
| 21 |
# Judul aplikasi
|
|
|
|
| 15 |
input_ids = tf.constant(bert_tokenizer.encode(text, add_special_tokens=True))[None, :] # Menambahkan token khusus [CLS] dan [SEP]
|
| 16 |
logits = bert_model(input_ids)[0]
|
| 17 |
probabilities = tf.nn.softmax(logits, axis=1)
|
| 18 |
+
sentiment_score, sentiment_label = probabilities.numpy()[0]
|
| 19 |
return sentiment_score, sentiment_label
|
| 20 |
|
| 21 |
# Judul aplikasi
|