Update app.py
Browse files
app.py
CHANGED
@@ -37,7 +37,7 @@ def check_text():
|
|
37 |
print('Validate data')
|
38 |
answer = validate_data(text, model_name, topic)
|
39 |
if answer != '':
|
40 |
-
return jsonify({'
|
41 |
|
42 |
topic = check_topic(topic)
|
43 |
hcRelativeToThreshold, df_sentences = detect_human_text(model_name, topic, text)
|
@@ -74,13 +74,12 @@ def validate_data(text, model_name, topic):
|
|
74 |
|
75 |
def check_topic(topic):
|
76 |
topic_dict = {
|
77 |
-
'
|
78 |
-
'
|
79 |
-
'
|
80 |
-
'
|
81 |
-
'
|
82 |
-
'
|
83 |
-
'War': 'war'
|
84 |
}
|
85 |
|
86 |
return topic_dict[topic]
|
|
|
37 |
print('Validate data')
|
38 |
answer = validate_data(text, model_name, topic)
|
39 |
if answer != '':
|
40 |
+
return jsonify({'error': answer}), 400
|
41 |
|
42 |
topic = check_topic(topic)
|
43 |
hcRelativeToThreshold, df_sentences = detect_human_text(model_name, topic, text)
|
|
|
74 |
|
75 |
def check_topic(topic):
|
76 |
topic_dict = {
|
77 |
+
'empirical': 'empirical',
|
78 |
+
'figures': 'characters',
|
79 |
+
'landmarks': 'locations',
|
80 |
+
'nature': 'nature',
|
81 |
+
'games': 'video_games_series_movies',
|
82 |
+
'wars': 'war'
|
|
|
83 |
}
|
84 |
|
85 |
return topic_dict[topic]
|