Commit cd91adfb authored by Kavindu Randika's avatar Kavindu Randika

Merge branch 'dev-it18141252' into 'master'

symptoms API

See merge request !6
parents 211b4ac9 ca4cddbe
...@@ -14,12 +14,12 @@ def load_data_json(path=''): ...@@ -14,12 +14,12 @@ def load_data_json(path=''):
fp.close() fp.close()
return data return data
@prediction.get('/api/predictions/symptoms') @prediction.post('/api/predictions/symptoms')
async def predict_symptoms(): async def predict_symptoms(symptoms: List[int]):
try: try:
data = load_data_json('../config/data.json') data = load_data_json('./data.json')
threshold = 0.5 threshold = 0.5
input = set([79,77]) input = set(symptoms)
output = [] output = []
for key in data.keys(): for key in data.keys():
numbers = [int(i) for i in key.split(',') if int(i) != 0] numbers = [int(i) for i in key.split(',') if int(i) != 0]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment