idkash1 commited on
Commit
c14636f
·
verified ·
1 Parent(s): d74e15b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -8
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({'answer': answer}), 400
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
- 'Characters': 'characters',
78
- 'Locations': 'locations',
79
- 'Nature': 'nature',
80
- 'Video games': 'video_games_series_movies',
81
- 'Series': 'video_games_series_movies',
82
- 'Movies': 'video_games_series_movies',
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]