Update app.py
Browse files
app.py
CHANGED
|
@@ -120,8 +120,8 @@ def compute_features(text):
|
|
| 120 |
# ---------------- 生成解釋 ----------------
|
| 121 |
def explain_prediction(text):
|
| 122 |
# 文字向量化
|
| 123 |
-
seq = vectorizer([text])
|
| 124 |
-
seq = tf.keras.utils.pad_sequences(seq.
|
| 125 |
|
| 126 |
# 統計特徵
|
| 127 |
feat = compute_features(text)
|
|
|
|
| 120 |
# ---------------- 生成解釋 ----------------
|
| 121 |
def explain_prediction(text):
|
| 122 |
# 文字向量化
|
| 123 |
+
seq = vectorizer.transform([text])
|
| 124 |
+
seq = tf.keras.utils.pad_sequences(seq.toarray(), maxlen=50, padding='pre')
|
| 125 |
|
| 126 |
# 統計特徵
|
| 127 |
feat = compute_features(text)
|