Qualitative Feedback Analysis (QFA) API.
Synopsis: a dockerized python API to analyze qualitative feedback.
Powered by open-source language models. Uses Poetry for dependency management.
- Prepare a kobo form as follows:
- add one question of type
text
, whose content will be classified. Example:feedback
. - add up to three cascading select questions of type
select_one
, which determine how the text will be classified. Example:type
,category
,code
. - fill in the possible choices in the
choices
sheet of the form exactly as explained here. - upload and deploy the form.
- add one question of type
Tip
The text will be classified according to the labels
of the choices. A few tips to improve the accuracy of the classification:
- The model cannot possibly know all humanitarian acronyms, so make sure to spell them out. Example: use
Water, Sanitation and Hygiene
instead ofWASH
, orRed Crescent
instead ofRC
. - Avoid using ambiguous labels and be specific. Example: use
distribution of non-food items
anddistribution of cash
instead ofrelief
andcash
. - The more choices you provide, the less accurate the classification will be. Keep the number of choices as low as possible.
- Register a new Kobo REST Service and configure it as follows:
- insert as
Endpoint URL
https://qfa-api.azurewebsites.net/classify-text
- add the following headers under
Custom HTTP Headers
:- under
Name
inserttext-field
and underValue
the name of the text question to be classified. Example:feedback
. - under
Name
insertsource-name
and underValue
justkobo
. - under
Name
insertsource-origin
and underValue
the ID of the form (see where to find it). - under
Name
insertsource-authorization
and underValue
your Kobo token (see how to get one). - under
Name
insertsource-level1
and underValue
the name of the first of the cascading select questions. Example:type
. - under
Name
insertsource-level2
and underValue
the name of the second of the cascading select questions. Example:category
. - under
Name
insertsource-level3
and underValue
the name of the third of the cascading select questions. Example:code
.
- under
- insert as
That's it. Your submissions will be automatically classified in a few seconds. Happy qualitative feedback analysis!
See the docs.
cp example.env .env
and edit the provided ENV-variables accordingly.
pip install poetry
poetry install --no-root
uvicorn main:app --reload
docker compose up --detach