Spaces:
Sleeping
Sleeping
Fix a nameerror
Browse files
app.py
CHANGED
|
@@ -8,8 +8,8 @@ with open("tokenizer.pckl", "rb") as file:
|
|
| 8 |
tokenizer = pickle.load(file)
|
| 9 |
|
| 10 |
def classify(text: str, response: str):
|
| 11 |
-
question = list(tokenizer.texts_to_sequences([
|
| 12 |
-
answer = list(tokenizer.texts_to_sequences([
|
| 13 |
arr = np.array([(list(question)+[0,]*l1)[:l1]+(list(answer)+[0,]*l2)[:l2],])
|
| 14 |
prediction = model.predict(arr)[0][0]
|
| 15 |
if prediction > 0.9:
|
|
|
|
| 8 |
tokenizer = pickle.load(file)
|
| 9 |
|
| 10 |
def classify(text: str, response: str):
|
| 11 |
+
question = list(tokenizer.texts_to_sequences([text.lower(),])[0])
|
| 12 |
+
answer = list(tokenizer.texts_to_sequences([response.lower(),])[0])
|
| 13 |
arr = np.array([(list(question)+[0,]*l1)[:l1]+(list(answer)+[0,]*l2)[:l2],])
|
| 14 |
prediction = model.predict(arr)[0][0]
|
| 15 |
if prediction > 0.9:
|