Spaces:
Sleeping
Sleeping
change text name to comment
Browse files
app.py
CHANGED
|
@@ -21,10 +21,10 @@ app = Flask(__name__)
|
|
| 21 |
def predict():
|
| 22 |
try:
|
| 23 |
data = request.get_json()
|
| 24 |
-
comment = data.get("
|
| 25 |
|
| 26 |
if not comment:
|
| 27 |
-
return jsonify({"error": "Empty
|
| 28 |
|
| 29 |
cleaned_comment = clean_text(comment)
|
| 30 |
comment_vector = vectorizer.transform([cleaned_comment])
|
|
|
|
| 21 |
def predict():
|
| 22 |
try:
|
| 23 |
data = request.get_json()
|
| 24 |
+
comment = data.get("comment", "")
|
| 25 |
|
| 26 |
if not comment:
|
| 27 |
+
return jsonify({"error": "Empty comment cannot be sent."}), 400
|
| 28 |
|
| 29 |
cleaned_comment = clean_text(comment)
|
| 30 |
comment_vector = vectorizer.transform([cleaned_comment])
|