This repository contains a Python script that implements a Question Answering (QA) system. It is powered by OpenAI's GPT-3 and PyPDF2 for PDF manipulation.
The script reads a PDF file, extracts the text, and uses this extracted text as a knowledge base for the GPT-3 model. Users can then interact with the model by asking questions related to the contents of the PDF file. The script leverages the text-davinci-003
engine from OpenAI for generating responses.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
You need Python 3.x and the following packages installed:
openai
PyPDF2
-
Clone the repository:
git clone https://github.com/atef1995/OpenAI-GPT3-PDF-Question-Answering.git
-
Navigate into the directory:
cd OpenAI-GPT3-PDF-Question-Answering
-
Install the required packages:
pip install -r requirements.txt
-
Place your PDF file in the same directory as the script.
-
Run the script and interact with the model by asking questions in the command line:
python script.py
While the script is running, enter your questions one at a time in the console. To end the question session, simply input a single period character (.
) and press Enter.
Enter your question (enter '.' on a new line to finish):
Who is the author of the document?