mayadeeb08/hopepet-ai-synthetic-dataset
πΎ HOPEPET AI β Synthetic Dataset Creation Notebook 1: Part 1 Only This README explains Part 1 of the HOPEPET AI final project: creating the synthetic dataset. Notebook: 01_HOPEPET_Part1_Synthetic_Data_Creation_Assignment_Style.ipynb Main output file: hopepet_synthetic_dataset.csv Purpose of Part 1 The goal of this notebook is to create a synthetic dataset for an AI-based pet-care assistant. HOPEPET AI helps dog and cat owners receive responsibleβ¦ See the full description on the dataset page: https://huggingface.co/datasets/mayadeeb08/hopepet-ai-synthetic-dataset.
πΎ HOPEPET AI β Synthetic Dataset Creation
Notebook 1: Part 1 Only
This README explains Part 1 of the HOPEPET AI final project: creating the synthetic dataset.
Notebook:
01_HOPEPET_Part1_Synthetic_Data_Creation_Assignment_Style.ipynbMain output file:
hopepet_synthetic_dataset.csvPurpose of Part 1
The goal of this notebook is to create a synthetic dataset for an AI-based pet-care assistant.
HOPEPET AI helps dog and cat owners receive responsible first-step guidance when they notice a pet-related problem, symptom, or behavior change.
The dataset created in this notebook is later used for:
- Exploratory Data Analysis
- Feature engineering
- Embedding creation
- Semantic retrieval
- Recommendation
- Text generation
- Gradio app deployment
The dataset is fully synthetic. It does not include real pet owners, real pets, real veterinary records, or private personal information.
Why Synthetic Data Was Used
Real veterinary records are sensitive, private, and not available for this academic project. Therefore, we created a synthetic dataset that simulates realistic dog and cat care cases.
Synthetic data is useful here because it allows the project to include:
- A large number of examples
- Different pet types and age groups
- Common and urgent symptoms
- Safety-sensitive edge cases
- Structured labels such as
problem_categoryandurgency_level - Natural-language fields for semantic retrieval
The goal was not to create real medical data, but to create a controlled dataset that can support a Data Science and AI pipeline.
Model + Prompt-Based Dataset Design
The assignment requires a model-and-prompt-based dataset creation process.
In this project, the prompt is used as a dataset creation contract. It defines:
- The role of the synthetic data generator
- The required fields
- The allowed categories
- The pet-care context
- Safety rules
- The expected output style
- The need to avoid diagnosis, medication, and dosage recommendations
The final rows are then generated programmatically using Python code. This makes the process more controlled, reproducible, and easier to validate than directly asking a model to output 11,000 CSV rows.
The prompt was connected to:
PROMPT_MODEL_ID = "google/flan-t5-base"However, the final dataset was not copied directly from a model-generated CSV. The prompt defined the structure and logic, and the Python generator created the final balanced dataset.
Dataset Creation Flow
<p align="center"> <img src="diagramdatasetcreation.png" alt="Synthetic Dataset Creation Flow" width="900"> </p>
The notebook follows this structure:
Final Dataset Summary
Dataset Columns
The dataset includes 33 columns:
case_id
pet_type
pet_age_years
pet_age_group
pet_sex
neutered_status
breed_size
vaccination_status
environment
medical_background
recent_change
main_symptom
secondary_symptoms
symptom_duration
appetite_status
water_intake
energy_level
pain_signs
emergency_signs
previous_occurrence
problem_category
urgency_level
safety_disclaimer_level
recommended_next_step
triage_reason
safe_first_steps
user_goal
user_question
short_recommendation
detailed_advice
vet_warning
keywords
retrieval_textThe most important column for the later recommendation system is retrieval_text.
This column combines the relevant details of each case into one searchable text field, including pet type, age group, symptoms, urgency level, recommended next step, and veterinary warning.
Balanced Dataset Design
The generator was designed to avoid an overly random or overly skewed dataset.
Main balance targets:
- 5,500 dog cases
- 5,500 cat cases
- More balanced age groups than a fully random generator
- A reasonable spread across problem categories
- A reasonable spread across urgency levels
- Enough edge cases for safety-sensitive retrieval
Pet Type Distribution
<p align="center"> <img src="edapettype_distribution.png" alt="Pet Type Distribution" width="760"> </p>
Pet Age Group Distribution
<p align="center"> <img src="edapetage_groups.png" alt="Pet Age Group Distribution" width="760"> </p>
Controlled Values
The dataset uses controlled value pools instead of fully open random text.
Examples of controlled fields:
Using controlled values prevents inconsistent labels and makes the dataset easier to analyze in EDA.
Safety Rules
The generator includes safety rules that protect the logic of the dataset.
Important rules:
- If emergency signs are reported, the urgency level must be Emergency.
- If the pet is a cat, the age group cannot be
Puppy. - If the pet is a dog, the age group cannot be
Kitten. - If a senior cat is not eating, the urgency should be High or Emergency.
- If a cat cannot urinate, the urgency must be Emergency.
- Training and behavior issues without emergency signs are usually Low or Medium.
- The dataset does not include diagnosis, medication advice, or dosage recommendations.
Edge Cases
The dataset includes common cases and high-risk edge cases.
Examples of edge cases:
- Senior cat not eating
- Dog with difficulty breathing
- Cat cannot urinate
- Dog ate chocolate
- Puppy with repeated vomiting
- Pet with seizure
- Dog limping after injury
- Cat hiding and not drinking
- Pet after surgery acting weak
- Suspected poisoning
Including edge cases is important because a responsible pet-care assistant should not only handle simple everyday cases. It should also handle situations where the safest recommendation is immediate veterinary care.
Quality Checks
After generating the dataset, the notebook performs quality checks:
The final dataset passed the quality checks with:
Rows: 11,000
Columns: 33
Missing values: 0
Duplicate rows: 0Logical Validation Checks
The notebook validates the main rules after generation.
The validation checks confirm that:
- Emergency signs always lead to Emergency urgency.
- Cats are never assigned the Puppy age group.
- Dogs are never assigned the Kitten age group.
- Recommended next step matches urgency level.
- Cat urinary blockage cases are Emergency.
- Senior cats that are not eating are High or Emergency.
This step is important because synthetic data can look correct on the surface but still contain unrealistic or unsafe combinations.
Main Output
The final dataset is saved as:
hopepet_synthetic_dataset.csvThis file is uploaded to the Hugging Face Dataset Repository and used as the starting point for Notebook 2.
Part 1 Summary
In this notebook, we created the HOPEPET AI synthetic dataset using a prompt-defined design and Python code.
The final dataset includes 11,000 fictional pet-care cases for dogs and cats. Each case includes structured fields, symptoms, urgency level, recommended next step, safe first steps, veterinary warning, user question, and retrieval text.
The dataset is balanced, reproducible, validated, and ready for EDA, embeddings, semantic retrieval, generation, and Gradio deployment.
