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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "code",
|
5 |
+
"execution_count": null,
|
6 |
+
"metadata": {
|
7 |
+
"id": "MoW8_q7gUlIW"
|
8 |
+
},
|
9 |
+
"outputs": [],
|
10 |
+
"source": [
|
11 |
+
"# Register at: https://stackapps.com/apps/oauth/register\n",
|
12 |
+
"# !curl ipecho.net/plain\n",
|
13 |
+
"\n",
|
14 |
+
"secret = \"your_secret_key\"\n",
|
15 |
+
"key = \"your_api_key\""
|
16 |
+
]
|
17 |
+
},
|
18 |
+
{
|
19 |
+
"cell_type": "code",
|
20 |
+
"source": [
|
21 |
+
"# Which site to extract questions from\n",
|
22 |
+
"\n",
|
23 |
+
"site = \"medicalsciences\" # \"law\" or \"medicalsciences\" etc."
|
24 |
+
],
|
25 |
+
"metadata": {
|
26 |
+
"id": "ZCBvcPHXQDhP"
|
27 |
+
},
|
28 |
+
"execution_count": null,
|
29 |
+
"outputs": []
|
30 |
+
},
|
31 |
+
{
|
32 |
+
"cell_type": "code",
|
33 |
+
"execution_count": null,
|
34 |
+
"metadata": {
|
35 |
+
"id": "R15jxqHE949f"
|
36 |
+
},
|
37 |
+
"outputs": [],
|
38 |
+
"source": [
|
39 |
+
"import requests\n",
|
40 |
+
"from requests.adapters import HTTPAdapter, Retry\n",
|
41 |
+
"from requests.exceptions import ConnectionError\n",
|
42 |
+
"from tqdm.notebook import tqdm\n",
|
43 |
+
"import json\n",
|
44 |
+
"from time import sleep"
|
45 |
+
]
|
46 |
+
},
|
47 |
+
{
|
48 |
+
"cell_type": "markdown",
|
49 |
+
"metadata": {
|
50 |
+
"id": "GXc6vVHxetgV"
|
51 |
+
},
|
52 |
+
"source": [
|
53 |
+
"# Get questions"
|
54 |
+
]
|
55 |
+
},
|
56 |
+
{
|
57 |
+
"cell_type": "code",
|
58 |
+
"execution_count": null,
|
59 |
+
"metadata": {
|
60 |
+
"id": "7FWu3teNDblP"
|
61 |
+
},
|
62 |
+
"outputs": [],
|
63 |
+
"source": [
|
64 |
+
"url = \"https://api.stackexchange.com/2.3/questions/\"\n",
|
65 |
+
"params = {\"client_secret\": secret,\n",
|
66 |
+
" \"key\": key,\n",
|
67 |
+
" \"site\": site,\n",
|
68 |
+
" \"filter\": \"withbody\",\n",
|
69 |
+
" \"order\":\"desc\",\n",
|
70 |
+
" \"sort\":\"votes\",\n",
|
71 |
+
" \"pagesize\":100\n",
|
72 |
+
" }\n",
|
73 |
+
"\n",
|
74 |
+
"max_pages = 80 # 300 for law or 80 for medicalsciences\n",
|
75 |
+
"\n",
|
76 |
+
"retries = Retry(total=5,\n",
|
77 |
+
" backoff_factor=0.1,\n",
|
78 |
+
" status_forcelist=[500, 502, 503, 504, 429])\n",
|
79 |
+
"\n",
|
80 |
+
"adapter = HTTPAdapter(max_retries=retries)\n",
|
81 |
+
"session = requests.Session()\n",
|
82 |
+
"\n",
|
83 |
+
"# Use the adapter for all requests to endpoints that start with this URL\n",
|
84 |
+
"session.mount('https://api.stackexchange.com/', adapter)\n",
|
85 |
+
"\n",
|
86 |
+
"retrieved_data = []\n",
|
87 |
+
"\n",
|
88 |
+
"for page in tqdm(range(max_pages)):\n",
|
89 |
+
" params[\"page\"] = page+1\n",
|
90 |
+
" response = session.get(url, params=params)\n",
|
91 |
+
"\n",
|
92 |
+
" if response.status_code != 200:\n",
|
93 |
+
" print(\"Error:\", response.status_code)\n",
|
94 |
+
" break\n",
|
95 |
+
" else:\n",
|
96 |
+
" current_page = response.json()\n",
|
97 |
+
" for item in current_page['items']:\n",
|
98 |
+
" retrieved_data.append(item)\n",
|
99 |
+
" if current_page[\"has_more\"] == False:\n",
|
100 |
+
" print(\"No more pages\")\n",
|
101 |
+
" break"
|
102 |
+
]
|
103 |
+
},
|
104 |
+
{
|
105 |
+
"cell_type": "code",
|
106 |
+
"execution_count": null,
|
107 |
+
"metadata": {
|
108 |
+
"colab": {
|
109 |
+
"base_uri": "https://localhost:8080/"
|
110 |
+
},
|
111 |
+
"id": "Ge00fuGnFzn1",
|
112 |
+
"outputId": "320ed184-9ae7-4240-bdef-d6217a488b5e"
|
113 |
+
},
|
114 |
+
"outputs": [
|
115 |
+
{
|
116 |
+
"output_type": "execute_result",
|
117 |
+
"data": {
|
118 |
+
"text/plain": [
|
119 |
+
"7829"
|
120 |
+
]
|
121 |
+
},
|
122 |
+
"metadata": {},
|
123 |
+
"execution_count": 11
|
124 |
+
}
|
125 |
+
],
|
126 |
+
"source": [
|
127 |
+
"len(retrieved_data)"
|
128 |
+
]
|
129 |
+
},
|
130 |
+
{
|
131 |
+
"cell_type": "code",
|
132 |
+
"execution_count": null,
|
133 |
+
"metadata": {
|
134 |
+
"colab": {
|
135 |
+
"base_uri": "https://localhost:8080/"
|
136 |
+
},
|
137 |
+
"id": "xZkjwdb_EP-q",
|
138 |
+
"outputId": "4397a793-0992-4120-b5aa-6475425d4dc7"
|
139 |
+
},
|
140 |
+
"outputs": [
|
141 |
+
{
|
142 |
+
"output_type": "stream",
|
143 |
+
"name": "stdout",
|
144 |
+
"text": [
|
145 |
+
"{\n",
|
146 |
+
" \"tags\": [\n",
|
147 |
+
" \"covid-19\",\n",
|
148 |
+
" \"vaccination\",\n",
|
149 |
+
" \"side-effects\"\n",
|
150 |
+
" ],\n",
|
151 |
+
" \"owner\": {\n",
|
152 |
+
" \"account_id\": 27722897,\n",
|
153 |
+
" \"reputation\": 3,\n",
|
154 |
+
" \"user_id\": 26386,\n",
|
155 |
+
" \"user_type\": \"unregistered\",\n",
|
156 |
+
" \"profile_image\": \"https://www.gravatar.com/avatar/511c7e442e5fbe49cdcb16d96aa8cd19?s=256&d=identicon&r=PG\",\n",
|
157 |
+
" \"display_name\": \"Unknown user\",\n",
|
158 |
+
" \"link\": \"https://medicalsciences.stackexchange.com/users/26386/unknown-user\"\n",
|
159 |
+
" },\n",
|
160 |
+
" \"is_answered\": true,\n",
|
161 |
+
" \"view_count\": 67,\n",
|
162 |
+
" \"closed_date\": 1675778668,\n",
|
163 |
+
" \"accepted_answer_id\": 31982,\n",
|
164 |
+
" \"answer_count\": 1,\n",
|
165 |
+
" \"score\": -5,\n",
|
166 |
+
" \"last_activity_date\": 1685671894,\n",
|
167 |
+
" \"creation_date\": 1675753683,\n",
|
168 |
+
" \"question_id\": 31981,\n",
|
169 |
+
" \"link\": \"https://medicalsciences.stackexchange.com/questions/31981/how-bad-are-covid-vaccines\",\n",
|
170 |
+
" \"closed_reason\": \"Not suitable for this site\",\n",
|
171 |
+
" \"title\": \"How bad are covid vaccines?\",\n",
|
172 |
+
" \"body\": \"<p>For the past year I've been hearing about people claiming that those who took the covid jabs are dropping like flies. I even hear people claim that the covid vaccinations are depopulation tools and most people who get it are going to die within the next 10 years! As someone who (reluctantly) took the jabs in May 2021, this concerns me and I'm sure there are millions of people like me. If you go on bitchute there seems to be a lot of evidence in support of that notion and it worries me. I also hear about people on the internet saying that they or someone they know are having some nasty side effects. But today darkmatter2525 made a video saying that the whole "died suddenly" thing is just the frequency illusion and that claims saying that athletes are collapsing more than ever is just based on misleading data. Every time someone under 70 years old dies a lot of people are blaming the vaccine. But what's the truth? I know there's some truth to what these "anti-vaxxers" saying but just how bad is it and what exactly is going on? Should I be concerned for myself and my loved ones?</p>\\n\"\n",
|
173 |
+
"}\n"
|
174 |
+
]
|
175 |
+
}
|
176 |
+
],
|
177 |
+
"source": [
|
178 |
+
"import json\n",
|
179 |
+
"\n",
|
180 |
+
"print(json.dumps(retrieved_data[-1], indent=4))"
|
181 |
+
]
|
182 |
+
},
|
183 |
+
{
|
184 |
+
"cell_type": "code",
|
185 |
+
"execution_count": null,
|
186 |
+
"metadata": {
|
187 |
+
"id": "8xM9SKctZaB1"
|
188 |
+
},
|
189 |
+
"outputs": [],
|
190 |
+
"source": [
|
191 |
+
"# Save file - test\n",
|
192 |
+
"with open(\"example.json\", \"w\") as output:\n",
|
193 |
+
" json.dump(retrieved_data[:10], output, indent=4)"
|
194 |
+
]
|
195 |
+
},
|
196 |
+
{
|
197 |
+
"cell_type": "code",
|
198 |
+
"execution_count": null,
|
199 |
+
"metadata": {
|
200 |
+
"id": "KzfcTYt7XWgJ"
|
201 |
+
},
|
202 |
+
"outputs": [],
|
203 |
+
"source": [
|
204 |
+
"# Save the whole data\n",
|
205 |
+
"import os\n",
|
206 |
+
"\n",
|
207 |
+
"# output_questions_file_name = \"law.stackexchange.json\"\n",
|
208 |
+
"output_questions_file_name = \"medical.stackexchange.json\"\n",
|
209 |
+
"directory = \"/content/drive/MyDrive/data/StackExchange/MedicalSciences\"\n",
|
210 |
+
"full_output_path = os.path.join(directory, output_questions_file_name)\n",
|
211 |
+
"\n",
|
212 |
+
"with open(full_output_path, \"w+\") as output:\n",
|
213 |
+
" json.dump(retrieved_data, output, indent=4)"
|
214 |
+
]
|
215 |
+
},
|
216 |
+
{
|
217 |
+
"cell_type": "markdown",
|
218 |
+
"metadata": {
|
219 |
+
"id": "SXrXjiiV7PVo"
|
220 |
+
},
|
221 |
+
"source": [
|
222 |
+
"# Get answers"
|
223 |
+
]
|
224 |
+
},
|
225 |
+
{
|
226 |
+
"cell_type": "code",
|
227 |
+
"execution_count": null,
|
228 |
+
"metadata": {
|
229 |
+
"colab": {
|
230 |
+
"base_uri": "https://localhost:8080/"
|
231 |
+
},
|
232 |
+
"id": "_K8jZu0F7RtY",
|
233 |
+
"outputId": "b97611ce-7641-48fd-b04c-7ea0c8632e09"
|
234 |
+
},
|
235 |
+
"outputs": [
|
236 |
+
{
|
237 |
+
"output_type": "stream",
|
238 |
+
"name": "stdout",
|
239 |
+
"text": [
|
240 |
+
"Questions total: 7829\n",
|
241 |
+
"Questions with answers: 4969\n"
|
242 |
+
]
|
243 |
+
}
|
244 |
+
],
|
245 |
+
"source": [
|
246 |
+
"import os\n",
|
247 |
+
"\n",
|
248 |
+
"# file_path = \"/content/drive/MyDrive/data/StackExchange/Law/\"\n",
|
249 |
+
"# file_name = \"law.stackexchange.json\"\n",
|
250 |
+
"\n",
|
251 |
+
"file_path = \"/content/drive/MyDrive/data/StackExchange/MedicalSciences/\"\n",
|
252 |
+
"file_name = \"medical.stackexchange.json\"\n",
|
253 |
+
"\n",
|
254 |
+
"data = json.load(open(os.path.join(file_path, file_name)))\n",
|
255 |
+
"questions = [question for question in data if question[\"is_answered\"]]\n",
|
256 |
+
"\n",
|
257 |
+
"print(\"Questions total:\", len(data))\n",
|
258 |
+
"print(\"Questions with answers:\", len(questions))"
|
259 |
+
]
|
260 |
+
},
|
261 |
+
{
|
262 |
+
"cell_type": "code",
|
263 |
+
"execution_count": null,
|
264 |
+
"metadata": {
|
265 |
+
"colab": {
|
266 |
+
"base_uri": "https://localhost:8080/",
|
267 |
+
"height": 49,
|
268 |
+
"referenced_widgets": [
|
269 |
+
"caef01b2ea1d490baca92066e9f7ae12",
|
270 |
+
"7fccf71e710841c6aabcdad832b36c61",
|
271 |
+
"9f9ac1d792f24afc8ee9a8bc38a1f7c8",
|
272 |
+
"410b5fe10d0a45dfa5b24c5c9256ff86",
|
273 |
+
"494f8244675041d4aaca3d83c7955365",
|
274 |
+
"12fce8eb451f4e129a0dff5dffa84c2c",
|
275 |
+
"bb22bbd047fc405db894526a3ca4d1b8",
|
276 |
+
"9c1944fee7fb44d5b8b0e8eda7d31cac",
|
277 |
+
"e068f8e3183844ec9db63f5bff304e62",
|
278 |
+
"3400c1e7251e4d339a291f2cfa7b9c08",
|
279 |
+
"e1ca24cc7b2f4355bc9a9b39eadb8baa"
|
280 |
+
]
|
281 |
+
},
|
282 |
+
"id": "BpRZN4zwZ7KD",
|
283 |
+
"outputId": "7be24266-229f-400e-e191-24ea0c191ce6"
|
284 |
+
},
|
285 |
+
"outputs": [
|
286 |
+
{
|
287 |
+
"output_type": "display_data",
|
288 |
+
"data": {
|
289 |
+
"text/plain": [
|
290 |
+
" 0%| | 0/100 [00:00<?, ?it/s]"
|
291 |
+
],
|
292 |
+
"application/vnd.jupyter.widget-view+json": {
|
293 |
+
"version_major": 2,
|
294 |
+
"version_minor": 0,
|
295 |
+
"model_id": "caef01b2ea1d490baca92066e9f7ae12"
|
296 |
+
}
|
297 |
+
},
|
298 |
+
"metadata": {}
|
299 |
+
}
|
300 |
+
],
|
301 |
+
"source": [
|
302 |
+
"url = {\"url\":\"https://api.stackexchange.com/2.3/questions/{idx}/answers\"}\n",
|
303 |
+
"params = {\"client_secret\": secret,\n",
|
304 |
+
" \"key\": key,\n",
|
305 |
+
" \"site\": site,\n",
|
306 |
+
" \"filter\": \"withbody\",\n",
|
307 |
+
" \"order\":\"desc\",\n",
|
308 |
+
" \"sort\":\"votes\",\n",
|
309 |
+
" \"pagesize\":100}\n",
|
310 |
+
"\n",
|
311 |
+
"retries = Retry(total=5,\n",
|
312 |
+
" backoff_factor=0.99,\n",
|
313 |
+
" status_forcelist=[400, 429, 500, 502, 503, 504])\n",
|
314 |
+
"\n",
|
315 |
+
"adapter = HTTPAdapter(max_retries=retries)\n",
|
316 |
+
"session = requests.Session()\n",
|
317 |
+
"\n",
|
318 |
+
"# Use the adapter for all requests to endpoints that start with this URL\n",
|
319 |
+
"session.mount('https://api.stackexchange.com/', adapter)\n",
|
320 |
+
"\n",
|
321 |
+
"questions_data = []\n",
|
322 |
+
"\n",
|
323 |
+
"for question_item in tqdm(questions):\n",
|
324 |
+
" question_id = question_item[\"question_id\"]\n",
|
325 |
+
"\n",
|
326 |
+
" question = {}\n",
|
327 |
+
" question[\"question_id\"] = question_item[\"question_id\"]\n",
|
328 |
+
" question[\"tags\"] = question_item[\"tags\"]\n",
|
329 |
+
" question[\"score\"] = question_item[\"score\"]\n",
|
330 |
+
" question[\"license\"] = question_item.get(\"content_license\", \"\")\n",
|
331 |
+
" question[\"title\"] = question_item[\"title\"]\n",
|
332 |
+
" question[\"body\"] = question_item[\"body\"]\n",
|
333 |
+
" question[\"link\"] = question_item[\"link\"]\n",
|
334 |
+
" question[\"answers\"] = []\n",
|
335 |
+
"\n",
|
336 |
+
" response = session.get(url[\"url\"].format(idx=question_id), params=params)\n",
|
337 |
+
"\n",
|
338 |
+
" if response.status_code != 200:\n",
|
339 |
+
" print(\"Error:\", response.status_code)\n",
|
340 |
+
" break\n",
|
341 |
+
" else:\n",
|
342 |
+
" current_page = response.json()\n",
|
343 |
+
" for answer_item in current_page['items']:\n",
|
344 |
+
" if answer_item[\"score\"] >= 0:\n",
|
345 |
+
" answer = {}\n",
|
346 |
+
" answer[\"answer_id\"] = answer_item[\"answer_id\"]\n",
|
347 |
+
" answer[\"score\"] = answer_item[\"score\"]\n",
|
348 |
+
" answer[\"body\"] = answer_item[\"body\"]\n",
|
349 |
+
"\n",
|
350 |
+
" question[\"answers\"].append(answer)\n",
|
351 |
+
"\n",
|
352 |
+
" questions_data.append(question)\n",
|
353 |
+
" sleep(0.5)\n"
|
354 |
+
]
|
355 |
+
},
|
356 |
+
{
|
357 |
+
"cell_type": "code",
|
358 |
+
"execution_count": null,
|
359 |
+
"metadata": {
|
360 |
+
"id": "zfQVzhOhhMPe"
|
361 |
+
},
|
362 |
+
"outputs": [],
|
363 |
+
"source": [
|
364 |
+
"print(len(questions_data))\n",
|
365 |
+
"print(json.dumps(questions_data[-1], indent=2))"
|
366 |
+
]
|
367 |
+
},
|
368 |
+
{
|
369 |
+
"cell_type": "code",
|
370 |
+
"execution_count": null,
|
371 |
+
"metadata": {
|
372 |
+
"id": "l1Pz83HF1NpA"
|
373 |
+
},
|
374 |
+
"outputs": [],
|
375 |
+
"source": [
|
376 |
+
"# Save the whole data\n",
|
377 |
+
"\n",
|
378 |
+
"# output_file_name = \"law.stackexchange-questions-answers.json\"\n",
|
379 |
+
"output_file_name = \"medical.stackexchange-questions-answers.json\"\n",
|
380 |
+
"\n",
|
381 |
+
"full_output_path = os.path.join(file_path, output_file_name)\n",
|
382 |
+
"\n",
|
383 |
+
"with open(full_output_path, \"w+\") as output:\n",
|
384 |
+
" json.dump(questions_data, output, indent=4)"
|
385 |
+
]
|
386 |
+
},
|
387 |
+
{
|
388 |
+
"cell_type": "code",
|
389 |
+
"execution_count": null,
|
390 |
+
"metadata": {
|
391 |
+
"colab": {
|
392 |
+
"base_uri": "https://localhost:8080/"
|
393 |
+
},
|
394 |
+
"id": "UIp1PBiRCUQT",
|
395 |
+
"outputId": "128de532-01cb-4630-bbad-f9199aad2623"
|
396 |
+
},
|
397 |
+
"outputs": [
|
398 |
+
{
|
399 |
+
"output_type": "stream",
|
400 |
+
"name": "stdout",
|
401 |
+
"text": [
|
402 |
+
"medical.stackexchange.json medical.stackexchange-questions-answers.json\n"
|
403 |
+
]
|
404 |
+
}
|
405 |
+
],
|
406 |
+
"source": [
|
407 |
+
"!ls $file_path"
|
408 |
+
]
|
409 |
+
},
|
410 |
+
{
|
411 |
+
"cell_type": "code",
|
412 |
+
"execution_count": null,
|
413 |
+
"metadata": {
|
414 |
+
"id": "Ky2qBJnfaO1Y"
|
415 |
+
},
|
416 |
+
"outputs": [],
|
417 |
+
"source": [
|
418 |
+
"import os\n",
|
419 |
+
"import json\n",
|
420 |
+
"\n",
|
421 |
+
"# output_file_name = \"law.stackexchange-questions-answers.json\"\n",
|
422 |
+
"output_file_name = \"medical.stackexchange-questions-answers.json\"\n",
|
423 |
+
"\n",
|
424 |
+
"full_output_path = os.path.join(file_path, output_file_name)\n",
|
425 |
+
"\n",
|
426 |
+
"with open(full_output_path, \"r\") as output:\n",
|
427 |
+
" questions_answers = json.load(output)"
|
428 |
+
]
|
429 |
+
},
|
430 |
+
{
|
431 |
+
"cell_type": "code",
|
432 |
+
"execution_count": null,
|
433 |
+
"metadata": {
|
434 |
+
"colab": {
|
435 |
+
"base_uri": "https://localhost:8080/"
|
436 |
+
},
|
437 |
+
"id": "Sbo2JcJCfrFp",
|
438 |
+
"outputId": "f4d26220-2c7a-409d-bc7c-95d2830789b7"
|
439 |
+
},
|
440 |
+
"outputs": [
|
441 |
+
{
|
442 |
+
"output_type": "execute_result",
|
443 |
+
"data": {
|
444 |
+
"text/plain": [
|
445 |
+
"4969"
|
446 |
+
]
|
447 |
+
},
|
448 |
+
"metadata": {},
|
449 |
+
"execution_count": 48
|
450 |
+
}
|
451 |
+
],
|
452 |
+
"source": [
|
453 |
+
"len(questions_answers)"
|
454 |
+
]
|
455 |
+
},
|
456 |
+
{
|
457 |
+
"cell_type": "code",
|
458 |
+
"source": [
|
459 |
+
"print(json.dumps(questions_answers[0], indent=4))"
|
460 |
+
],
|
461 |
+
"metadata": {
|
462 |
+
"colab": {
|
463 |
+
"base_uri": "https://localhost:8080/"
|
464 |
+
},
|
465 |
+
"id": "LJabX_yzjg7X",
|
466 |
+
"outputId": "518244ca-3a5b-4afb-e5c8-c2a598f8c2e4"
|
467 |
+
},
|
468 |
+
"execution_count": null,
|
469 |
+
"outputs": [
|
470 |
+
{
|
471 |
+
"output_type": "stream",
|
472 |
+
"name": "stdout",
|
473 |
+
"text": [
|
474 |
+
"{\n",
|
475 |
+
" \"question_id\": 52,\n",
|
476 |
+
" \"tags\": [\n",
|
477 |
+
" \"eye\",\n",
|
478 |
+
" \"computers\",\n",
|
479 |
+
" \"lifestyle\"\n",
|
480 |
+
" ],\n",
|
481 |
+
" \"score\": 112,\n",
|
482 |
+
" \"license\": \"CC BY-SA 3.0\",\n",
|
483 |
+
" \"title\": \"How can I protect my eyesight when using computers?\",\n",
|
484 |
+
" \"body\": \"<p>My job requires long periods of computer screen use. I have good eyesight (20/15) and don't wear glasses, but I definitely notice my eyes feeling fatigued at the end of the day. Sometimes when I'm short on sleep, I have trouble focusing or see slightly blurred vision.</p>\\n\\n<p>I want to protect my eyesight as much as possible. What are the best practices for doing so if you spend a lot of time staring at screens?</p>\\n\",\n",
|
485 |
+
" \"link\": \"https://medicalsciences.stackexchange.com/questions/52/how-can-i-protect-my-eyesight-when-using-computers\",\n",
|
486 |
+
" \"answers\": [\n",
|
487 |
+
" {\n",
|
488 |
+
" \"answer_id\": 85,\n",
|
489 |
+
" \"score\": 79,\n",
|
490 |
+
" \"body\": \"<h3>20-20-20 Rule</h3>\\n<p>Every 20 minutes of looking at the screen, look at something 20 feet away for 20 seconds. Also, try to blink a lot.</p>\\n<h3>Adjusting settings</h3>\\n<p>Using a larger font to read helps to reduce eye strain. Adjusting your brightness helps, usually brighter screens are better in brighter rooms, dimmer screens are better in dark rooms.</p>\\n<p>Also, try to make your computer screen lower than your eyes; more of your eye is covered by your eyelid when you look down, so there will be more lubrication and you will subconsciously blink more.</p>\\n<h3>Eating</h3>\\n<p>Eat foods with vitamin A, which helps with the health of your eyes. See <a href=\\\"https://health.stackexchange.com/questions/79/do-carrots-actually-improve-eyesight\\\">this question</a> for more.</p>\\n<hr />\\n<p><a href=\\\"http://visianinfo.com/the-20-20-20-rule-preventing-digital-eye-strain/\\\" rel=\\\"noreferrer\\\"><sup>The 20-20-20 Rule: Preventing Digital Eye Strain</sup></a><br />\\n<sub><a href=\\\"http://onlinelibrary.wiley.com/doi/10.1111/j.1475-1313.2011.00834.x/full\\\" rel=\\\"noreferrer\\\">Computer vision syndrome: a review of ocular causes and potential treatments</a></sub><br />\\n<sub><a href=\\\"http://commons.erau.edu/jaaer/vol24/iss2/5/?utm_source=commons.erau.edu%2Fjaaer%2Fvol24%2Fiss2%2F5&utm_medium=PDF&utm_campaign=PDFCoverPages\\\" rel=\\\"noreferrer\\\">Assessing Computer Vision Syndrome Risk for Pilots</a></sub><br />\\n<sub><a href=\\\"http://www.mayoclinic.org/diseases-conditions/eyestrain/basics/prevention/con-20032649\\\" rel=\\\"noreferrer\\\">Eyestrain</a></sub></p>\\n\"\n",
|
491 |
+
" },\n",
|
492 |
+
" {\n",
|
493 |
+
" \"answer_id\": 468,\n",
|
494 |
+
" \"score\": 25,\n",
|
495 |
+
" \"body\": \"<p>There are some options you have to reduce eye strain.</p>\\n\\n<ul>\\n<li><p>You can get an anti glare cover for your monitor</p></li>\\n<li><p>You can also adjust lighting of your work area (not always possible) \\nby lowering internal lighting and blocking external lighting.</p></li>\\n<li><p>You can adjust the setting of your monitor to make the brightness<br>\\nsimilar to your surroundings which will help with strain</p></li>\\n<li><p>You can blink more often to keep your eyes from drying out You can \\ntake breaks both by leaving your computer or by moving your eyes<br>\\naround the room/desk and avoiding your computer every once in a<br>\\nwhile.</p></li>\\n<li><p>You can set up your desk to make sure printed material is in easy eye\\nreach and lighted similarly</p></li>\\n<li><p>You can look into getting specialized gaming/computer glasses which<br>\\nare designed to reduce eye strain and fatigue</p></li>\\n</ul>\\n\\n<p><a href=\\\"http://www.allaboutvision.com/cvs/irritated.htm\\\">http://www.allaboutvision.com/cvs/irritated.htm</a></p>\\n\"\n",
|
496 |
+
" },\n",
|
497 |
+
" {\n",
|
498 |
+
" \"answer_id\": 1104,\n",
|
499 |
+
" \"score\": 22,\n",
|
500 |
+
" \"body\": \"<p>The primary risk is what is called Computer Vision Syndrome (<a href=\\\"http://www.webmd.com/eye-health/computer-vision-syndrome\\\">ref</a>, <a href=\\\"http://www.aoa.org/patients-and-public/caring-for-your-vision/protecting-your-vision/computer-vision-syndrome?sso=y\\\">ref</a>, <a href=\\\"http://en.wikipedia.org/wiki/Computer_vision_syndrome\\\">ref</a>).</p>\\n\\n<p>The American Optometric Association (referenced above) recommends the following changes in viewing habits to alleviate symptoms:</p>\\n\\n<blockquote>\\n <p>Some important factors in preventing or reducing the symptoms of CVS\\n have to do with the computer and how it is used. This includes\\n lighting conditions, chair comfort, location of reference materials,\\n position of the monitor, and the use of rest breaks.</p>\\n \\n <ul>\\n <li><strong>Location of computer screen</strong> - Most people find it more comfortable to\\n view a computer when the eyes are looking downward. Optimally, the\\n computer screen should be 15 to 20 degrees below eye level (about 4 or\\n 5 inches) as measured from the center of the screen and 20 to 28\\n inches from the eyes. </li>\\n <li><strong>Reference materials</strong> - These materials should be\\n located above the keyboard and below the monitor. If this is not\\n possible, a document holder can be used beside the monitor. The goal\\n is to position the documents so you do not need to move your head to\\n look from the document to the screen.</li>\\n <li><strong>Lighting</strong> - Position the computer\\n screen to avoid glare, particularly from overhead lighting or windows.\\n Use blinds or drapes on windows and replace the light bulbs in desk\\n lamps with bulbs of lower wattage. </li>\\n <li><strong>Anti-glare screens</strong> - If there is no\\n way to minimize glare from light sources, consider using a screen\\n glare filter. These filters decrease the amount of light reflected\\n from the screen.</li>\\n <li><strong>Seating position</strong> - Chairs should be comfortably\\n padded and conform to the body. Chair height should be adjusted so\\n your feet rest flat on the floor. If your chair has arms, they should\\n be adjusted to provide arm support while you are typing. Your wrists\\n shouldn't rest on the keyboard when typing.</li>\\n <li><strong>Rest breaks</strong> - To prevent\\n eyestrain, try to rest your eyes when using the computer for long\\n periods. Rest your eyes for 15 minutes after two hours of continuous\\n computer use. Also, for every 20 minutes of computer viewing, look\\n into the distance for 20 seconds to allow your eyes a chance to\\n refocus. </li>\\n <li><strong>Blinking</strong> - To minimize your chances of developing dry eye\\n when using a computer, make an effort to blink frequently. Blinking\\n keeps the front surface of your eye moist.</li>\\n </ul>\\n \\n <p>Regular eye examinations and proper viewing habits can help to prevent\\n or reduce the development of the symptoms associated with Computer\\n Vision Syndrome.</p>\\n</blockquote>\\n\\n<p>Also, from WebMD:</p>\\n\\n<blockquote>\\n <ul>\\n <li><strong>Tweak your computer settings.</strong> You don't have to live with the factory-installed settings on your computer if you're uncomfortable. Adjust the brightness, contrast, and font size until you find the best settings for your vision.</li>\\n </ul>\\n</blockquote>\\n\\n<p>Gunnar glasses: Studies have shown <a href=\\\"http://en.wikipedia.org/wiki/Gunnar_Optiks\\\">some short term relief</a> but generally no evidence has yet surfaced to support benefits of these glasses for long term health.</p>\\n\"\n",
|
501 |
+
" },\n",
|
502 |
+
" {\n",
|
503 |
+
" \"answer_id\": 907,\n",
|
504 |
+
" \"score\": 13,\n",
|
505 |
+
" \"body\": \"<p>You can also use <a href=\\\"https://justgetflux.com/\\\" rel=\\\"noreferrer\\\">f.lux</a>, it is a software that adjusts automatically and according to your location the brightness and contrast of your monitor. It lowers UV light during day, and lowers IR light during night.</p>\\n\"\n",
|
506 |
+
" },\n",
|
507 |
+
" {\n",
|
508 |
+
" \"answer_id\": 235,\n",
|
509 |
+
" \"score\": 6,\n",
|
510 |
+
" \"body\": \"<p>The health of your eyesight when using computer it really depends what kind of screen you're using and many other factors (DNA, diet, etc.), but in general, modern monitors (such as <a href=\\\"http://en.wikipedia.org/wiki/Liquid_crystal_display\\\" rel=\\\"nofollow\\\">LCD</a>, <a href=\\\"http://en.wikipedia.org/wiki/LED-backlit_LCD_display\\\" rel=\\\"nofollow\\\">LED-backlit</a>, <a href=\\\"http://en.wikipedia.org/wiki/LED_display\\\" rel=\\\"nofollow\\\">white-LED</a>, <a href=\\\"http://en.wikipedia.org/wiki/OLED#Disadvantages\\\" rel=\\\"nofollow\\\">OLED</a>) does nothing to the health of your eyes, unless you're still using <a href=\\\"http://en.wikipedia.org/wiki/Cathode_ray_tube\\\" rel=\\\"nofollow\\\">CRT</a> monitor. The bigger issue is rather neck and back if you don't site properly.</p>\\n\\n<p>Remember, if you feel your eyes are not comfortable, you may adjust the brightness and contrast of your screen.</p>\\n\\n<p>If you're using computer for too long, it's completely normal that your eyes would be tired and it really depends on the person (professionals can spent 8-12 everyday for years and their eyesight is perfect, for other 1h is enough). </p>\\n\\n<p>In this case, you simply need a rest. It's usually advice to do short breaks and take a fresh air. You may also consider to train your eye muscles as a number of <a href=\\\"http://en.wikipedia.org/wiki/Ophthalmology\\\" rel=\\\"nofollow\\\">ophthalmologists</a> believe that an exercise programme based on something called the <a href=\\\"http://en.wikipedia.org/wiki/Bates_method\\\" rel=\\\"nofollow\\\">Bates Method</a> may keep eyes in better shape.</p>\\n\\n<p>See: <a href=\\\"http://www.independent.co.uk/life-style/can-you-really-train-your-eyes-to-see-better-1240390.html\\\" rel=\\\"nofollow\\\">Can you really train your eyes to see better?</a> where we can read:</p>\\n\\n<blockquote>\\n <p>Some of the principles of the Bates Method are already accepted by mainstream eye care.</p>\\n</blockquote>\\n\\n<hr>\\n\\n<p>More information about older monitors:</p>\\n\\n<p><strong><a href=\\\"http://en.wikipedia.org/wiki/Cathode_ray_tube\\\" rel=\\\"nofollow\\\">CRT</a></strong></p>\\n\\n<p>If you're using CRT most people experience mild discomfort unless the <a href=\\\"http://en.wikipedia.org/wiki/Refresh_rate\\\" rel=\\\"nofollow\\\">refresh rate</a> is set to 72 Hz or higher. A rate of 100 Hz is comfortable at almost any size. It's usually advice to have a screen protector. However CRT are long lost technologies and this doesn't apply anymore to LCD monitors. </p>\\n\"\n",
|
511 |
+
" },\n",
|
512 |
+
" {\n",
|
513 |
+
" \"answer_id\": 11235,\n",
|
514 |
+
" \"score\": 6,\n",
|
515 |
+
" \"body\": \"<p><a href=\\\"https://en.wikipedia.org/wiki/The_Vision_Council\\\" rel=\\\"noreferrer\\\">The Vision Council</a>, which represents the manufacturers and suppliers of the optical industry, suggests the following tips to prevent and lessen digital eye strain:</p>\\n\\n<ul>\\n<li>Adjust the brightness of your device. Consider changing your background color from bright white to cool gray.\\nAttach a glare reduction filter to your computer screen.</li>\\n<li>Frequently dust and wipe digital screens to help reduce glare.</li>\\n<li>Adjust your screen so that it is directly in front of your face and slightly below eye level. Do not tilt a computer\\nmonitor.</li>\\n<li>Position yourself or your device so there is sufficient distance between your eyes and the screen.</li>\\n<li>Lessen the amount of overhead and surrounding light that is competing with your device\\u2019s screen.</li>\\n<li>When using a computer, first sit in your chair and extend your arm. Your palm should rest comfortably on the\\nmonitor (as if you\\u2019re high-fiving the screen).</li>\\n<li>Keep handheld devices a safe distance from your eyes and just below eye level.</li>\\n<li>Increase text size to better define the content on your screen. Use the settings control to make adjustments that\\nfeel comfortable to your eyes.</li>\\n<li>Remind yourself to blink more often. Staring at a digital screen can affect the number of times you blink, causing\\neyes to dry.</li>\\n<li>Take a 20-20-20 break: Every 20 minutes, take a 20-second break and look at something 20 feet away.</li>\\n<li>Parents should limit the amount of screen time for children, and reduce their screen time in front of children so as\\nto set healthy standards in the home.</li>\\n<li>Blink. Breathe. Break.</li>\\n</ul>\\n\\n<p>Also check the following image as a guidance:</p>\\n\\n<p><a href=\\\"https://i.stack.imgur.com/zhAW3.jpg\\\" rel=\\\"noreferrer\\\"><img src=\\\"https://i.stack.imgur.com/zhAW3.jpg\\\" alt=\\\"Computer Eye-gonomics - tips to prevent and lessen digital eye strain\\\"></a></p>\\n\\n<p>Source: <a href=\\\"https://www.thevisioncouncil.org/sites/default/files/TVCDigitEYEzedReport2013.pdf\\\" rel=\\\"noreferrer\\\">Digiteyezed - The daily impack of digital screens on the eye health of Americans</a></p>\\n\"\n",
|
516 |
+
" }\n",
|
517 |
+
" ]\n",
|
518 |
+
"}\n"
|
519 |
+
]
|
520 |
+
}
|
521 |
+
]
|
522 |
+
}
|
523 |
+
],
|
524 |
+
"metadata": {
|
525 |
+
"colab": {
|
526 |
+
"machine_shape": "hm",
|
527 |
+
"provenance": []
|
528 |
+
},
|
529 |
+
"kernelspec": {
|
530 |
+
"display_name": "Python 3",
|
531 |
+
"name": "python3"
|
532 |
+
},
|
533 |
+
"language_info": {
|
534 |
+
"name": "python"
|
535 |
+
},
|
536 |
+
"widgets": {
|
537 |
+
"application/vnd.jupyter.widget-state+json": {
|
538 |
+
"caef01b2ea1d490baca92066e9f7ae12": {
|
539 |
+
"model_module": "@jupyter-widgets/controls",
|
540 |
+
"model_name": "HBoxModel",
|
541 |
+
"model_module_version": "1.5.0",
|
542 |
+
"state": {
|
543 |
+
"_dom_classes": [],
|
544 |
+
"_model_module": "@jupyter-widgets/controls",
|
545 |
+
"_model_module_version": "1.5.0",
|
546 |
+
"_model_name": "HBoxModel",
|
547 |
+
"_view_count": null,
|
548 |
+
"_view_module": "@jupyter-widgets/controls",
|
549 |
+
"_view_module_version": "1.5.0",
|
550 |
+
"_view_name": "HBoxView",
|
551 |
+
"box_style": "",
|
552 |
+
"children": [
|
553 |
+
"IPY_MODEL_7fccf71e710841c6aabcdad832b36c61",
|
554 |
+
"IPY_MODEL_9f9ac1d792f24afc8ee9a8bc38a1f7c8",
|
555 |
+
"IPY_MODEL_410b5fe10d0a45dfa5b24c5c9256ff86"
|
556 |
+
],
|
557 |
+
"layout": "IPY_MODEL_494f8244675041d4aaca3d83c7955365"
|
558 |
+
}
|
559 |
+
},
|
560 |
+
"7fccf71e710841c6aabcdad832b36c61": {
|
561 |
+
"model_module": "@jupyter-widgets/controls",
|
562 |
+
"model_name": "HTMLModel",
|
563 |
+
"model_module_version": "1.5.0",
|
564 |
+
"state": {
|
565 |
+
"_dom_classes": [],
|
566 |
+
"_model_module": "@jupyter-widgets/controls",
|
567 |
+
"_model_module_version": "1.5.0",
|
568 |
+
"_model_name": "HTMLModel",
|
569 |
+
"_view_count": null,
|
570 |
+
"_view_module": "@jupyter-widgets/controls",
|
571 |
+
"_view_module_version": "1.5.0",
|
572 |
+
"_view_name": "HTMLView",
|
573 |
+
"description": "",
|
574 |
+
"description_tooltip": null,
|
575 |
+
"layout": "IPY_MODEL_12fce8eb451f4e129a0dff5dffa84c2c",
|
576 |
+
"placeholder": "",
|
577 |
+
"style": "IPY_MODEL_bb22bbd047fc405db894526a3ca4d1b8",
|
578 |
+
"value": "100%"
|
579 |
+
}
|
580 |
+
},
|
581 |
+
"9f9ac1d792f24afc8ee9a8bc38a1f7c8": {
|
582 |
+
"model_module": "@jupyter-widgets/controls",
|
583 |
+
"model_name": "FloatProgressModel",
|
584 |
+
"model_module_version": "1.5.0",
|
585 |
+
"state": {
|
586 |
+
"_dom_classes": [],
|
587 |
+
"_model_module": "@jupyter-widgets/controls",
|
588 |
+
"_model_module_version": "1.5.0",
|
589 |
+
"_model_name": "FloatProgressModel",
|
590 |
+
"_view_count": null,
|
591 |
+
"_view_module": "@jupyter-widgets/controls",
|
592 |
+
"_view_module_version": "1.5.0",
|
593 |
+
"_view_name": "ProgressView",
|
594 |
+
"bar_style": "success",
|
595 |
+
"description": "",
|
596 |
+
"description_tooltip": null,
|
597 |
+
"layout": "IPY_MODEL_9c1944fee7fb44d5b8b0e8eda7d31cac",
|
598 |
+
"max": 100,
|
599 |
+
"min": 0,
|
600 |
+
"orientation": "horizontal",
|
601 |
+
"style": "IPY_MODEL_e068f8e3183844ec9db63f5bff304e62",
|
602 |
+
"value": 100
|
603 |
+
}
|
604 |
+
},
|
605 |
+
"410b5fe10d0a45dfa5b24c5c9256ff86": {
|
606 |
+
"model_module": "@jupyter-widgets/controls",
|
607 |
+
"model_name": "HTMLModel",
|
608 |
+
"model_module_version": "1.5.0",
|
609 |
+
"state": {
|
610 |
+
"_dom_classes": [],
|
611 |
+
"_model_module": "@jupyter-widgets/controls",
|
612 |
+
"_model_module_version": "1.5.0",
|
613 |
+
"_model_name": "HTMLModel",
|
614 |
+
"_view_count": null,
|
615 |
+
"_view_module": "@jupyter-widgets/controls",
|
616 |
+
"_view_module_version": "1.5.0",
|
617 |
+
"_view_name": "HTMLView",
|
618 |
+
"description": "",
|
619 |
+
"description_tooltip": null,
|
620 |
+
"layout": "IPY_MODEL_3400c1e7251e4d339a291f2cfa7b9c08",
|
621 |
+
"placeholder": "",
|
622 |
+
"style": "IPY_MODEL_e1ca24cc7b2f4355bc9a9b39eadb8baa",
|
623 |
+
"value": " 100/100 [00:53<00:00, 1.91it/s]"
|
624 |
+
}
|
625 |
+
},
|
626 |
+
"494f8244675041d4aaca3d83c7955365": {
|
627 |
+
"model_module": "@jupyter-widgets/base",
|
628 |
+
"model_name": "LayoutModel",
|
629 |
+
"model_module_version": "1.2.0",
|
630 |
+
"state": {
|
631 |
+
"_model_module": "@jupyter-widgets/base",
|
632 |
+
"_model_module_version": "1.2.0",
|
633 |
+
"_model_name": "LayoutModel",
|
634 |
+
"_view_count": null,
|
635 |
+
"_view_module": "@jupyter-widgets/base",
|
636 |
+
"_view_module_version": "1.2.0",
|
637 |
+
"_view_name": "LayoutView",
|
638 |
+
"align_content": null,
|
639 |
+
"align_items": null,
|
640 |
+
"align_self": null,
|
641 |
+
"border": null,
|
642 |
+
"bottom": null,
|
643 |
+
"display": null,
|
644 |
+
"flex": null,
|
645 |
+
"flex_flow": null,
|
646 |
+
"grid_area": null,
|
647 |
+
"grid_auto_columns": null,
|
648 |
+
"grid_auto_flow": null,
|
649 |
+
"grid_auto_rows": null,
|
650 |
+
"grid_column": null,
|
651 |
+
"grid_gap": null,
|
652 |
+
"grid_row": null,
|
653 |
+
"grid_template_areas": null,
|
654 |
+
"grid_template_columns": null,
|
655 |
+
"grid_template_rows": null,
|
656 |
+
"height": null,
|
657 |
+
"justify_content": null,
|
658 |
+
"justify_items": null,
|
659 |
+
"left": null,
|
660 |
+
"margin": null,
|
661 |
+
"max_height": null,
|
662 |
+
"max_width": null,
|
663 |
+
"min_height": null,
|
664 |
+
"min_width": null,
|
665 |
+
"object_fit": null,
|
666 |
+
"object_position": null,
|
667 |
+
"order": null,
|
668 |
+
"overflow": null,
|
669 |
+
"overflow_x": null,
|
670 |
+
"overflow_y": null,
|
671 |
+
"padding": null,
|
672 |
+
"right": null,
|
673 |
+
"top": null,
|
674 |
+
"visibility": null,
|
675 |
+
"width": null
|
676 |
+
}
|
677 |
+
},
|
678 |
+
"12fce8eb451f4e129a0dff5dffa84c2c": {
|
679 |
+
"model_module": "@jupyter-widgets/base",
|
680 |
+
"model_name": "LayoutModel",
|
681 |
+
"model_module_version": "1.2.0",
|
682 |
+
"state": {
|
683 |
+
"_model_module": "@jupyter-widgets/base",
|
684 |
+
"_model_module_version": "1.2.0",
|
685 |
+
"_model_name": "LayoutModel",
|
686 |
+
"_view_count": null,
|
687 |
+
"_view_module": "@jupyter-widgets/base",
|
688 |
+
"_view_module_version": "1.2.0",
|
689 |
+
"_view_name": "LayoutView",
|
690 |
+
"align_content": null,
|
691 |
+
"align_items": null,
|
692 |
+
"align_self": null,
|
693 |
+
"border": null,
|
694 |
+
"bottom": null,
|
695 |
+
"display": null,
|
696 |
+
"flex": null,
|
697 |
+
"flex_flow": null,
|
698 |
+
"grid_area": null,
|
699 |
+
"grid_auto_columns": null,
|
700 |
+
"grid_auto_flow": null,
|
701 |
+
"grid_auto_rows": null,
|
702 |
+
"grid_column": null,
|
703 |
+
"grid_gap": null,
|
704 |
+
"grid_row": null,
|
705 |
+
"grid_template_areas": null,
|
706 |
+
"grid_template_columns": null,
|
707 |
+
"grid_template_rows": null,
|
708 |
+
"height": null,
|
709 |
+
"justify_content": null,
|
710 |
+
"justify_items": null,
|
711 |
+
"left": null,
|
712 |
+
"margin": null,
|
713 |
+
"max_height": null,
|
714 |
+
"max_width": null,
|
715 |
+
"min_height": null,
|
716 |
+
"min_width": null,
|
717 |
+
"object_fit": null,
|
718 |
+
"object_position": null,
|
719 |
+
"order": null,
|
720 |
+
"overflow": null,
|
721 |
+
"overflow_x": null,
|
722 |
+
"overflow_y": null,
|
723 |
+
"padding": null,
|
724 |
+
"right": null,
|
725 |
+
"top": null,
|
726 |
+
"visibility": null,
|
727 |
+
"width": null
|
728 |
+
}
|
729 |
+
},
|
730 |
+
"bb22bbd047fc405db894526a3ca4d1b8": {
|
731 |
+
"model_module": "@jupyter-widgets/controls",
|
732 |
+
"model_name": "DescriptionStyleModel",
|
733 |
+
"model_module_version": "1.5.0",
|
734 |
+
"state": {
|
735 |
+
"_model_module": "@jupyter-widgets/controls",
|
736 |
+
"_model_module_version": "1.5.0",
|
737 |
+
"_model_name": "DescriptionStyleModel",
|
738 |
+
"_view_count": null,
|
739 |
+
"_view_module": "@jupyter-widgets/base",
|
740 |
+
"_view_module_version": "1.2.0",
|
741 |
+
"_view_name": "StyleView",
|
742 |
+
"description_width": ""
|
743 |
+
}
|
744 |
+
},
|
745 |
+
"9c1944fee7fb44d5b8b0e8eda7d31cac": {
|
746 |
+
"model_module": "@jupyter-widgets/base",
|
747 |
+
"model_name": "LayoutModel",
|
748 |
+
"model_module_version": "1.2.0",
|
749 |
+
"state": {
|
750 |
+
"_model_module": "@jupyter-widgets/base",
|
751 |
+
"_model_module_version": "1.2.0",
|
752 |
+
"_model_name": "LayoutModel",
|
753 |
+
"_view_count": null,
|
754 |
+
"_view_module": "@jupyter-widgets/base",
|
755 |
+
"_view_module_version": "1.2.0",
|
756 |
+
"_view_name": "LayoutView",
|
757 |
+
"align_content": null,
|
758 |
+
"align_items": null,
|
759 |
+
"align_self": null,
|
760 |
+
"border": null,
|
761 |
+
"bottom": null,
|
762 |
+
"display": null,
|
763 |
+
"flex": null,
|
764 |
+
"flex_flow": null,
|
765 |
+
"grid_area": null,
|
766 |
+
"grid_auto_columns": null,
|
767 |
+
"grid_auto_flow": null,
|
768 |
+
"grid_auto_rows": null,
|
769 |
+
"grid_column": null,
|
770 |
+
"grid_gap": null,
|
771 |
+
"grid_row": null,
|
772 |
+
"grid_template_areas": null,
|
773 |
+
"grid_template_columns": null,
|
774 |
+
"grid_template_rows": null,
|
775 |
+
"height": null,
|
776 |
+
"justify_content": null,
|
777 |
+
"justify_items": null,
|
778 |
+
"left": null,
|
779 |
+
"margin": null,
|
780 |
+
"max_height": null,
|
781 |
+
"max_width": null,
|
782 |
+
"min_height": null,
|
783 |
+
"min_width": null,
|
784 |
+
"object_fit": null,
|
785 |
+
"object_position": null,
|
786 |
+
"order": null,
|
787 |
+
"overflow": null,
|
788 |
+
"overflow_x": null,
|
789 |
+
"overflow_y": null,
|
790 |
+
"padding": null,
|
791 |
+
"right": null,
|
792 |
+
"top": null,
|
793 |
+
"visibility": null,
|
794 |
+
"width": null
|
795 |
+
}
|
796 |
+
},
|
797 |
+
"e068f8e3183844ec9db63f5bff304e62": {
|
798 |
+
"model_module": "@jupyter-widgets/controls",
|
799 |
+
"model_name": "ProgressStyleModel",
|
800 |
+
"model_module_version": "1.5.0",
|
801 |
+
"state": {
|
802 |
+
"_model_module": "@jupyter-widgets/controls",
|
803 |
+
"_model_module_version": "1.5.0",
|
804 |
+
"_model_name": "ProgressStyleModel",
|
805 |
+
"_view_count": null,
|
806 |
+
"_view_module": "@jupyter-widgets/base",
|
807 |
+
"_view_module_version": "1.2.0",
|
808 |
+
"_view_name": "StyleView",
|
809 |
+
"bar_color": null,
|
810 |
+
"description_width": ""
|
811 |
+
}
|
812 |
+
},
|
813 |
+
"3400c1e7251e4d339a291f2cfa7b9c08": {
|
814 |
+
"model_module": "@jupyter-widgets/base",
|
815 |
+
"model_name": "LayoutModel",
|
816 |
+
"model_module_version": "1.2.0",
|
817 |
+
"state": {
|
818 |
+
"_model_module": "@jupyter-widgets/base",
|
819 |
+
"_model_module_version": "1.2.0",
|
820 |
+
"_model_name": "LayoutModel",
|
821 |
+
"_view_count": null,
|
822 |
+
"_view_module": "@jupyter-widgets/base",
|
823 |
+
"_view_module_version": "1.2.0",
|
824 |
+
"_view_name": "LayoutView",
|
825 |
+
"align_content": null,
|
826 |
+
"align_items": null,
|
827 |
+
"align_self": null,
|
828 |
+
"border": null,
|
829 |
+
"bottom": null,
|
830 |
+
"display": null,
|
831 |
+
"flex": null,
|
832 |
+
"flex_flow": null,
|
833 |
+
"grid_area": null,
|
834 |
+
"grid_auto_columns": null,
|
835 |
+
"grid_auto_flow": null,
|
836 |
+
"grid_auto_rows": null,
|
837 |
+
"grid_column": null,
|
838 |
+
"grid_gap": null,
|
839 |
+
"grid_row": null,
|
840 |
+
"grid_template_areas": null,
|
841 |
+
"grid_template_columns": null,
|
842 |
+
"grid_template_rows": null,
|
843 |
+
"height": null,
|
844 |
+
"justify_content": null,
|
845 |
+
"justify_items": null,
|
846 |
+
"left": null,
|
847 |
+
"margin": null,
|
848 |
+
"max_height": null,
|
849 |
+
"max_width": null,
|
850 |
+
"min_height": null,
|
851 |
+
"min_width": null,
|
852 |
+
"object_fit": null,
|
853 |
+
"object_position": null,
|
854 |
+
"order": null,
|
855 |
+
"overflow": null,
|
856 |
+
"overflow_x": null,
|
857 |
+
"overflow_y": null,
|
858 |
+
"padding": null,
|
859 |
+
"right": null,
|
860 |
+
"top": null,
|
861 |
+
"visibility": null,
|
862 |
+
"width": null
|
863 |
+
}
|
864 |
+
},
|
865 |
+
"e1ca24cc7b2f4355bc9a9b39eadb8baa": {
|
866 |
+
"model_module": "@jupyter-widgets/controls",
|
867 |
+
"model_name": "DescriptionStyleModel",
|
868 |
+
"model_module_version": "1.5.0",
|
869 |
+
"state": {
|
870 |
+
"_model_module": "@jupyter-widgets/controls",
|
871 |
+
"_model_module_version": "1.5.0",
|
872 |
+
"_model_name": "DescriptionStyleModel",
|
873 |
+
"_view_count": null,
|
874 |
+
"_view_module": "@jupyter-widgets/base",
|
875 |
+
"_view_module_version": "1.2.0",
|
876 |
+
"_view_name": "StyleView",
|
877 |
+
"description_width": ""
|
878 |
+
}
|
879 |
+
}
|
880 |
+
}
|
881 |
+
}
|
882 |
+
},
|
883 |
+
"nbformat": 4,
|
884 |
+
"nbformat_minor": 0
|
885 |
+
}
|