Dataset Preview
Duplicate
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed because of a cast error
Error code:   DatasetGenerationCastError
Exception:    DatasetGenerationCastError
Message:      An error occurred while generating the dataset

All the data files must have the same columns, but at some point there are 5 new columns ({'database_analysis', 'processing_stats', 'total_qa_pairs', 'generation_timestamp', 'processing_time_seconds'}) and 11 missing columns ({'category', 'completion', 'guide_number', 'prompt', 'chemical_name', 'chemical_id', 'timestamp', 'scenario_based', 'data_source', 'quality_score', 'operational_context'}).

This happened while the json dataset builder was generating data using

hf://datasets/Johnohhh1/erg_chemical_dataset/training_data_enhanced_metadata.json (at revision a80629584db5b2e8faf4ca931b4ce84632a27c1e)

Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1831, in _prepare_split_single
                  writer.write_table(table)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py", line 644, in write_table
                  pa_table = table_cast(pa_table, self._schema)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2272, in table_cast
                  return cast_table_to_schema(table, schema)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2218, in cast_table_to_schema
                  raise CastError(
              datasets.table.CastError: Couldn't cast
              processing_stats: struct<chemicals_processed: int64, total_questions: int64, high_quality_questions: int64, scenario_based_questions: int64, agent_contributions: struct<identity_erg: int64, hazard_assessment: int64, tactical_ops: int64, medical_response: int64, evacuation: int64, marplot: int64>>
                child 0, chemicals_processed: int64
                child 1, total_questions: int64
                child 2, high_quality_questions: int64
                child 3, scenario_based_questions: int64
                child 4, agent_contributions: struct<identity_erg: int64, hazard_assessment: int64, tactical_ops: int64, medical_response: int64, evacuation: int64, marplot: int64>
                    child 0, identity_erg: int64
                    child 1, hazard_assessment: int64
                    child 2, tactical_ops: int64
                    child 3, medical_response: int64
                    child 4, evacuation: int64
                    child 5, marplot: int64
              database_analysis: struct<total_chemicals: int64, guide_distribution: struct<126: int64, 119: int64, 116: int64, 122: int64, 125: int64, 115: int64, 120: int64, 118: int64, 124: int64, 117: int64, 128: int64, 123: int64, 129: int64, 132: int64, 127: int64, 130: int64, 155: int64, 131: int64, 139: int64, 133: int64, 170: int64, 113: int64, 135: int64, 136: int64, 138: int64, 140: int64, 143: int64, 141: int64, 144: int64, 151: int64, 153: int64, 157: int64, 154: int64, 152: int64, 134: int64, 156: int64, 160: int64, 159: int64, 137: int64, 171: int64, 158: int64, 172: int64, 163: int64, 161: int64, 162: int64, 166: int64, 146: int64, 145: int64, 148: int64, 14
              ...
              9, 133: int64
                    child 20, 170: int64
                    child 21, 113: int64
                    child 22, 135: int64
                    child 23, 136: int64
                    child 24, 138: int64
                    child 25, 140: int64
                    child 26, 143: int64
                    child 27, 141: int64
                    child 28, 144: int64
                    child 29, 151: int64
                    child 30, 153: int64
                    child 31, 157: int64
                    child 32, 154: int64
                    child 33, 152: int64
                    child 34, 134: int64
                    child 35, 156: int64
                    child 36, 160: int64
                    child 37, 159: int64
                    child 38, 137: int64
                    child 39, 171: int64
                    child 40, 158: int64
                    child 41, 172: int64
                    child 42, 163: int64
                    child 43, 161: int64
                    child 44, 162: int64
                    child 45, 166: int64
                    child 46, 146: int64
                    child 47, 145: int64
                    child 48, 148: int64
                    child 49, 142: int64
                    child 50, 147: int64
                    child 51, 149: int64
                    child 52, 150: int64
                    child 53, 165: int64
                    child 54, 173: int64
                    child 55, 174: int64
                    child 56, 168: int64
                    child 57, 169: int64
                    child 58, 164: int64
                child 2, data_coverage: struct<fire_hazards: int64, health_effects: int64, extinguishing_agents: int64, ppe_requirements: int64, spill_containment: int64>
                    child 0, fire_hazards: int64
                    child 1, health_effects: int64
                    child 2, extinguishing_agents: int64
                    child 3, ppe_requirements: int64
                    child 4, spill_containment: int64
              generation_timestamp: string
              processing_time_seconds: double
              total_qa_pairs: int64
              to
              {'prompt': Value('string'), 'completion': Value('string'), 'category': Value('string'), 'quality_score': Value('float64'), 'scenario_based': Value('bool'), 'operational_context': Value('string'), 'chemical_id': Value('string'), 'chemical_name': Value('string'), 'guide_number': Value('string'), 'timestamp': Value('string'), 'data_source': Value('string')}
              because column names don't match
              
              During handling of the above exception, another exception occurred:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1456, in compute_config_parquet_and_info_response
                  parquet_operations = convert_to_parquet(builder)
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1055, in convert_to_parquet
                  builder.download_and_prepare(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 894, in download_and_prepare
                  self._download_and_prepare(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 970, in _download_and_prepare
                  self._prepare_split(split_generator, **prepare_split_kwargs)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1702, in _prepare_split
                  for job_id, done, content in self._prepare_split_single(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1833, in _prepare_split_single
                  raise DatasetGenerationCastError.from_cast_error(
              datasets.exceptions.DatasetGenerationCastError: An error occurred while generating the dataset
              
              All the data files must have the same columns, but at some point there are 5 new columns ({'database_analysis', 'processing_stats', 'total_qa_pairs', 'generation_timestamp', 'processing_time_seconds'}) and 11 missing columns ({'category', 'completion', 'guide_number', 'prompt', 'chemical_name', 'chemical_id', 'timestamp', 'scenario_based', 'data_source', 'quality_score', 'operational_context'}).
              
              This happened while the json dataset builder was generating data using
              
              hf://datasets/Johnohhh1/erg_chemical_dataset/training_data_enhanced_metadata.json (at revision a80629584db5b2e8faf4ca931b4ce84632a27c1e)
              
              Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

prompt
string
completion
string
category
string
quality_score
float64
scenario_based
bool
operational_context
string
chemical_id
string
chemical_name
string
guide_number
string
timestamp
string
data_source
string
What's the ERG guide for Triazine Pesticide, Liquid, Toxic?
ERG Guide 151
identity_lookup
0.9
false
lookup
2998
Triazine pesticide, liquid, toxic
151
2025-09-25T18:58:24.065207
ERG2024
ERG number for Triazine Pesticide, Liquid, Toxic
Guide 151
identity_lookup
0.85
false
dispatch
2998
Triazine pesticide, liquid, toxic
151
2025-09-25T18:58:24.065207
ERG2024
We have a spill involving Triazine Pesticide, Liquid, Toxic. What ERG guide do we use?
Use ERG Guide 151 for Triazine Pesticide, Liquid, Toxic
scenario_lookup
0.95
true
incident_response
2998
Triazine pesticide, liquid, toxic
151
2025-09-25T18:58:24.065207
ERG2024
Dispatch is asking for the guide number on Triazine Pesticide, Liquid, Toxic
ERG 151
communication
0.9
true
dispatch_communication
2998
Triazine pesticide, liquid, toxic
151
2025-09-25T18:58:24.065207
ERG2024
Chemical ID 2998 corresponds to what substance?
Triazine Pesticide, Liquid, Toxic
id_lookup
0.8
false
database_lookup
2998
Triazine pesticide, liquid, toxic
151
2025-09-25T18:58:24.065207
ERG2024
What is UN 2998?
Triazine Pesticide, Liquid, Toxic
un_lookup
0.85
false
shipping_identification
2998
Triazine pesticide, liquid, toxic
151
2025-09-25T18:58:24.065207
ERG2024
What's another name for triazine pesticide, liquid, toxic?
Triazine Pesticide, Liquid, Toxic
synonym_lookup
0.7
false
identification
2998
Triazine pesticide, liquid, toxic
151
2025-09-25T18:58:24.065207
ERG2024
What extinguishing agents can be used on Triazine Pesticide, Liquid, Toxic fires?
Dry chemical, CO2, Water spray, Foam
firefighting_agents
0.9
false
firefighting
2998
Triazine pesticide, liquid, toxic
151
2025-09-25T18:58:24.065207
ERG2024
We have a Triazine Pesticide, Liquid, Toxic fire. What do we use to extinguish it?
Use: Dry chemical, CO2, Water spray, Foam
firefighting_scenario
0.95
true
fire_suppression
2998
Triazine pesticide, liquid, toxic
151
2025-09-25T18:58:24.065207
ERG2024
Engine company asking what to use on Triazine Pesticide, Liquid, Toxic fire
Dry chemical, CO2, Water spray, Foam
firefighting_tactical
0.92
true
tactical_communication
2998
Triazine pesticide, liquid, toxic
151
2025-09-25T18:58:24.065207
ERG2024
What decontamination is needed for Triazine Pesticide, Liquid, Toxic exposure?
Use copious water irrigation. Remove contaminated clothing. Avoid cross-contamination.
decontamination
0.9
false
decontamination_procedure
2998
Triazine pesticide, liquid, toxic
151
2025-09-25T18:58:24.065207
ERG2024
Decon team asking about Triazine Pesticide, Liquid, Toxic patient treatment
Priority: copious water irrigation. Full PPE required for decon personnel. Isolate runoff.
decon_scenario
0.92
true
decontamination_operations
2998
Triazine pesticide, liquid, toxic
151
2025-09-25T18:58:24.065207
ERG2024
What's the initial evacuation distance for Triazine Pesticide, Liquid, Toxic?
Initial evacuation: 50m in all directions
evacuation_distance
0.9
false
evacuation_planning
2998
Triazine pesticide, liquid, toxic
151
2025-09-25T18:58:24.065207
ERG2024
Large spill evacuation distance for Triazine Pesticide, Liquid, Toxic?
Large spill evacuation: 300m downwind
large_spill_evacuation
0.9
false
major_incident_planning
2998
Triazine pesticide, liquid, toxic
151
2025-09-25T18:58:24.065207
ERG2024
IC needs evacuation zones for Triazine Pesticide, Liquid, Toxic incident
Recommend 50m initial perimeter, 300m for large spills downwind
evacuation_scenario
0.95
true
incident_command
2998
Triazine pesticide, liquid, toxic
151
2025-09-25T18:58:24.065207
ERG2024
How quickly do we need to establish evacuation zones for Triazine Pesticide, Liquid, Toxic?
Establish initial isolation perimeter immediately. Expand to protective action distances within 15-30 minutes based on spill size and weather.
evacuation_timing
0.88
false
time_critical_decisions
2998
Triazine pesticide, liquid, toxic
151
2025-09-25T18:58:24.065207
ERG2024
What factors affect evacuation distances for Triazine Pesticide, Liquid, Toxic?
Wind direction and speed, spill size, temperature, terrain, and population density all affect evacuation zone size and shape.
evacuation_factors
0.85
false
evacuation_planning
2998
Triazine pesticide, liquid, toxic
151
2025-09-25T18:58:24.065207
ERG2024
What weather factors affect Triazine Pesticide, Liquid, Toxic dispersion modeling?
Wind speed/direction, atmospheric stability, temperature inversions, precipitation, and humidity all significantly affect plume behavior and modeling accuracy.
weather_factors
0.85
false
meteorological_assessment
2998
Triazine pesticide, liquid, toxic
151
2025-09-25T18:58:24.065207
ERG2024
MARPLOT shows Triazine Pesticide, Liquid, Toxic plume toward populated area. Recommendations?
Verify wind data accuracy, consider atmospheric stability changes, and evaluate need for expanded evacuation zones or sheltering. Monitor weather forecasts for wind shifts.
plume_threat_assessment
0.92
true
threat_assessment
2998
Triazine pesticide, liquid, toxic
151
2025-09-25T18:58:24.065207
ERG2024
How often should we update MARPLOT models for Triazine Pesticide, Liquid, Toxic incidents?
Update models every 15-30 minutes or when weather conditions change significantly. Continuous monitoring during active releases.
model_update_frequency
0.88
false
continuous_assessment
2998
Triazine pesticide, liquid, toxic
151
2025-09-25T18:58:24.065207
ERG2024
MARPLOT showing Triazine Pesticide, Liquid, Toxic plume dissipation. When is area safe?
Area considered safe when concentrations drop below AEGL-1 or equivalent exposure limits AND atmospheric conditions remain stable. Confirm with air monitoring.
safe_reentry
0.9
true
reentry_decisions
2998
Triazine pesticide, liquid, toxic
151
2025-09-25T18:58:24.065207
ERG2024
What's the ERG guide for Bipyridilium Pesticide, Liquid,?
ERG Guide 131
identity_lookup
0.9
false
lookup
3015
Bipyridilium pesticide, liquid,
131
2025-09-25T18:58:24.065207
ERG2024
ERG number for Bipyridilium Pesticide, Liquid,
Guide 131
identity_lookup
0.85
false
dispatch
3015
Bipyridilium pesticide, liquid,
131
2025-09-25T18:58:24.065207
ERG2024
We have a spill involving Bipyridilium Pesticide, Liquid,. What ERG guide do we use?
Use ERG Guide 131 for Bipyridilium Pesticide, Liquid,
scenario_lookup
0.95
true
incident_response
3015
Bipyridilium pesticide, liquid,
131
2025-09-25T18:58:24.065207
ERG2024
Dispatch is asking for the guide number on Bipyridilium Pesticide, Liquid,
ERG 131
communication
0.9
true
dispatch_communication
3015
Bipyridilium pesticide, liquid,
131
2025-09-25T18:58:24.065207
ERG2024
Chemical ID 3015 corresponds to what substance?
Bipyridilium Pesticide, Liquid,
id_lookup
0.8
false
database_lookup
3015
Bipyridilium pesticide, liquid,
131
2025-09-25T18:58:24.065207
ERG2024
What is UN 3015?
Bipyridilium Pesticide, Liquid,
un_lookup
0.85
false
shipping_identification
3015
Bipyridilium pesticide, liquid,
131
2025-09-25T18:58:24.065207
ERG2024
What's another name for bipyridilium pesticide, liquid,?
Bipyridilium Pesticide, Liquid,
synonym_lookup
0.7
false
identification
3015
Bipyridilium pesticide, liquid,
131
2025-09-25T18:58:24.065207
ERG2024
What extinguishing agents can be used on Bipyridilium Pesticide, Liquid, fires?
Dry chemical, CO2, Water spray, Foam
firefighting_agents
0.9
false
firefighting
3015
Bipyridilium pesticide, liquid,
131
2025-09-25T18:58:24.065207
ERG2024
We have a Bipyridilium Pesticide, Liquid, fire. What do we use to extinguish it?
Use: Dry chemical, CO2, Water spray, Foam
firefighting_scenario
0.95
true
fire_suppression
3015
Bipyridilium pesticide, liquid,
131
2025-09-25T18:58:24.065207
ERG2024
Engine company asking what to use on Bipyridilium Pesticide, Liquid, fire
Dry chemical, CO2, Water spray, Foam
firefighting_tactical
0.92
true
tactical_communication
3015
Bipyridilium pesticide, liquid,
131
2025-09-25T18:58:24.065207
ERG2024
How do we contain a Bipyridilium Pesticide, Liquid, spill?
Stop leak if safe to do so; Use water spray to reduce vapors; Prevent entry into waterways/sewers
spill_containment
0.9
false
spill_response
3015
Bipyridilium pesticide, liquid,
131
2025-09-25T18:58:24.065207
ERG2024
We have a Bipyridilium Pesticide, Liquid, leak. Containment procedures?
Containment: Stop leak if safe to do so; Use water spray to reduce vapors; Prevent entry into waterways/sewers
spill_scenario
0.95
true
leak_response
3015
Bipyridilium pesticide, liquid,
131
2025-09-25T18:58:24.065207
ERG2024
HazMat team requesting containment strategy for Bipyridilium Pesticide, Liquid,
Stop leak if safe to do so; Use water spray to reduce vapors; Prevent entry into waterways/sewers
containment_tactical
0.92
true
hazmat_operations
3015
Bipyridilium pesticide, liquid,
131
2025-09-25T18:58:24.065207
ERG2024
Does Bipyridilium Pesticide, Liquid, require vapor control measures?
Yes, use water spray to reduce vapors and control vapor cloud
vapor_control
0.9
false
atmospheric_protection
3015
Bipyridilium pesticide, liquid,
131
2025-09-25T18:58:24.065207
ERG2024
What decontamination is needed for Bipyridilium Pesticide, Liquid, exposure?
Use copious water irrigation. Remove contaminated clothing. Avoid cross-contamination.
decontamination
0.9
false
decontamination_procedure
3015
Bipyridilium pesticide, liquid,
131
2025-09-25T18:58:24.065207
ERG2024
Decon team asking about Bipyridilium Pesticide, Liquid, patient treatment
Priority: copious water irrigation. Full PPE required for decon personnel. Isolate runoff.
decon_scenario
0.92
true
decontamination_operations
3015
Bipyridilium pesticide, liquid,
131
2025-09-25T18:58:24.065207
ERG2024
Mass casualty incident with Bipyridilium Pesticide, Liquid,. Medical priorities?
Establish decontamination corridor, triage exposed vs. non-exposed, coordinate multiple hospitals, request additional medical resources.
mass_casualty
0.95
true
mass_casualty_response
3015
Bipyridilium pesticide, liquid,
131
2025-09-25T18:58:24.065207
ERG2024
How many ambulances needed for Bipyridilium Pesticide, Liquid, exposure incident?
Request minimum 1:3 ambulance to patient ratio for exposed victims. Consider helicopter transport for severe cases.
resource_planning
0.88
true
medical_resource_planning
3015
Bipyridilium pesticide, liquid,
131
2025-09-25T18:58:24.065207
ERG2024
What's the initial evacuation distance for Bipyridilium Pesticide, Liquid,?
Initial evacuation: 100m in all directions
evacuation_distance
0.9
false
evacuation_planning
3015
Bipyridilium pesticide, liquid,
131
2025-09-25T18:58:24.065207
ERG2024
Large spill evacuation distance for Bipyridilium Pesticide, Liquid,?
Large spill evacuation: 600m downwind
large_spill_evacuation
0.9
false
major_incident_planning
3015
Bipyridilium pesticide, liquid,
131
2025-09-25T18:58:24.065207
ERG2024
IC needs evacuation zones for Bipyridilium Pesticide, Liquid, incident
Recommend 100m initial perimeter, 600m for large spills downwind
evacuation_scenario
0.95
true
incident_command
3015
Bipyridilium pesticide, liquid,
131
2025-09-25T18:58:24.065207
ERG2024
Should we evacuate or shelter-in-place for Bipyridilium Pesticide, Liquid,?
Evacuation is preferred for this highly toxic material. Shelter-in-place only if evacuation is not feasible.
protective_action_decision
0.95
false
protective_action_planning
3015
Bipyridilium pesticide, liquid,
131
2025-09-25T18:58:24.065207
ERG2024
Emergency manager asking about protective actions for Bipyridilium Pesticide, Liquid,
Recommend evacuation due to high toxicity. Consider shelter-in-place only for areas where evacuation cannot be completed safely.
protective_action_consultation
0.92
true
emergency_management
3015
Bipyridilium pesticide, liquid,
131
2025-09-25T18:58:24.065207
ERG2024
How quickly do we need to establish evacuation zones for Bipyridilium Pesticide, Liquid,?
Establish initial isolation perimeter immediately. Expand to protective action distances within 15-30 minutes based on spill size and weather.
evacuation_timing
0.88
false
time_critical_decisions
3015
Bipyridilium pesticide, liquid,
131
2025-09-25T18:58:24.065207
ERG2024
What factors affect evacuation distances for Bipyridilium Pesticide, Liquid,?
Wind direction and speed, spill size, temperature, terrain, and population density all affect evacuation zone size and shape.
evacuation_factors
0.85
false
evacuation_planning
3015
Bipyridilium pesticide, liquid,
131
2025-09-25T18:58:24.065207
ERG2024
What MARPLOT parameters do we need for Bipyridilium Pesticide, Liquid,?
MARPLOT inputs: Heavy vapor (>1.0), check ERG 131 for specific gravity and boiling point data. Model as ground-hugging vapor cloud.
marplot_parameters
0.9
false
atmospheric_modeling
3015
Bipyridilium pesticide, liquid,
131
2025-09-25T18:58:24.065207
ERG2024
How does Bipyridilium Pesticide, Liquid, behave in atmospheric modeling?
Heavy vapors stay close to ground, follow terrain features, and concentrate in low-lying areas. Use dense gas dispersion models.
vapor_behavior
0.88
false
plume_modeling
3015
Bipyridilium pesticide, liquid,
131
2025-09-25T18:58:24.065207
ERG2024
What weather factors affect Bipyridilium Pesticide, Liquid, dispersion modeling?
Wind speed/direction, atmospheric stability, temperature inversions, precipitation, and humidity all significantly affect plume behavior and modeling accuracy.
weather_factors
0.85
false
meteorological_assessment
3015
Bipyridilium pesticide, liquid,
131
2025-09-25T18:58:24.065207
ERG2024
MARPLOT shows Bipyridilium Pesticide, Liquid, plume toward populated area. Recommendations?
Verify wind data accuracy, consider atmospheric stability changes, and evaluate need for expanded evacuation zones or sheltering. Monitor weather forecasts for wind shifts.
plume_threat_assessment
0.92
true
threat_assessment
3015
Bipyridilium pesticide, liquid,
131
2025-09-25T18:58:24.065207
ERG2024
How often should we update MARPLOT models for Bipyridilium Pesticide, Liquid, incidents?
Update models every 15-30 minutes or when weather conditions change significantly. Continuous monitoring during active releases.
model_update_frequency
0.88
false
continuous_assessment
3015
Bipyridilium pesticide, liquid,
131
2025-09-25T18:58:24.065207
ERG2024
MARPLOT showing Bipyridilium Pesticide, Liquid, plume dissipation. When is area safe?
Area considered safe when concentrations drop below AEGL-1 or equivalent exposure limits AND atmospheric conditions remain stable. Confirm with air monitoring.
safe_reentry
0.9
true
reentry_decisions
3015
Bipyridilium pesticide, liquid,
131
2025-09-25T18:58:24.065207
ERG2024
What's the ERG guide for Phenyl Urea Pesticides, Liquid, Toxic, Flammable?
ERG Guide 151
identity_lookup
0.9
false
lookup
3002
Phenyl urea pesticides, liquid, toxic, flammable
151
2025-09-25T18:58:24.065207
ERG2024
ERG number for Phenyl Urea Pesticides, Liquid, Toxic, Flammable
Guide 151
identity_lookup
0.85
false
dispatch
3002
Phenyl urea pesticides, liquid, toxic, flammable
151
2025-09-25T18:58:24.065207
ERG2024
We have a spill involving Phenyl Urea Pesticides, Liquid, Toxic, Flammable. What ERG guide do we use?
Use ERG Guide 151 for Phenyl Urea Pesticides, Liquid, Toxic, Flammable
scenario_lookup
0.95
true
incident_response
3002
Phenyl urea pesticides, liquid, toxic, flammable
151
2025-09-25T18:58:24.065207
ERG2024
Dispatch is asking for the guide number on Phenyl Urea Pesticides, Liquid, Toxic, Flammable
ERG 151
communication
0.9
true
dispatch_communication
3002
Phenyl urea pesticides, liquid, toxic, flammable
151
2025-09-25T18:58:24.065207
ERG2024
Chemical ID 3002 corresponds to what substance?
Phenyl Urea Pesticides, Liquid, Toxic, Flammable
id_lookup
0.8
false
database_lookup
3002
Phenyl urea pesticides, liquid, toxic, flammable
151
2025-09-25T18:58:24.065207
ERG2024
What is UN 3002?
Phenyl Urea Pesticides, Liquid, Toxic, Flammable
un_lookup
0.85
false
shipping_identification
3002
Phenyl urea pesticides, liquid, toxic, flammable
151
2025-09-25T18:58:24.065207
ERG2024
What's another name for phenyl urea pesticides, liquid, toxic, flammable?
Phenyl Urea Pesticides, Liquid, Toxic, Flammable
synonym_lookup
0.7
false
identification
3002
Phenyl urea pesticides, liquid, toxic, flammable
151
2025-09-25T18:58:24.065207
ERG2024
What extinguishing agents can be used on Phenyl Urea Pesticides, Liquid, Toxic, Flammable fires?
Dry chemical, CO2, Water spray, Foam
firefighting_agents
0.9
false
firefighting
3002
Phenyl urea pesticides, liquid, toxic, flammable
151
2025-09-25T18:58:24.065207
ERG2024
We have a Phenyl Urea Pesticides, Liquid, Toxic, Flammable fire. What do we use to extinguish it?
Use: Dry chemical, CO2, Water spray, Foam
firefighting_scenario
0.95
true
fire_suppression
3002
Phenyl urea pesticides, liquid, toxic, flammable
151
2025-09-25T18:58:24.065207
ERG2024
Engine company asking what to use on Phenyl Urea Pesticides, Liquid, Toxic, Flammable fire
Dry chemical, CO2, Water spray, Foam
firefighting_tactical
0.92
true
tactical_communication
3002
Phenyl urea pesticides, liquid, toxic, flammable
151
2025-09-25T18:58:24.065207
ERG2024
What decontamination is needed for Phenyl Urea Pesticides, Liquid, Toxic, Flammable exposure?
Use copious water irrigation. Remove contaminated clothing. Avoid cross-contamination.
decontamination
0.9
false
decontamination_procedure
3002
Phenyl urea pesticides, liquid, toxic, flammable
151
2025-09-25T18:58:24.065207
ERG2024
Decon team asking about Phenyl Urea Pesticides, Liquid, Toxic, Flammable patient treatment
Priority: copious water irrigation. Full PPE required for decon personnel. Isolate runoff.
decon_scenario
0.92
true
decontamination_operations
3002
Phenyl urea pesticides, liquid, toxic, flammable
151
2025-09-25T18:58:24.065207
ERG2024
What's the initial evacuation distance for Phenyl Urea Pesticides, Liquid, Toxic, Flammable?
Initial evacuation: 50m in all directions
evacuation_distance
0.9
false
evacuation_planning
3002
Phenyl urea pesticides, liquid, toxic, flammable
151
2025-09-25T18:58:24.065207
ERG2024
Large spill evacuation distance for Phenyl Urea Pesticides, Liquid, Toxic, Flammable?
Large spill evacuation: 300m downwind
large_spill_evacuation
0.9
false
major_incident_planning
3002
Phenyl urea pesticides, liquid, toxic, flammable
151
2025-09-25T18:58:24.065207
ERG2024
IC needs evacuation zones for Phenyl Urea Pesticides, Liquid, Toxic, Flammable incident
Recommend 50m initial perimeter, 300m for large spills downwind
evacuation_scenario
0.95
true
incident_command
3002
Phenyl urea pesticides, liquid, toxic, flammable
151
2025-09-25T18:58:24.065207
ERG2024
How quickly do we need to establish evacuation zones for Phenyl Urea Pesticides, Liquid, Toxic, Flammable?
Establish initial isolation perimeter immediately. Expand to protective action distances within 15-30 minutes based on spill size and weather.
evacuation_timing
0.88
false
time_critical_decisions
3002
Phenyl urea pesticides, liquid, toxic, flammable
151
2025-09-25T18:58:24.065207
ERG2024
What factors affect evacuation distances for Phenyl Urea Pesticides, Liquid, Toxic, Flammable?
Wind direction and speed, spill size, temperature, terrain, and population density all affect evacuation zone size and shape.
evacuation_factors
0.85
false
evacuation_planning
3002
Phenyl urea pesticides, liquid, toxic, flammable
151
2025-09-25T18:58:24.065207
ERG2024
What weather factors affect Phenyl Urea Pesticides, Liquid, Toxic, Flammable dispersion modeling?
Wind speed/direction, atmospheric stability, temperature inversions, precipitation, and humidity all significantly affect plume behavior and modeling accuracy.
weather_factors
0.85
false
meteorological_assessment
3002
Phenyl urea pesticides, liquid, toxic, flammable
151
2025-09-25T18:58:24.065207
ERG2024
MARPLOT shows Phenyl Urea Pesticides, Liquid, Toxic, Flammable plume toward populated area. Recommendations?
Verify wind data accuracy, consider atmospheric stability changes, and evaluate need for expanded evacuation zones or sheltering. Monitor weather forecasts for wind shifts.
plume_threat_assessment
0.92
true
threat_assessment
3002
Phenyl urea pesticides, liquid, toxic, flammable
151
2025-09-25T18:58:24.065207
ERG2024
How often should we update MARPLOT models for Phenyl Urea Pesticides, Liquid, Toxic, Flammable incidents?
Update models every 15-30 minutes or when weather conditions change significantly. Continuous monitoring during active releases.
model_update_frequency
0.88
false
continuous_assessment
3002
Phenyl urea pesticides, liquid, toxic, flammable
151
2025-09-25T18:58:24.065207
ERG2024
MARPLOT showing Phenyl Urea Pesticides, Liquid, Toxic, Flammable plume dissipation. When is area safe?
Area considered safe when concentrations drop below AEGL-1 or equivalent exposure limits AND atmospheric conditions remain stable. Confirm with air monitoring.
safe_reentry
0.9
true
reentry_decisions
3002
Phenyl urea pesticides, liquid, toxic, flammable
151
2025-09-25T18:58:24.065207
ERG2024
What's the ERG guide for Bipyridilium Pesticide, Liquid,?
ERG Guide 151
identity_lookup
0.9
false
lookup
3016
Bipyridilium pesticide, liquid,
151
2025-09-25T18:58:24.065207
ERG2024
ERG number for Bipyridilium Pesticide, Liquid,
Guide 151
identity_lookup
0.85
false
dispatch
3016
Bipyridilium pesticide, liquid,
151
2025-09-25T18:58:24.065207
ERG2024
We have a spill involving Bipyridilium Pesticide, Liquid,. What ERG guide do we use?
Use ERG Guide 151 for Bipyridilium Pesticide, Liquid,
scenario_lookup
0.95
true
incident_response
3016
Bipyridilium pesticide, liquid,
151
2025-09-25T18:58:24.065207
ERG2024
Dispatch is asking for the guide number on Bipyridilium Pesticide, Liquid,
ERG 151
communication
0.9
true
dispatch_communication
3016
Bipyridilium pesticide, liquid,
151
2025-09-25T18:58:24.065207
ERG2024
Chemical ID 3016 corresponds to what substance?
Bipyridilium Pesticide, Liquid,
id_lookup
0.8
false
database_lookup
3016
Bipyridilium pesticide, liquid,
151
2025-09-25T18:58:24.065207
ERG2024
What is UN 3016?
Bipyridilium Pesticide, Liquid,
un_lookup
0.85
false
shipping_identification
3016
Bipyridilium pesticide, liquid,
151
2025-09-25T18:58:24.065207
ERG2024
What's another name for bipyridilium pesticide, liquid,?
Bipyridilium Pesticide, Liquid,
synonym_lookup
0.7
false
identification
3016
Bipyridilium pesticide, liquid,
151
2025-09-25T18:58:24.065207
ERG2024
What extinguishing agents can be used on Bipyridilium Pesticide, Liquid, fires?
Dry chemical, CO2, Water spray, Foam
firefighting_agents
0.9
false
firefighting
3016
Bipyridilium pesticide, liquid,
151
2025-09-25T18:58:24.065207
ERG2024
We have a Bipyridilium Pesticide, Liquid, fire. What do we use to extinguish it?
Use: Dry chemical, CO2, Water spray, Foam
firefighting_scenario
0.95
true
fire_suppression
3016
Bipyridilium pesticide, liquid,
151
2025-09-25T18:58:24.065207
ERG2024
Engine company asking what to use on Bipyridilium Pesticide, Liquid, fire
Dry chemical, CO2, Water spray, Foam
firefighting_tactical
0.92
true
tactical_communication
3016
Bipyridilium pesticide, liquid,
151
2025-09-25T18:58:24.065207
ERG2024
What decontamination is needed for Bipyridilium Pesticide, Liquid, exposure?
Use copious water irrigation. Remove contaminated clothing. Avoid cross-contamination.
decontamination
0.9
false
decontamination_procedure
3016
Bipyridilium pesticide, liquid,
151
2025-09-25T18:58:24.065207
ERG2024
Decon team asking about Bipyridilium Pesticide, Liquid, patient treatment
Priority: copious water irrigation. Full PPE required for decon personnel. Isolate runoff.
decon_scenario
0.92
true
decontamination_operations
3016
Bipyridilium pesticide, liquid,
151
2025-09-25T18:58:24.065207
ERG2024
What's the initial evacuation distance for Bipyridilium Pesticide, Liquid,?
Initial evacuation: 50m in all directions
evacuation_distance
0.9
false
evacuation_planning
3016
Bipyridilium pesticide, liquid,
151
2025-09-25T18:58:24.065207
ERG2024
Large spill evacuation distance for Bipyridilium Pesticide, Liquid,?
Large spill evacuation: 300m downwind
large_spill_evacuation
0.9
false
major_incident_planning
3016
Bipyridilium pesticide, liquid,
151
2025-09-25T18:58:24.065207
ERG2024
IC needs evacuation zones for Bipyridilium Pesticide, Liquid, incident
Recommend 50m initial perimeter, 300m for large spills downwind
evacuation_scenario
0.95
true
incident_command
3016
Bipyridilium pesticide, liquid,
151
2025-09-25T18:58:24.065207
ERG2024
How quickly do we need to establish evacuation zones for Bipyridilium Pesticide, Liquid,?
Establish initial isolation perimeter immediately. Expand to protective action distances within 15-30 minutes based on spill size and weather.
evacuation_timing
0.88
false
time_critical_decisions
3016
Bipyridilium pesticide, liquid,
151
2025-09-25T18:58:24.065207
ERG2024
What factors affect evacuation distances for Bipyridilium Pesticide, Liquid,?
Wind direction and speed, spill size, temperature, terrain, and population density all affect evacuation zone size and shape.
evacuation_factors
0.85
false
evacuation_planning
3016
Bipyridilium pesticide, liquid,
151
2025-09-25T18:58:24.065207
ERG2024
What weather factors affect Bipyridilium Pesticide, Liquid, dispersion modeling?
Wind speed/direction, atmospheric stability, temperature inversions, precipitation, and humidity all significantly affect plume behavior and modeling accuracy.
weather_factors
0.85
false
meteorological_assessment
3016
Bipyridilium pesticide, liquid,
151
2025-09-25T18:58:24.065207
ERG2024
MARPLOT shows Bipyridilium Pesticide, Liquid, plume toward populated area. Recommendations?
Verify wind data accuracy, consider atmospheric stability changes, and evaluate need for expanded evacuation zones or sheltering. Monitor weather forecasts for wind shifts.
plume_threat_assessment
0.92
true
threat_assessment
3016
Bipyridilium pesticide, liquid,
151
2025-09-25T18:58:24.065207
ERG2024
How often should we update MARPLOT models for Bipyridilium Pesticide, Liquid, incidents?
Update models every 15-30 minutes or when weather conditions change significantly. Continuous monitoring during active releases.
model_update_frequency
0.88
false
continuous_assessment
3016
Bipyridilium pesticide, liquid,
151
2025-09-25T18:58:24.065207
ERG2024
MARPLOT showing Bipyridilium Pesticide, Liquid, plume dissipation. When is area safe?
Area considered safe when concentrations drop below AEGL-1 or equivalent exposure limits AND atmospheric conditions remain stable. Confirm with air monitoring.
safe_reentry
0.9
true
reentry_decisions
3016
Bipyridilium pesticide, liquid,
151
2025-09-25T18:58:24.065207
ERG2024
What's the ERG guide for Thiocarbamate Pesticide, Liquid, Toxic?
ERG Guide 131
identity_lookup
0.9
false
lookup
3005
Thiocarbamate pesticide, liquid, toxic
131
2025-09-25T18:58:24.065207
ERG2024
ERG number for Thiocarbamate Pesticide, Liquid, Toxic
Guide 131
identity_lookup
0.85
false
dispatch
3005
Thiocarbamate pesticide, liquid, toxic
131
2025-09-25T18:58:24.065207
ERG2024
We have a spill involving Thiocarbamate Pesticide, Liquid, Toxic. What ERG guide do we use?
Use ERG Guide 131 for Thiocarbamate Pesticide, Liquid, Toxic
scenario_lookup
0.95
true
incident_response
3005
Thiocarbamate pesticide, liquid, toxic
131
2025-09-25T18:58:24.065207
ERG2024
Dispatch is asking for the guide number on Thiocarbamate Pesticide, Liquid, Toxic
ERG 131
communication
0.9
true
dispatch_communication
3005
Thiocarbamate pesticide, liquid, toxic
131
2025-09-25T18:58:24.065207
ERG2024
Chemical ID 3005 corresponds to what substance?
Thiocarbamate Pesticide, Liquid, Toxic
id_lookup
0.8
false
database_lookup
3005
Thiocarbamate pesticide, liquid, toxic
131
2025-09-25T18:58:24.065207
ERG2024
What is UN 3005?
Thiocarbamate Pesticide, Liquid, Toxic
un_lookup
0.85
false
shipping_identification
3005
Thiocarbamate pesticide, liquid, toxic
131
2025-09-25T18:58:24.065207
ERG2024
End of preview.

Hazmat Q&A Training Data Generator

A comprehensive Python system for generating high-quality Q&A pairs from emergency response chemical databases for training firefighters and hazmat teams.

πŸš€ Features

  • 7 Core Training Themes: Identity, Hazards, Protective Actions, Firefighting, First Aid, PPE, Storage
  • MARPLOT/Plume Modeling: Specialized questions for atmospheric dispersion scenarios
  • Natural Language Variations: Operational terminology used by first responders
  • Quality Validation: Automated accuracy checking and relevance scoring
  • Configurable Output: 5-12 Q&A pairs per chemical with theme weighting
  • Batch Processing: Efficient handling of large chemical databases
  • Priority Chemical Support: Enhanced coverage for high-frequency response chemicals

πŸ“¦ Installation

# Clone or extract to your system
cd qa_pair_generator

# No additional dependencies required - uses Python standard library only
python --version  # Requires Python 3.8+

πŸƒ Quick Start

Generate Sample Q&A

python scripts/generate_training_data.py --sample "Chlorine"

Generate Full Training Dataset

python scripts/generate_training_data.py

Custom Configuration

python scripts/generate_training_data.py --config my_config.json --output my_training_data.jsonl

πŸ“‹ Example Output

Sample Q&A Pairs for Chlorine:

{"prompt": "What's the ERG guide number for Chlorine?", "completion": "ERG Guide 124"}
{"prompt": "How far do we isolate for a small Chlorine leak?", "completion": "100 meters in all directions"}
{"prompt": "What's the downwind protective distance for a large Chlorine release at night?", "completion": "7.0 km (4.3 miles) downwind"}
{"prompt": "How does Chlorine vapor behave in the environment?", "completion": "Chlorine is 2.5 times heavier than air, stays close to ground, and collects in low-lying areas"}
{"prompt": "What PPE is required for Chlorine response?", "completion": "Level A suit with SCBA for hot zone operations; minimum Level B with SCBA for warm zone"}
{"prompt": "Can we use water on a Chlorine leak?", "completion": "Use water spray to absorb vapors and cool containers, but avoid direct streams on liquid"}
{"prompt": "In MARPLOT, how should we model a Chlorine plume?", "completion": "Model as heavy gas that hugs ground, use terrain features, account for wind shifts, and map exclusion zones using ERG Table 1 distances"}

πŸ”§ Configuration

Basic Settings (config/settings.json)

{
  "min_qa_pairs": 5,
  "max_qa_pairs": 12,
  "themes": {
    "identity": {"weight": 1, "required": true},
    "hazards": {"weight": 2, "required": true},
    "protective_actions": {"weight": 3, "required": true},
    "firefighting": {"weight": 2, "required": true}
  },
  "plume_modeling": {
    "enabled": true,
    "marplot_integration": true
  }
}

πŸ“Š Training Themes

1. Identity Questions

  • ERG guide numbers
  • UN/placard numbers
  • Chemical synonyms
  • CAS registry numbers

2. Immediate Hazards

  • Fire and explosion risks
  • Health effects (acute/chronic)
  • Reactivity concerns
  • Environmental impacts

3. Protective Actions/Plume Modeling

  • Initial isolation distances
  • Downwind evacuation zones
  • Vapor behavior analysis
  • MARPLOT modeling parameters

4. Firefighting Guidance

  • Appropriate extinguishing media
  • Water usage safety
  • Container cooling procedures
  • Explosion prevention

5. First Aid/Medical

  • Exposure symptoms
  • Decontamination procedures
  • Treatment priorities
  • Special antidotes (e.g., calcium gluconate for HF)

6. PPE/Operational

  • Respiratory protection levels
  • Chemical protective clothing
  • SCBA requirements
  • Entry team protocols

7. Storage/Disposal

  • Temperature requirements
  • Incompatible materials
  • Neutralization methods
  • Regulatory compliance

πŸ—οΈ Project Structure

qa_pair_generator/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ qa_generator.py           # Main generation orchestrator
β”‚   β”œβ”€β”€ question_templates.py     # Theme-based question generators
β”‚   β”œβ”€β”€ plume_analyzer.py        # MARPLOT/atmospheric modeling
β”‚   └── validator.py             # Quality validation system
β”œβ”€β”€ scripts/
β”‚   └── generate_training_data.py # Main execution script
β”œβ”€β”€ config/
β”‚   └── settings.json            # Configuration file
β”œβ”€β”€ tests/
β”‚   └── test_generator.py        # Unit tests
β”œβ”€β”€ docs/
β”‚   └── USAGE.md                 # Detailed usage guide
β”œβ”€β”€ examples/
β”‚   β”œβ”€β”€ demo.py                  # Interactive demonstration
β”‚   └── generate_full_dataset.py # Full dataset generation
β”œβ”€β”€ output/                      # Generated training data
└── emergency_resp_database.json # Source chemical database

πŸ§ͺ Testing

# Run unit tests
python tests/test_generator.py

# Run demonstration
python examples/demo.py

# Test with specific chemical
python scripts/generate_training_data.py --sample "Anhydrous Ammonia"

πŸ“ˆ Performance Stats

From testing with the complete ERG 2024 database (1,786 chemicals):

  • Generation Rate: ~10-15 chemicals/second
  • Average Output: 8.67 Q&A pairs per chemical
  • Quality Score: 0.847 average (out of 1.0)
  • Total Dataset: ~15,000 Q&A pairs
  • File Size: ~25 MB (JSONL format)

🎯 Priority Chemicals

Enhanced question generation for high-frequency response chemicals:

  • Anhydrous Ammonia
  • Chlorine
  • Sulfuric Acid
  • Gasoline
  • Propane
  • Hydrochloric Acid
  • Sodium Hydroxide
  • Methanol

πŸ“ Command Line Options

Option Description Default
--database Path to chemical database emergency_resp_database.json
--config Configuration file config/settings.json
--output Output file path output/training_data.jsonl
--sample Generate sample for specific chemical None
--batch-size Processing batch size 100
--log-level Logging verbosity INFO

πŸ” Quality Validation

Automatic validation includes:

  • Answer Length: 10-500 characters
  • Operational Relevance: Emergency response terminology
  • Source Accuracy: Cross-reference with database
  • Theme Coverage: Required themes must be represented
  • Duplicate Detection: Remove similar questions

πŸš€ Integration Examples

Training Pipeline Integration

from src.qa_generator import QAGenerator

generator = QAGenerator('config/settings.json')
questions = generator.generate_qa_for_chemical(chemical_data)

# Convert to your training format
training_examples = [
    {
        'input': qa['prompt'],
        'target': qa['completion'],
        'metadata': qa.get('metadata', {})
    }
    for qa in questions
]

API Integration

import json

# Load generated data
with open('output/training_data.jsonl', 'r') as f:
    for line in f:
        qa_pair = json.loads(line)
        # Send to your training API
        training_api.submit_example(qa_pair)

πŸŽ“ Use Cases

  • Firefighter Training: ERG guide familiarity and emergency procedures
  • Hazmat Team Certification: Specialized chemical response knowledge
  • Emergency Planning: Scenario-based decision making
  • Refresher Training: Quick knowledge verification
  • Assessment Tools: Competency evaluation

πŸ“š Documentation

⚑ Performance Tips

Large Databases

python scripts/generate_training_data.py --batch-size 50 --log-level WARNING

High Quality Only

{
  "quality_thresholds": {
    "min_answer_length": 15,
    "required_accuracy": 0.98
  }
}

Priority Chemicals Only

Filter your database to include only high-priority chemicals before processing.

🀝 Contributing

  1. Test with sample chemicals first
  2. Validate output format and quality
  3. Check theme coverage and operational relevance
  4. Run unit tests before submitting changes

πŸ“„ License

MIT License - See LICENSE file for details

πŸ†˜ Support

  • Check USAGE.md for detailed documentation
  • Run unit tests to verify installation
  • Test with sample data before full processing
  • Review log files for troubleshooting

Ready to train the next generation of emergency responders! 🚨πŸ”₯πŸ‘¨β€πŸš’

Downloads last month
29

Models trained or fine-tuned on Johnohhh1/erg_chemical_dataset