STI AI
Overview
The Helfie STI Prediction Model utilizes advanced machine learning techniques, specifically xgboost classifiers, to provide predictions for sexually transmitted infections (STIs). This API caters to both male and female predictions based on a detailed symptom assessment.
Base URL
The base URLs for the Respiratory AI API are
- PROD:
https://api.prod.helfie.ai
. - DEV:
https://api-dev.helfie.ai
.
API Endpoints
STI Prediction Endpoint
- Endpoint: /sti/api/predict
- Method: POST
- Description: This endpoint provides predictions for sexually transmitted infections (STIs) for both males and females using trained machine learning models.
Request Parameters:
- body (json): JSON object containing the data for prediction. The structure differs for male and female, capturing specific STI related symptoms, conditions, and other relevant details.
- user_id (text): The unique user ID for tracking and validation.
- api_key (text): A valid API key for authentication and access control.
Example Request for Female
curl --location '${BASE_URL}/sti/api/predict' \
--header 'Content-Type: application/json' \
--header 'api-key: ••••••' \
--request POST \
--data-raw '{
{
"body": {
"female_data": {
"symptom_presency_f": 2,
"symptoms_type_f": {
"itch": 2,
"rash": 1,
"spots": 1,
"lumps": 2,
"blisters": 2,
"no_symptoms": 2
},
"symptoms_location_f": {
"around_bottom_or_anus": 2,
"groin_creases": 2,
"pubic_hair_area": 2,
"on_the_vulva": 2,
"inside_vagina": 1
},
"wart_condition_one_f": "A bit like this",
"molluscum_condition_f": "A bit like this",
"wart_condition_two_f": "Nothing like this",
"sore_condition_one_f": "A bit like this",
"sore_condition_two_f": "Nothing like this",
"tinea_cruris_condition_f": "Exactly like this",
"ppp_condition_f": "Not sure",
"sore_pain_f": {
"very_painful": 1,
"a_bit_painful": 2,
"not_painful_at_all": 2
},
"discharge_symptom_one_f": {
"discharge": 1,
"smell": 1,
"no_symptoms": 2
},
"discharge_f": {
"thick": 2,
"thin": 1,
"no_symptoms": 2
},
"discharge_itch_f": 2,
"pain_location_f": {
"pelvis_or_lower_part_of_tummy": 1,
"vulva": 2,
"inside_vagina": 2,
"groin_creases": 2,
"around_bottom_or_anus": 2,
"pubic_hair_area": 2,
"no_pain": 2
},
"pain_severity_f": {
"mild": 1,
"moderate": 2,
"severe": 2,
"unbearable": 2
},
"bleeding_symptoms_f": {
"bleeding_during_sex": 2,
"bleeding_between_periods": 1,
"pain_during_sex": 1,
"no_symptoms": 2
},
"pain_location_during_sex_f": {
"pelvis": 1,
"vagina": 2
},
"urine_symptoms_f": {
"burning": 2,
"urge": 1,
"blood": 1,
"feverish": 2,
"no_symptoms": 2
}
},
"mandatory_data": {
"sex_with_sti_person":2,
"sex": 0,
"sex_with_gender": {
"male": 4,
"female": 0
},
"condoms": 1,
"sex_overseas": 1
}
},
"gender": "female",
"duration": 120,
"user_id": "22be54d0-c888-4b7c-a69b-59fd1bbef048"
}
}'
Example Request for Male
curl --location '${BASE_URL}/sti/api/predict' \
--header 'Content-Type: application/json' \
--header 'api-key: ••••••' \
--request POST \
--data-raw '{
{
"body": {
"male_data": {
"symptom_presency": 2,
"symptoms_type": {
"itch": 2,
"rash": 2,
"spots": 2,
"lumps": 1,
"blisters": 1,
"no_symptoms": 2
},
"symptoms_location": {
"anus": 2,
"groin": 2,
"glans": 1,
"shaft": 2,
"testicles": 2
},
"wart_condition_one": "No Response",
"wart_condition_two": "A bit like this",
"balanitis_condition": "Nothing like this",
"molluscum_condition": "Nothing like this",
"syphilis_condition_one": "A bit like this",
"sore_condition_one": "Nothing like this",
"sore_condition_two": "Exactly like this",
"tinea_cruris_condition": "A bit like this",
"ppp_condition": "A bit like this",
"fordyce_condition": "Not sure",
"sores_pain": {
"very_painful": 1,
"a_bit_painful": 2,
"not_painful_at_all": 2
},
"penial_symptoms": {
"pain": 2,
"itch": 2,
"discharge": 3,
"no_symptoms": 1
},
"urine_symptoms": {
"burning": 2,
"urge": 2,
"blood": 2,
"feverish": 1,
"no_symptoms": 2
},
"discharge_description": {
"thick": 2,
"thin": 1
},
"pain_severity": {
"mild": 2,
"moderate": 1,
"severe": 2,
"unbearable": 2
}
},
"mandatory_data": {
"sex_with_sti_person":2,
"sex": 1,
"sex_with_gender": {
"male": 0,
"female": 4
},
"condoms": 1,
"sex_overseas": 1
}
},
"gender": "male",
"duration": 1,
"user_id": "22be54d0-c888-4b7c-a69b-59fd1bbef048"
}
}'
Example Response for female:
{
"response": {
"assessment_risk": "high",
"female_bv": {
"name": "female_bv",
"probability": 0.18920594825533782,
"decision": 0
},
"female_uti": {
"name": "female_uti",
"probability": 0.5885130381584169,
"decision": 0
},
"female_herpes": {
"name": "female_herpes",
"probability": 0.3317366366870497,
"decision": 0
},
"female_pid": {
"name": "female_pid",
"probability": 0.9043740655825689,
"decision": 1
},
"female_candidiasis": {
"name": "female_candidiasis",
"probability": 0.3262268327470922,
"decision": 0
},
"female_warts": {
"name": "female_warts",
"probability": 0.5533005886400066,
"decision": 0
}
}
}
Example Response for Male:
{
"response": {
"assessment_risk": "high",
"male_balanitis": {
"name": "male_balanitis",
"probability": 0.14461565089097048,
"decision": 0
},
"male_warts": {
"name": "male_warts",
"probability": 0.19954327793082685,
"decision": 0
},
"male_molluscum": {
"name": "male_molluscum",
"probability": 0.19405968428472892,
"decision": 0
},
"male_syphilis": {
"name": "male_syphilis",
"probability": 0.5764325489853954,
"decision": 0
},
"male_herpes": {
"name": "male_herpes",
"probability": 0.6769591989751953,
"decision": 0
},
"male_urethral_gono": {
"name": "male_urthral_gono",
"probability": 0.1770420197581879,
"decision": 0
},
"male_urethritis": {
"name": "male_urethritis",
"probability": 0.1887730385370902,
"decision": 0
}
}
}
Response Fields:
response
(dict): A dictionary containing the prediction results for the STIs.assessment_risk
(str): Any of high, medium, low based on results.name
(str): Name of the STI.probability
(float): Probability of the STI.decision
(int): Decision based on the probability. 1 if present, 0 if absent.
Check API Health
- Endpoint:
/sti/api/health
- Method:
GET
- Description: This endpoint allows a user to check the health status of the API for possible outages.
Request Parameters:
None
Example Request:
curl --location '${BASE_URL}/sti/api/health' \
--header 'Content-Type: application/json' \
--data '''
Example Response:
{
"status": "STI API healthy"
}
Response Fields:
status
(str): Status of the API.