This repository provides a solution for generating detailed and thoughtful questions based on workout plans and evaluating their quality using the **G-Eval** metric. It is designed to assist fitness enthusiasts, trainers, and developers working with structured workout plans in improving the clarity, relevance, and usability of their fitness-related questions.
View Final Report
·
View PPT
·
View Results
- Script:
generate_questions.py
- Description:
- Automatically generates thoughtful questions based on attributes of workout plans, such as title, phase, purpose, duration, and more.
- Utilizes Few-shot + Chain-of-Thought Prompting with OpenAI's GPT-3.5-turbo model for generating specific and context-aware questions.
- Input: JSON file containing workout plans (
data/workout_data.json
). - Output: Generated questions saved in a text file (
outputqns/generated_questions.txt
).
- Script:
test_geval.py
- Description:
- Evaluates the quality of the generated questions using the G-Eval metric.
- The evaluation focuses on correctness, relevance, and alignment with the context of workout plans.
- Results are saved in a CSV file (
results/evaluation_results.csv
) for further analysis.
- Metrics Used:
- Correctness: Ensures the questions are factually accurate and relevant.
project-root/
│
├── data/
│ └── workout_data.json # Input JSON with workout plan details.
│
├── outputqns/
│ └── generated_questions.txt # Text file containing generated questions.
│
├── results/
│ └── evaluation_results.csv # CSV file with evaluation results.
│
├── generate_questions.py # Script for generating workout questions.
├── test_geval.py # Script for evaluating generated questions.
└── README.md # Project documentation.
- Python 3.8+
- OpenAI Package
- DeepEval Package for metrics evaluation
- Pandas for result processing
Install the the required packages using pip:
pip install -r requirements.txt
or
pip install pandas openai deepeval
Ensure that you are having the following environment variable
OPENAI_API_KEY:
API Key for OpenAI GPT Models.
Execute the script generate_questions.py
to generate questions based on the workout data:
python generate_questions.py
- Note: Use
openai==0.28
for this script.
Run the test_geval.py
script to evaluate the generated questions.
- Note: Use Deepeval framework to Run
pip install -U deepeval
deepeval login
- Note: Paste the DeepEval API Key if prompted.
deepeval test run test_geval.py
- Note: Use the above script to run the evaluation file.
- Also, ensure that the latest version of
openai
is installed for this script.
- Ruban Gino Singh Arul Peppin Raj - rubangin@ualberta.ca
- Raja Priya Mariappan - rajapriy@ualberta.ca
- Raju Bhattarai - raju2@ualberta.ca