CoolFace
Datasetpublic

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.

sourceHugging Facemitupdated 2mo agoView on Hugging Face
0likes64downloads
Dataset Card

🐾 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:

text
01_HOPEPET_Part1_Synthetic_Data_Creation_Assignment_Style.ipynb

Main output file:

text
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 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_category and urgency_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:

python
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:

StepDescription
0. SetupImports, seed, output file, and project constants
1. Model + Prompt ContractDefines the dataset creation logic
2. Dataset SchemaDefines the 33 required columns
3. Controlled Value PoolsDefines allowed categories and values
4. Balanced GeneratorCreates a balanced and reproducible dataset
5. Safety RulesApplies veterinary safety constraints
6. Quality CheckChecks shape, missing values, duplicates, and distributions
7. Logical ValidationConfirms that safety rules were followed
8. Save FilesSaves CSV, stats file, and README
9. DownloadDownloads CSV for Hugging Face upload

Final Dataset Summary

Dataset ElementValue
Number of rows11,000
Number of columns33
Dog cases5,500
Cat cases5,500
Missing values0
Duplicate rows0
Final CSV filehopepet_synthetic_dataset.csv

Dataset Columns

The dataset includes 33 columns:

text
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_text

The 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:

FieldExamples
pet_typeDog, Cat
pet_age_groupPuppy, Kitten, Adult, Senior
problem_categoryHealth, Emergency, Behavior, Training, Anxiety, Nutrition, Grooming, General Care
urgency_levelLow, Medium, High, Emergency
recommended_next_stepHome monitoring, monitor closely, same-day vet consultation, immediate veterinary care

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:

CheckPurpose
Shape checkConfirms the number of rows and columns
Missing valuesConfirms that required fields are complete
Duplicate rowsConfirms that the dataset does not contain duplicate cases
Value countsConfirms distribution of key categorical features
Logical validationConfirms that safety rules were followed

The final dataset passed the quality checks with:

text
Rows: 11,000
Columns: 33
Missing values: 0
Duplicate rows: 0

Logical 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:

text
hopepet_synthetic_dataset.csv

This 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.