Uday commited on
Commit
9683162
·
verified ·
1 Parent(s): 1a35bca

Updating readme with reference data

Browse files
Files changed (1) hide show
  1. README.md +128 -38
README.md CHANGED
@@ -1,38 +1,128 @@
1
- ---
2
- license: apache-2.0
3
- dataset_info:
4
- features:
5
- - name: hazard_type
6
- dtype: string
7
- - name: phase
8
- dtype: string
9
- - name: audience
10
- dtype: string
11
- - name: topic
12
- dtype: string
13
- - name: content_raw
14
- dtype: string
15
- - name: action_items
16
- dtype: string
17
- - name: sources
18
- dtype: string
19
- - name: source_file
20
- dtype: string
21
- - name: page_ref
22
- dtype: int32
23
- - name: last_updated
24
- dtype: string
25
- - name: embedding
26
- list: float32
27
- splits:
28
- - name: train
29
- num_bytes: 2959000
30
- num_examples: 1022
31
- download_size: 2842511
32
- dataset_size: 2959000
33
- configs:
34
- - config_name: default
35
- data_files:
36
- - split: train
37
- path: data/train-*
38
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ dataset_info:
4
+ features:
5
+ - name: hazard_type
6
+ dtype: string
7
+ - name: phase
8
+ dtype: stringsa
9
+ - name: audience
10
+ dtype: string
11
+ - name: topic
12
+ dtype: string
13
+ - name: content_raw
14
+ dtype: string
15
+ - name: action_items
16
+ dtype: string
17
+ - name: sources
18
+ dtype: string
19
+ - name: source_file
20
+ dtype: string
21
+ - name: page_ref
22
+ dtype: int32
23
+ - name: last_updated
24
+ dtype: string
25
+ - name: embedding
26
+ list: float32
27
+ splits:
28
+ - name: train
29
+ num_bytes: 2959000
30
+ num_examples: 1022
31
+ download_size: 2842511
32
+ dataset_size: 2959000
33
+ configs:
34
+ - config_name: default
35
+ data_files:
36
+ - split: train
37
+ path: data/train-*
38
+ task_categories:
39
+ - text-retrieval
40
+ - text-generation
41
+ tags:
42
+ - safety
43
+ - hazards
44
+ - emergency-preparedness
45
+ size_categories:
46
+ - n<1K
47
+ language:
48
+ - en
49
+ ---
50
+
51
+ # Hazards Dataset
52
+
53
+ This dataset contains comprehensive information about various hazards, including preparation, reaction, and recovery steps. It is designed for fine-tuning Large Language Models (LLMs) on safety and emergency response procedures.
54
+
55
+ ## Dataset Structure
56
+
57
+ The dataset is provided in a format compatible with the Hugging Face `datasets` library.
58
+
59
+ ### Features
60
+
61
+ - `hazard_type` (string): The high-level category of the hazard (e.g., "Wildfire", "Active Shooter").
62
+ - `phase` (string): The phase of emergency management ("Prepare", "React", "Recover").
63
+ - `audience` (string): The target audience ("General", "Kids", "Elderly", "Pets", etc.).
64
+ - `topic` (string): The specific subject matter of the text chunk (e.g., "Evacuation Routes").
65
+ - `content_raw` (string): The exact text content extracted from the source PDF.
66
+ - `action_items` (list of strings): A list of actionable steps extracted from the text.
67
+ - `sources` (list of dicts): A list of sources/references found in the text, each with a `title` and `url`.
68
+ - `source_file` (string): The filename of the source PDF.
69
+ - `page_ref` (int): The page number in the source PDF.
70
+ - `last_updated` (date): The date the source file was last modified.
71
+ - `vector` (list of floats): A 384-dimensional vector embedding of the content.
72
+
73
+ ### Example
74
+
75
+ ```json
76
+ {
77
+ "hazard_type": "Avalanche",
78
+ "phase": "Recover",
79
+ "audience": "General",
80
+ "topic": "General Safety",
81
+ "content_raw": "A rapid flow of snow...",
82
+ "action_items": ["Stay calm", "Signal for help"],
83
+ "sources": [{"title": "Avalanche.org", "url": "https://avalanche.org"}],
84
+ "source_file": "avalanche.pdf",
85
+ "page_ref": 1,
86
+ "last_updated": "2025-11-24",
87
+ "vector": [0.023, -0.12, ...]
88
+ }
89
+ ```
90
+
91
+ ## Creation Process
92
+
93
+ ### Data Source
94
+
95
+ The data is sourced from [Hazadapt](https://app.hazadapt.com/), a safety application providing guides for various hazards.
96
+
97
+ ### Collection Method
98
+
99
+ Data was collected using a custom pipeline that:
100
+
101
+ 1. **Scrapes** hazard pages and downloads official PDF guides using Playwright.
102
+ 2. **Processes** PDFs using `PyMuPDF4LLM` to extract text and layout information.
103
+ 3. **Parses** content into structured fields (Phase, Audience, Topic) using keyword heuristics and layout analysis.
104
+ 4. **Embeds** content using `sentence-transformers/all-MiniLM-L6-v2`.
105
+
106
+ ## Intended Use
107
+
108
+ - **LLM Fine-tuning**: To train models on safety protocols and emergency response.
109
+ - **RAG (Retrieval-Augmented Generation)**: As a knowledge base for safety chatbots.
110
+ - **Analysis**: For analyzing the structure and content of emergency guides.
111
+
112
+ ## Citation
113
+
114
+ If you use this dataset in your research or application, please cite it as follows:
115
+
116
+ ```bibtex
117
+ @dataset{hazards_dataset_2025,
118
+ author = {Hazards Dataset Builder},
119
+ title = {Hazards Safety Dataset},
120
+ year = {2025},
121
+ publisher = {Hugging Face},
122
+ howpublished = {\url{https://huggingface.co/datasets/your-username/hazards-dataset}},
123
+ note = {Data sourced from Hazadapt}
124
+ }
125
+ ```
126
+
127
+ ## Limitations
128
+ - Users should verify critical safety information with official sources.