Spaces:
Runtime error
Runtime error
Commit
·
dc40079
1
Parent(s):
710f00d
Add prediction functionality
Browse files
app.py
CHANGED
@@ -8,8 +8,9 @@ os.system("cp -r ./nltk_data/ /home/user/nltk_data")
|
|
8 |
def analyze(text):
|
9 |
model = CustomModel()
|
10 |
text = preprocess_pipeline(text)
|
11 |
-
|
12 |
-
|
|
|
13 |
|
14 |
app = gr.Interface(fn=analyze, inputs="text", outputs="text")
|
15 |
|
|
|
8 |
def analyze(text):
|
9 |
model = CustomModel()
|
10 |
text = preprocess_pipeline(text)
|
11 |
+
vector = vectorizer([text])
|
12 |
+
pred = model.predict(vector)
|
13 |
+
return pred
|
14 |
|
15 |
app = gr.Interface(fn=analyze, inputs="text", outputs="text")
|
16 |
|