BOLI is a Next.js
app aimed towards the development of a frontend web-application for Machine Learning model inference.
This project is designed and developed as part of the Masters Thesis Submission for MSc Cyber Security from Royal Holloway, University of London.
BOLI provides two interfaces: /predict
and /feedback
. Users can utilise the /predict
interface to access the Machine Learning model. Users can also provide feedback through the /feedback
interface.
Note
You must have node.js
installed on your system before proceeding with the below steps.
Steps:
- Clone the repo and change directory
git clone https://github.com/hate-detection/boli-app.git
cd boli-app
- Install dependencies with
npm install
- Run the server in development mode
npm run dev
A major security configuration involves the Rotating Token Mechanism for the /api/predict
and /api/feedback
endpoints. Ideally, the /api/feedback
endpoint can only be called after getting a successful response from /api/predict
.
To implement this logic, the /api/predict
endpoint sends a hashed value with a secret token, the text and the predicted values. The /api/feedback
endpoint parses the incoming request for the hashed value and generates its own hash. If the incoming hash and the newly generated hash match, /api/feedback
accepts the request. Moreover, one hashed value can only be used once.
The hash is computed using the following formula:
Here,
-
$Secret_{token}$ (generated in the previous function) -
$text$ (entered by users) -
$prediction$ (generated by the ML Model)
This app is currently not accepting contributions. However, you are free to fork and modify the app according to your use cases. If you find a problem or have a feature recommendation, create an issue.