2021-12-03 17:58:48 +01:00

41 lines
1.0 KiB
Python

def get_features(request_form):
count_checkboxs = 0
for _in in request_form:
if _in[0:3] in 'checkbox':
count_checkboxs+=1
features = ''
count_caixas = 0
for _in in request_form:
if _in[0:3] in 'caixa':
count_caixas += 1
features += request_form[_in] + ' '
if count_caixas == count_checkboxs:
break
stripped = features.strip()
splited = stripped.split()
features = list(map(float, splited))
return features
def get_title(scenario):
if scenario == "1":
title = "Visited Onion URLs"
elif scenario == '2':
title = "Categorised Onion URLs"
elif scenario =="3":
title = "Annotated Onion URLs"
elif scenario =="4":
title = "Onion Page Excerpts"
elif scenario == "stats":
title = "Statistical Graphs"
elif scenario == "predictions":
title = "Prediction Model Graphs"
elif scenario == "search":
title="Searching the Archive"
else:
title = "Datasets"
return title