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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cells": [
|
| 3 |
+
{
|
| 4 |
+
"cell_type": "code",
|
| 5 |
+
"execution_count": null,
|
| 6 |
+
"metadata": {
|
| 7 |
+
"colab": {
|
| 8 |
+
"base_uri": "https://localhost:8080/",
|
| 9 |
+
"height": 220,
|
| 10 |
+
"referenced_widgets": [
|
| 11 |
+
"d6d7368c1c7b4a549d9a706ee1a62785",
|
| 12 |
+
"0e22f97db509402a9b4d4a2fa8c80fe0",
|
| 13 |
+
"475728820f8e4b6fa0c33a1e9989179a",
|
| 14 |
+
"cf5e926c8c004525b5aad36d821ef928",
|
| 15 |
+
"9275c5cf7b314dc69419611128cb0c09",
|
| 16 |
+
"926c9a0562f3455b958c71bd0a138558",
|
| 17 |
+
"ef276c365d604dcc83b4a0133c6b7652",
|
| 18 |
+
"3dc315e087f44330badbb6749b0611a9",
|
| 19 |
+
"bc6c346b95424eb881b793bf6fd2f53e",
|
| 20 |
+
"c26db3dd5a86405b81f510fd759c3af7",
|
| 21 |
+
"dae2b5afeee243e682322c1ecb8238e6",
|
| 22 |
+
"f66e121a24e441c2a4cb32fb87d22632",
|
| 23 |
+
"1776c0895e7f400f85d3a2123cb573f1",
|
| 24 |
+
"e7fd82b589eb49aaba73aeafcc340421",
|
| 25 |
+
"210ec65a874a4f51ab9f059d3de804a9",
|
| 26 |
+
"c91d89b903ce4f02b635454d3bd87877",
|
| 27 |
+
"9cba2384346645499516a7923ad6fcef",
|
| 28 |
+
"491f71a8889c4c7aa0042e99f374be79",
|
| 29 |
+
"9f60072613d84754a0efe7813d853565",
|
| 30 |
+
"bf48a3e692ae4e6da5379152f51baa09",
|
| 31 |
+
"25529d785e9047e1b9bd197a7ec56773",
|
| 32 |
+
"9dda1a77133c4247bac106a9c4699153"
|
| 33 |
+
]
|
| 34 |
+
},
|
| 35 |
+
"id": "Sm-TvQo5chAc",
|
| 36 |
+
"outputId": "031ba45c-fc02-4ee6-ddd4-eeca67c6f92e"
|
| 37 |
+
},
|
| 38 |
+
"outputs": [
|
| 39 |
+
{
|
| 40 |
+
"name": "stdout",
|
| 41 |
+
"output_type": "stream",
|
| 42 |
+
"text": [
|
| 43 |
+
"Initialising HRCS Classifier Pipeline...\n",
|
| 44 |
+
"Loading model and tokenizer from: NIHRDataInsights/HRCSHealthCategories...\n"
|
| 45 |
+
]
|
| 46 |
+
},
|
| 47 |
+
{
|
| 48 |
+
"ename": "SSLError",
|
| 49 |
+
"evalue": "(MaxRetryError(\"HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /NIHRDataInsights/HRCSHealthCategories/resolve/main/tokenizer_config.json (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)')))\"), '(Request ID: c39f4927-7e74-4ee1-b0ff-59c87354a7cb)')",
|
| 50 |
+
"output_type": "error",
|
| 51 |
+
"traceback": [
|
| 52 |
+
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
|
| 53 |
+
"\u001b[1;31mSSLCertVerificationError\u001b[0m Traceback (most recent call last)",
|
| 54 |
+
"File \u001b[1;32mc:\\Users\\Ashley.Banks\\AppData\\Local\\anaconda3\\Lib\\site-packages\\urllib3\\connectionpool.py:466\u001b[0m, in \u001b[0;36mHTTPConnectionPool._make_request\u001b[1;34m(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)\u001b[0m\n\u001b[0;32m 465\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m--> 466\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_validate_conn(conn)\n\u001b[0;32m 467\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m (SocketTimeout, BaseSSLError) \u001b[38;5;28;01mas\u001b[39;00m e:\n",
|
| 55 |
+
"File \u001b[1;32mc:\\Users\\Ashley.Banks\\AppData\\Local\\anaconda3\\Lib\\site-packages\\urllib3\\connectionpool.py:1095\u001b[0m, in \u001b[0;36mHTTPSConnectionPool._validate_conn\u001b[1;34m(self, conn)\u001b[0m\n\u001b[0;32m 1094\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m conn\u001b[38;5;241m.\u001b[39mis_closed:\n\u001b[1;32m-> 1095\u001b[0m conn\u001b[38;5;241m.\u001b[39mconnect()\n\u001b[0;32m 1097\u001b[0m \u001b[38;5;66;03m# TODO revise this, see https://github.com/urllib3/urllib3/issues/2791\u001b[39;00m\n",
|
| 56 |
+
"File \u001b[1;32mc:\\Users\\Ashley.Banks\\AppData\\Local\\anaconda3\\Lib\\site-packages\\urllib3\\connection.py:730\u001b[0m, in \u001b[0;36mHTTPSConnection.connect\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 728\u001b[0m server_hostname_rm_dot \u001b[38;5;241m=\u001b[39m server_hostname\u001b[38;5;241m.\u001b[39mrstrip(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m.\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m--> 730\u001b[0m sock_and_verified \u001b[38;5;241m=\u001b[39m _ssl_wrap_socket_and_match_hostname(\n\u001b[0;32m 731\u001b[0m sock\u001b[38;5;241m=\u001b[39msock,\n\u001b[0;32m 732\u001b[0m cert_reqs\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mcert_reqs,\n\u001b[0;32m 733\u001b[0m ssl_version\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mssl_version,\n\u001b[0;32m 734\u001b[0m ssl_minimum_version\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mssl_minimum_version,\n\u001b[0;32m 735\u001b[0m ssl_maximum_version\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mssl_maximum_version,\n\u001b[0;32m 736\u001b[0m ca_certs\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mca_certs,\n\u001b[0;32m 737\u001b[0m ca_cert_dir\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mca_cert_dir,\n\u001b[0;32m 738\u001b[0m ca_cert_data\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mca_cert_data,\n\u001b[0;32m 739\u001b[0m cert_file\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mcert_file,\n\u001b[0;32m 740\u001b[0m key_file\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mkey_file,\n\u001b[0;32m 741\u001b[0m key_password\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mkey_password,\n\u001b[0;32m 742\u001b[0m server_hostname\u001b[38;5;241m=\u001b[39mserver_hostname_rm_dot,\n\u001b[0;32m 743\u001b[0m ssl_context\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mssl_context,\n\u001b[0;32m 744\u001b[0m tls_in_tls\u001b[38;5;241m=\u001b[39mtls_in_tls,\n\u001b[0;32m 745\u001b[0m assert_hostname\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39massert_hostname,\n\u001b[0;32m 746\u001b[0m assert_fingerprint\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39massert_fingerprint,\n\u001b[0;32m 747\u001b[0m )\n\u001b[0;32m 748\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msock \u001b[38;5;241m=\u001b[39m sock_and_verified\u001b[38;5;241m.\u001b[39msocket\n",
|
| 57 |
+
"File \u001b[1;32mc:\\Users\\Ashley.Banks\\AppData\\Local\\anaconda3\\Lib\\site-packages\\urllib3\\connection.py:909\u001b[0m, in \u001b[0;36m_ssl_wrap_socket_and_match_hostname\u001b[1;34m(sock, cert_reqs, ssl_version, ssl_minimum_version, ssl_maximum_version, cert_file, key_file, key_password, ca_certs, ca_cert_dir, ca_cert_data, assert_hostname, assert_fingerprint, server_hostname, ssl_context, tls_in_tls)\u001b[0m\n\u001b[0;32m 907\u001b[0m server_hostname \u001b[38;5;241m=\u001b[39m normalized\n\u001b[1;32m--> 909\u001b[0m ssl_sock \u001b[38;5;241m=\u001b[39m ssl_wrap_socket(\n\u001b[0;32m 910\u001b[0m sock\u001b[38;5;241m=\u001b[39msock,\n\u001b[0;32m 911\u001b[0m keyfile\u001b[38;5;241m=\u001b[39mkey_file,\n\u001b[0;32m 912\u001b[0m certfile\u001b[38;5;241m=\u001b[39mcert_file,\n\u001b[0;32m 913\u001b[0m key_password\u001b[38;5;241m=\u001b[39mkey_password,\n\u001b[0;32m 914\u001b[0m ca_certs\u001b[38;5;241m=\u001b[39mca_certs,\n\u001b[0;32m 915\u001b[0m ca_cert_dir\u001b[38;5;241m=\u001b[39mca_cert_dir,\n\u001b[0;32m 916\u001b[0m ca_cert_data\u001b[38;5;241m=\u001b[39mca_cert_data,\n\u001b[0;32m 917\u001b[0m server_hostname\u001b[38;5;241m=\u001b[39mserver_hostname,\n\u001b[0;32m 918\u001b[0m ssl_context\u001b[38;5;241m=\u001b[39mcontext,\n\u001b[0;32m 919\u001b[0m tls_in_tls\u001b[38;5;241m=\u001b[39mtls_in_tls,\n\u001b[0;32m 920\u001b[0m )\n\u001b[0;32m 922\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n",
|
| 58 |
+
"File \u001b[1;32mc:\\Users\\Ashley.Banks\\AppData\\Local\\anaconda3\\Lib\\site-packages\\urllib3\\util\\ssl_.py:469\u001b[0m, in \u001b[0;36mssl_wrap_socket\u001b[1;34m(sock, keyfile, certfile, cert_reqs, ca_certs, server_hostname, ssl_version, ciphers, ssl_context, ca_cert_dir, key_password, ca_cert_data, tls_in_tls)\u001b[0m\n\u001b[0;32m 467\u001b[0m context\u001b[38;5;241m.\u001b[39mset_alpn_protocols(ALPN_PROTOCOLS)\n\u001b[1;32m--> 469\u001b[0m ssl_sock \u001b[38;5;241m=\u001b[39m _ssl_wrap_socket_impl(sock, context, tls_in_tls, server_hostname)\n\u001b[0;32m 470\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m ssl_sock\n",
|
| 59 |
+
"File \u001b[1;32mc:\\Users\\Ashley.Banks\\AppData\\Local\\anaconda3\\Lib\\site-packages\\urllib3\\util\\ssl_.py:513\u001b[0m, in \u001b[0;36m_ssl_wrap_socket_impl\u001b[1;34m(sock, ssl_context, tls_in_tls, server_hostname)\u001b[0m\n\u001b[0;32m 511\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m SSLTransport(sock, ssl_context, server_hostname)\n\u001b[1;32m--> 513\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m ssl_context\u001b[38;5;241m.\u001b[39mwrap_socket(sock, server_hostname\u001b[38;5;241m=\u001b[39mserver_hostname)\n",
|
| 60 |
+
"File \u001b[1;32mc:\\Users\\Ashley.Banks\\AppData\\Local\\anaconda3\\Lib\\ssl.py:455\u001b[0m, in \u001b[0;36mSSLContext.wrap_socket\u001b[1;34m(self, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname, session)\u001b[0m\n\u001b[0;32m 449\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mwrap_socket\u001b[39m(\u001b[38;5;28mself\u001b[39m, sock, server_side\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m,\n\u001b[0;32m 450\u001b[0m do_handshake_on_connect\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m,\n\u001b[0;32m 451\u001b[0m suppress_ragged_eofs\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m,\n\u001b[0;32m 452\u001b[0m server_hostname\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mNone\u001b[39;00m, session\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mNone\u001b[39;00m):\n\u001b[0;32m 453\u001b[0m \u001b[38;5;66;03m# SSLSocket class handles server_hostname encoding before it calls\u001b[39;00m\n\u001b[0;32m 454\u001b[0m \u001b[38;5;66;03m# ctx._wrap_socket()\u001b[39;00m\n\u001b[1;32m--> 455\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msslsocket_class\u001b[38;5;241m.\u001b[39m_create(\n\u001b[0;32m 456\u001b[0m sock\u001b[38;5;241m=\u001b[39msock,\n\u001b[0;32m 457\u001b[0m server_side\u001b[38;5;241m=\u001b[39mserver_side,\n\u001b[0;32m 458\u001b[0m do_handshake_on_connect\u001b[38;5;241m=\u001b[39mdo_handshake_on_connect,\n\u001b[0;32m 459\u001b[0m suppress_ragged_eofs\u001b[38;5;241m=\u001b[39msuppress_ragged_eofs,\n\u001b[0;32m 460\u001b[0m server_hostname\u001b[38;5;241m=\u001b[39mserver_hostname,\n\u001b[0;32m 461\u001b[0m context\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m,\n\u001b[0;32m 462\u001b[0m session\u001b[38;5;241m=\u001b[39msession\n\u001b[0;32m 463\u001b[0m )\n",
|
| 61 |
+
"File \u001b[1;32mc:\\Users\\Ashley.Banks\\AppData\\Local\\anaconda3\\Lib\\ssl.py:1041\u001b[0m, in \u001b[0;36mSSLSocket._create\u001b[1;34m(cls, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname, context, session)\u001b[0m\n\u001b[0;32m 1040\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mdo_handshake_on_connect should not be specified for non-blocking sockets\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m-> 1041\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdo_handshake()\n\u001b[0;32m 1042\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m:\n",
|
| 62 |
+
"File \u001b[1;32mc:\\Users\\Ashley.Banks\\AppData\\Local\\anaconda3\\Lib\\ssl.py:1319\u001b[0m, in \u001b[0;36mSSLSocket.do_handshake\u001b[1;34m(self, block)\u001b[0m\n\u001b[0;32m 1318\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msettimeout(\u001b[38;5;28;01mNone\u001b[39;00m)\n\u001b[1;32m-> 1319\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_sslobj\u001b[38;5;241m.\u001b[39mdo_handshake()\n\u001b[0;32m 1320\u001b[0m \u001b[38;5;28;01mfinally\u001b[39;00m:\n",
|
| 63 |
+
"\u001b[1;31mSSLCertVerificationError\u001b[0m: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)",
|
| 64 |
+
"\nDuring handling of the above exception, another exception occurred:\n",
|
| 65 |
+
"\u001b[1;31mSSLError\u001b[0m Traceback (most recent call last)",
|
| 66 |
+
"File \u001b[1;32mc:\\Users\\Ashley.Banks\\AppData\\Local\\anaconda3\\Lib\\site-packages\\urllib3\\connectionpool.py:789\u001b[0m, in \u001b[0;36mHTTPConnectionPool.urlopen\u001b[1;34m(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw)\u001b[0m\n\u001b[0;32m 788\u001b[0m \u001b[38;5;66;03m# Make the request on the HTTPConnection object\u001b[39;00m\n\u001b[1;32m--> 789\u001b[0m response \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_make_request(\n\u001b[0;32m 790\u001b[0m conn,\n\u001b[0;32m 791\u001b[0m method,\n\u001b[0;32m 792\u001b[0m url,\n\u001b[0;32m 793\u001b[0m timeout\u001b[38;5;241m=\u001b[39mtimeout_obj,\n\u001b[0;32m 794\u001b[0m body\u001b[38;5;241m=\u001b[39mbody,\n\u001b[0;32m 795\u001b[0m headers\u001b[38;5;241m=\u001b[39mheaders,\n\u001b[0;32m 796\u001b[0m chunked\u001b[38;5;241m=\u001b[39mchunked,\n\u001b[0;32m 797\u001b[0m retries\u001b[38;5;241m=\u001b[39mretries,\n\u001b[0;32m 798\u001b[0m response_conn\u001b[38;5;241m=\u001b[39mresponse_conn,\n\u001b[0;32m 799\u001b[0m preload_content\u001b[38;5;241m=\u001b[39mpreload_content,\n\u001b[0;32m 800\u001b[0m decode_content\u001b[38;5;241m=\u001b[39mdecode_content,\n\u001b[0;32m 801\u001b[0m \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mresponse_kw,\n\u001b[0;32m 802\u001b[0m )\n\u001b[0;32m 804\u001b[0m \u001b[38;5;66;03m# Everything went great!\u001b[39;00m\n",
|
| 67 |
+
"File \u001b[1;32mc:\\Users\\Ashley.Banks\\AppData\\Local\\anaconda3\\Lib\\site-packages\\urllib3\\connectionpool.py:490\u001b[0m, in \u001b[0;36mHTTPConnectionPool._make_request\u001b[1;34m(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)\u001b[0m\n\u001b[0;32m 489\u001b[0m new_e \u001b[38;5;241m=\u001b[39m _wrap_proxy_error(new_e, conn\u001b[38;5;241m.\u001b[39mproxy\u001b[38;5;241m.\u001b[39mscheme)\n\u001b[1;32m--> 490\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m new_e\n\u001b[0;32m 492\u001b[0m \u001b[38;5;66;03m# conn.request() calls http.client.*.request, not the method in\u001b[39;00m\n\u001b[0;32m 493\u001b[0m \u001b[38;5;66;03m# urllib3.request. It also calls makefile (recv) on the socket.\u001b[39;00m\n",
|
| 68 |
+
"\u001b[1;31mSSLError\u001b[0m: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)",
|
| 69 |
+
"\nThe above exception was the direct cause of the following exception:\n",
|
| 70 |
+
"\u001b[1;31mMaxRetryError\u001b[0m Traceback (most recent call last)",
|
| 71 |
+
"File \u001b[1;32mc:\\Users\\Ashley.Banks\\AppData\\Local\\anaconda3\\Lib\\site-packages\\requests\\adapters.py:667\u001b[0m, in \u001b[0;36mHTTPAdapter.send\u001b[1;34m(self, request, stream, timeout, verify, cert, proxies)\u001b[0m\n\u001b[0;32m 666\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m--> 667\u001b[0m resp \u001b[38;5;241m=\u001b[39m conn\u001b[38;5;241m.\u001b[39murlopen(\n\u001b[0;32m 668\u001b[0m method\u001b[38;5;241m=\u001b[39mrequest\u001b[38;5;241m.\u001b[39mmethod,\n\u001b[0;32m 669\u001b[0m url\u001b[38;5;241m=\u001b[39murl,\n\u001b[0;32m 670\u001b[0m body\u001b[38;5;241m=\u001b[39mrequest\u001b[38;5;241m.\u001b[39mbody,\n\u001b[0;32m 671\u001b[0m headers\u001b[38;5;241m=\u001b[39mrequest\u001b[38;5;241m.\u001b[39mheaders,\n\u001b[0;32m 672\u001b[0m redirect\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m,\n\u001b[0;32m 673\u001b[0m assert_same_host\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m,\n\u001b[0;32m 674\u001b[0m preload_content\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m,\n\u001b[0;32m 675\u001b[0m decode_content\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m,\n\u001b[0;32m 676\u001b[0m retries\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mmax_retries,\n\u001b[0;32m 677\u001b[0m timeout\u001b[38;5;241m=\u001b[39mtimeout,\n\u001b[0;32m 678\u001b[0m chunked\u001b[38;5;241m=\u001b[39mchunked,\n\u001b[0;32m 679\u001b[0m )\n\u001b[0;32m 681\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m (ProtocolError, \u001b[38;5;167;01mOSError\u001b[39;00m) \u001b[38;5;28;01mas\u001b[39;00m err:\n",
|
| 72 |
+
"File \u001b[1;32mc:\\Users\\Ashley.Banks\\AppData\\Local\\anaconda3\\Lib\\site-packages\\urllib3\\connectionpool.py:843\u001b[0m, in \u001b[0;36mHTTPConnectionPool.urlopen\u001b[1;34m(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw)\u001b[0m\n\u001b[0;32m 841\u001b[0m new_e \u001b[38;5;241m=\u001b[39m ProtocolError(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mConnection aborted.\u001b[39m\u001b[38;5;124m\"\u001b[39m, new_e)\n\u001b[1;32m--> 843\u001b[0m retries \u001b[38;5;241m=\u001b[39m retries\u001b[38;5;241m.\u001b[39mincrement(\n\u001b[0;32m 844\u001b[0m method, url, error\u001b[38;5;241m=\u001b[39mnew_e, _pool\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m, _stacktrace\u001b[38;5;241m=\u001b[39msys\u001b[38;5;241m.\u001b[39mexc_info()[\u001b[38;5;241m2\u001b[39m]\n\u001b[0;32m 845\u001b[0m )\n\u001b[0;32m 846\u001b[0m retries\u001b[38;5;241m.\u001b[39msleep()\n",
|
| 73 |
+
"File \u001b[1;32mc:\\Users\\Ashley.Banks\\AppData\\Local\\anaconda3\\Lib\\site-packages\\urllib3\\util\\retry.py:519\u001b[0m, in \u001b[0;36mRetry.increment\u001b[1;34m(self, method, url, response, error, _pool, _stacktrace)\u001b[0m\n\u001b[0;32m 518\u001b[0m reason \u001b[38;5;241m=\u001b[39m error \u001b[38;5;129;01mor\u001b[39;00m ResponseError(cause)\n\u001b[1;32m--> 519\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m MaxRetryError(_pool, url, reason) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mreason\u001b[39;00m \u001b[38;5;66;03m# type: ignore[arg-type]\u001b[39;00m\n\u001b[0;32m 521\u001b[0m log\u001b[38;5;241m.\u001b[39mdebug(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mIncremented Retry for (url=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m): \u001b[39m\u001b[38;5;132;01m%r\u001b[39;00m\u001b[38;5;124m\"\u001b[39m, url, new_retry)\n",
|
| 74 |
+
"\u001b[1;31mMaxRetryError\u001b[0m: HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /NIHRDataInsights/HRCSHealthCategories/resolve/main/tokenizer_config.json (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)')))",
|
| 75 |
+
"\nDuring handling of the above exception, another exception occurred:\n",
|
| 76 |
+
"\u001b[1;31mSSLError\u001b[0m Traceback (most recent call last)",
|
| 77 |
+
"Cell \u001b[1;32mIn[1], line 200\u001b[0m\n\u001b[0;32m 197\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mInitialising HRCS Classifier Pipeline...\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m 199\u001b[0m \u001b[38;5;66;03m# Load models once outside the loop to save memory/time\u001b[39;00m\n\u001b[1;32m--> 200\u001b[0m hc_assets \u001b[38;5;241m=\u001b[39m load_hf_model(HC_REPO_ID)\n\u001b[0;32m 201\u001b[0m rac_assets \u001b[38;5;241m=\u001b[39m load_hf_model(RAC_REPO_ID)\n\u001b[0;32m 203\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m folder \u001b[38;5;129;01min\u001b[39;00m DATA_FOLDERS:\n",
|
| 78 |
+
"Cell \u001b[1;32mIn[1], line 75\u001b[0m, in \u001b[0;36mload_hf_model\u001b[1;34m(repo_id)\u001b[0m\n\u001b[0;32m 70\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[0;32m 71\u001b[0m \u001b[38;5;124;03mThis section downloads the models from hugging face and the optimal thresholds.\u001b[39;00m\n\u001b[0;32m 72\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[0;32m 73\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mLoading model and tokenizer from: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mrepo_id\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m...\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m---> 75\u001b[0m tok \u001b[38;5;241m=\u001b[39m AutoTokenizer\u001b[38;5;241m.\u001b[39mfrom_pretrained(repo_id, use_fast\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m)\n\u001b[0;32m 76\u001b[0m model \u001b[38;5;241m=\u001b[39m AutoModelForSequenceClassification\u001b[38;5;241m.\u001b[39mfrom_pretrained(repo_id)\n\u001b[0;32m 78\u001b[0m model\u001b[38;5;241m.\u001b[39meval()\n",
|
| 79 |
+
"File \u001b[1;32mc:\\Users\\Ashley.Banks\\AppData\\Local\\anaconda3\\Lib\\site-packages\\transformers\\models\\auto\\tokenization_auto.py:983\u001b[0m, in \u001b[0;36mAutoTokenizer.from_pretrained\u001b[1;34m(cls, pretrained_model_name_or_path, *inputs, **kwargs)\u001b[0m\n\u001b[0;32m 980\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m tokenizer_class\u001b[38;5;241m.\u001b[39mfrom_pretrained(pretrained_model_name_or_path, \u001b[38;5;241m*\u001b[39minputs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[0;32m 982\u001b[0m \u001b[38;5;66;03m# Next, let's try to use the tokenizer_config file to get the tokenizer class.\u001b[39;00m\n\u001b[1;32m--> 983\u001b[0m tokenizer_config \u001b[38;5;241m=\u001b[39m get_tokenizer_config(pretrained_model_name_or_path, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[0;32m 984\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m_commit_hash\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01min\u001b[39;00m tokenizer_config:\n\u001b[0;32m 985\u001b[0m kwargs[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m_commit_hash\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m tokenizer_config[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m_commit_hash\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n",
|
| 80 |
+
"File \u001b[1;32mc:\\Users\\Ashley.Banks\\AppData\\Local\\anaconda3\\Lib\\site-packages\\transformers\\models\\auto\\tokenization_auto.py:815\u001b[0m, in \u001b[0;36mget_tokenizer_config\u001b[1;34m(pretrained_model_name_or_path, cache_dir, force_download, resume_download, proxies, token, revision, local_files_only, subfolder, **kwargs)\u001b[0m\n\u001b[0;32m 812\u001b[0m token \u001b[38;5;241m=\u001b[39m use_auth_token\n\u001b[0;32m 814\u001b[0m commit_hash \u001b[38;5;241m=\u001b[39m kwargs\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m_commit_hash\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m)\n\u001b[1;32m--> 815\u001b[0m resolved_config_file \u001b[38;5;241m=\u001b[39m cached_file(\n\u001b[0;32m 816\u001b[0m pretrained_model_name_or_path,\n\u001b[0;32m 817\u001b[0m TOKENIZER_CONFIG_FILE,\n\u001b[0;32m 818\u001b[0m cache_dir\u001b[38;5;241m=\u001b[39mcache_dir,\n\u001b[0;32m 819\u001b[0m force_download\u001b[38;5;241m=\u001b[39mforce_download,\n\u001b[0;32m 820\u001b[0m resume_download\u001b[38;5;241m=\u001b[39mresume_download,\n\u001b[0;32m 821\u001b[0m proxies\u001b[38;5;241m=\u001b[39mproxies,\n\u001b[0;32m 822\u001b[0m token\u001b[38;5;241m=\u001b[39mtoken,\n\u001b[0;32m 823\u001b[0m revision\u001b[38;5;241m=\u001b[39mrevision,\n\u001b[0;32m 824\u001b[0m local_files_only\u001b[38;5;241m=\u001b[39mlocal_files_only,\n\u001b[0;32m 825\u001b[0m subfolder\u001b[38;5;241m=\u001b[39msubfolder,\n\u001b[0;32m 826\u001b[0m _raise_exceptions_for_gated_repo\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m,\n\u001b[0;32m 827\u001b[0m _raise_exceptions_for_missing_entries\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m,\n\u001b[0;32m 828\u001b[0m _raise_exceptions_for_connection_errors\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m,\n\u001b[0;32m 829\u001b[0m _commit_hash\u001b[38;5;241m=\u001b[39mcommit_hash,\n\u001b[0;32m 830\u001b[0m )\n\u001b[0;32m 831\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m resolved_config_file \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m 832\u001b[0m logger\u001b[38;5;241m.\u001b[39minfo(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mCould not locate the tokenizer configuration file, will try to use the model config instead.\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n",
|
| 81 |
+
"File \u001b[1;32mc:\\Users\\Ashley.Banks\\AppData\\Local\\anaconda3\\Lib\\site-packages\\transformers\\utils\\hub.py:312\u001b[0m, in \u001b[0;36mcached_file\u001b[1;34m(path_or_repo_id, filename, **kwargs)\u001b[0m\n\u001b[0;32m 254\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mcached_file\u001b[39m(\n\u001b[0;32m 255\u001b[0m path_or_repo_id: Union[\u001b[38;5;28mstr\u001b[39m, os\u001b[38;5;241m.\u001b[39mPathLike],\n\u001b[0;32m 256\u001b[0m filename: \u001b[38;5;28mstr\u001b[39m,\n\u001b[0;32m 257\u001b[0m \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs,\n\u001b[0;32m 258\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Optional[\u001b[38;5;28mstr\u001b[39m]:\n\u001b[0;32m 259\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[0;32m 260\u001b[0m \u001b[38;5;124;03m Tries to locate a file in a local folder and repo, downloads and cache it if necessary.\u001b[39;00m\n\u001b[0;32m 261\u001b[0m \n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 310\u001b[0m \u001b[38;5;124;03m ```\u001b[39;00m\n\u001b[0;32m 311\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[1;32m--> 312\u001b[0m file \u001b[38;5;241m=\u001b[39m cached_files(path_or_repo_id\u001b[38;5;241m=\u001b[39mpath_or_repo_id, filenames\u001b[38;5;241m=\u001b[39m[filename], \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[0;32m 313\u001b[0m file \u001b[38;5;241m=\u001b[39m file[\u001b[38;5;241m0\u001b[39m] \u001b[38;5;28;01mif\u001b[39;00m file \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;28;01melse\u001b[39;00m file\n\u001b[0;32m 314\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m file\n",
|
| 82 |
+
"File \u001b[1;32mc:\\Users\\Ashley.Banks\\AppData\\Local\\anaconda3\\Lib\\site-packages\\transformers\\utils\\hub.py:557\u001b[0m, in \u001b[0;36mcached_files\u001b[1;34m(path_or_repo_id, filenames, cache_dir, force_download, resume_download, proxies, token, revision, local_files_only, subfolder, repo_type, user_agent, _raise_exceptions_for_gated_repo, _raise_exceptions_for_missing_entries, _raise_exceptions_for_connection_errors, _commit_hash, **deprecated_kwargs)\u001b[0m\n\u001b[0;32m 554\u001b[0m \u001b[38;5;66;03m# Any other Exception type should now be re-raised, in order to provide helpful error messages and break the execution flow\u001b[39;00m\n\u001b[0;32m 555\u001b[0m \u001b[38;5;66;03m# (EntryNotFoundError will be treated outside this block and correctly re-raised if needed)\u001b[39;00m\n\u001b[0;32m 556\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(e, EntryNotFoundError):\n\u001b[1;32m--> 557\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m e\n\u001b[0;32m 559\u001b[0m resolved_files \u001b[38;5;241m=\u001b[39m [\n\u001b[0;32m 560\u001b[0m _get_cache_file_to_return(path_or_repo_id, filename, cache_dir, revision) \u001b[38;5;28;01mfor\u001b[39;00m filename \u001b[38;5;129;01min\u001b[39;00m full_filenames\n\u001b[0;32m 561\u001b[0m ]\n\u001b[0;32m 562\u001b[0m \u001b[38;5;66;03m# If there are any missing file and the flag is active, raise\u001b[39;00m\n",
|
| 83 |
+
"File \u001b[1;32mc:\\Users\\Ashley.Banks\\AppData\\Local\\anaconda3\\Lib\\site-packages\\transformers\\utils\\hub.py:470\u001b[0m, in \u001b[0;36mcached_files\u001b[1;34m(path_or_repo_id, filenames, cache_dir, force_download, resume_download, proxies, token, revision, local_files_only, subfolder, repo_type, user_agent, _raise_exceptions_for_gated_repo, _raise_exceptions_for_missing_entries, _raise_exceptions_for_connection_errors, _commit_hash, **deprecated_kwargs)\u001b[0m\n\u001b[0;32m 467\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m 468\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(full_filenames) \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m1\u001b[39m:\n\u001b[0;32m 469\u001b[0m \u001b[38;5;66;03m# This is slightly better for only 1 file\u001b[39;00m\n\u001b[1;32m--> 470\u001b[0m hf_hub_download(\n\u001b[0;32m 471\u001b[0m path_or_repo_id,\n\u001b[0;32m 472\u001b[0m filenames[\u001b[38;5;241m0\u001b[39m],\n\u001b[0;32m 473\u001b[0m subfolder\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(subfolder) \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m0\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m subfolder,\n\u001b[0;32m 474\u001b[0m repo_type\u001b[38;5;241m=\u001b[39mrepo_type,\n\u001b[0;32m 475\u001b[0m revision\u001b[38;5;241m=\u001b[39mrevision,\n\u001b[0;32m 476\u001b[0m cache_dir\u001b[38;5;241m=\u001b[39mcache_dir,\n\u001b[0;32m 477\u001b[0m user_agent\u001b[38;5;241m=\u001b[39muser_agent,\n\u001b[0;32m 478\u001b[0m force_download\u001b[38;5;241m=\u001b[39mforce_download,\n\u001b[0;32m 479\u001b[0m proxies\u001b[38;5;241m=\u001b[39mproxies,\n\u001b[0;32m 480\u001b[0m resume_download\u001b[38;5;241m=\u001b[39mresume_download,\n\u001b[0;32m 481\u001b[0m token\u001b[38;5;241m=\u001b[39mtoken,\n\u001b[0;32m 482\u001b[0m local_files_only\u001b[38;5;241m=\u001b[39mlocal_files_only,\n\u001b[0;32m 483\u001b[0m )\n\u001b[0;32m 484\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m 485\u001b[0m snapshot_download(\n\u001b[0;32m 486\u001b[0m path_or_repo_id,\n\u001b[0;32m 487\u001b[0m allow_patterns\u001b[38;5;241m=\u001b[39mfull_filenames,\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 496\u001b[0m local_files_only\u001b[38;5;241m=\u001b[39mlocal_files_only,\n\u001b[0;32m 497\u001b[0m )\n",
|
| 84 |
+
"File \u001b[1;32mc:\\Users\\Ashley.Banks\\AppData\\Local\\anaconda3\\Lib\\site-packages\\huggingface_hub\\utils\\_validators.py:114\u001b[0m, in \u001b[0;36mvalidate_hf_hub_args.<locals>._inner_fn\u001b[1;34m(*args, **kwargs)\u001b[0m\n\u001b[0;32m 111\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m check_use_auth_token:\n\u001b[0;32m 112\u001b[0m kwargs \u001b[38;5;241m=\u001b[39m smoothly_deprecate_use_auth_token(fn_name\u001b[38;5;241m=\u001b[39mfn\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__name__\u001b[39m, has_token\u001b[38;5;241m=\u001b[39mhas_token, kwargs\u001b[38;5;241m=\u001b[39mkwargs)\n\u001b[1;32m--> 114\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m fn(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n",
|
| 85 |
+
"File \u001b[1;32mc:\\Users\\Ashley.Banks\\AppData\\Local\\anaconda3\\Lib\\site-packages\\huggingface_hub\\file_download.py:1008\u001b[0m, in \u001b[0;36mhf_hub_download\u001b[1;34m(repo_id, filename, subfolder, repo_type, revision, library_name, library_version, cache_dir, local_dir, user_agent, force_download, proxies, etag_timeout, token, local_files_only, headers, endpoint, resume_download, force_filename, local_dir_use_symlinks)\u001b[0m\n\u001b[0;32m 988\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m _hf_hub_download_to_local_dir(\n\u001b[0;32m 989\u001b[0m \u001b[38;5;66;03m# Destination\u001b[39;00m\n\u001b[0;32m 990\u001b[0m local_dir\u001b[38;5;241m=\u001b[39mlocal_dir,\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 1005\u001b[0m local_files_only\u001b[38;5;241m=\u001b[39mlocal_files_only,\n\u001b[0;32m 1006\u001b[0m )\n\u001b[0;32m 1007\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m-> 1008\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m _hf_hub_download_to_cache_dir(\n\u001b[0;32m 1009\u001b[0m \u001b[38;5;66;03m# Destination\u001b[39;00m\n\u001b[0;32m 1010\u001b[0m cache_dir\u001b[38;5;241m=\u001b[39mcache_dir,\n\u001b[0;32m 1011\u001b[0m \u001b[38;5;66;03m# File info\u001b[39;00m\n\u001b[0;32m 1012\u001b[0m repo_id\u001b[38;5;241m=\u001b[39mrepo_id,\n\u001b[0;32m 1013\u001b[0m filename\u001b[38;5;241m=\u001b[39mfilename,\n\u001b[0;32m 1014\u001b[0m repo_type\u001b[38;5;241m=\u001b[39mrepo_type,\n\u001b[0;32m 1015\u001b[0m revision\u001b[38;5;241m=\u001b[39mrevision,\n\u001b[0;32m 1016\u001b[0m \u001b[38;5;66;03m# HTTP info\u001b[39;00m\n\u001b[0;32m 1017\u001b[0m endpoint\u001b[38;5;241m=\u001b[39mendpoint,\n\u001b[0;32m 1018\u001b[0m etag_timeout\u001b[38;5;241m=\u001b[39metag_timeout,\n\u001b[0;32m 1019\u001b[0m headers\u001b[38;5;241m=\u001b[39mhf_headers,\n\u001b[0;32m 1020\u001b[0m proxies\u001b[38;5;241m=\u001b[39mproxies,\n\u001b[0;32m 1021\u001b[0m token\u001b[38;5;241m=\u001b[39mtoken,\n\u001b[0;32m 1022\u001b[0m \u001b[38;5;66;03m# Additional options\u001b[39;00m\n\u001b[0;32m 1023\u001b[0m local_files_only\u001b[38;5;241m=\u001b[39mlocal_files_only,\n\u001b[0;32m 1024\u001b[0m force_download\u001b[38;5;241m=\u001b[39mforce_download,\n\u001b[0;32m 1025\u001b[0m )\n",
|
| 86 |
+
"File \u001b[1;32mc:\\Users\\Ashley.Banks\\AppData\\Local\\anaconda3\\Lib\\site-packages\\huggingface_hub\\file_download.py:1071\u001b[0m, in \u001b[0;36m_hf_hub_download_to_cache_dir\u001b[1;34m(cache_dir, repo_id, filename, repo_type, revision, endpoint, etag_timeout, headers, proxies, token, local_files_only, force_download)\u001b[0m\n\u001b[0;32m 1067\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m pointer_path\n\u001b[0;32m 1069\u001b[0m \u001b[38;5;66;03m# Try to get metadata (etag, commit_hash, url, size) from the server.\u001b[39;00m\n\u001b[0;32m 1070\u001b[0m \u001b[38;5;66;03m# If we can't, a HEAD request error is returned.\u001b[39;00m\n\u001b[1;32m-> 1071\u001b[0m (url_to_download, etag, commit_hash, expected_size, xet_file_data, head_call_error) \u001b[38;5;241m=\u001b[39m _get_metadata_or_catch_error(\n\u001b[0;32m 1072\u001b[0m repo_id\u001b[38;5;241m=\u001b[39mrepo_id,\n\u001b[0;32m 1073\u001b[0m filename\u001b[38;5;241m=\u001b[39mfilename,\n\u001b[0;32m 1074\u001b[0m repo_type\u001b[38;5;241m=\u001b[39mrepo_type,\n\u001b[0;32m 1075\u001b[0m revision\u001b[38;5;241m=\u001b[39mrevision,\n\u001b[0;32m 1076\u001b[0m endpoint\u001b[38;5;241m=\u001b[39mendpoint,\n\u001b[0;32m 1077\u001b[0m proxies\u001b[38;5;241m=\u001b[39mproxies,\n\u001b[0;32m 1078\u001b[0m etag_timeout\u001b[38;5;241m=\u001b[39metag_timeout,\n\u001b[0;32m 1079\u001b[0m headers\u001b[38;5;241m=\u001b[39mheaders,\n\u001b[0;32m 1080\u001b[0m token\u001b[38;5;241m=\u001b[39mtoken,\n\u001b[0;32m 1081\u001b[0m local_files_only\u001b[38;5;241m=\u001b[39mlocal_files_only,\n\u001b[0;32m 1082\u001b[0m storage_folder\u001b[38;5;241m=\u001b[39mstorage_folder,\n\u001b[0;32m 1083\u001b[0m relative_filename\u001b[38;5;241m=\u001b[39mrelative_filename,\n\u001b[0;32m 1084\u001b[0m )\n\u001b[0;32m 1086\u001b[0m \u001b[38;5;66;03m# etag can be None for several reasons:\u001b[39;00m\n\u001b[0;32m 1087\u001b[0m \u001b[38;5;66;03m# 1. we passed local_files_only.\u001b[39;00m\n\u001b[0;32m 1088\u001b[0m \u001b[38;5;66;03m# 2. we don't have a connection\u001b[39;00m\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 1094\u001b[0m \u001b[38;5;66;03m# If the specified revision is a commit hash, look inside \"snapshots\".\u001b[39;00m\n\u001b[0;32m 1095\u001b[0m \u001b[38;5;66;03m# If the specified revision is a branch or tag, look inside \"refs\".\u001b[39;00m\n\u001b[0;32m 1096\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m head_call_error \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m 1097\u001b[0m \u001b[38;5;66;03m# Couldn't make a HEAD call => let's try to find a local file\u001b[39;00m\n",
|
| 87 |
+
"File \u001b[1;32mc:\\Users\\Ashley.Banks\\AppData\\Local\\anaconda3\\Lib\\site-packages\\huggingface_hub\\file_download.py:1533\u001b[0m, in \u001b[0;36m_get_metadata_or_catch_error\u001b[1;34m(repo_id, filename, repo_type, revision, endpoint, proxies, etag_timeout, headers, token, local_files_only, relative_filename, storage_folder)\u001b[0m\n\u001b[0;32m 1531\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m 1532\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m-> 1533\u001b[0m metadata \u001b[38;5;241m=\u001b[39m get_hf_file_metadata(\n\u001b[0;32m 1534\u001b[0m url\u001b[38;5;241m=\u001b[39murl, proxies\u001b[38;5;241m=\u001b[39mproxies, timeout\u001b[38;5;241m=\u001b[39metag_timeout, headers\u001b[38;5;241m=\u001b[39mheaders, token\u001b[38;5;241m=\u001b[39mtoken\n\u001b[0;32m 1535\u001b[0m )\n\u001b[0;32m 1536\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m EntryNotFoundError \u001b[38;5;28;01mas\u001b[39;00m http_error:\n\u001b[0;32m 1537\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m storage_folder \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m relative_filename \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m 1538\u001b[0m \u001b[38;5;66;03m# Cache the non-existence of the file\u001b[39;00m\n",
|
| 88 |
+
"File \u001b[1;32mc:\\Users\\Ashley.Banks\\AppData\\Local\\anaconda3\\Lib\\site-packages\\huggingface_hub\\utils\\_validators.py:114\u001b[0m, in \u001b[0;36mvalidate_hf_hub_args.<locals>._inner_fn\u001b[1;34m(*args, **kwargs)\u001b[0m\n\u001b[0;32m 111\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m check_use_auth_token:\n\u001b[0;32m 112\u001b[0m kwargs \u001b[38;5;241m=\u001b[39m smoothly_deprecate_use_auth_token(fn_name\u001b[38;5;241m=\u001b[39mfn\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__name__\u001b[39m, has_token\u001b[38;5;241m=\u001b[39mhas_token, kwargs\u001b[38;5;241m=\u001b[39mkwargs)\n\u001b[1;32m--> 114\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m fn(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n",
|
| 89 |
+
"File \u001b[1;32mc:\\Users\\Ashley.Banks\\AppData\\Local\\anaconda3\\Lib\\site-packages\\huggingface_hub\\file_download.py:1450\u001b[0m, in \u001b[0;36mget_hf_file_metadata\u001b[1;34m(url, token, proxies, timeout, library_name, library_version, user_agent, headers)\u001b[0m\n\u001b[0;32m 1447\u001b[0m hf_headers[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mAccept-Encoding\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124midentity\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;66;03m# prevent any compression => we want to know the real size of the file\u001b[39;00m\n\u001b[0;32m 1449\u001b[0m \u001b[38;5;66;03m# Retrieve metadata\u001b[39;00m\n\u001b[1;32m-> 1450\u001b[0m r \u001b[38;5;241m=\u001b[39m _request_wrapper(\n\u001b[0;32m 1451\u001b[0m method\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mHEAD\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[0;32m 1452\u001b[0m url\u001b[38;5;241m=\u001b[39murl,\n\u001b[0;32m 1453\u001b[0m headers\u001b[38;5;241m=\u001b[39mhf_headers,\n\u001b[0;32m 1454\u001b[0m allow_redirects\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m,\n\u001b[0;32m 1455\u001b[0m follow_relative_redirects\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m,\n\u001b[0;32m 1456\u001b[0m proxies\u001b[38;5;241m=\u001b[39mproxies,\n\u001b[0;32m 1457\u001b[0m timeout\u001b[38;5;241m=\u001b[39mtimeout,\n\u001b[0;32m 1458\u001b[0m )\n\u001b[0;32m 1459\u001b[0m hf_raise_for_status(r)\n\u001b[0;32m 1461\u001b[0m \u001b[38;5;66;03m# Return\u001b[39;00m\n",
|
| 90 |
+
"File \u001b[1;32mc:\\Users\\Ashley.Banks\\AppData\\Local\\anaconda3\\Lib\\site-packages\\huggingface_hub\\file_download.py:286\u001b[0m, in \u001b[0;36m_request_wrapper\u001b[1;34m(method, url, follow_relative_redirects, **params)\u001b[0m\n\u001b[0;32m 284\u001b[0m \u001b[38;5;66;03m# Recursively follow relative redirects\u001b[39;00m\n\u001b[0;32m 285\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m follow_relative_redirects:\n\u001b[1;32m--> 286\u001b[0m response \u001b[38;5;241m=\u001b[39m _request_wrapper(\n\u001b[0;32m 287\u001b[0m method\u001b[38;5;241m=\u001b[39mmethod,\n\u001b[0;32m 288\u001b[0m url\u001b[38;5;241m=\u001b[39murl,\n\u001b[0;32m 289\u001b[0m follow_relative_redirects\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m,\n\u001b[0;32m 290\u001b[0m \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mparams,\n\u001b[0;32m 291\u001b[0m )\n\u001b[0;32m 293\u001b[0m \u001b[38;5;66;03m# If redirection, we redirect only relative paths.\u001b[39;00m\n\u001b[0;32m 294\u001b[0m \u001b[38;5;66;03m# This is useful in case of a renamed repository.\u001b[39;00m\n\u001b[0;32m 295\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;241m300\u001b[39m \u001b[38;5;241m<\u001b[39m\u001b[38;5;241m=\u001b[39m response\u001b[38;5;241m.\u001b[39mstatus_code \u001b[38;5;241m<\u001b[39m\u001b[38;5;241m=\u001b[39m \u001b[38;5;241m399\u001b[39m:\n",
|
| 91 |
+
"File \u001b[1;32mc:\\Users\\Ashley.Banks\\AppData\\Local\\anaconda3\\Lib\\site-packages\\huggingface_hub\\file_download.py:309\u001b[0m, in \u001b[0;36m_request_wrapper\u001b[1;34m(method, url, follow_relative_redirects, **params)\u001b[0m\n\u001b[0;32m 306\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m response\n\u001b[0;32m 308\u001b[0m \u001b[38;5;66;03m# Perform request and return if status_code is not in the retry list.\u001b[39;00m\n\u001b[1;32m--> 309\u001b[0m response \u001b[38;5;241m=\u001b[39m http_backoff(method\u001b[38;5;241m=\u001b[39mmethod, url\u001b[38;5;241m=\u001b[39murl, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mparams, retry_on_exceptions\u001b[38;5;241m=\u001b[39m(), retry_on_status_codes\u001b[38;5;241m=\u001b[39m(\u001b[38;5;241m429\u001b[39m,))\n\u001b[0;32m 310\u001b[0m hf_raise_for_status(response)\n\u001b[0;32m 311\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m response\n",
|
| 92 |
+
"File \u001b[1;32mc:\\Users\\Ashley.Banks\\AppData\\Local\\anaconda3\\Lib\\site-packages\\huggingface_hub\\utils\\_http.py:310\u001b[0m, in \u001b[0;36mhttp_backoff\u001b[1;34m(method, url, max_retries, base_wait_time, max_wait_time, retry_on_exceptions, retry_on_status_codes, **kwargs)\u001b[0m\n\u001b[0;32m 307\u001b[0m kwargs[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mdata\u001b[39m\u001b[38;5;124m\"\u001b[39m]\u001b[38;5;241m.\u001b[39mseek(io_obj_initial_pos)\n\u001b[0;32m 309\u001b[0m \u001b[38;5;66;03m# Perform request and return if status_code is not in the retry list.\u001b[39;00m\n\u001b[1;32m--> 310\u001b[0m response \u001b[38;5;241m=\u001b[39m session\u001b[38;5;241m.\u001b[39mrequest(method\u001b[38;5;241m=\u001b[39mmethod, url\u001b[38;5;241m=\u001b[39murl, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[0;32m 311\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m response\u001b[38;5;241m.\u001b[39mstatus_code \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m retry_on_status_codes:\n\u001b[0;32m 312\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m response\n",
|
| 93 |
+
"File \u001b[1;32mc:\\Users\\Ashley.Banks\\AppData\\Local\\anaconda3\\Lib\\site-packages\\requests\\sessions.py:589\u001b[0m, in \u001b[0;36mSession.request\u001b[1;34m(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)\u001b[0m\n\u001b[0;32m 584\u001b[0m send_kwargs \u001b[38;5;241m=\u001b[39m {\n\u001b[0;32m 585\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtimeout\u001b[39m\u001b[38;5;124m\"\u001b[39m: timeout,\n\u001b[0;32m 586\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mallow_redirects\u001b[39m\u001b[38;5;124m\"\u001b[39m: allow_redirects,\n\u001b[0;32m 587\u001b[0m }\n\u001b[0;32m 588\u001b[0m send_kwargs\u001b[38;5;241m.\u001b[39mupdate(settings)\n\u001b[1;32m--> 589\u001b[0m resp \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msend(prep, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39msend_kwargs)\n\u001b[0;32m 591\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m resp\n",
|
| 94 |
+
"File \u001b[1;32mc:\\Users\\Ashley.Banks\\AppData\\Local\\anaconda3\\Lib\\site-packages\\requests\\sessions.py:703\u001b[0m, in \u001b[0;36mSession.send\u001b[1;34m(self, request, **kwargs)\u001b[0m\n\u001b[0;32m 700\u001b[0m start \u001b[38;5;241m=\u001b[39m preferred_clock()\n\u001b[0;32m 702\u001b[0m \u001b[38;5;66;03m# Send the request\u001b[39;00m\n\u001b[1;32m--> 703\u001b[0m r \u001b[38;5;241m=\u001b[39m adapter\u001b[38;5;241m.\u001b[39msend(request, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[0;32m 705\u001b[0m \u001b[38;5;66;03m# Total elapsed time of the request (approximately)\u001b[39;00m\n\u001b[0;32m 706\u001b[0m elapsed \u001b[38;5;241m=\u001b[39m preferred_clock() \u001b[38;5;241m-\u001b[39m start\n",
|
| 95 |
+
"File \u001b[1;32mc:\\Users\\Ashley.Banks\\AppData\\Local\\anaconda3\\Lib\\site-packages\\huggingface_hub\\utils\\_http.py:96\u001b[0m, in \u001b[0;36mUniqueRequestIdAdapter.send\u001b[1;34m(self, request, *args, **kwargs)\u001b[0m\n\u001b[0;32m 94\u001b[0m logger\u001b[38;5;241m.\u001b[39mdebug(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mSend: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00m_curlify(request)\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m 95\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m---> 96\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28msuper\u001b[39m()\u001b[38;5;241m.\u001b[39msend(request, \u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[0;32m 97\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m requests\u001b[38;5;241m.\u001b[39mRequestException \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[0;32m 98\u001b[0m request_id \u001b[38;5;241m=\u001b[39m request\u001b[38;5;241m.\u001b[39mheaders\u001b[38;5;241m.\u001b[39mget(X_AMZN_TRACE_ID)\n",
|
| 96 |
+
"File \u001b[1;32mc:\\Users\\Ashley.Banks\\AppData\\Local\\anaconda3\\Lib\\site-packages\\requests\\adapters.py:698\u001b[0m, in \u001b[0;36mHTTPAdapter.send\u001b[1;34m(self, request, stream, timeout, verify, cert, proxies)\u001b[0m\n\u001b[0;32m 694\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m ProxyError(e, request\u001b[38;5;241m=\u001b[39mrequest)\n\u001b[0;32m 696\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(e\u001b[38;5;241m.\u001b[39mreason, _SSLError):\n\u001b[0;32m 697\u001b[0m \u001b[38;5;66;03m# This branch is for urllib3 v1.22 and later.\u001b[39;00m\n\u001b[1;32m--> 698\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m SSLError(e, request\u001b[38;5;241m=\u001b[39mrequest)\n\u001b[0;32m 700\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mConnectionError\u001b[39;00m(e, request\u001b[38;5;241m=\u001b[39mrequest)\n\u001b[0;32m 702\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m ClosedPoolError \u001b[38;5;28;01mas\u001b[39;00m e:\n",
|
| 97 |
+
"\u001b[1;31mSSLError\u001b[0m: (MaxRetryError(\"HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /NIHRDataInsights/HRCSHealthCategories/resolve/main/tokenizer_config.json (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)')))\"), '(Request ID: c39f4927-7e74-4ee1-b0ff-59c87354a7cb)')"
|
| 98 |
+
]
|
| 99 |
+
}
|
| 100 |
+
],
|
| 101 |
+
"source": [
|
| 102 |
+
"\"\"\"\n",
|
| 103 |
+
"HRCS Health Category & Research Activity Code - Inference Script\n",
|
| 104 |
+
"Developed by National Institute for Health and Care Research (NIHR)\n",
|
| 105 |
+
"\n",
|
| 106 |
+
"This script downloads the trained models from Hugging Face and runs\n",
|
| 107 |
+
"predictions locally on a provided CSV of research awards.\n",
|
| 108 |
+
"\n",
|
| 109 |
+
"Dependencies required:\n",
|
| 110 |
+
"pip install torch pandas numpy tqdm transformers huggingface_hub\n",
|
| 111 |
+
"\"\"\"\n",
|
| 112 |
+
"\n",
|
| 113 |
+
"import os, json\n",
|
| 114 |
+
"from typing import List\n",
|
| 115 |
+
"import numpy as np\n",
|
| 116 |
+
"import pandas as pd\n",
|
| 117 |
+
"from tqdm import tqdm\n",
|
| 118 |
+
"\n",
|
| 119 |
+
"import torch\n",
|
| 120 |
+
"from torch.utils.data import Dataset as TorchDataset, DataLoader\n",
|
| 121 |
+
"from torch.nn.functional import sigmoid\n",
|
| 122 |
+
"\n",
|
| 123 |
+
"from transformers import AutoTokenizer, AutoModelForSequenceClassification\n",
|
| 124 |
+
"from huggingface_hub import hf_hub_download\n",
|
| 125 |
+
"\n",
|
| 126 |
+
"# --- USER SETTINGS ---\n",
|
| 127 |
+
"# Set the path to the folder containing your CSV and the desired filenames\n",
|
| 128 |
+
"DATA_FOLDERS = [\"./\"] # can input more than one folder if needed\n",
|
| 129 |
+
"TEST_FILENAME = r\"test_data.csv\"\n",
|
| 130 |
+
"OUTPUT_FILENAME = \"hc_rac_predictions.csv\"\n",
|
| 131 |
+
"\n",
|
| 132 |
+
"# --- HUGGING FACE REPO SETTINGS ---\n",
|
| 133 |
+
"HC_REPO_ID = \"NIHRDataInsights/HRCSHealthCategories\"\n",
|
| 134 |
+
"RAC_REPO_ID = \"NIHRDataInsights/HRCSResearchActivityCodes\"\n",
|
| 135 |
+
"\n",
|
| 136 |
+
"BATCH_SIZE = 16 # Adjust based on your hardware (use 64+ for GPUs, 2-16 for CPUs)\n",
|
| 137 |
+
"MAX_LEN = 512\n",
|
| 138 |
+
"USE_GPU = torch.cuda.is_available()\n",
|
| 139 |
+
"\n",
|
| 140 |
+
"# -------------------- DATASET --------------------\n",
|
| 141 |
+
"class TextDataset(TorchDataset):\n",
|
| 142 |
+
" \"\"\"\n",
|
| 143 |
+
" This section takes your spreadsheet and packages it so the AI can read it.\n",
|
| 144 |
+
" It combines the 'AwardTitle' and 'AwardAbstract' together into 'text' (to be categorised).\n",
|
| 145 |
+
" \"\"\"\n",
|
| 146 |
+
" def __init__(self, df: pd.DataFrame, tokenizer, max_len: int = 512):\n",
|
| 147 |
+
" df = df.copy()\n",
|
| 148 |
+
" df[\"text\"] = (\n",
|
| 149 |
+
" df[\"AwardTitle\"].fillna(\"\").astype(str) + \"\\n\" +\n",
|
| 150 |
+
" df[\"AwardAbstract\"].fillna(\"\").astype(str)\n",
|
| 151 |
+
" )\n",
|
| 152 |
+
" self.texts = df[\"text\"].tolist()\n",
|
| 153 |
+
" self.tokenizer = tokenizer\n",
|
| 154 |
+
" self.max_len = max_len\n",
|
| 155 |
+
"\n",
|
| 156 |
+
" def __len__(self):\n",
|
| 157 |
+
" return len(self.texts)\n",
|
| 158 |
+
"\n",
|
| 159 |
+
" def __getitem__(self, idx):\n",
|
| 160 |
+
" enc = self.tokenizer(\n",
|
| 161 |
+
" self.texts[idx],\n",
|
| 162 |
+
" truncation=True, # cuts if too long\n",
|
| 163 |
+
" padding=\"max_length\", # adds spaces if under limit\n",
|
| 164 |
+
" max_length=self.max_len,\n",
|
| 165 |
+
" return_tensors=\"pt\"\n",
|
| 166 |
+
" )\n",
|
| 167 |
+
" return {k: v.squeeze(0) for k, v in enc.items()}\n",
|
| 168 |
+
"\n",
|
| 169 |
+
"# -------------------- MODEL LOADING --------------------\n",
|
| 170 |
+
"def load_hf_model(repo_id: str):\n",
|
| 171 |
+
" \"\"\"\n",
|
| 172 |
+
" This section downloads the models from hugging face and the optimal thresholds.\n",
|
| 173 |
+
" \"\"\"\n",
|
| 174 |
+
" print(f\"Loading model and tokenizer from: {repo_id}...\")\n",
|
| 175 |
+
"\n",
|
| 176 |
+
" tok = AutoTokenizer.from_pretrained(repo_id, use_fast=True)\n",
|
| 177 |
+
" model = AutoModelForSequenceClassification.from_pretrained(repo_id)\n",
|
| 178 |
+
"\n",
|
| 179 |
+
" model.eval()\n",
|
| 180 |
+
" device = torch.device(\"cuda\" if USE_GPU else \"cpu\")\n",
|
| 181 |
+
" model.to(device)\n",
|
| 182 |
+
"\n",
|
| 183 |
+
" # Download custom metadata.json from the repo for specific threshold values\n",
|
| 184 |
+
" try:\n",
|
| 185 |
+
" meta_path = hf_hub_download(repo_id=repo_id, filename=\"metadata.json\")\n",
|
| 186 |
+
" with open(meta_path, \"r\") as f:\n",
|
| 187 |
+
" meta = json.load(f)\n",
|
| 188 |
+
" labels = meta.get(\"labels\")\n",
|
| 189 |
+
" thresholds = np.array(meta.get(\"optimal_thresholds\", []), dtype=float)\n",
|
| 190 |
+
" except Exception as e:\n",
|
| 191 |
+
" print(f\"Warning: Could not load metadata.json from {repo_id}. {e}\")\n",
|
| 192 |
+
" labels, thresholds = None, None\n",
|
| 193 |
+
"\n",
|
| 194 |
+
" if labels is None:\n",
|
| 195 |
+
" num_labels = int(model.config.num_labels)\n",
|
| 196 |
+
" labels = [model.config.id2label.get(i, f\"L{i}\") for i in range(num_labels)]\n",
|
| 197 |
+
"\n",
|
| 198 |
+
" if thresholds is None or len(thresholds) != len(labels):\n",
|
| 199 |
+
" print(f\"Using default 0.5 threshold for {repo_id}\")\n",
|
| 200 |
+
" thresholds = np.full(len(labels), 0.5, dtype=float)\n",
|
| 201 |
+
"\n",
|
| 202 |
+
" return tok, model, labels, thresholds\n",
|
| 203 |
+
"\n",
|
| 204 |
+
"# -------------------- INFERENCE & BUILD --------------------\n",
|
| 205 |
+
"def predict(model, dataloader: DataLoader, thresholds: np.ndarray):\n",
|
| 206 |
+
" device = next(model.parameters()).device\n",
|
| 207 |
+
" all_logits = []\n",
|
| 208 |
+
"\n",
|
| 209 |
+
" with torch.no_grad():\n",
|
| 210 |
+
" for batch in tqdm(dataloader, desc=\"Inferencing\"):\n",
|
| 211 |
+
" inputs = {k: v.to(device) for k, v in batch.items()}\n",
|
| 212 |
+
" logits = model(**inputs).logits\n",
|
| 213 |
+
" all_logits.append(logits.cpu())\n",
|
| 214 |
+
"\n",
|
| 215 |
+
" logits = torch.cat(all_logits, dim=0).numpy()\n",
|
| 216 |
+
" probs = sigmoid(torch.tensor(logits)).numpy()\n",
|
| 217 |
+
" preds = (probs > thresholds.reshape(1, -1)).astype(int)\n",
|
| 218 |
+
" return logits, probs, preds\n",
|
| 219 |
+
"\n",
|
| 220 |
+
"def build_outputs(df, logits, probs, preds, label_list, thresholds, prefix: str):\n",
|
| 221 |
+
" \"\"\"\n",
|
| 222 |
+
" This section builds the final columns for your spreadsheet.\n",
|
| 223 |
+
" Crucially, it calculates the 'Smallest Logit Diff'.\n",
|
| 224 |
+
" This can be considered an 'AI Certainty Score'. The closer this number is to 0,\n",
|
| 225 |
+
" the more confused the AI was. Please see the Hugging Face READMEs for each model which contains details on the impact on performance.\n",
|
| 226 |
+
" \"\"\"\n",
|
| 227 |
+
" # Clip thresholds to avoid log(0) warnings\n",
|
| 228 |
+
" safe_thresholds = np.clip(thresholds, 1e-7, 1 - 1e-7)\n",
|
| 229 |
+
" thr_logits = np.log(safe_thresholds / (1 - safe_thresholds))\n",
|
| 230 |
+
"\n",
|
| 231 |
+
" rows = {}\n",
|
| 232 |
+
" for i in range(len(df)):\n",
|
| 233 |
+
" logit_row = logits[i]\n",
|
| 234 |
+
" pred_row = preds[i]\n",
|
| 235 |
+
"\n",
|
| 236 |
+
" # gather categories labelled as 'yes'\n",
|
| 237 |
+
" chosen = [label_list[j] for j, val in enumerate(pred_row) if val == 1]\n",
|
| 238 |
+
"\n",
|
| 239 |
+
" # Calculate the uncertainty score\n",
|
| 240 |
+
" smallest_diff = float(np.min(np.abs(logit_row - thr_logits)))\n",
|
| 241 |
+
" rows[i] = {\n",
|
| 242 |
+
" f\"{prefix}_PredictedLabels\": \";\".join(chosen),\n",
|
| 243 |
+
" f\"{prefix}_SmallestLogitDiff\": smallest_diff\n",
|
| 244 |
+
" }\n",
|
| 245 |
+
" return rows\n",
|
| 246 |
+
"\n",
|
| 247 |
+
"# -------------------- PROCESS FOLDER --------------------\n",
|
| 248 |
+
"def run_folder(data_folder: str, hc_assets, rac_assets):\n",
|
| 249 |
+
" \"\"\"\n",
|
| 250 |
+
" This function opens your specific folder (selected in the first section), reads your CSV, passes it through\n",
|
| 251 |
+
" both AI models (Health Categories and Research Activity Codes), and saves the result.\n",
|
| 252 |
+
" \"\"\"\n",
|
| 253 |
+
" test_file = os.path.join(data_folder, TEST_FILENAME)\n",
|
| 254 |
+
" output_file = os.path.join(data_folder, OUTPUT_FILENAME)\n",
|
| 255 |
+
"\n",
|
| 256 |
+
" if not os.path.exists(test_file):\n",
|
| 257 |
+
" print(f\"Skipping: {test_file} not found in {data_folder}.\")\n",
|
| 258 |
+
" return\n",
|
| 259 |
+
"\n",
|
| 260 |
+
" print(f\"\\n=== Processing folder: {data_folder} ===\")\n",
|
| 261 |
+
" df = pd.read_csv(test_file).reset_index(drop=True)\n",
|
| 262 |
+
"\n",
|
| 263 |
+
" # Validate Input Data contains title and abstract\n",
|
| 264 |
+
" if \"AwardTitle\" not in df.columns or \"AwardAbstract\" not in df.columns:\n",
|
| 265 |
+
" print(f\"ERROR: '{TEST_FILENAME}' must contain 'AwardTitle' and 'AwardAbstract' columns. Skipping.\")\n",
|
| 266 |
+
" return\n",
|
| 267 |
+
"\n",
|
| 268 |
+
" # HC Inference\n",
|
| 269 |
+
" hc_tok, hc_model, hc_labels, hc_thr = hc_assets\n",
|
| 270 |
+
" hc_loader = DataLoader(TextDataset(df, hc_tok), batch_size=BATCH_SIZE)\n",
|
| 271 |
+
" hc_logits, _, hc_preds = predict(hc_model, hc_loader, hc_thr)\n",
|
| 272 |
+
" hc_rows = build_outputs(df, hc_logits, None, hc_preds, hc_labels, hc_thr, \"HC\")\n",
|
| 273 |
+
"\n",
|
| 274 |
+
" # RAC Inference\n",
|
| 275 |
+
" rac_tok, rac_model, rac_labels, rac_thr = rac_assets\n",
|
| 276 |
+
" rac_loader = DataLoader(TextDataset(df, rac_tok), batch_size=BATCH_SIZE)\n",
|
| 277 |
+
" rac_logits, _, rac_preds = predict(rac_model, rac_loader, rac_thr)\n",
|
| 278 |
+
" rac_rows = build_outputs(df, rac_logits, None, rac_preds, rac_labels, rac_thr, \"RAC\")\n",
|
| 279 |
+
"\n",
|
| 280 |
+
" # Construct final dataframe\n",
|
| 281 |
+
" output_data = []\n",
|
| 282 |
+
" for i in range(len(df)):\n",
|
| 283 |
+
" row = {\n",
|
| 284 |
+
" \"ID\": df.loc[i, \"ID\"] if \"ID\" in df.columns else i,\n",
|
| 285 |
+
" \"FunderAcronym\": df.loc[i, \"FunderAcronym\"] if \"FunderAcronym\" in df.columns else \"\",\n",
|
| 286 |
+
" \"AwardTitle\": df.loc[i, \"AwardTitle\"],\n",
|
| 287 |
+
" \"AwardAbstract\": df.loc[i, \"AwardAbstract\"],\n",
|
| 288 |
+
" **hc_rows[i],\n",
|
| 289 |
+
" **rac_rows[i]\n",
|
| 290 |
+
" }\n",
|
| 291 |
+
" output_data.append(row)\n",
|
| 292 |
+
"\n",
|
| 293 |
+
" pd.DataFrame(output_data).to_csv(OUTPUT_FILENAME, index=False)\n",
|
| 294 |
+
" print(f\"Success! Predictions saved to: {output_file}\")\n",
|
| 295 |
+
"\n",
|
| 296 |
+
"# -------------------- MAIN --------------------\n",
|
| 297 |
+
"if __name__ == \"__main__\":\n",
|
| 298 |
+
" print(\"Initialising HRCS Classifier Pipeline...\")\n",
|
| 299 |
+
"\n",
|
| 300 |
+
" # Load models once outside the loop to save memory/time\n",
|
| 301 |
+
" hc_assets = load_hf_model(HC_REPO_ID)\n",
|
| 302 |
+
" rac_assets = load_hf_model(RAC_REPO_ID)\n",
|
| 303 |
+
"\n",
|
| 304 |
+
" for folder in DATA_FOLDERS:\n",
|
| 305 |
+
" run_folder(folder, hc_assets, rac_assets)"
|
| 306 |
+
]
|
| 307 |
+
}
|
| 308 |
+
],
|
| 309 |
+
"metadata": {
|
| 310 |
+
"colab": {
|
| 311 |
+
"provenance": []
|
| 312 |
+
},
|
| 313 |
+
"kernelspec": {
|
| 314 |
+
"display_name": "base",
|
| 315 |
+
"language": "python",
|
| 316 |
+
"name": "python3"
|
| 317 |
+
},
|
| 318 |
+
"language_info": {
|
| 319 |
+
"codemirror_mode": {
|
| 320 |
+
"name": "ipython",
|
| 321 |
+
"version": 3
|
| 322 |
+
},
|
| 323 |
+
"file_extension": ".py",
|
| 324 |
+
"mimetype": "text/x-python",
|
| 325 |
+
"name": "python",
|
| 326 |
+
"nbconvert_exporter": "python",
|
| 327 |
+
"pygments_lexer": "ipython3",
|
| 328 |
+
"version": "3.12.7"
|
| 329 |
+
},
|
| 330 |
+
"widgets": {
|
| 331 |
+
"application/vnd.jupyter.widget-state+json": {
|
| 332 |
+
"0e22f97db509402a9b4d4a2fa8c80fe0": {
|
| 333 |
+
"model_module": "@jupyter-widgets/controls",
|
| 334 |
+
"model_module_version": "1.5.0",
|
| 335 |
+
"model_name": "HTMLModel",
|
| 336 |
+
"state": {
|
| 337 |
+
"_dom_classes": [],
|
| 338 |
+
"_model_module": "@jupyter-widgets/controls",
|
| 339 |
+
"_model_module_version": "1.5.0",
|
| 340 |
+
"_model_name": "HTMLModel",
|
| 341 |
+
"_view_count": null,
|
| 342 |
+
"_view_module": "@jupyter-widgets/controls",
|
| 343 |
+
"_view_module_version": "1.5.0",
|
| 344 |
+
"_view_name": "HTMLView",
|
| 345 |
+
"description": "",
|
| 346 |
+
"description_tooltip": null,
|
| 347 |
+
"layout": "IPY_MODEL_926c9a0562f3455b958c71bd0a138558",
|
| 348 |
+
"placeholder": "",
|
| 349 |
+
"style": "IPY_MODEL_ef276c365d604dcc83b4a0133c6b7652",
|
| 350 |
+
"value": "Loading weights: 100%"
|
| 351 |
+
}
|
| 352 |
+
},
|
| 353 |
+
"1776c0895e7f400f85d3a2123cb573f1": {
|
| 354 |
+
"model_module": "@jupyter-widgets/controls",
|
| 355 |
+
"model_module_version": "1.5.0",
|
| 356 |
+
"model_name": "HTMLModel",
|
| 357 |
+
"state": {
|
| 358 |
+
"_dom_classes": [],
|
| 359 |
+
"_model_module": "@jupyter-widgets/controls",
|
| 360 |
+
"_model_module_version": "1.5.0",
|
| 361 |
+
"_model_name": "HTMLModel",
|
| 362 |
+
"_view_count": null,
|
| 363 |
+
"_view_module": "@jupyter-widgets/controls",
|
| 364 |
+
"_view_module_version": "1.5.0",
|
| 365 |
+
"_view_name": "HTMLView",
|
| 366 |
+
"description": "",
|
| 367 |
+
"description_tooltip": null,
|
| 368 |
+
"layout": "IPY_MODEL_9cba2384346645499516a7923ad6fcef",
|
| 369 |
+
"placeholder": "",
|
| 370 |
+
"style": "IPY_MODEL_491f71a8889c4c7aa0042e99f374be79",
|
| 371 |
+
"value": "Loading weights: 100%"
|
| 372 |
+
}
|
| 373 |
+
},
|
| 374 |
+
"210ec65a874a4f51ab9f059d3de804a9": {
|
| 375 |
+
"model_module": "@jupyter-widgets/controls",
|
| 376 |
+
"model_module_version": "1.5.0",
|
| 377 |
+
"model_name": "HTMLModel",
|
| 378 |
+
"state": {
|
| 379 |
+
"_dom_classes": [],
|
| 380 |
+
"_model_module": "@jupyter-widgets/controls",
|
| 381 |
+
"_model_module_version": "1.5.0",
|
| 382 |
+
"_model_name": "HTMLModel",
|
| 383 |
+
"_view_count": null,
|
| 384 |
+
"_view_module": "@jupyter-widgets/controls",
|
| 385 |
+
"_view_module_version": "1.5.0",
|
| 386 |
+
"_view_name": "HTMLView",
|
| 387 |
+
"description": "",
|
| 388 |
+
"description_tooltip": null,
|
| 389 |
+
"layout": "IPY_MODEL_25529d785e9047e1b9bd197a7ec56773",
|
| 390 |
+
"placeholder": "",
|
| 391 |
+
"style": "IPY_MODEL_9dda1a77133c4247bac106a9c4699153",
|
| 392 |
+
"value": " 393/393 [00:00<00:00, 581.79it/s, Materializing param=classifier.weight]"
|
| 393 |
+
}
|
| 394 |
+
},
|
| 395 |
+
"25529d785e9047e1b9bd197a7ec56773": {
|
| 396 |
+
"model_module": "@jupyter-widgets/base",
|
| 397 |
+
"model_module_version": "1.2.0",
|
| 398 |
+
"model_name": "LayoutModel",
|
| 399 |
+
"state": {
|
| 400 |
+
"_model_module": "@jupyter-widgets/base",
|
| 401 |
+
"_model_module_version": "1.2.0",
|
| 402 |
+
"_model_name": "LayoutModel",
|
| 403 |
+
"_view_count": null,
|
| 404 |
+
"_view_module": "@jupyter-widgets/base",
|
| 405 |
+
"_view_module_version": "1.2.0",
|
| 406 |
+
"_view_name": "LayoutView",
|
| 407 |
+
"align_content": null,
|
| 408 |
+
"align_items": null,
|
| 409 |
+
"align_self": null,
|
| 410 |
+
"border": null,
|
| 411 |
+
"bottom": null,
|
| 412 |
+
"display": null,
|
| 413 |
+
"flex": null,
|
| 414 |
+
"flex_flow": null,
|
| 415 |
+
"grid_area": null,
|
| 416 |
+
"grid_auto_columns": null,
|
| 417 |
+
"grid_auto_flow": null,
|
| 418 |
+
"grid_auto_rows": null,
|
| 419 |
+
"grid_column": null,
|
| 420 |
+
"grid_gap": null,
|
| 421 |
+
"grid_row": null,
|
| 422 |
+
"grid_template_areas": null,
|
| 423 |
+
"grid_template_columns": null,
|
| 424 |
+
"grid_template_rows": null,
|
| 425 |
+
"height": null,
|
| 426 |
+
"justify_content": null,
|
| 427 |
+
"justify_items": null,
|
| 428 |
+
"left": null,
|
| 429 |
+
"margin": null,
|
| 430 |
+
"max_height": null,
|
| 431 |
+
"max_width": null,
|
| 432 |
+
"min_height": null,
|
| 433 |
+
"min_width": null,
|
| 434 |
+
"object_fit": null,
|
| 435 |
+
"object_position": null,
|
| 436 |
+
"order": null,
|
| 437 |
+
"overflow": null,
|
| 438 |
+
"overflow_x": null,
|
| 439 |
+
"overflow_y": null,
|
| 440 |
+
"padding": null,
|
| 441 |
+
"right": null,
|
| 442 |
+
"top": null,
|
| 443 |
+
"visibility": null,
|
| 444 |
+
"width": null
|
| 445 |
+
}
|
| 446 |
+
},
|
| 447 |
+
"3dc315e087f44330badbb6749b0611a9": {
|
| 448 |
+
"model_module": "@jupyter-widgets/base",
|
| 449 |
+
"model_module_version": "1.2.0",
|
| 450 |
+
"model_name": "LayoutModel",
|
| 451 |
+
"state": {
|
| 452 |
+
"_model_module": "@jupyter-widgets/base",
|
| 453 |
+
"_model_module_version": "1.2.0",
|
| 454 |
+
"_model_name": "LayoutModel",
|
| 455 |
+
"_view_count": null,
|
| 456 |
+
"_view_module": "@jupyter-widgets/base",
|
| 457 |
+
"_view_module_version": "1.2.0",
|
| 458 |
+
"_view_name": "LayoutView",
|
| 459 |
+
"align_content": null,
|
| 460 |
+
"align_items": null,
|
| 461 |
+
"align_self": null,
|
| 462 |
+
"border": null,
|
| 463 |
+
"bottom": null,
|
| 464 |
+
"display": null,
|
| 465 |
+
"flex": null,
|
| 466 |
+
"flex_flow": null,
|
| 467 |
+
"grid_area": null,
|
| 468 |
+
"grid_auto_columns": null,
|
| 469 |
+
"grid_auto_flow": null,
|
| 470 |
+
"grid_auto_rows": null,
|
| 471 |
+
"grid_column": null,
|
| 472 |
+
"grid_gap": null,
|
| 473 |
+
"grid_row": null,
|
| 474 |
+
"grid_template_areas": null,
|
| 475 |
+
"grid_template_columns": null,
|
| 476 |
+
"grid_template_rows": null,
|
| 477 |
+
"height": null,
|
| 478 |
+
"justify_content": null,
|
| 479 |
+
"justify_items": null,
|
| 480 |
+
"left": null,
|
| 481 |
+
"margin": null,
|
| 482 |
+
"max_height": null,
|
| 483 |
+
"max_width": null,
|
| 484 |
+
"min_height": null,
|
| 485 |
+
"min_width": null,
|
| 486 |
+
"object_fit": null,
|
| 487 |
+
"object_position": null,
|
| 488 |
+
"order": null,
|
| 489 |
+
"overflow": null,
|
| 490 |
+
"overflow_x": null,
|
| 491 |
+
"overflow_y": null,
|
| 492 |
+
"padding": null,
|
| 493 |
+
"right": null,
|
| 494 |
+
"top": null,
|
| 495 |
+
"visibility": null,
|
| 496 |
+
"width": null
|
| 497 |
+
}
|
| 498 |
+
},
|
| 499 |
+
"475728820f8e4b6fa0c33a1e9989179a": {
|
| 500 |
+
"model_module": "@jupyter-widgets/controls",
|
| 501 |
+
"model_module_version": "1.5.0",
|
| 502 |
+
"model_name": "FloatProgressModel",
|
| 503 |
+
"state": {
|
| 504 |
+
"_dom_classes": [],
|
| 505 |
+
"_model_module": "@jupyter-widgets/controls",
|
| 506 |
+
"_model_module_version": "1.5.0",
|
| 507 |
+
"_model_name": "FloatProgressModel",
|
| 508 |
+
"_view_count": null,
|
| 509 |
+
"_view_module": "@jupyter-widgets/controls",
|
| 510 |
+
"_view_module_version": "1.5.0",
|
| 511 |
+
"_view_name": "ProgressView",
|
| 512 |
+
"bar_style": "success",
|
| 513 |
+
"description": "",
|
| 514 |
+
"description_tooltip": null,
|
| 515 |
+
"layout": "IPY_MODEL_3dc315e087f44330badbb6749b0611a9",
|
| 516 |
+
"max": 393,
|
| 517 |
+
"min": 0,
|
| 518 |
+
"orientation": "horizontal",
|
| 519 |
+
"style": "IPY_MODEL_bc6c346b95424eb881b793bf6fd2f53e",
|
| 520 |
+
"value": 393
|
| 521 |
+
}
|
| 522 |
+
},
|
| 523 |
+
"491f71a8889c4c7aa0042e99f374be79": {
|
| 524 |
+
"model_module": "@jupyter-widgets/controls",
|
| 525 |
+
"model_module_version": "1.5.0",
|
| 526 |
+
"model_name": "DescriptionStyleModel",
|
| 527 |
+
"state": {
|
| 528 |
+
"_model_module": "@jupyter-widgets/controls",
|
| 529 |
+
"_model_module_version": "1.5.0",
|
| 530 |
+
"_model_name": "DescriptionStyleModel",
|
| 531 |
+
"_view_count": null,
|
| 532 |
+
"_view_module": "@jupyter-widgets/base",
|
| 533 |
+
"_view_module_version": "1.2.0",
|
| 534 |
+
"_view_name": "StyleView",
|
| 535 |
+
"description_width": ""
|
| 536 |
+
}
|
| 537 |
+
},
|
| 538 |
+
"926c9a0562f3455b958c71bd0a138558": {
|
| 539 |
+
"model_module": "@jupyter-widgets/base",
|
| 540 |
+
"model_module_version": "1.2.0",
|
| 541 |
+
"model_name": "LayoutModel",
|
| 542 |
+
"state": {
|
| 543 |
+
"_model_module": "@jupyter-widgets/base",
|
| 544 |
+
"_model_module_version": "1.2.0",
|
| 545 |
+
"_model_name": "LayoutModel",
|
| 546 |
+
"_view_count": null,
|
| 547 |
+
"_view_module": "@jupyter-widgets/base",
|
| 548 |
+
"_view_module_version": "1.2.0",
|
| 549 |
+
"_view_name": "LayoutView",
|
| 550 |
+
"align_content": null,
|
| 551 |
+
"align_items": null,
|
| 552 |
+
"align_self": null,
|
| 553 |
+
"border": null,
|
| 554 |
+
"bottom": null,
|
| 555 |
+
"display": null,
|
| 556 |
+
"flex": null,
|
| 557 |
+
"flex_flow": null,
|
| 558 |
+
"grid_area": null,
|
| 559 |
+
"grid_auto_columns": null,
|
| 560 |
+
"grid_auto_flow": null,
|
| 561 |
+
"grid_auto_rows": null,
|
| 562 |
+
"grid_column": null,
|
| 563 |
+
"grid_gap": null,
|
| 564 |
+
"grid_row": null,
|
| 565 |
+
"grid_template_areas": null,
|
| 566 |
+
"grid_template_columns": null,
|
| 567 |
+
"grid_template_rows": null,
|
| 568 |
+
"height": null,
|
| 569 |
+
"justify_content": null,
|
| 570 |
+
"justify_items": null,
|
| 571 |
+
"left": null,
|
| 572 |
+
"margin": null,
|
| 573 |
+
"max_height": null,
|
| 574 |
+
"max_width": null,
|
| 575 |
+
"min_height": null,
|
| 576 |
+
"min_width": null,
|
| 577 |
+
"object_fit": null,
|
| 578 |
+
"object_position": null,
|
| 579 |
+
"order": null,
|
| 580 |
+
"overflow": null,
|
| 581 |
+
"overflow_x": null,
|
| 582 |
+
"overflow_y": null,
|
| 583 |
+
"padding": null,
|
| 584 |
+
"right": null,
|
| 585 |
+
"top": null,
|
| 586 |
+
"visibility": null,
|
| 587 |
+
"width": null
|
| 588 |
+
}
|
| 589 |
+
},
|
| 590 |
+
"9275c5cf7b314dc69419611128cb0c09": {
|
| 591 |
+
"model_module": "@jupyter-widgets/base",
|
| 592 |
+
"model_module_version": "1.2.0",
|
| 593 |
+
"model_name": "LayoutModel",
|
| 594 |
+
"state": {
|
| 595 |
+
"_model_module": "@jupyter-widgets/base",
|
| 596 |
+
"_model_module_version": "1.2.0",
|
| 597 |
+
"_model_name": "LayoutModel",
|
| 598 |
+
"_view_count": null,
|
| 599 |
+
"_view_module": "@jupyter-widgets/base",
|
| 600 |
+
"_view_module_version": "1.2.0",
|
| 601 |
+
"_view_name": "LayoutView",
|
| 602 |
+
"align_content": null,
|
| 603 |
+
"align_items": null,
|
| 604 |
+
"align_self": null,
|
| 605 |
+
"border": null,
|
| 606 |
+
"bottom": null,
|
| 607 |
+
"display": null,
|
| 608 |
+
"flex": null,
|
| 609 |
+
"flex_flow": null,
|
| 610 |
+
"grid_area": null,
|
| 611 |
+
"grid_auto_columns": null,
|
| 612 |
+
"grid_auto_flow": null,
|
| 613 |
+
"grid_auto_rows": null,
|
| 614 |
+
"grid_column": null,
|
| 615 |
+
"grid_gap": null,
|
| 616 |
+
"grid_row": null,
|
| 617 |
+
"grid_template_areas": null,
|
| 618 |
+
"grid_template_columns": null,
|
| 619 |
+
"grid_template_rows": null,
|
| 620 |
+
"height": null,
|
| 621 |
+
"justify_content": null,
|
| 622 |
+
"justify_items": null,
|
| 623 |
+
"left": null,
|
| 624 |
+
"margin": null,
|
| 625 |
+
"max_height": null,
|
| 626 |
+
"max_width": null,
|
| 627 |
+
"min_height": null,
|
| 628 |
+
"min_width": null,
|
| 629 |
+
"object_fit": null,
|
| 630 |
+
"object_position": null,
|
| 631 |
+
"order": null,
|
| 632 |
+
"overflow": null,
|
| 633 |
+
"overflow_x": null,
|
| 634 |
+
"overflow_y": null,
|
| 635 |
+
"padding": null,
|
| 636 |
+
"right": null,
|
| 637 |
+
"top": null,
|
| 638 |
+
"visibility": null,
|
| 639 |
+
"width": null
|
| 640 |
+
}
|
| 641 |
+
},
|
| 642 |
+
"9cba2384346645499516a7923ad6fcef": {
|
| 643 |
+
"model_module": "@jupyter-widgets/base",
|
| 644 |
+
"model_module_version": "1.2.0",
|
| 645 |
+
"model_name": "LayoutModel",
|
| 646 |
+
"state": {
|
| 647 |
+
"_model_module": "@jupyter-widgets/base",
|
| 648 |
+
"_model_module_version": "1.2.0",
|
| 649 |
+
"_model_name": "LayoutModel",
|
| 650 |
+
"_view_count": null,
|
| 651 |
+
"_view_module": "@jupyter-widgets/base",
|
| 652 |
+
"_view_module_version": "1.2.0",
|
| 653 |
+
"_view_name": "LayoutView",
|
| 654 |
+
"align_content": null,
|
| 655 |
+
"align_items": null,
|
| 656 |
+
"align_self": null,
|
| 657 |
+
"border": null,
|
| 658 |
+
"bottom": null,
|
| 659 |
+
"display": null,
|
| 660 |
+
"flex": null,
|
| 661 |
+
"flex_flow": null,
|
| 662 |
+
"grid_area": null,
|
| 663 |
+
"grid_auto_columns": null,
|
| 664 |
+
"grid_auto_flow": null,
|
| 665 |
+
"grid_auto_rows": null,
|
| 666 |
+
"grid_column": null,
|
| 667 |
+
"grid_gap": null,
|
| 668 |
+
"grid_row": null,
|
| 669 |
+
"grid_template_areas": null,
|
| 670 |
+
"grid_template_columns": null,
|
| 671 |
+
"grid_template_rows": null,
|
| 672 |
+
"height": null,
|
| 673 |
+
"justify_content": null,
|
| 674 |
+
"justify_items": null,
|
| 675 |
+
"left": null,
|
| 676 |
+
"margin": null,
|
| 677 |
+
"max_height": null,
|
| 678 |
+
"max_width": null,
|
| 679 |
+
"min_height": null,
|
| 680 |
+
"min_width": null,
|
| 681 |
+
"object_fit": null,
|
| 682 |
+
"object_position": null,
|
| 683 |
+
"order": null,
|
| 684 |
+
"overflow": null,
|
| 685 |
+
"overflow_x": null,
|
| 686 |
+
"overflow_y": null,
|
| 687 |
+
"padding": null,
|
| 688 |
+
"right": null,
|
| 689 |
+
"top": null,
|
| 690 |
+
"visibility": null,
|
| 691 |
+
"width": null
|
| 692 |
+
}
|
| 693 |
+
},
|
| 694 |
+
"9dda1a77133c4247bac106a9c4699153": {
|
| 695 |
+
"model_module": "@jupyter-widgets/controls",
|
| 696 |
+
"model_module_version": "1.5.0",
|
| 697 |
+
"model_name": "DescriptionStyleModel",
|
| 698 |
+
"state": {
|
| 699 |
+
"_model_module": "@jupyter-widgets/controls",
|
| 700 |
+
"_model_module_version": "1.5.0",
|
| 701 |
+
"_model_name": "DescriptionStyleModel",
|
| 702 |
+
"_view_count": null,
|
| 703 |
+
"_view_module": "@jupyter-widgets/base",
|
| 704 |
+
"_view_module_version": "1.2.0",
|
| 705 |
+
"_view_name": "StyleView",
|
| 706 |
+
"description_width": ""
|
| 707 |
+
}
|
| 708 |
+
},
|
| 709 |
+
"9f60072613d84754a0efe7813d853565": {
|
| 710 |
+
"model_module": "@jupyter-widgets/base",
|
| 711 |
+
"model_module_version": "1.2.0",
|
| 712 |
+
"model_name": "LayoutModel",
|
| 713 |
+
"state": {
|
| 714 |
+
"_model_module": "@jupyter-widgets/base",
|
| 715 |
+
"_model_module_version": "1.2.0",
|
| 716 |
+
"_model_name": "LayoutModel",
|
| 717 |
+
"_view_count": null,
|
| 718 |
+
"_view_module": "@jupyter-widgets/base",
|
| 719 |
+
"_view_module_version": "1.2.0",
|
| 720 |
+
"_view_name": "LayoutView",
|
| 721 |
+
"align_content": null,
|
| 722 |
+
"align_items": null,
|
| 723 |
+
"align_self": null,
|
| 724 |
+
"border": null,
|
| 725 |
+
"bottom": null,
|
| 726 |
+
"display": null,
|
| 727 |
+
"flex": null,
|
| 728 |
+
"flex_flow": null,
|
| 729 |
+
"grid_area": null,
|
| 730 |
+
"grid_auto_columns": null,
|
| 731 |
+
"grid_auto_flow": null,
|
| 732 |
+
"grid_auto_rows": null,
|
| 733 |
+
"grid_column": null,
|
| 734 |
+
"grid_gap": null,
|
| 735 |
+
"grid_row": null,
|
| 736 |
+
"grid_template_areas": null,
|
| 737 |
+
"grid_template_columns": null,
|
| 738 |
+
"grid_template_rows": null,
|
| 739 |
+
"height": null,
|
| 740 |
+
"justify_content": null,
|
| 741 |
+
"justify_items": null,
|
| 742 |
+
"left": null,
|
| 743 |
+
"margin": null,
|
| 744 |
+
"max_height": null,
|
| 745 |
+
"max_width": null,
|
| 746 |
+
"min_height": null,
|
| 747 |
+
"min_width": null,
|
| 748 |
+
"object_fit": null,
|
| 749 |
+
"object_position": null,
|
| 750 |
+
"order": null,
|
| 751 |
+
"overflow": null,
|
| 752 |
+
"overflow_x": null,
|
| 753 |
+
"overflow_y": null,
|
| 754 |
+
"padding": null,
|
| 755 |
+
"right": null,
|
| 756 |
+
"top": null,
|
| 757 |
+
"visibility": null,
|
| 758 |
+
"width": null
|
| 759 |
+
}
|
| 760 |
+
},
|
| 761 |
+
"bc6c346b95424eb881b793bf6fd2f53e": {
|
| 762 |
+
"model_module": "@jupyter-widgets/controls",
|
| 763 |
+
"model_module_version": "1.5.0",
|
| 764 |
+
"model_name": "ProgressStyleModel",
|
| 765 |
+
"state": {
|
| 766 |
+
"_model_module": "@jupyter-widgets/controls",
|
| 767 |
+
"_model_module_version": "1.5.0",
|
| 768 |
+
"_model_name": "ProgressStyleModel",
|
| 769 |
+
"_view_count": null,
|
| 770 |
+
"_view_module": "@jupyter-widgets/base",
|
| 771 |
+
"_view_module_version": "1.2.0",
|
| 772 |
+
"_view_name": "StyleView",
|
| 773 |
+
"bar_color": null,
|
| 774 |
+
"description_width": ""
|
| 775 |
+
}
|
| 776 |
+
},
|
| 777 |
+
"bf48a3e692ae4e6da5379152f51baa09": {
|
| 778 |
+
"model_module": "@jupyter-widgets/controls",
|
| 779 |
+
"model_module_version": "1.5.0",
|
| 780 |
+
"model_name": "ProgressStyleModel",
|
| 781 |
+
"state": {
|
| 782 |
+
"_model_module": "@jupyter-widgets/controls",
|
| 783 |
+
"_model_module_version": "1.5.0",
|
| 784 |
+
"_model_name": "ProgressStyleModel",
|
| 785 |
+
"_view_count": null,
|
| 786 |
+
"_view_module": "@jupyter-widgets/base",
|
| 787 |
+
"_view_module_version": "1.2.0",
|
| 788 |
+
"_view_name": "StyleView",
|
| 789 |
+
"bar_color": null,
|
| 790 |
+
"description_width": ""
|
| 791 |
+
}
|
| 792 |
+
},
|
| 793 |
+
"c26db3dd5a86405b81f510fd759c3af7": {
|
| 794 |
+
"model_module": "@jupyter-widgets/base",
|
| 795 |
+
"model_module_version": "1.2.0",
|
| 796 |
+
"model_name": "LayoutModel",
|
| 797 |
+
"state": {
|
| 798 |
+
"_model_module": "@jupyter-widgets/base",
|
| 799 |
+
"_model_module_version": "1.2.0",
|
| 800 |
+
"_model_name": "LayoutModel",
|
| 801 |
+
"_view_count": null,
|
| 802 |
+
"_view_module": "@jupyter-widgets/base",
|
| 803 |
+
"_view_module_version": "1.2.0",
|
| 804 |
+
"_view_name": "LayoutView",
|
| 805 |
+
"align_content": null,
|
| 806 |
+
"align_items": null,
|
| 807 |
+
"align_self": null,
|
| 808 |
+
"border": null,
|
| 809 |
+
"bottom": null,
|
| 810 |
+
"display": null,
|
| 811 |
+
"flex": null,
|
| 812 |
+
"flex_flow": null,
|
| 813 |
+
"grid_area": null,
|
| 814 |
+
"grid_auto_columns": null,
|
| 815 |
+
"grid_auto_flow": null,
|
| 816 |
+
"grid_auto_rows": null,
|
| 817 |
+
"grid_column": null,
|
| 818 |
+
"grid_gap": null,
|
| 819 |
+
"grid_row": null,
|
| 820 |
+
"grid_template_areas": null,
|
| 821 |
+
"grid_template_columns": null,
|
| 822 |
+
"grid_template_rows": null,
|
| 823 |
+
"height": null,
|
| 824 |
+
"justify_content": null,
|
| 825 |
+
"justify_items": null,
|
| 826 |
+
"left": null,
|
| 827 |
+
"margin": null,
|
| 828 |
+
"max_height": null,
|
| 829 |
+
"max_width": null,
|
| 830 |
+
"min_height": null,
|
| 831 |
+
"min_width": null,
|
| 832 |
+
"object_fit": null,
|
| 833 |
+
"object_position": null,
|
| 834 |
+
"order": null,
|
| 835 |
+
"overflow": null,
|
| 836 |
+
"overflow_x": null,
|
| 837 |
+
"overflow_y": null,
|
| 838 |
+
"padding": null,
|
| 839 |
+
"right": null,
|
| 840 |
+
"top": null,
|
| 841 |
+
"visibility": null,
|
| 842 |
+
"width": null
|
| 843 |
+
}
|
| 844 |
+
},
|
| 845 |
+
"c91d89b903ce4f02b635454d3bd87877": {
|
| 846 |
+
"model_module": "@jupyter-widgets/base",
|
| 847 |
+
"model_module_version": "1.2.0",
|
| 848 |
+
"model_name": "LayoutModel",
|
| 849 |
+
"state": {
|
| 850 |
+
"_model_module": "@jupyter-widgets/base",
|
| 851 |
+
"_model_module_version": "1.2.0",
|
| 852 |
+
"_model_name": "LayoutModel",
|
| 853 |
+
"_view_count": null,
|
| 854 |
+
"_view_module": "@jupyter-widgets/base",
|
| 855 |
+
"_view_module_version": "1.2.0",
|
| 856 |
+
"_view_name": "LayoutView",
|
| 857 |
+
"align_content": null,
|
| 858 |
+
"align_items": null,
|
| 859 |
+
"align_self": null,
|
| 860 |
+
"border": null,
|
| 861 |
+
"bottom": null,
|
| 862 |
+
"display": null,
|
| 863 |
+
"flex": null,
|
| 864 |
+
"flex_flow": null,
|
| 865 |
+
"grid_area": null,
|
| 866 |
+
"grid_auto_columns": null,
|
| 867 |
+
"grid_auto_flow": null,
|
| 868 |
+
"grid_auto_rows": null,
|
| 869 |
+
"grid_column": null,
|
| 870 |
+
"grid_gap": null,
|
| 871 |
+
"grid_row": null,
|
| 872 |
+
"grid_template_areas": null,
|
| 873 |
+
"grid_template_columns": null,
|
| 874 |
+
"grid_template_rows": null,
|
| 875 |
+
"height": null,
|
| 876 |
+
"justify_content": null,
|
| 877 |
+
"justify_items": null,
|
| 878 |
+
"left": null,
|
| 879 |
+
"margin": null,
|
| 880 |
+
"max_height": null,
|
| 881 |
+
"max_width": null,
|
| 882 |
+
"min_height": null,
|
| 883 |
+
"min_width": null,
|
| 884 |
+
"object_fit": null,
|
| 885 |
+
"object_position": null,
|
| 886 |
+
"order": null,
|
| 887 |
+
"overflow": null,
|
| 888 |
+
"overflow_x": null,
|
| 889 |
+
"overflow_y": null,
|
| 890 |
+
"padding": null,
|
| 891 |
+
"right": null,
|
| 892 |
+
"top": null,
|
| 893 |
+
"visibility": null,
|
| 894 |
+
"width": null
|
| 895 |
+
}
|
| 896 |
+
},
|
| 897 |
+
"cf5e926c8c004525b5aad36d821ef928": {
|
| 898 |
+
"model_module": "@jupyter-widgets/controls",
|
| 899 |
+
"model_module_version": "1.5.0",
|
| 900 |
+
"model_name": "HTMLModel",
|
| 901 |
+
"state": {
|
| 902 |
+
"_dom_classes": [],
|
| 903 |
+
"_model_module": "@jupyter-widgets/controls",
|
| 904 |
+
"_model_module_version": "1.5.0",
|
| 905 |
+
"_model_name": "HTMLModel",
|
| 906 |
+
"_view_count": null,
|
| 907 |
+
"_view_module": "@jupyter-widgets/controls",
|
| 908 |
+
"_view_module_version": "1.5.0",
|
| 909 |
+
"_view_name": "HTMLView",
|
| 910 |
+
"description": "",
|
| 911 |
+
"description_tooltip": null,
|
| 912 |
+
"layout": "IPY_MODEL_c26db3dd5a86405b81f510fd759c3af7",
|
| 913 |
+
"placeholder": "",
|
| 914 |
+
"style": "IPY_MODEL_dae2b5afeee243e682322c1ecb8238e6",
|
| 915 |
+
"value": " 393/393 [00:01<00:00, 353.83it/s, Materializing param=classifier.weight]"
|
| 916 |
+
}
|
| 917 |
+
},
|
| 918 |
+
"d6d7368c1c7b4a549d9a706ee1a62785": {
|
| 919 |
+
"model_module": "@jupyter-widgets/controls",
|
| 920 |
+
"model_module_version": "1.5.0",
|
| 921 |
+
"model_name": "HBoxModel",
|
| 922 |
+
"state": {
|
| 923 |
+
"_dom_classes": [],
|
| 924 |
+
"_model_module": "@jupyter-widgets/controls",
|
| 925 |
+
"_model_module_version": "1.5.0",
|
| 926 |
+
"_model_name": "HBoxModel",
|
| 927 |
+
"_view_count": null,
|
| 928 |
+
"_view_module": "@jupyter-widgets/controls",
|
| 929 |
+
"_view_module_version": "1.5.0",
|
| 930 |
+
"_view_name": "HBoxView",
|
| 931 |
+
"box_style": "",
|
| 932 |
+
"children": [
|
| 933 |
+
"IPY_MODEL_0e22f97db509402a9b4d4a2fa8c80fe0",
|
| 934 |
+
"IPY_MODEL_475728820f8e4b6fa0c33a1e9989179a",
|
| 935 |
+
"IPY_MODEL_cf5e926c8c004525b5aad36d821ef928"
|
| 936 |
+
],
|
| 937 |
+
"layout": "IPY_MODEL_9275c5cf7b314dc69419611128cb0c09"
|
| 938 |
+
}
|
| 939 |
+
},
|
| 940 |
+
"dae2b5afeee243e682322c1ecb8238e6": {
|
| 941 |
+
"model_module": "@jupyter-widgets/controls",
|
| 942 |
+
"model_module_version": "1.5.0",
|
| 943 |
+
"model_name": "DescriptionStyleModel",
|
| 944 |
+
"state": {
|
| 945 |
+
"_model_module": "@jupyter-widgets/controls",
|
| 946 |
+
"_model_module_version": "1.5.0",
|
| 947 |
+
"_model_name": "DescriptionStyleModel",
|
| 948 |
+
"_view_count": null,
|
| 949 |
+
"_view_module": "@jupyter-widgets/base",
|
| 950 |
+
"_view_module_version": "1.2.0",
|
| 951 |
+
"_view_name": "StyleView",
|
| 952 |
+
"description_width": ""
|
| 953 |
+
}
|
| 954 |
+
},
|
| 955 |
+
"e7fd82b589eb49aaba73aeafcc340421": {
|
| 956 |
+
"model_module": "@jupyter-widgets/controls",
|
| 957 |
+
"model_module_version": "1.5.0",
|
| 958 |
+
"model_name": "FloatProgressModel",
|
| 959 |
+
"state": {
|
| 960 |
+
"_dom_classes": [],
|
| 961 |
+
"_model_module": "@jupyter-widgets/controls",
|
| 962 |
+
"_model_module_version": "1.5.0",
|
| 963 |
+
"_model_name": "FloatProgressModel",
|
| 964 |
+
"_view_count": null,
|
| 965 |
+
"_view_module": "@jupyter-widgets/controls",
|
| 966 |
+
"_view_module_version": "1.5.0",
|
| 967 |
+
"_view_name": "ProgressView",
|
| 968 |
+
"bar_style": "success",
|
| 969 |
+
"description": "",
|
| 970 |
+
"description_tooltip": null,
|
| 971 |
+
"layout": "IPY_MODEL_9f60072613d84754a0efe7813d853565",
|
| 972 |
+
"max": 393,
|
| 973 |
+
"min": 0,
|
| 974 |
+
"orientation": "horizontal",
|
| 975 |
+
"style": "IPY_MODEL_bf48a3e692ae4e6da5379152f51baa09",
|
| 976 |
+
"value": 393
|
| 977 |
+
}
|
| 978 |
+
},
|
| 979 |
+
"ef276c365d604dcc83b4a0133c6b7652": {
|
| 980 |
+
"model_module": "@jupyter-widgets/controls",
|
| 981 |
+
"model_module_version": "1.5.0",
|
| 982 |
+
"model_name": "DescriptionStyleModel",
|
| 983 |
+
"state": {
|
| 984 |
+
"_model_module": "@jupyter-widgets/controls",
|
| 985 |
+
"_model_module_version": "1.5.0",
|
| 986 |
+
"_model_name": "DescriptionStyleModel",
|
| 987 |
+
"_view_count": null,
|
| 988 |
+
"_view_module": "@jupyter-widgets/base",
|
| 989 |
+
"_view_module_version": "1.2.0",
|
| 990 |
+
"_view_name": "StyleView",
|
| 991 |
+
"description_width": ""
|
| 992 |
+
}
|
| 993 |
+
},
|
| 994 |
+
"f66e121a24e441c2a4cb32fb87d22632": {
|
| 995 |
+
"model_module": "@jupyter-widgets/controls",
|
| 996 |
+
"model_module_version": "1.5.0",
|
| 997 |
+
"model_name": "HBoxModel",
|
| 998 |
+
"state": {
|
| 999 |
+
"_dom_classes": [],
|
| 1000 |
+
"_model_module": "@jupyter-widgets/controls",
|
| 1001 |
+
"_model_module_version": "1.5.0",
|
| 1002 |
+
"_model_name": "HBoxModel",
|
| 1003 |
+
"_view_count": null,
|
| 1004 |
+
"_view_module": "@jupyter-widgets/controls",
|
| 1005 |
+
"_view_module_version": "1.5.0",
|
| 1006 |
+
"_view_name": "HBoxView",
|
| 1007 |
+
"box_style": "",
|
| 1008 |
+
"children": [
|
| 1009 |
+
"IPY_MODEL_1776c0895e7f400f85d3a2123cb573f1",
|
| 1010 |
+
"IPY_MODEL_e7fd82b589eb49aaba73aeafcc340421",
|
| 1011 |
+
"IPY_MODEL_210ec65a874a4f51ab9f059d3de804a9"
|
| 1012 |
+
],
|
| 1013 |
+
"layout": "IPY_MODEL_c91d89b903ce4f02b635454d3bd87877"
|
| 1014 |
+
}
|
| 1015 |
+
}
|
| 1016 |
+
}
|
| 1017 |
+
}
|
| 1018 |
+
},
|
| 1019 |
+
"nbformat": 4,
|
| 1020 |
+
"nbformat_minor": 0
|
| 1021 |
+
}
|