Dataset Viewer
Auto-converted to Parquet Duplicate
Search is not available for this dataset
image
imagewidth (px)
560
1.4k

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

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

Synthetic Dataset Creation Flow

The notebook follows this structure:

Step Description
0. Setup Imports, seed, output file, and project constants
1. Model + Prompt Contract Defines the dataset creation logic
2. Dataset Schema Defines the 33 required columns
3. Controlled Value Pools Defines allowed categories and values
4. Balanced Generator Creates a balanced and reproducible dataset
5. Safety Rules Applies veterinary safety constraints
6. Quality Check Checks shape, missing values, duplicates, and distributions
7. Logical Validation Confirms that safety rules were followed
8. Save Files Saves CSV, stats file, and README
9. Download Downloads CSV for Hugging Face upload

Final Dataset Summary

Dataset Element Value
Number of rows 11,000
Number of columns 33
Dog cases 5,500
Cat cases 5,500
Missing values 0
Duplicate rows 0
Final CSV file hopepet_synthetic_dataset.csv

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_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

Pet Type Distribution

Pet Age Group Distribution

Pet Age Group Distribution


Controlled Values

The dataset uses controlled value pools instead of fully open random text.

Examples of controlled fields:

Field Examples
pet_type Dog, Cat
pet_age_group Puppy, Kitten, Adult, Senior
problem_category Health, Emergency, Behavior, Training, Anxiety, Nutrition, Grooming, General Care
urgency_level Low, Medium, High, Emergency
recommended_next_step Home 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:

Check Purpose
Shape check Confirms the number of rows and columns
Missing values Confirms that required fields are complete
Duplicate rows Confirms that the dataset does not contain duplicate cases
Value counts Confirms distribution of key categorical features
Logical validation Confirms that safety rules were followed

The final dataset passed the quality checks with:

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:

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.

Downloads last month
60

Space using mayadeeb08/hopepet-ai-synthetic-dataset 1