This application processes a medical report in PDF format and uses the GPT-4 engine to answer a series of questions based on the report.
The application relies on the following Python libraries:
- pdfminer
- openai
- pandas
- json
- os
- re
Additionally, Docker needs to be installed on your machine to build and run the application inside a Docker container.
This class performs the following:
- Initializes the GPT model and processes the provided medical report.
- Extracts text from the PDF report along with its font details.
- Converts the extracted PDF content to a dictionary format.
- Initializes the GPT model with API credentials.
- Uses the GPT model to answer a given question based on the report.
Extracts text characters from a PDF along with their font name and size.
Processes the extracted text and groups it into sections based on identified header fonts. This results in a dictionary where each section of the PDF is represented as a key-value pair.
Initializes the GPT model using API credentials from a provided JSON configuration.
Uses the GPT model to answer a given question based on the medical report. The question is provided in a predefined JSON format.
- Ensure you have Docker installed on your machine.
- Place your medical report in the root directory and name it
medical-record.pdf
. - Place the
task.json
configuration in the root directory. - List your questions in
questions.txt
, placing each question on a new line.
To build and run the Docker image:
docker build -t gpt-nurse .
docker run gpt-nurse