lheuveline
commited on
Commit
•
3c5f5b9
1
Parent(s):
b073070
Removed translation errors
Browse files- data/dataset.csv +0 -0
- notebooks/PostProcessing.ipynb +1121 -0
data/dataset.csv
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
notebooks/PostProcessing.ipynb
ADDED
@@ -0,0 +1,1121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "code",
|
5 |
+
"execution_count": null,
|
6 |
+
"id": "66d5faa2",
|
7 |
+
"metadata": {},
|
8 |
+
"outputs": [],
|
9 |
+
"source": [
|
10 |
+
"import pandas as pd\n",
|
11 |
+
"\n",
|
12 |
+
"from transformers import AutoModel, AutoTokenizer\n",
|
13 |
+
"# from transformers import MarianMTModel\n",
|
14 |
+
"from transformers import XLMRobertaForSequenceClassification\n",
|
15 |
+
"\n",
|
16 |
+
"from tqdm import tqdm\n",
|
17 |
+
"tqdm.pandas()\n",
|
18 |
+
"%matplotlib inline"
|
19 |
+
]
|
20 |
+
},
|
21 |
+
{
|
22 |
+
"cell_type": "code",
|
23 |
+
"execution_count": 9,
|
24 |
+
"id": "ed76080b",
|
25 |
+
"metadata": {},
|
26 |
+
"outputs": [],
|
27 |
+
"source": [
|
28 |
+
"def detect_language(model, tokenizer, text):\n",
|
29 |
+
" \n",
|
30 |
+
" token_dict = tokenizer(text, return_tensors=\"pt\").to(\"cuda\")\n",
|
31 |
+
" outputs = model(token_dict.input_ids)\n",
|
32 |
+
" decoded = outputs.logits.argmax(-1).item()\n",
|
33 |
+
" lang = model.config.id2label[decoded]\n",
|
34 |
+
" return lang"
|
35 |
+
]
|
36 |
+
},
|
37 |
+
{
|
38 |
+
"cell_type": "code",
|
39 |
+
"execution_count": 68,
|
40 |
+
"id": "d671ed05",
|
41 |
+
"metadata": {},
|
42 |
+
"outputs": [
|
43 |
+
{
|
44 |
+
"data": {
|
45 |
+
"text/html": [
|
46 |
+
"<div>\n",
|
47 |
+
"<style scoped>\n",
|
48 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
49 |
+
" vertical-align: middle;\n",
|
50 |
+
" }\n",
|
51 |
+
"\n",
|
52 |
+
" .dataframe tbody tr th {\n",
|
53 |
+
" vertical-align: top;\n",
|
54 |
+
" }\n",
|
55 |
+
"\n",
|
56 |
+
" .dataframe thead th {\n",
|
57 |
+
" text-align: right;\n",
|
58 |
+
" }\n",
|
59 |
+
"</style>\n",
|
60 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
61 |
+
" <thead>\n",
|
62 |
+
" <tr style=\"text-align: right;\">\n",
|
63 |
+
" <th></th>\n",
|
64 |
+
" <th>text</th>\n",
|
65 |
+
" <th>label</th>\n",
|
66 |
+
" </tr>\n",
|
67 |
+
" </thead>\n",
|
68 |
+
" <tbody>\n",
|
69 |
+
" <tr>\n",
|
70 |
+
" <th>7</th>\n",
|
71 |
+
" <td>fuck you</td>\n",
|
72 |
+
" <td>1</td>\n",
|
73 |
+
" </tr>\n",
|
74 |
+
" <tr>\n",
|
75 |
+
" <th>32</th>\n",
|
76 |
+
" <td>hell fucking biatch ass licking but fuckinger</td>\n",
|
77 |
+
" <td>1</td>\n",
|
78 |
+
" </tr>\n",
|
79 |
+
" <tr>\n",
|
80 |
+
" <th>33</th>\n",
|
81 |
+
" <td>fuck you bitch</td>\n",
|
82 |
+
" <td>1</td>\n",
|
83 |
+
" </tr>\n",
|
84 |
+
" <tr>\n",
|
85 |
+
" <th>59</th>\n",
|
86 |
+
" <td>fuck you</td>\n",
|
87 |
+
" <td>1</td>\n",
|
88 |
+
" </tr>\n",
|
89 |
+
" <tr>\n",
|
90 |
+
" <th>61</th>\n",
|
91 |
+
" <td>piss off</td>\n",
|
92 |
+
" <td>1</td>\n",
|
93 |
+
" </tr>\n",
|
94 |
+
" <tr>\n",
|
95 |
+
" <th>...</th>\n",
|
96 |
+
" <td>...</td>\n",
|
97 |
+
" <td>...</td>\n",
|
98 |
+
" </tr>\n",
|
99 |
+
" <tr>\n",
|
100 |
+
" <th>3993</th>\n",
|
101 |
+
" <td>quand il n'est plus possible d'établir des lie...</td>\n",
|
102 |
+
" <td>0</td>\n",
|
103 |
+
" </tr>\n",
|
104 |
+
" <tr>\n",
|
105 |
+
" <th>3999</th>\n",
|
106 |
+
" <td>quand vous prendrez vos sources ailleurs que s...</td>\n",
|
107 |
+
" <td>0</td>\n",
|
108 |
+
" </tr>\n",
|
109 |
+
" <tr>\n",
|
110 |
+
" <th>4002</th>\n",
|
111 |
+
" <td>je suis actuellement en amerique je suis en hi...</td>\n",
|
112 |
+
" <td>0</td>\n",
|
113 |
+
" </tr>\n",
|
114 |
+
" <tr>\n",
|
115 |
+
" <th>4013</th>\n",
|
116 |
+
" <td>pourquoi tant de migrants africains en europe ...</td>\n",
|
117 |
+
" <td>0</td>\n",
|
118 |
+
" </tr>\n",
|
119 |
+
" <tr>\n",
|
120 |
+
" <th>label</th>\n",
|
121 |
+
" <td>0</td>\n",
|
122 |
+
" <td>0</td>\n",
|
123 |
+
" </tr>\n",
|
124 |
+
" </tbody>\n",
|
125 |
+
"</table>\n",
|
126 |
+
"<p>66224 rows × 2 columns</p>\n",
|
127 |
+
"</div>"
|
128 |
+
],
|
129 |
+
"text/plain": [
|
130 |
+
" text label\n",
|
131 |
+
"7 fuck you 1\n",
|
132 |
+
"32 hell fucking biatch ass licking but fuckinger 1\n",
|
133 |
+
"33 fuck you bitch 1\n",
|
134 |
+
"59 fuck you 1\n",
|
135 |
+
"61 piss off 1\n",
|
136 |
+
"... ... ...\n",
|
137 |
+
"3993 quand il n'est plus possible d'établir des lie... 0\n",
|
138 |
+
"3999 quand vous prendrez vos sources ailleurs que s... 0\n",
|
139 |
+
"4002 je suis actuellement en amerique je suis en hi... 0\n",
|
140 |
+
"4013 pourquoi tant de migrants africains en europe ... 0\n",
|
141 |
+
"label 0 0\n",
|
142 |
+
"\n",
|
143 |
+
"[66224 rows x 2 columns]"
|
144 |
+
]
|
145 |
+
},
|
146 |
+
"execution_count": 68,
|
147 |
+
"metadata": {},
|
148 |
+
"output_type": "execute_result"
|
149 |
+
}
|
150 |
+
],
|
151 |
+
"source": [
|
152 |
+
"dataset_path = \"../data/dataset.csv\"\n",
|
153 |
+
"output_path = \"../data/clean_dataset.csv\"\n",
|
154 |
+
"\n",
|
155 |
+
"df = pd.read_csv(dataset_path, index_col=0)\n",
|
156 |
+
"df"
|
157 |
+
]
|
158 |
+
},
|
159 |
+
{
|
160 |
+
"cell_type": "code",
|
161 |
+
"execution_count": 8,
|
162 |
+
"id": "974b27b1",
|
163 |
+
"metadata": {},
|
164 |
+
"outputs": [
|
165 |
+
{
|
166 |
+
"data": {
|
167 |
+
"application/vnd.jupyter.widget-view+json": {
|
168 |
+
"model_id": "886bab4622fd4408ae02815fbea41a23",
|
169 |
+
"version_major": 2,
|
170 |
+
"version_minor": 0
|
171 |
+
},
|
172 |
+
"text/plain": [
|
173 |
+
"Downloading: 0%| | 0.00/502 [00:00<?, ?B/s]"
|
174 |
+
]
|
175 |
+
},
|
176 |
+
"metadata": {},
|
177 |
+
"output_type": "display_data"
|
178 |
+
},
|
179 |
+
{
|
180 |
+
"data": {
|
181 |
+
"application/vnd.jupyter.widget-view+json": {
|
182 |
+
"model_id": "2f3a2c0e4f174d309da84fae2f54a90c",
|
183 |
+
"version_major": 2,
|
184 |
+
"version_minor": 0
|
185 |
+
},
|
186 |
+
"text/plain": [
|
187 |
+
"Downloading: 0%| | 0.00/5.07M [00:00<?, ?B/s]"
|
188 |
+
]
|
189 |
+
},
|
190 |
+
"metadata": {},
|
191 |
+
"output_type": "display_data"
|
192 |
+
},
|
193 |
+
{
|
194 |
+
"data": {
|
195 |
+
"application/vnd.jupyter.widget-view+json": {
|
196 |
+
"model_id": "8bae5697fac04f2684829cb6e4373ec1",
|
197 |
+
"version_major": 2,
|
198 |
+
"version_minor": 0
|
199 |
+
},
|
200 |
+
"text/plain": [
|
201 |
+
"Downloading: 0%| | 0.00/9.08M [00:00<?, ?B/s]"
|
202 |
+
]
|
203 |
+
},
|
204 |
+
"metadata": {},
|
205 |
+
"output_type": "display_data"
|
206 |
+
},
|
207 |
+
{
|
208 |
+
"data": {
|
209 |
+
"application/vnd.jupyter.widget-view+json": {
|
210 |
+
"model_id": "a411a2445a554322aba6acd18f52cff8",
|
211 |
+
"version_major": 2,
|
212 |
+
"version_minor": 0
|
213 |
+
},
|
214 |
+
"text/plain": [
|
215 |
+
"Downloading: 0%| | 0.00/239 [00:00<?, ?B/s]"
|
216 |
+
]
|
217 |
+
},
|
218 |
+
"metadata": {},
|
219 |
+
"output_type": "display_data"
|
220 |
+
},
|
221 |
+
{
|
222 |
+
"data": {
|
223 |
+
"application/vnd.jupyter.widget-view+json": {
|
224 |
+
"model_id": "3377b1effe9c48dcbea42f6ab77cba39",
|
225 |
+
"version_major": 2,
|
226 |
+
"version_minor": 0
|
227 |
+
},
|
228 |
+
"text/plain": [
|
229 |
+
"Downloading: 0%| | 0.00/1.42k [00:00<?, ?B/s]"
|
230 |
+
]
|
231 |
+
},
|
232 |
+
"metadata": {},
|
233 |
+
"output_type": "display_data"
|
234 |
+
},
|
235 |
+
{
|
236 |
+
"data": {
|
237 |
+
"application/vnd.jupyter.widget-view+json": {
|
238 |
+
"model_id": "814cfe6a21b048b7b21ddfd41965fabd",
|
239 |
+
"version_major": 2,
|
240 |
+
"version_minor": 0
|
241 |
+
},
|
242 |
+
"text/plain": [
|
243 |
+
"Downloading: 0%| | 0.00/1.11G [00:00<?, ?B/s]"
|
244 |
+
]
|
245 |
+
},
|
246 |
+
"metadata": {},
|
247 |
+
"output_type": "display_data"
|
248 |
+
}
|
249 |
+
],
|
250 |
+
"source": [
|
251 |
+
"# Language detection model\n",
|
252 |
+
"tokenizer = AutoTokenizer.from_pretrained(\"papluca/xlm-roberta-base-language-detection\")\n",
|
253 |
+
"model = XLMRobertaForSequenceClassification.from_pretrained(\"papluca/xlm-roberta-base-language-detection\").to(\"cuda\")"
|
254 |
+
]
|
255 |
+
},
|
256 |
+
{
|
257 |
+
"cell_type": "code",
|
258 |
+
"execution_count": 12,
|
259 |
+
"id": "10b222d4",
|
260 |
+
"metadata": {},
|
261 |
+
"outputs": [
|
262 |
+
{
|
263 |
+
"data": {
|
264 |
+
"text/plain": [
|
265 |
+
"'en'"
|
266 |
+
]
|
267 |
+
},
|
268 |
+
"execution_count": 12,
|
269 |
+
"metadata": {},
|
270 |
+
"output_type": "execute_result"
|
271 |
+
}
|
272 |
+
],
|
273 |
+
"source": [
|
274 |
+
"detect_language(model, tokenizer, df.iloc[0].text)"
|
275 |
+
]
|
276 |
+
},
|
277 |
+
{
|
278 |
+
"cell_type": "code",
|
279 |
+
"execution_count": 15,
|
280 |
+
"id": "07d92587",
|
281 |
+
"metadata": {},
|
282 |
+
"outputs": [
|
283 |
+
{
|
284 |
+
"name": "stderr",
|
285 |
+
"output_type": "stream",
|
286 |
+
"text": [
|
287 |
+
"100%|████████████████████████████████████████████████████████████████████████████████| 66224/66224 [08:31<00:00, 129.51it/s]\n"
|
288 |
+
]
|
289 |
+
}
|
290 |
+
],
|
291 |
+
"source": [
|
292 |
+
"df[\"language\"] = df.text.progress_apply(lambda x: detect_language(model, tokenizer, x))"
|
293 |
+
]
|
294 |
+
},
|
295 |
+
{
|
296 |
+
"cell_type": "code",
|
297 |
+
"execution_count": 18,
|
298 |
+
"id": "a402e116",
|
299 |
+
"metadata": {},
|
300 |
+
"outputs": [
|
301 |
+
{
|
302 |
+
"data": {
|
303 |
+
"text/plain": [
|
304 |
+
"<AxesSubplot: >"
|
305 |
+
]
|
306 |
+
},
|
307 |
+
"execution_count": 18,
|
308 |
+
"metadata": {},
|
309 |
+
"output_type": "execute_result"
|
310 |
+
},
|
311 |
+
{
|
312 |
+
"data": {
|
313 |
+
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjkAAAGhCAYAAACDNqXeAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8o6BhiAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA5/UlEQVR4nO3dfVyUdb7/8Tc3Mt4O5g2gK+Zdq7LeoJg43ZgmMRnt5mrnaHqMTO3oQTdhU2DX0HU9q6un1I4meWzD9uSmtattkhhhYq2UhrKipZtmYUcHqIRJUlCY3x/95lon8AZlHLl8PR+P65FzXZ/r+nyvMZn3XHf4uVwulwAAAEzG39cDAAAA8AZCDgAAMCVCDgAAMCVCDgAAMCVCDgAAMCVCDgAAMCVCDgAAMKVAXw/Al2pqanTixAm1atVKfn5+vh4OAAC4Ai6XS99++606duwof/+LH6+5qUPOiRMnFB4e7uthAACAq3D8+HF16tTpostv6pDTqlUrSd+/SVar1cejAQAAV8LpdCo8PNz4HL+YmzrkuE9RWa1WQg4AAI3M5S414cJjAABgSoQcAABgSoQcAABgSoQcAABgSoQcAABgSoQcAABgSoQcAABgSoQcAABgSoQcAABgSoQcAABgSoQcAABgSoQcAABgSoQcAABgSoQcAABgSoQcAABgSoG+HsCNrEtK5jWt//niuAYaCQAAqC+O5AAAAFMi5AAAAFMi5AAAAFMi5AAAAFMi5AAAAFMi5AAAAFMi5AAAAFMi5AAAAFMi5AAAAFMi5AAAAFMi5AAAAFMi5AAAAFMi5AAAAFMi5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36eMxr0aKF2rZta8yfPHmykpKS1KZNG1mtVs2cOVM2m01DhgyRJMXGxioiIkITJ07UkiVL5HA4NHfuXCUkJBinkqZNm6aVK1dqzpw5evzxx7V9+3Zt3LhRmZn/vNspKSlJ8fHxGjRokAYPHqzly5eroqJCkyZNuqY3BAAAmEO9Qs6VWLZsmfz9/TVmzBhVVlbKbrfr+eefN5YHBARoy5Ytmj59umw2m1q0aKH4+HgtWLDAqOnatasyMzOVmJioFStWqFOnTlq7dq3sdrtRM3bsWJWWliotLU0Oh0ORkZHKysqqdTEyAAC4OV3Vc3LM4nL32fOcHAAAbjxefU4OAADAjY6QAwAATImQAwAATImQAwAATImQAwAATImQAwAATImQAwAATImQAwAATImQAwAATImQAwAATImQAwAATImQAwAATImQAwAATImQAwAATImQAwAATImQAwAATImQAwAATImQAwAATImQAwAATImQAwAATImQAwAATImQAwAATImQAwAATImQAwAATImQAwAATImQAwAATImQAwAATImQAwAATImQAwAATImQAwAATKleIWf16tXq16+frFarrFarbDabtm7daiwfNmyY/Pz8PKZp06Z5bKOoqEhxcXFq3ry5QkJCNHv2bJ0/f96jZseOHRo4cKAsFot69OihjIyMWmNZtWqVunTpoqZNmyo6Olq7d++uz64AAACTq1fI6dSpkxYvXqz8/Hx99NFHuvfee/XQQw/p4MGDRs3UqVN18uRJY1qyZImxrLq6WnFxcaqqqtKuXbu0bt06ZWRkKC0tzag5duyY4uLiNHz4cBUUFGjWrFmaMmWKtm3bZtRs2LBBSUlJmjdvnvbu3av+/fvLbrerpKTkWt4LAABgIn4ul8t1LRto06aNli5dqsmTJ2vYsGGKjIzU8uXL66zdunWrHnzwQZ04cUKhoaGSpPT0dCUnJ6u0tFRBQUFKTk5WZmamDhw4YKw3btw4lZWVKSsrS5IUHR2t22+/XStXrpQk1dTUKDw8XDNnzlRKSsoVj93pdCo4OFjl5eWyWq21lndJybzibdXl88Vx17Q+AACo7XKf325XfU1OdXW1Xn31VVVUVMhmsxnzX3nlFbVr1059+vRRamqqvvvuO2NZXl6e+vbtawQcSbLb7XI6ncbRoLy8PMXExHj0stvtysvLkyRVVVUpPz/fo8bf318xMTFGzcVUVlbK6XR6TAAAwJwC67tCYWGhbDabzp49q5YtW2rTpk2KiIiQJI0fP1633nqrOnbsqP379ys5OVmHDx/WX/7yF0mSw+HwCDiSjNcOh+OSNU6nU2fOnNGpU6dUXV1dZ82hQ4cuOfZFixbpN7/5TX13GQAANEL1Djk9e/ZUQUGBysvL9frrrys+Pl65ubmKiIjQE088YdT17dtXHTp00IgRI3T06FF17969QQd+NVJTU5WUlGS8djqdCg8P9+GIAACAt9Q75AQFBalHjx6SpKioKO3Zs0crVqzQCy+8UKs2OjpaknTkyBF1795dYWFhte6CKi4uliSFhYUZ/3XPu7DGarWqWbNmCggIUEBAQJ017m1cjMVikcViqcfeAgCAxuqan5NTU1OjysrKOpcVFBRIkjp06CBJstlsKiws9LgLKjs7W1ar1TjlZbPZlJOT47Gd7Oxs47qfoKAgRUVFedTU1NQoJyfH49ogAABwc6vXkZzU1FSNHDlSnTt31rfffqv169drx44d2rZtm44ePar169frgQceUNu2bbV//34lJiZq6NCh6tevnyQpNjZWERERmjhxopYsWSKHw6G5c+cqISHBOMIybdo0rVy5UnPmzNHjjz+u7du3a+PGjcrM/OedTklJSYqPj9egQYM0ePBgLV++XBUVFZo0aVIDvjUAAKAxq1fIKSkp0aOPPqqTJ08qODhY/fr107Zt23Tffffp+PHjeuedd4zAER4erjFjxmju3LnG+gEBAdqyZYumT58um82mFi1aKD4+XgsWLDBqunbtqszMTCUmJmrFihXq1KmT1q5dK7vdbtSMHTtWpaWlSktLk8PhUGRkpLKysmpdjAwAAG5e1/ycnMaM5+QAAND4eP05OQAAADcyQg4AADAlQg4AADAlQg4AADAlQg4AADAlQg4AADAlQg4AADAlQg4AADAlQg4AADAlQg4AADAlQg4AADAlQg4AADAlQg4AADAlQg4AADAlQg4AADAlQg4AADAlQg4AADAlQg4AADAlQg4AADAlQg4AADAlQg4AADAlQg4AADAlQg4A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04oNDRUkpSenq7k5GSVlpYqKChIycnJyszM1IEDB4z1xo0bp7KyMmVlZUmSoqOjdfvtt2vlypWSpJqaGoWHh2vmzJlKSUmps3dlZaUqKyuN106nU+Hh4SovL5fVaq1V3yUls/5vygU+Xxx3TesDAIDanE6ngoODL/r57XZN1+SUl5dLktq0aeMx/5VXXlG7du3Up08fpaam6rvvvjOW5eXlqW/fvkbAkSS73S6n06mDBw8aNTExMR7btNvtysvLkyRVVVUpPz/fo8bf318xMTFGTV0WLVqk4OBgYwoPD7/KPQcAADe6wKtdsaamRrNmzdKdd96pPn36GPPHjx+vW2+9VR07dtT+/fuVnJysw4cP6y9/+YskyeFweAQcScZrh8NxyRqn06kzZ87o1KlTqq6urrPm0KFDFx1zamqqkpKSjNfuIzkAAMB8rjrkJCQk6MCBA3r//fc95j/xxBPGn/v27asOHTpoxIgROnr0qLp37371I20AFotFFovFp2MAAADXx1WdrpoxY4a2bNmid999V506dbpkbXR0tCTpyJEjkqSwsDAVFxd71Lhfh4WFXbLGarWqWbNmateunQICAuqscW8DAADc3OoVclwul2bMmKFNmzZp+/bt6tq162XXKSgokCR16NBBkmSz2VRYWOhxF1R2drasVqsiIiKMmpycHI/tZGdny2azSZKCgoIUFRXlUVNTU6OcnByjBgAA3NzqdboqISFB69ev1xtvvKFWrVoZ19AEBwerWbNmOnr0qNavX68HHnhAbdu21f79+5WYmKihQ4eqX79+kqTY2FhFRERo4sSJWrJkiRwOh+bOnauEhATjVNK0adO0cuVKzZkzR48//ri2b9+ujRs3KjPzn3c7JSUlKT4+XoMGDdLgwYO1fPlyVVRUaNKkSQ313gAAgEasXiFn9erVkr6/TfxCL730kh577DEFBQXpnXfeMQJHeHi4xowZo7lz5xq1AQEB2rJli6ZPny6bzaYWLVooPj5eCxYsMGq6du2qzMxMJSYmasWKFerUqZPWrl0ru91u1IwdO1alpaVKS0uTw+FQZGSksrKyal2MDAAAbk7X9Jycxu5y99nznBwAAG481+U5OQAAADcqQg4AADAlQg4AADAl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euutys/P19KlSzV//nytWbPGqNm1a5ceeeQRTZ48Wfv27dOoUaM0atQoHThwoL67BAAATMjP5XK5rnplPz9t2rRJo0aNMuY99thjKisrq3WEx+2TTz5RRESE9uzZo0GDBkmSsrKy9MADD+jLL79Ux44dtXr1av3617+Ww+FQUFCQJCklJUWbN2/WoUOHJEljx45VRUWFtmzZYmx7yJAhioyMVHp6+hWN3+l0Kjg4WOXl5bJarbWWd0nJvKLtXMzni+OuaX0AAFDb5T6/3bxyTc6OHTsUEhKinj17avr06fr666+NZXl5eWrdurURcCQpJiZG/v7++vDDD42aoUOHGgFHkux2uw4fPqxTp04ZNTExMR597Xa78vLyLjquyspKOZ1OjwkAAJhTg4ec+++/Xy+//LJycnL0+9//Xrm5uRo5cqSqq6slSQ6HQyEhIR7rBAYGqk2bNnI4HEZNaGioR4379eVq3MvrsmjRIgUHBxtTeHj4te0sAAC4YQU29AbHjRtn/Llv377q16+funfvrh07dmjEiBEN3a5eUlNTlZSUZLx2Op0EHQAATKrBQ84PdevWTe3atdORI0c0YsQIhYWFqaSkxKPm/Pnz+uabbxQWFiZJCgsLU3FxsUeN+/XlatzL62KxWGSxWK55n64HrgcCAODaeP05OV9++aW+/vprdejQQZJks9lUVlam/Px8o2b79u2qqalRdHS0UbNz506dO3fOqMnOzlbPnj11yy23GDU5OTkevbKzs2Wz2by9SwAAoBGod8g5ffq0CgoKVFBQIEk6duyYCgoKVFRUpNOnT2v27Nn64IMP9PnnnysnJ0cPPfSQevToIbvdLknq3bu37r//fk2dOlW7d+/W3/72N82YMUPjxo1Tx44dJUnjx49XUFCQJk+erIMHD2rDhg1asWKFx6mmJ598UllZWXrmmWd06NAhzZ8/Xx999JFmzJjRAG8LAABo7Oodcj766CMNGDBAAwYMkCQlJSVpwIABSktLU0BAgPbv36+f/exn+vGPf6zJkycrKipK7733nsdpoldeeUW9evXSiBEj9MADD+iuu+7yeAZOcHCw3n77bR07dkxRUVH65S9/qbS0NI9n6dxxxx1av3691qxZo/79++v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3jh07Vud89/ft6/HzVJIKCwu1fv36WvNDQkL01VdfNXi/HwaX9957Ty+88IKOHj2q119/XT/60Y/0xz/+8YpD4NX64anRc+fOad++fXr66af1n//5n17r66vPMELOJQwYMMA4bP/FF19oz549atu2rU/GEhER4ZV/eFdi/Pjxys3NVWVlpYYOHap77rlHKSkp6tevn9d/IP3Hf/yHpLqPlHnrA2DZsmWSvv+hm56e7nGYPigoSF26dFF6enqD9/2hnJwc5eTkqKSkxCMI+Pn56cUXX2zwfjfrfrvdd999mjJligYMGKB//OMfRvg4ePCgbr31Vq/1femllxQeHl7rdFBNTY3Xr7eTpLlz5+rPf/6zEXAkqUePHvqv//ovjRkzRp999pmWLFmiMWPGeKX/iy++qGXLlhk3dtx2222aNWuWpkyZ4pV+bq1bt9bJkydrhYp9+/bpRz/6kVd7//nPf9bEiRM1YcIE7du3T5WVlZKk8vJy/e53v9Nbb73ltd7BwcG15t13330KCgpSUlKS8vPzvdLXZ59hLlxUmzZtXB988IHL5XK5/Pz8XCUlJT4bS05Ojstms7neffdd11dffeUqLy/3mLzJz8/P1b59e1dycrJr27ZtroqKCq/2u1EMGzbMderUKZ/0nj9/vsvf3981ePBg10MPPeQaNWqUx+RNF+53TU2Nq6amxqv9LuTL/T516pRrxowZroceesiVlZVlzE9LS3MtXLjQa339/f1dxcXFteZ/9dVXLn9/f6/1dWvWrJlrz549tebv3r3b1axZM5fL5XIdO3bM1aJFiwbv/fTTT7tatGjhSklJcb3xxhuuN954w5WSkuJq2bKl6+mnn27wfhf65S9/6brrrrtcJ0+edLVq1cr16aefut5//31Xt27dXPPnz/dq78jISNe6detcLpfL1bJlS9fRo0ddLpfLtXfvXldoaKhXe1/MJ5980uB/xxd+RvnqM4xrci7hiSee0Msvv6wOHTqoqKhInTp1uujFd948dyx5nke93oe0T506pffee087duxQbm6uPvnkE0VGRmrYsGEaNmyYYmNjvdZ7wYIFF13m5+enp59+ukH7JSUl6be//a1atGihxMTESx6p8uZ1WB06dNCSJUs0ceJ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U+Hh0aCkdyGhlffMt8/fXXNX78eFVXV2vEiBF6++23JX1/dGnnzp3aunWr18cAoOG4r5O4HD8/P23fvt3Lo/GtiooK47Rs9+7da12jgsaNkIMr4nA4dPLkSfXv3994+vLu3btltVp9+ktDAQC4GEIOAAAwJf/LlwAAADQ+hBwAAGBKhBwAAGBKhBwAAGBKhBwAAGBKhBwAAGBKhBwAAGBK/w+yc0I/BK+1SgAAAABJRU5ErkJggg==\n",
|
314 |
+
"text/plain": [
|
315 |
+
"<Figure size 640x480 with 1 Axes>"
|
316 |
+
]
|
317 |
+
},
|
318 |
+
"metadata": {},
|
319 |
+
"output_type": "display_data"
|
320 |
+
}
|
321 |
+
],
|
322 |
+
"source": [
|
323 |
+
"df.language.value_counts().plot.bar()"
|
324 |
+
]
|
325 |
+
},
|
326 |
+
{
|
327 |
+
"cell_type": "code",
|
328 |
+
"execution_count": 19,
|
329 |
+
"id": "04d8369e",
|
330 |
+
"metadata": {},
|
331 |
+
"outputs": [
|
332 |
+
{
|
333 |
+
"data": {
|
334 |
+
"text/plain": [
|
335 |
+
"(24002, 3)"
|
336 |
+
]
|
337 |
+
},
|
338 |
+
"execution_count": 19,
|
339 |
+
"metadata": {},
|
340 |
+
"output_type": "execute_result"
|
341 |
+
}
|
342 |
+
],
|
343 |
+
"source": [
|
344 |
+
"errors_df = df.loc[df.language != \"fr\"]\n",
|
345 |
+
"errors_df.shape"
|
346 |
+
]
|
347 |
+
},
|
348 |
+
{
|
349 |
+
"cell_type": "code",
|
350 |
+
"execution_count": 23,
|
351 |
+
"id": "f1ed5db9",
|
352 |
+
"metadata": {},
|
353 |
+
"outputs": [
|
354 |
+
{
|
355 |
+
"data": {
|
356 |
+
"text/html": [
|
357 |
+
"<div>\n",
|
358 |
+
"<style scoped>\n",
|
359 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
360 |
+
" vertical-align: middle;\n",
|
361 |
+
" }\n",
|
362 |
+
"\n",
|
363 |
+
" .dataframe tbody tr th {\n",
|
364 |
+
" vertical-align: top;\n",
|
365 |
+
" }\n",
|
366 |
+
"\n",
|
367 |
+
" .dataframe thead th {\n",
|
368 |
+
" text-align: right;\n",
|
369 |
+
" }\n",
|
370 |
+
"</style>\n",
|
371 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
372 |
+
" <thead>\n",
|
373 |
+
" <tr style=\"text-align: right;\">\n",
|
374 |
+
" <th></th>\n",
|
375 |
+
" <th>text</th>\n",
|
376 |
+
" <th>label</th>\n",
|
377 |
+
" <th>language</th>\n",
|
378 |
+
" </tr>\n",
|
379 |
+
" </thead>\n",
|
380 |
+
" <tbody>\n",
|
381 |
+
" <tr>\n",
|
382 |
+
" <th>3218</th>\n",
|
383 |
+
" <td>oshi que mongol</td>\n",
|
384 |
+
" <td>0</td>\n",
|
385 |
+
" <td>sw</td>\n",
|
386 |
+
" </tr>\n",
|
387 |
+
" <tr>\n",
|
388 |
+
" <th>[2019-06-13 14:16:49]</th>\n",
|
389 |
+
" <td>toi ta mere c satan</td>\n",
|
390 |
+
" <td>1</td>\n",
|
391 |
+
" <td>hi</td>\n",
|
392 |
+
" </tr>\n",
|
393 |
+
" <tr>\n",
|
394 |
+
" <th>235</th>\n",
|
395 |
+
" <td>Fascist republican profiteers nazi pigs https:...</td>\n",
|
396 |
+
" <td>1</td>\n",
|
397 |
+
" <td>it</td>\n",
|
398 |
+
" </tr>\n",
|
399 |
+
" <tr>\n",
|
400 |
+
" <th>[2019-06-13 14:33:42]</th>\n",
|
401 |
+
" <td>boucje</td>\n",
|
402 |
+
" <td>0</td>\n",
|
403 |
+
" <td>pl</td>\n",
|
404 |
+
" </tr>\n",
|
405 |
+
" <tr>\n",
|
406 |
+
" <th>9203</th>\n",
|
407 |
+
" <td>yes i am</td>\n",
|
408 |
+
" <td>0</td>\n",
|
409 |
+
" <td>sw</td>\n",
|
410 |
+
" </tr>\n",
|
411 |
+
" <tr>\n",
|
412 |
+
" <th>2783</th>\n",
|
413 |
+
" <td>buenos aires</td>\n",
|
414 |
+
" <td>0</td>\n",
|
415 |
+
" <td>es</td>\n",
|
416 |
+
" </tr>\n",
|
417 |
+
" <tr>\n",
|
418 |
+
" <th>[2019-06-13 14:32:11]</th>\n",
|
419 |
+
" <td>salope</td>\n",
|
420 |
+
" <td>1</td>\n",
|
421 |
+
" <td>bg</td>\n",
|
422 |
+
" </tr>\n",
|
423 |
+
" <tr>\n",
|
424 |
+
" <th>3228</th>\n",
|
425 |
+
" <td>gay men aren't real men</td>\n",
|
426 |
+
" <td>1</td>\n",
|
427 |
+
" <td>nl</td>\n",
|
428 |
+
" </tr>\n",
|
429 |
+
" <tr>\n",
|
430 |
+
" <th>2814</th>\n",
|
431 |
+
" <td>@Btlabeutax93 @AntiChanell Mdrrrr wesh jtarran...</td>\n",
|
432 |
+
" <td>0</td>\n",
|
433 |
+
" <td>tr</td>\n",
|
434 |
+
" </tr>\n",
|
435 |
+
" <tr>\n",
|
436 |
+
" <th>3005</th>\n",
|
437 |
+
" <td>no</td>\n",
|
438 |
+
" <td>0</td>\n",
|
439 |
+
" <td>sw</td>\n",
|
440 |
+
" </tr>\n",
|
441 |
+
" <tr>\n",
|
442 |
+
" <th>8460</th>\n",
|
443 |
+
" <td>i wan't</td>\n",
|
444 |
+
" <td>0</td>\n",
|
445 |
+
" <td>sw</td>\n",
|
446 |
+
" </tr>\n",
|
447 |
+
" <tr>\n",
|
448 |
+
" <th>1031</th>\n",
|
449 |
+
" <td>\"Comme si Hitler n'existait pas !</td>\n",
|
450 |
+
" <td>0</td>\n",
|
451 |
+
" <td>it</td>\n",
|
452 |
+
" </tr>\n",
|
453 |
+
" <tr>\n",
|
454 |
+
" <th>[2019-06-13 14:29:04]</th>\n",
|
455 |
+
" <td>Adrien</td>\n",
|
456 |
+
" <td>0</td>\n",
|
457 |
+
" <td>nl</td>\n",
|
458 |
+
" </tr>\n",
|
459 |
+
" <tr>\n",
|
460 |
+
" <th>[2019-06-13 14:31:44]</th>\n",
|
461 |
+
" <td>...</td>\n",
|
462 |
+
" <td>0</td>\n",
|
463 |
+
" <td>hi</td>\n",
|
464 |
+
" </tr>\n",
|
465 |
+
" <tr>\n",
|
466 |
+
" <th>2260</th>\n",
|
467 |
+
" <td>@TeikOoFN @Sweafts @wahxbb Tu penses j'en reço...</td>\n",
|
468 |
+
" <td>1</td>\n",
|
469 |
+
" <td>nl</td>\n",
|
470 |
+
" </tr>\n",
|
471 |
+
" <tr>\n",
|
472 |
+
" <th>1844</th>\n",
|
473 |
+
" <td>Trichirappalli</td>\n",
|
474 |
+
" <td>0</td>\n",
|
475 |
+
" <td>hi</td>\n",
|
476 |
+
" </tr>\n",
|
477 |
+
" <tr>\n",
|
478 |
+
" <th>6357</th>\n",
|
479 |
+
" <td>lax</td>\n",
|
480 |
+
" <td>0</td>\n",
|
481 |
+
" <td>it</td>\n",
|
482 |
+
" </tr>\n",
|
483 |
+
" <tr>\n",
|
484 |
+
" <th>[2019-06-13 14:22:19]</th>\n",
|
485 |
+
" <td>pute</td>\n",
|
486 |
+
" <td>0</td>\n",
|
487 |
+
" <td>ur</td>\n",
|
488 |
+
" </tr>\n",
|
489 |
+
" <tr>\n",
|
490 |
+
" <th>8913</th>\n",
|
491 |
+
" <td>Yep</td>\n",
|
492 |
+
" <td>0</td>\n",
|
493 |
+
" <td>sw</td>\n",
|
494 |
+
" </tr>\n",
|
495 |
+
" <tr>\n",
|
496 |
+
" <th>[2019-06-13 14:28:14]</th>\n",
|
497 |
+
" <td>sylvia ouuouuu?</td>\n",
|
498 |
+
" <td>0</td>\n",
|
499 |
+
" <td>pt</td>\n",
|
500 |
+
" </tr>\n",
|
501 |
+
" </tbody>\n",
|
502 |
+
"</table>\n",
|
503 |
+
"</div>"
|
504 |
+
],
|
505 |
+
"text/plain": [
|
506 |
+
" text \\\n",
|
507 |
+
"3218 oshi que mongol \n",
|
508 |
+
"[2019-06-13 14:16:49] toi ta mere c satan \n",
|
509 |
+
"235 Fascist republican profiteers nazi pigs https:... \n",
|
510 |
+
"[2019-06-13 14:33:42] boucje \n",
|
511 |
+
"9203 yes i am \n",
|
512 |
+
"2783 buenos aires \n",
|
513 |
+
"[2019-06-13 14:32:11] salope \n",
|
514 |
+
"3228 gay men aren't real men \n",
|
515 |
+
"2814 @Btlabeutax93 @AntiChanell Mdrrrr wesh jtarran... \n",
|
516 |
+
"3005 no \n",
|
517 |
+
"8460 i wan't \n",
|
518 |
+
"1031 \"Comme si Hitler n'existait pas ! \n",
|
519 |
+
"[2019-06-13 14:29:04] Adrien \n",
|
520 |
+
"[2019-06-13 14:31:44] ... \n",
|
521 |
+
"2260 @TeikOoFN @Sweafts @wahxbb Tu penses j'en reço... \n",
|
522 |
+
"1844 Trichirappalli \n",
|
523 |
+
"6357 lax \n",
|
524 |
+
"[2019-06-13 14:22:19] pute \n",
|
525 |
+
"8913 Yep \n",
|
526 |
+
"[2019-06-13 14:28:14] sylvia ouuouuu? \n",
|
527 |
+
"\n",
|
528 |
+
" label language \n",
|
529 |
+
"3218 0 sw \n",
|
530 |
+
"[2019-06-13 14:16:49] 1 hi \n",
|
531 |
+
"235 1 it \n",
|
532 |
+
"[2019-06-13 14:33:42] 0 pl \n",
|
533 |
+
"9203 0 sw \n",
|
534 |
+
"2783 0 es \n",
|
535 |
+
"[2019-06-13 14:32:11] 1 bg \n",
|
536 |
+
"3228 1 nl \n",
|
537 |
+
"2814 0 tr \n",
|
538 |
+
"3005 0 sw \n",
|
539 |
+
"8460 0 sw \n",
|
540 |
+
"1031 0 it \n",
|
541 |
+
"[2019-06-13 14:29:04] 0 nl \n",
|
542 |
+
"[2019-06-13 14:31:44] 0 hi \n",
|
543 |
+
"2260 1 nl \n",
|
544 |
+
"1844 0 hi \n",
|
545 |
+
"6357 0 it \n",
|
546 |
+
"[2019-06-13 14:22:19] 0 ur \n",
|
547 |
+
"8913 0 sw \n",
|
548 |
+
"[2019-06-13 14:28:14] 0 pt "
|
549 |
+
]
|
550 |
+
},
|
551 |
+
"execution_count": 23,
|
552 |
+
"metadata": {},
|
553 |
+
"output_type": "execute_result"
|
554 |
+
}
|
555 |
+
],
|
556 |
+
"source": [
|
557 |
+
"errors_df.loc[errors_df.language != \"en\"].sample(20)"
|
558 |
+
]
|
559 |
+
},
|
560 |
+
{
|
561 |
+
"cell_type": "code",
|
562 |
+
"execution_count": 39,
|
563 |
+
"id": "87c43105",
|
564 |
+
"metadata": {
|
565 |
+
"scrolled": true
|
566 |
+
},
|
567 |
+
"outputs": [
|
568 |
+
{
|
569 |
+
"name": "stdout",
|
570 |
+
"output_type": "stream",
|
571 |
+
"text": [
|
572 |
+
"Pred errors : 441\n"
|
573 |
+
]
|
574 |
+
},
|
575 |
+
{
|
576 |
+
"data": {
|
577 |
+
"text/html": [
|
578 |
+
"<div>\n",
|
579 |
+
"<style scoped>\n",
|
580 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
581 |
+
" vertical-align: middle;\n",
|
582 |
+
" }\n",
|
583 |
+
"\n",
|
584 |
+
" .dataframe tbody tr th {\n",
|
585 |
+
" vertical-align: top;\n",
|
586 |
+
" }\n",
|
587 |
+
"\n",
|
588 |
+
" .dataframe thead th {\n",
|
589 |
+
" text-align: right;\n",
|
590 |
+
" }\n",
|
591 |
+
"</style>\n",
|
592 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
593 |
+
" <thead>\n",
|
594 |
+
" <tr style=\"text-align: right;\">\n",
|
595 |
+
" <th></th>\n",
|
596 |
+
" <th>text</th>\n",
|
597 |
+
" <th>label</th>\n",
|
598 |
+
" <th>language</th>\n",
|
599 |
+
" </tr>\n",
|
600 |
+
" </thead>\n",
|
601 |
+
" <tbody>\n",
|
602 |
+
" <tr>\n",
|
603 |
+
" <th>5823</th>\n",
|
604 |
+
" <td>dumb bot</td>\n",
|
605 |
+
" <td>1</td>\n",
|
606 |
+
" <td>fr</td>\n",
|
607 |
+
" </tr>\n",
|
608 |
+
" <tr>\n",
|
609 |
+
" <th>6783</th>\n",
|
610 |
+
" <td>dumb bot</td>\n",
|
611 |
+
" <td>1</td>\n",
|
612 |
+
" <td>fr</td>\n",
|
613 |
+
" </tr>\n",
|
614 |
+
" <tr>\n",
|
615 |
+
" <th>8898</th>\n",
|
616 |
+
" <td>dumb bot</td>\n",
|
617 |
+
" <td>1</td>\n",
|
618 |
+
" <td>fr</td>\n",
|
619 |
+
" </tr>\n",
|
620 |
+
" <tr>\n",
|
621 |
+
" <th>[2019-06-13 14:12:47]</th>\n",
|
622 |
+
" <td>t as vu ce que t as fait a la soiré sale pute</td>\n",
|
623 |
+
" <td>1</td>\n",
|
624 |
+
" <td>fr</td>\n",
|
625 |
+
" </tr>\n",
|
626 |
+
" <tr>\n",
|
627 |
+
" <th>[2019-06-13 14:14:56]</th>\n",
|
628 |
+
" <td>je suis espagnol pardon de ne pas tout savoir...</td>\n",
|
629 |
+
" <td>1</td>\n",
|
630 |
+
" <td>fr</td>\n",
|
631 |
+
" </tr>\n",
|
632 |
+
" <tr>\n",
|
633 |
+
" <th>...</th>\n",
|
634 |
+
" <td>...</td>\n",
|
635 |
+
" <td>...</td>\n",
|
636 |
+
" <td>...</td>\n",
|
637 |
+
" </tr>\n",
|
638 |
+
" <tr>\n",
|
639 |
+
" <th>[2019-06-13 14:32:11]</th>\n",
|
640 |
+
" <td>salope</td>\n",
|
641 |
+
" <td>0</td>\n",
|
642 |
+
" <td>fr</td>\n",
|
643 |
+
" </tr>\n",
|
644 |
+
" <tr>\n",
|
645 |
+
" <th>[2019-06-13 14:16:49]</th>\n",
|
646 |
+
" <td>toi ta mere c satan</td>\n",
|
647 |
+
" <td>0</td>\n",
|
648 |
+
" <td>fr</td>\n",
|
649 |
+
" </tr>\n",
|
650 |
+
" <tr>\n",
|
651 |
+
" <th>[2019-06-13 14:22:15]</th>\n",
|
652 |
+
" <td>t conne</td>\n",
|
653 |
+
" <td>0</td>\n",
|
654 |
+
" <td>fr</td>\n",
|
655 |
+
" </tr>\n",
|
656 |
+
" <tr>\n",
|
657 |
+
" <th>[2019-06-13 14:22:22]</th>\n",
|
658 |
+
" <td>salope</td>\n",
|
659 |
+
" <td>0</td>\n",
|
660 |
+
" <td>fr</td>\n",
|
661 |
+
" </tr>\n",
|
662 |
+
" <tr>\n",
|
663 |
+
" <th>[2019-06-13 14:32:11]</th>\n",
|
664 |
+
" <td>salope</td>\n",
|
665 |
+
" <td>0</td>\n",
|
666 |
+
" <td>fr</td>\n",
|
667 |
+
" </tr>\n",
|
668 |
+
" </tbody>\n",
|
669 |
+
"</table>\n",
|
670 |
+
"<p>42663 rows × 3 columns</p>\n",
|
671 |
+
"</div>"
|
672 |
+
],
|
673 |
+
"text/plain": [
|
674 |
+
" text \\\n",
|
675 |
+
"5823 dumb bot \n",
|
676 |
+
"6783 dumb bot \n",
|
677 |
+
"8898 dumb bot \n",
|
678 |
+
"[2019-06-13 14:12:47] t as vu ce que t as fait a la soiré sale pute \n",
|
679 |
+
"[2019-06-13 14:14:56] je suis espagnol pardon de ne pas tout savoir... \n",
|
680 |
+
"... ... \n",
|
681 |
+
"[2019-06-13 14:32:11] salope \n",
|
682 |
+
"[2019-06-13 14:16:49] toi ta mere c satan \n",
|
683 |
+
"[2019-06-13 14:22:15] t conne \n",
|
684 |
+
"[2019-06-13 14:22:22] salope \n",
|
685 |
+
"[2019-06-13 14:32:11] salope \n",
|
686 |
+
"\n",
|
687 |
+
" label language \n",
|
688 |
+
"5823 1 fr \n",
|
689 |
+
"6783 1 fr \n",
|
690 |
+
"8898 1 fr \n",
|
691 |
+
"[2019-06-13 14:12:47] 1 fr \n",
|
692 |
+
"[2019-06-13 14:14:56] 1 fr \n",
|
693 |
+
"... ... ... \n",
|
694 |
+
"[2019-06-13 14:32:11] 0 fr \n",
|
695 |
+
"[2019-06-13 14:16:49] 0 fr \n",
|
696 |
+
"[2019-06-13 14:22:15] 0 fr \n",
|
697 |
+
"[2019-06-13 14:22:22] 0 fr \n",
|
698 |
+
"[2019-06-13 14:32:11] 0 fr \n",
|
699 |
+
"\n",
|
700 |
+
"[42663 rows x 3 columns]"
|
701 |
+
]
|
702 |
+
},
|
703 |
+
"execution_count": 39,
|
704 |
+
"metadata": {},
|
705 |
+
"output_type": "execute_result"
|
706 |
+
}
|
707 |
+
],
|
708 |
+
"source": [
|
709 |
+
"clean_df = df.loc[df.language == \"fr\"]\n",
|
710 |
+
"\n",
|
711 |
+
"# Check language predictions using specific stopword list\n",
|
712 |
+
"stopwords = [\"conne\", \"salope\", \"mere\"]\n",
|
713 |
+
"\n",
|
714 |
+
"pred_errors = errors_df.loc[errors_df.text.str.contains(\"|\".join(stopwords))]\n",
|
715 |
+
"print(\"Pred errors :\", pred_errors.shape[0])\n",
|
716 |
+
"clean_df = pd.concat([clean_df, pred_errors])\n",
|
717 |
+
"clean_df[\"language\"] = \"fr\"\n",
|
718 |
+
"clean_df"
|
719 |
+
]
|
720 |
+
},
|
721 |
+
{
|
722 |
+
"cell_type": "markdown",
|
723 |
+
"id": "8a33a9c3",
|
724 |
+
"metadata": {},
|
725 |
+
"source": [
|
726 |
+
"### Manual postprocessing\n",
|
727 |
+
"\n",
|
728 |
+
"Remove manually detected wrong language rows"
|
729 |
+
]
|
730 |
+
},
|
731 |
+
{
|
732 |
+
"cell_type": "code",
|
733 |
+
"execution_count": 47,
|
734 |
+
"id": "9d9f26e1",
|
735 |
+
"metadata": {},
|
736 |
+
"outputs": [
|
737 |
+
{
|
738 |
+
"data": {
|
739 |
+
"text/html": [
|
740 |
+
"<div>\n",
|
741 |
+
"<style scoped>\n",
|
742 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
743 |
+
" vertical-align: middle;\n",
|
744 |
+
" }\n",
|
745 |
+
"\n",
|
746 |
+
" .dataframe tbody tr th {\n",
|
747 |
+
" vertical-align: top;\n",
|
748 |
+
" }\n",
|
749 |
+
"\n",
|
750 |
+
" .dataframe thead th {\n",
|
751 |
+
" text-align: right;\n",
|
752 |
+
" }\n",
|
753 |
+
"</style>\n",
|
754 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
755 |
+
" <thead>\n",
|
756 |
+
" <tr style=\"text-align: right;\">\n",
|
757 |
+
" <th></th>\n",
|
758 |
+
" <th>text</th>\n",
|
759 |
+
" <th>label</th>\n",
|
760 |
+
" <th>language</th>\n",
|
761 |
+
" </tr>\n",
|
762 |
+
" </thead>\n",
|
763 |
+
" <tbody>\n",
|
764 |
+
" <tr>\n",
|
765 |
+
" <th>[2019-06-13 14:12:47]</th>\n",
|
766 |
+
" <td>t as vu ce que t as fait a la soiré sale pute</td>\n",
|
767 |
+
" <td>1</td>\n",
|
768 |
+
" <td>fr</td>\n",
|
769 |
+
" </tr>\n",
|
770 |
+
" <tr>\n",
|
771 |
+
" <th>[2019-06-13 14:14:56]</th>\n",
|
772 |
+
" <td>je suis espagnol pardon de ne pas tout savoir...</td>\n",
|
773 |
+
" <td>1</td>\n",
|
774 |
+
" <td>fr</td>\n",
|
775 |
+
" </tr>\n",
|
776 |
+
" <tr>\n",
|
777 |
+
" <th>[2019-06-13 14:15:18]</th>\n",
|
778 |
+
" <td>tu as embrasser Lucas alors que sophia est ta...</td>\n",
|
779 |
+
" <td>1</td>\n",
|
780 |
+
" <td>fr</td>\n",
|
781 |
+
" </tr>\n",
|
782 |
+
" <tr>\n",
|
783 |
+
" <th>[2019-06-13 14:15:27]</th>\n",
|
784 |
+
" <td>tu as foutu la merde dans leurs couple</td>\n",
|
785 |
+
" <td>1</td>\n",
|
786 |
+
" <td>fr</td>\n",
|
787 |
+
" </tr>\n",
|
788 |
+
" <tr>\n",
|
789 |
+
" <th>[2019-06-13 14:15:31]</th>\n",
|
790 |
+
" <td>c'est dégeulasse</td>\n",
|
791 |
+
" <td>1</td>\n",
|
792 |
+
" <td>fr</td>\n",
|
793 |
+
" </tr>\n",
|
794 |
+
" <tr>\n",
|
795 |
+
" <th>...</th>\n",
|
796 |
+
" <td>...</td>\n",
|
797 |
+
" <td>...</td>\n",
|
798 |
+
" <td>...</td>\n",
|
799 |
+
" </tr>\n",
|
800 |
+
" <tr>\n",
|
801 |
+
" <th>[2019-06-13 14:32:11]</th>\n",
|
802 |
+
" <td>salope</td>\n",
|
803 |
+
" <td>0</td>\n",
|
804 |
+
" <td>fr</td>\n",
|
805 |
+
" </tr>\n",
|
806 |
+
" <tr>\n",
|
807 |
+
" <th>[2019-06-13 14:16:49]</th>\n",
|
808 |
+
" <td>toi ta mere c satan</td>\n",
|
809 |
+
" <td>0</td>\n",
|
810 |
+
" <td>fr</td>\n",
|
811 |
+
" </tr>\n",
|
812 |
+
" <tr>\n",
|
813 |
+
" <th>[2019-06-13 14:22:15]</th>\n",
|
814 |
+
" <td>t conne</td>\n",
|
815 |
+
" <td>0</td>\n",
|
816 |
+
" <td>fr</td>\n",
|
817 |
+
" </tr>\n",
|
818 |
+
" <tr>\n",
|
819 |
+
" <th>[2019-06-13 14:22:22]</th>\n",
|
820 |
+
" <td>salope</td>\n",
|
821 |
+
" <td>0</td>\n",
|
822 |
+
" <td>fr</td>\n",
|
823 |
+
" </tr>\n",
|
824 |
+
" <tr>\n",
|
825 |
+
" <th>[2019-06-13 14:32:11]</th>\n",
|
826 |
+
" <td>salope</td>\n",
|
827 |
+
" <td>0</td>\n",
|
828 |
+
" <td>fr</td>\n",
|
829 |
+
" </tr>\n",
|
830 |
+
" </tbody>\n",
|
831 |
+
"</table>\n",
|
832 |
+
"<p>42660 rows × 3 columns</p>\n",
|
833 |
+
"</div>"
|
834 |
+
],
|
835 |
+
"text/plain": [
|
836 |
+
" text \\\n",
|
837 |
+
"[2019-06-13 14:12:47] t as vu ce que t as fait a la soiré sale pute \n",
|
838 |
+
"[2019-06-13 14:14:56] je suis espagnol pardon de ne pas tout savoir... \n",
|
839 |
+
"[2019-06-13 14:15:18] tu as embrasser Lucas alors que sophia est ta... \n",
|
840 |
+
"[2019-06-13 14:15:27] tu as foutu la merde dans leurs couple \n",
|
841 |
+
"[2019-06-13 14:15:31] c'est dégeulasse \n",
|
842 |
+
"... ... \n",
|
843 |
+
"[2019-06-13 14:32:11] salope \n",
|
844 |
+
"[2019-06-13 14:16:49] toi ta mere c satan \n",
|
845 |
+
"[2019-06-13 14:22:15] t conne \n",
|
846 |
+
"[2019-06-13 14:22:22] salope \n",
|
847 |
+
"[2019-06-13 14:32:11] salope \n",
|
848 |
+
"\n",
|
849 |
+
" label language \n",
|
850 |
+
"[2019-06-13 14:12:47] 1 fr \n",
|
851 |
+
"[2019-06-13 14:14:56] 1 fr \n",
|
852 |
+
"[2019-06-13 14:15:18] 1 fr \n",
|
853 |
+
"[2019-06-13 14:15:27] 1 fr \n",
|
854 |
+
"[2019-06-13 14:15:31] 1 fr \n",
|
855 |
+
"... ... ... \n",
|
856 |
+
"[2019-06-13 14:32:11] 0 fr \n",
|
857 |
+
"[2019-06-13 14:16:49] 0 fr \n",
|
858 |
+
"[2019-06-13 14:22:15] 0 fr \n",
|
859 |
+
"[2019-06-13 14:22:22] 0 fr \n",
|
860 |
+
"[2019-06-13 14:32:11] 0 fr \n",
|
861 |
+
"\n",
|
862 |
+
"[42660 rows x 3 columns]"
|
863 |
+
]
|
864 |
+
},
|
865 |
+
"execution_count": 47,
|
866 |
+
"metadata": {},
|
867 |
+
"output_type": "execute_result"
|
868 |
+
}
|
869 |
+
],
|
870 |
+
"source": [
|
871 |
+
"ids = [\"5823\", \"6783\", \"8898\", \"1966\"]\n",
|
872 |
+
"\n",
|
873 |
+
"manual_clean_df = clean_df.loc[clean_df.index.isin(ids) == False]\n",
|
874 |
+
"manual_clean_df"
|
875 |
+
]
|
876 |
+
},
|
877 |
+
{
|
878 |
+
"cell_type": "code",
|
879 |
+
"execution_count": 63,
|
880 |
+
"id": "fb79ecfb",
|
881 |
+
"metadata": {},
|
882 |
+
"outputs": [
|
883 |
+
{
|
884 |
+
"data": {
|
885 |
+
"text/html": [
|
886 |
+
"<div>\n",
|
887 |
+
"<style scoped>\n",
|
888 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
889 |
+
" vertical-align: middle;\n",
|
890 |
+
" }\n",
|
891 |
+
"\n",
|
892 |
+
" .dataframe tbody tr th {\n",
|
893 |
+
" vertical-align: top;\n",
|
894 |
+
" }\n",
|
895 |
+
"\n",
|
896 |
+
" .dataframe thead th {\n",
|
897 |
+
" text-align: right;\n",
|
898 |
+
" }\n",
|
899 |
+
"</style>\n",
|
900 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
901 |
+
" <thead>\n",
|
902 |
+
" <tr style=\"text-align: right;\">\n",
|
903 |
+
" <th></th>\n",
|
904 |
+
" <th>text</th>\n",
|
905 |
+
" <th>label</th>\n",
|
906 |
+
" <th>language</th>\n",
|
907 |
+
" </tr>\n",
|
908 |
+
" </thead>\n",
|
909 |
+
" <tbody>\n",
|
910 |
+
" <tr>\n",
|
911 |
+
" <th>[2019-06-13 14:21:43]</th>\n",
|
912 |
+
" <td>apprend a écrire connasse</td>\n",
|
913 |
+
" <td>0</td>\n",
|
914 |
+
" <td>fr</td>\n",
|
915 |
+
" </tr>\n",
|
916 |
+
" <tr>\n",
|
917 |
+
" <th>[2019-06-13 14:21:42]</th>\n",
|
918 |
+
" <td>il leur paie des apparts privés</td>\n",
|
919 |
+
" <td>0</td>\n",
|
920 |
+
" <td>fr</td>\n",
|
921 |
+
" </tr>\n",
|
922 |
+
" <tr>\n",
|
923 |
+
" <th>3333</th>\n",
|
924 |
+
" <td>la pauvreté n'est le collateral de la violence...</td>\n",
|
925 |
+
" <td>0</td>\n",
|
926 |
+
" <td>fr</td>\n",
|
927 |
+
" </tr>\n",
|
928 |
+
" <tr>\n",
|
929 |
+
" <th>827</th>\n",
|
930 |
+
" <td>\"Les décès massifs qui ont lieu en Afghanistan...</td>\n",
|
931 |
+
" <td>0</td>\n",
|
932 |
+
" <td>fr</td>\n",
|
933 |
+
" </tr>\n",
|
934 |
+
" <tr>\n",
|
935 |
+
" <th>2674</th>\n",
|
936 |
+
" <td>@Arashi_Storm @Jubaieuh par contre dire que je...</td>\n",
|
937 |
+
" <td>0</td>\n",
|
938 |
+
" <td>fr</td>\n",
|
939 |
+
" </tr>\n",
|
940 |
+
" <tr>\n",
|
941 |
+
" <th>1023</th>\n",
|
942 |
+
" <td>@TeTr4_Live Non mais totalement... Bon Zemmour...</td>\n",
|
943 |
+
" <td>0</td>\n",
|
944 |
+
" <td>fr</td>\n",
|
945 |
+
" </tr>\n",
|
946 |
+
" <tr>\n",
|
947 |
+
" <th>284</th>\n",
|
948 |
+
" <td>homme si une dame a essayé de se mettre entre ...</td>\n",
|
949 |
+
" <td>0</td>\n",
|
950 |
+
" <td>fr</td>\n",
|
951 |
+
" </tr>\n",
|
952 |
+
" <tr>\n",
|
953 |
+
" <th>664</th>\n",
|
954 |
+
" <td>rt l'histoire du quebec vaut la peine qu'on s...</td>\n",
|
955 |
+
" <td>0</td>\n",
|
956 |
+
" <td>fr</td>\n",
|
957 |
+
" </tr>\n",
|
958 |
+
" <tr>\n",
|
959 |
+
" <th>[2019-06-13 14:28:44]</th>\n",
|
960 |
+
" <td>déso j'avais plus de connexion</td>\n",
|
961 |
+
" <td>0</td>\n",
|
962 |
+
" <td>fr</td>\n",
|
963 |
+
" </tr>\n",
|
964 |
+
" <tr>\n",
|
965 |
+
" <th>609</th>\n",
|
966 |
+
" <td>@CommanderTorenn On va faire court,je ne m,int...</td>\n",
|
967 |
+
" <td>0</td>\n",
|
968 |
+
" <td>fr</td>\n",
|
969 |
+
" </tr>\n",
|
970 |
+
" <tr>\n",
|
971 |
+
" <th>[2019-06-13 14:35:20]</th>\n",
|
972 |
+
" <td>au moins j'arrive à me faire embrasse Diana</td>\n",
|
973 |
+
" <td>0</td>\n",
|
974 |
+
" <td>fr</td>\n",
|
975 |
+
" </tr>\n",
|
976 |
+
" <tr>\n",
|
977 |
+
" <th>[2019-06-13 14:32:35]</th>\n",
|
978 |
+
" <td>Mais oui...</td>\n",
|
979 |
+
" <td>0</td>\n",
|
980 |
+
" <td>fr</td>\n",
|
981 |
+
" </tr>\n",
|
982 |
+
" <tr>\n",
|
983 |
+
" <th>137</th>\n",
|
984 |
+
" <td>@djoulye @LiorahDouge @barriere_dr @MahmoudZur...</td>\n",
|
985 |
+
" <td>0</td>\n",
|
986 |
+
" <td>fr</td>\n",
|
987 |
+
" </tr>\n",
|
988 |
+
" <tr>\n",
|
989 |
+
" <th>1293</th>\n",
|
990 |
+
" <td>ptdrrr tout les «anti satanistes/theorie du co...</td>\n",
|
991 |
+
" <td>0</td>\n",
|
992 |
+
" <td>fr</td>\n",
|
993 |
+
" </tr>\n",
|
994 |
+
" <tr>\n",
|
995 |
+
" <th>[2019-06-13 14:35:04]</th>\n",
|
996 |
+
" <td>au moins mon pere est pas mort</td>\n",
|
997 |
+
" <td>0</td>\n",
|
998 |
+
" <td>fr</td>\n",
|
999 |
+
" </tr>\n",
|
1000 |
+
" <tr>\n",
|
1001 |
+
" <th>1602</th>\n",
|
1002 |
+
" <td>@LamoloQc @tvanouvelles On ne sera plus là pou...</td>\n",
|
1003 |
+
" <td>0</td>\n",
|
1004 |
+
" <td>fr</td>\n",
|
1005 |
+
" </tr>\n",
|
1006 |
+
" <tr>\n",
|
1007 |
+
" <th>[2019-06-13 14:16:49]</th>\n",
|
1008 |
+
" <td>toi ta mere c satan</td>\n",
|
1009 |
+
" <td>1</td>\n",
|
1010 |
+
" <td>fr</td>\n",
|
1011 |
+
" </tr>\n",
|
1012 |
+
" <tr>\n",
|
1013 |
+
" <th>[2019-06-13 14:24:51]</th>\n",
|
1014 |
+
" <td>t'es venu au nom de dieu Herbert?</td>\n",
|
1015 |
+
" <td>0</td>\n",
|
1016 |
+
" <td>fr</td>\n",
|
1017 |
+
" </tr>\n",
|
1018 |
+
" <tr>\n",
|
1019 |
+
" <th>[2019-06-13 14:11:46]</th>\n",
|
1020 |
+
" <td>Salut Adri, ça va?</td>\n",
|
1021 |
+
" <td>0</td>\n",
|
1022 |
+
" <td>fr</td>\n",
|
1023 |
+
" </tr>\n",
|
1024 |
+
" <tr>\n",
|
1025 |
+
" <th>[2019-06-13 14:32:11]</th>\n",
|
1026 |
+
" <td>salope</td>\n",
|
1027 |
+
" <td>0</td>\n",
|
1028 |
+
" <td>fr</td>\n",
|
1029 |
+
" </tr>\n",
|
1030 |
+
" </tbody>\n",
|
1031 |
+
"</table>\n",
|
1032 |
+
"</div>"
|
1033 |
+
],
|
1034 |
+
"text/plain": [
|
1035 |
+
" text \\\n",
|
1036 |
+
"[2019-06-13 14:21:43] apprend a écrire connasse \n",
|
1037 |
+
"[2019-06-13 14:21:42] il leur paie des apparts privés \n",
|
1038 |
+
"3333 la pauvreté n'est le collateral de la violence... \n",
|
1039 |
+
"827 \"Les décès massifs qui ont lieu en Afghanistan... \n",
|
1040 |
+
"2674 @Arashi_Storm @Jubaieuh par contre dire que je... \n",
|
1041 |
+
"1023 @TeTr4_Live Non mais totalement... Bon Zemmour... \n",
|
1042 |
+
"284 homme si une dame a essayé de se mettre entre ... \n",
|
1043 |
+
"664 rt l'histoire du quebec vaut la peine qu'on s... \n",
|
1044 |
+
"[2019-06-13 14:28:44] déso j'avais plus de connexion \n",
|
1045 |
+
"609 @CommanderTorenn On va faire court,je ne m,int... \n",
|
1046 |
+
"[2019-06-13 14:35:20] au moins j'arrive à me faire embrasse Diana \n",
|
1047 |
+
"[2019-06-13 14:32:35] Mais oui... \n",
|
1048 |
+
"137 @djoulye @LiorahDouge @barriere_dr @MahmoudZur... \n",
|
1049 |
+
"1293 ptdrrr tout les «anti satanistes/theorie du co... \n",
|
1050 |
+
"[2019-06-13 14:35:04] au moins mon pere est pas mort \n",
|
1051 |
+
"1602 @LamoloQc @tvanouvelles On ne sera plus là pou... \n",
|
1052 |
+
"[2019-06-13 14:16:49] toi ta mere c satan \n",
|
1053 |
+
"[2019-06-13 14:24:51] t'es venu au nom de dieu Herbert? \n",
|
1054 |
+
"[2019-06-13 14:11:46] Salut Adri, ça va? \n",
|
1055 |
+
"[2019-06-13 14:32:11] salope \n",
|
1056 |
+
"\n",
|
1057 |
+
" label language \n",
|
1058 |
+
"[2019-06-13 14:21:43] 0 fr \n",
|
1059 |
+
"[2019-06-13 14:21:42] 0 fr \n",
|
1060 |
+
"3333 0 fr \n",
|
1061 |
+
"827 0 fr \n",
|
1062 |
+
"2674 0 fr \n",
|
1063 |
+
"1023 0 fr \n",
|
1064 |
+
"284 0 fr \n",
|
1065 |
+
"664 0 fr \n",
|
1066 |
+
"[2019-06-13 14:28:44] 0 fr \n",
|
1067 |
+
"609 0 fr \n",
|
1068 |
+
"[2019-06-13 14:35:20] 0 fr \n",
|
1069 |
+
"[2019-06-13 14:32:35] 0 fr \n",
|
1070 |
+
"137 0 fr \n",
|
1071 |
+
"1293 0 fr \n",
|
1072 |
+
"[2019-06-13 14:35:04] 0 fr \n",
|
1073 |
+
"1602 0 fr \n",
|
1074 |
+
"[2019-06-13 14:16:49] 1 fr \n",
|
1075 |
+
"[2019-06-13 14:24:51] 0 fr \n",
|
1076 |
+
"[2019-06-13 14:11:46] 0 fr \n",
|
1077 |
+
"[2019-06-13 14:32:11] 0 fr "
|
1078 |
+
]
|
1079 |
+
},
|
1080 |
+
"execution_count": 63,
|
1081 |
+
"metadata": {},
|
1082 |
+
"output_type": "execute_result"
|
1083 |
+
}
|
1084 |
+
],
|
1085 |
+
"source": [
|
1086 |
+
"manual_clean_df.sample(20)"
|
1087 |
+
]
|
1088 |
+
},
|
1089 |
+
{
|
1090 |
+
"cell_type": "code",
|
1091 |
+
"execution_count": 69,
|
1092 |
+
"id": "922e8862",
|
1093 |
+
"metadata": {},
|
1094 |
+
"outputs": [],
|
1095 |
+
"source": [
|
1096 |
+
"manual_clean_df.to_csv(output_path)"
|
1097 |
+
]
|
1098 |
+
}
|
1099 |
+
],
|
1100 |
+
"metadata": {
|
1101 |
+
"kernelspec": {
|
1102 |
+
"display_name": "sexism_detection",
|
1103 |
+
"language": "python",
|
1104 |
+
"name": "sexism_detection"
|
1105 |
+
},
|
1106 |
+
"language_info": {
|
1107 |
+
"codemirror_mode": {
|
1108 |
+
"name": "ipython",
|
1109 |
+
"version": 3
|
1110 |
+
},
|
1111 |
+
"file_extension": ".py",
|
1112 |
+
"mimetype": "text/x-python",
|
1113 |
+
"name": "python",
|
1114 |
+
"nbconvert_exporter": "python",
|
1115 |
+
"pygments_lexer": "ipython3",
|
1116 |
+
"version": "3.9.15"
|
1117 |
+
}
|
1118 |
+
},
|
1119 |
+
"nbformat": 4,
|
1120 |
+
"nbformat_minor": 5
|
1121 |
+
}
|