harshithakr commited on
Commit
d56b313
·
1 Parent(s): 55a257c

Update topics_extraction.py

Browse files
Files changed (1) hide show
  1. topics_extraction.py +3 -10
topics_extraction.py CHANGED
@@ -1,5 +1,3 @@
1
- from flask import Flask
2
- from flask_restful import reqparse, abort, Api, Resource, request
3
  import numpy as np
4
  import pandas as pd
5
  from urllib.parse import unquote
@@ -30,7 +28,7 @@ evType_stop = set(nltk.corpus.stopwords.words('english'))
30
 
31
  # read configuration file
32
  config = configparser.ConfigParser()
33
- config.read('C:/Users/harsh/Documents/ML-APIs_origi/myproject.ini')
34
 
35
  # initialize flask object
36
  app = Flask(__name__)
@@ -285,9 +283,7 @@ def getTags(text):
285
  return tags_list
286
 
287
 
288
- @app.route('/classify/',methods=['POST'])
289
- def classify():
290
- user_query = request.json.get('text')
291
  user_query = unquote(unquote(user_query))
292
  eventdict = {}
293
  eventdict['tags'] = []
@@ -299,7 +295,4 @@ def classify():
299
  return eventdict
300
  except (ValueError, TypeError, AttributeError) as e:
301
  #print(e)
302
- return eventdict
303
-
304
- if __name__ == '__main__':
305
- app.run(host='0.0.0.0')
 
 
 
1
  import numpy as np
2
  import pandas as pd
3
  from urllib.parse import unquote
 
28
 
29
  # read configuration file
30
  config = configparser.ConfigParser()
31
+ config.read('myproject.ini')
32
 
33
  # initialize flask object
34
  app = Flask(__name__)
 
283
  return tags_list
284
 
285
 
286
+ def classify(user_query):
 
 
287
  user_query = unquote(unquote(user_query))
288
  eventdict = {}
289
  eventdict['tags'] = []
 
295
  return eventdict
296
  except (ValueError, TypeError, AttributeError) as e:
297
  #print(e)
298
+ return eventdict