! Note. Currently we are now using Meta's LLaMA 3 to classify questions and summarize transcripts. It is found here
This is a simple API that categorizes and summarizes a given text. The API is built using Flask. Categorization is done using a fine-tuned GEMMA model and summarization is done using a Huggingface T5 model.
Install the required packages using the following command:
pip install -r requirements.txt
Install Gemma by cloning it in the same directory as this repository. The Gemma repository can be found here
git clone https://github.com/google/gemma_pytorch.git
To run the API, use the following command:
python app.py
The API will be running on http://localhost:5002
by default.
curl -X POST -H "Content-Type: application/json" -d '{"question":"What is the square root of 5?"}' http://localhost:5002/categorize
Note: This does better if you include more context (previous sentences) in the question. For example, "Okay, we have learned about the Pythagorean theorem. What is the square root of 5?"
{"response":1}
(signifying this is a level 1 question, according to Costa's levels of questioning)
curl localhost:5002/summarize -X POST -H "Content-Type: application/json" -d '{"text":"The quick brown fox jumps over the lazy dog."}'
{"response":"The quick brown fox jumps over the lazy dog. This is 'a classroom transcript,' where I am to sum up what the teachers are teaching."}
curl localhost:5002/healthcheck
{"status": "ok"}