Welcome to the Heal Tech.AI Django API repository! This API serves as the backend for the Heal Tech.AI web application, providing various AI-powered medical services. It includes endpoints for next word prediction, summarization, and question answering using pretrained language models.
-
Clone this repository:
git clone https://github.com/Aya-Jafar/AI-services-API.git
-
Navigate to the project directory:
cd collegeDjango
-
python -m venv venv
-
Activate python environment
Windows:
source venv/Scripts/activate
MacOs:
source venv/bin/activate
- Install dependencies
pip install -r requirements.txt
- Run Server
python manage.py runserver
This endpoint takes a prompt as input and generates the next word prediction based on the provided prompt using a pretrained language model.
- Endpoint:
/generate/next-word/
- HTTP Method: POST
- Example Usage:
{ "prompt": "Once upon a time" }
- Response
{ "generated_text": "there" }
Takes a long text to summarize
- Endpoint:
/generate/summarize/
- HTTP Method: POST
- Example Usage:
{ "long_text": "Doctor: Good morning! How can I help you today?\nPatient: Hi, doctor. I've been experiencing some chest pain and shortness of breath lately.\nDoctor: I see. When did these symptoms start?\nPatient: It's been about a week now. The chest pain comes and goes, and I feel like I can't take a deep breath sometimes.\nDoctor: Have you noticed any other symptoms, such as coughing or fever?\nPatient: No coughing, but I've been feeling a bit tired and lightheaded.\nDoctor: Alright. Let's do a quick examination. I'll listen to your heart and lungs and take your blood pressure.\nPatient: Sure, doctor.\n[Doctor performs examination]\nDoctor: Your blood pressure is slightly elevated, and I hear some wheezing in your lungs. I'd like to run some tests to rule out any serious conditions. We'll start with an ECG and a chest X-ray.\nPatient: Okay, doctor. Should I be worried?\nDoctor: It's important to investigate further to determine the cause of your symptoms. Let's take one step at a time. I'll also prescribe you some medication to help with the chest pain and shortness of breath in the meantime.\nPatient: Thank you, doctor. I appreciate your help.\nDoctor: You're welcome. Let's get those tests done, and we'll go from there. I'll see you again soon for a follow-up.\n" }
- Response
{ "summarized_text": "Doctor: Good morning! How can I help you today? Patient: Hi, doctor. I've been experiencing some chest pain and shortness of breath lately. Doctor: I see. When did these symptoms start? Patient: It's been about a week now. The chest pain comes and goes, and I feel like I can't take a deep breath sometimes. Doctor: Have you noticed any other symptoms, such as coughing or fever? Patient: No coughing, but I've been feeling a bit tired and lightheaded. Doctor: Alright. Let's do a quick examination. I'll listen to your heart and lungs and take your blood pressure. Patient: Sure, doctor. [Doctor performs examination] Doctor: Your blood" }
Takes a medical question and returns an answer
- Endpoint:
/generate/QA/
- HTTP Method: POST
- Example Usage:
{ "prompt": "What are the symptoms of appendicitis?" }
- Response
{ "generated_text": "the symptoms of appendicitis can vary depending on the location of the infection, but common symptoms include abdominal pain, nausea, vomiting, and fever." }