aryan012234 commited on
Commit
729c2ab
·
1 Parent(s): b14a05c

chore: fresh deployment to aryan012234/safetyspeech-app

Browse files
Files changed (1) hide show
  1. notebooks/01_data_exploration.ipynb +42 -25
notebooks/01_data_exploration.ipynb CHANGED
@@ -11,33 +11,29 @@
11
  ]
12
  },
13
  {
14
- "cell_type": "code",
15
- "execution_count": null,
16
  "metadata": {},
17
- "outputs": [],
18
  "source": [
19
- "import pandas as pd\n",
20
- "import matplotlib.pyplot as plt\n",
21
- "import seaborn as sns\n",
22
- "import os\n",
23
- "import warnings\n",
24
- "warnings.filterwarnings('ignore')\n",
25
- "\n",
26
- "sns.set_theme(style='darkgrid', palette='Set2')\n",
27
- "plt.rcParams['figure.figsize'] = (12, 5)\n",
28
- "print('Setup complete.')"
29
  ]
30
  },
31
- {
32
- "cell_type": "markdown",
33
- "metadata": {},
34
- "source": ["## 1. Load External Datasets"]
35
- },
36
  {
37
  "cell_type": "code",
38
- "execution_count": null,
39
  "metadata": {},
40
- "outputs": [],
 
 
 
 
 
 
 
 
 
 
 
 
41
  "source": [
42
  "# Load Jigsaw dataset\n",
43
  "jigsaw_path = '../data/external/jigsaw_toxic.csv'\n",
@@ -85,7 +81,9 @@
85
  {
86
  "cell_type": "markdown",
87
  "metadata": {},
88
- "source": ["## 2. Label Distribution Analysis"]
 
 
89
  },
90
  {
91
  "cell_type": "code",
@@ -124,7 +122,9 @@
124
  {
125
  "cell_type": "markdown",
126
  "metadata": {},
127
- "source": ["## 3. Text Length Analysis"]
 
 
128
  },
129
  {
130
  "cell_type": "code",
@@ -154,7 +154,9 @@
154
  {
155
  "cell_type": "markdown",
156
  "metadata": {},
157
- "source": ["## 4. Sample Texts per Category"]
 
 
158
  },
159
  {
160
  "cell_type": "code",
@@ -173,8 +175,23 @@
173
  }
174
  ],
175
  "metadata": {
176
- "kernelspec": {"display_name": "Python 3", "language": "python", "name": "python3"},
177
- "language_info": {"name": "python", "version": "3.10.0"}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  },
179
  "nbformat": 4,
180
  "nbformat_minor": 4
 
11
  ]
12
  },
13
  {
14
+ "cell_type": "markdown",
 
15
  "metadata": {},
 
16
  "source": [
17
+ "## 1. Load External Datasets"
 
 
 
 
 
 
 
 
 
18
  ]
19
  },
 
 
 
 
 
20
  {
21
  "cell_type": "code",
22
+ "execution_count": 1,
23
  "metadata": {},
24
+ "outputs": [
25
+ {
26
+ "ename": "NameError",
27
+ "evalue": "name 'os' is not defined",
28
+ "output_type": "error",
29
+ "traceback": [
30
+ "\u001b[31m---------------------------------------------------------------------------\u001b[39m",
31
+ "\u001b[31mNameError\u001b[39m Traceback (most recent call last)",
32
+ "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[1]\u001b[39m\u001b[32m, line 3\u001b[39m\n\u001b[32m 1\u001b[39m \u001b[38;5;66;03m# Load Jigsaw dataset\u001b[39;00m\n\u001b[32m 2\u001b[39m jigsaw_path = \u001b[33m'\u001b[39m\u001b[33m../data/external/jigsaw_toxic.csv\u001b[39m\u001b[33m'\u001b[39m\n\u001b[32m----> \u001b[39m\u001b[32m3\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[43mos\u001b[49m.path.exists(jigsaw_path):\n\u001b[32m 4\u001b[39m jigsaw = pd.read_csv(jigsaw_path)\n\u001b[32m 5\u001b[39m \u001b[38;5;28mprint\u001b[39m(\u001b[33mf\u001b[39m\u001b[33m'\u001b[39m\u001b[33mJigsaw: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[38;5;28mlen\u001b[39m(jigsaw)\u001b[38;5;132;01m:\u001b[39;00m\u001b[33m,\u001b[39m\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m rows, columns: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mjigsaw.columns.tolist()\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m'\u001b[39m)\n",
33
+ "\u001b[31mNameError\u001b[39m: name 'os' is not defined"
34
+ ]
35
+ }
36
+ ],
37
  "source": [
38
  "# Load Jigsaw dataset\n",
39
  "jigsaw_path = '../data/external/jigsaw_toxic.csv'\n",
 
81
  {
82
  "cell_type": "markdown",
83
  "metadata": {},
84
+ "source": [
85
+ "## 2. Label Distribution Analysis"
86
+ ]
87
  },
88
  {
89
  "cell_type": "code",
 
122
  {
123
  "cell_type": "markdown",
124
  "metadata": {},
125
+ "source": [
126
+ "## 3. Text Length Analysis"
127
+ ]
128
  },
129
  {
130
  "cell_type": "code",
 
154
  {
155
  "cell_type": "markdown",
156
  "metadata": {},
157
+ "source": [
158
+ "## 4. Sample Texts per Category"
159
+ ]
160
  },
161
  {
162
  "cell_type": "code",
 
175
  }
176
  ],
177
  "metadata": {
178
+ "kernelspec": {
179
+ "display_name": "Python 3",
180
+ "language": "python",
181
+ "name": "python3"
182
+ },
183
+ "language_info": {
184
+ "codemirror_mode": {
185
+ "name": "ipython",
186
+ "version": 3
187
+ },
188
+ "file_extension": ".py",
189
+ "mimetype": "text/x-python",
190
+ "name": "python",
191
+ "nbconvert_exporter": "python",
192
+ "pygments_lexer": "ipython3",
193
+ "version": "3.12.4"
194
+ }
195
  },
196
  "nbformat": 4,
197
  "nbformat_minor": 4