aboutsummaryrefslogtreecommitdiff
path: root/backend/microservice/api.py
diff options
context:
space:
mode:
authorSonja Galovic <galovicsonja@gmail.com>2022-03-20 23:39:07 +0100
committerSonja Galovic <galovicsonja@gmail.com>2022-03-20 23:39:07 +0100
commit470442d5b7c8f034f13ed0e8d2aaafe826b40a8c (patch)
tree34336ff754da362ab121a25dcfe137a0ff704913 /backend/microservice/api.py
parentefecf70b6f54560269c3ee8211ea6456c0481e69 (diff)
parentacf5c2a1e1920e158125758efda7b15232f53702 (diff)
Merge branch 'dev' of http://gitlab.pmf.kg.ac.rs/igrannonica/neuronstellar into dev
Diffstat (limited to 'backend/microservice/api.py')
-rw-r--r--backend/microservice/api.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/backend/microservice/api.py b/backend/microservice/api.py
new file mode 100644
index 00000000..b2fb503b
--- /dev/null
+++ b/backend/microservice/api.py
@@ -0,0 +1,28 @@
+from copyreg import constructor
+import flask
+from flask import request, jsonify, render_template
+from sklearn.preprocessing import LabelEncoder
+import tensorflow as tf
+import pandas as pd
+import keras
+import csv
+import json
+import mlservice
+from mlservice import obuka
+
+app = flask.Flask(__name__)
+app.config["DEBUG"] = True
+
+
+@app.route('/', methods = ['GET', 'POST'])
+def index():
+ return render_template('index.html')
+
+@app.route('/data', methods = ['GET', 'POST'])
+def data():
+ if request.method == 'POST':
+ f = request.json['filepath']
+ data = pd.read_csv(f)
+ print(data)
+ return obuka(data,request.json)
+app.run() \ No newline at end of file