shakhovak
commited on
Commit
·
6fb03a0
1
Parent(s):
c78f0d7
updates
Browse files
utils.py
CHANGED
@@ -6,6 +6,7 @@ import pickle
|
|
6 |
import random
|
7 |
from nltk.tokenize import word_tokenize
|
8 |
import string
|
|
|
9 |
|
10 |
|
11 |
def encode(texts, model, intent, contexts=None, do_norm=True):
|
@@ -218,6 +219,7 @@ def read_files_negative(path1, path2):
|
|
218 |
|
219 |
def intent_classification(question, answer, tag_model):
|
220 |
greetings = ["hi", "hello", "greeting", "greetings", "hii", "helo", "hellow"]
|
|
|
221 |
tokens = word_tokenize(answer.lower())
|
222 |
for token in tokens:
|
223 |
if token in greetings:
|
|
|
6 |
import random
|
7 |
from nltk.tokenize import word_tokenize
|
8 |
import string
|
9 |
+
import nltk
|
10 |
|
11 |
|
12 |
def encode(texts, model, intent, contexts=None, do_norm=True):
|
|
|
219 |
|
220 |
def intent_classification(question, answer, tag_model):
|
221 |
greetings = ["hi", "hello", "greeting", "greetings", "hii", "helo", "hellow"]
|
222 |
+
nltk.download("punkt")
|
223 |
tokens = word_tokenize(answer.lower())
|
224 |
for token in tokens:
|
225 |
if token in greetings:
|