OOSE-AI-Question-Generator is a Python-based tool that leverages OpenAI's new GPT-4o model to generate questions and answers based on a given cheat sheet. This tool is particularly useful for creating study materials or quizzes, in this case used for the Object-Oriented Software Engineering (OOSE) course.
- Loads example questions and a combined cheat sheet from all specified data files.
- Automatically processes all files in the
dataandformatdirectories. - Prompts the user for the number of questions to generate.
- Generates new questions and answers based on the combined cheat sheet.
- Saves the generated questions to output files named based on the format files.
- Supports a graphical user interface (GUI) for a more user-friendly experience.
- Expands input formats to include PDFs and DOCX files, increasing versatility.
- Includes analytics functionality to track question types and difficulty levels, providing insights for refinement.
- Python 3.6 or higher
- An OpenAI API key
- Dependencies for PDF and DOCX processing
- GUI library
- Clone the repository:
git clone https://github.com/turiddu25/OOSE-AI-Question-Generator.git
- Install the required Python packages:
pip install -r requirements.txt
- Set up your OpenAI API key:
- Create an account on the OpenAI website.
- Create an API key in the OpenAI dashboard.
- Add your API key to the
.envfile:OPENAI_API_KEY=YOURKEYHERE
To use the graphical user interface (GUI) for generating questions:
- Run the script:
python question_generator.py
- The GUI will prompt you for the number of questions to generate and allow you to select input files directly.
- Place your data files in the
datadirectory. These files should contain the content you want to generate questions about. - Place your format files in the
formatdirectory. These files should contain example questions that you want to use as a reference. - Run the script:
python generate_questions.py
- Enter the number of questions you want to generate when prompted.
- The script will generate questions based on the combined data from all files in the
datadirectory and save the generated questions in thegenerated_questionsdirectory. The output files will be named based on the format files.
The analytics feature tracks the types of questions generated and their difficulty levels. This data is stored in the analytics directory and can be used to refine the question generation process.
If you have the following files:
data/cheat_sheet1.txtdata/cheat_sheet2.txtformat/example_format1.jsonformat/example_format2.json
Running the script and entering 10 when prompted will generate 10 questions and save them in generated_questions/questions_example_format1.json and generated_questions/questions_example_format2.json.
This project is licensed under the MIT License.