{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "PfSMqenAwpKI",
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"# Preparing training datasets"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"id": "gN8kk98Rwuzs",
"pycharm": {
"name": "#%%\n"
},
"tags": [
"hide-output"
]
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"INFO:ekorpkit.base:Set environment variable EKORPKIT_DATA_ROOT=/workspace/data\n",
"INFO:ekorpkit.base:Set environment variable CACHED_PATH_CACHE_ROOT=/workspace/.cache/cached_path\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"version: 0.1.40.post0.dev57\n",
"project_dir: /workspace/projects/ekorpkit-book/exmaples\n",
"time: 955 ms (started: 2022-12-16 04:03:41 +00:00)\n"
]
}
],
"source": [
"from ekorpkit import eKonf\n",
"\n",
"if eKonf.is_colab():\n",
" eKonf.mount_google_drive()\n",
"ws = eKonf.set_workspace(\n",
" workspace=\"/workspace\", \n",
" project=\"ekorpkit-book/exmaples\", \n",
" task=\"esg\", \n",
" log_level=\"INFO\"\n",
")\n",
"print(\"version:\", ws.version)\n",
"print(\"project_dir:\", ws.project_dir)"
]
},
{
"cell_type": "markdown",
"metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"## Fetch the labeled dataset from the labelstudio server"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"id": "OhqanxoywpKJ",
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"time: 644 ms (started: 2022-12-16 04:04:13 +00:00)\n"
]
}
],
"source": [
"from ekorpkit.io.fetch.labelstudio import LabelStudio\n",
"\n",
"ls = LabelStudio()"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"13: ESG Topic Classification (Sep 2022)\n",
"12: ESG Polarity Classification (Sep 2022)\n",
"3: ESG Topic Classification\n",
"2: ESG Polarity Classification\n",
"time: 1.12 s (started: 2022-12-16 04:04:20 +00:00)\n"
]
}
],
"source": [
"project_list = ls.list_projects(verbose=True)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"scrolled": false
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"INFO:ekorpkit.io.fetch.labelstudio:fetching http://ekorpkit-labelstudio:8080/api/projects/12/export with {'exportType': 'JSON'} to /workspace/projects/ekorpkit-book/exmaples/esg/outputs/esg_polarity_labels/esg_polarity_labels(2)_annotations.json\n",
"INFO:ekorpkit.io.fetch.labelstudio:/workspace/projects/ekorpkit-book/exmaples/esg/outputs/esg_polarity_labels/esg_polarity_labels(2)_annotations.json is downloaded\n",
"INFO:ekorpkit.io.file:Saving dataframe to /workspace/projects/ekorpkit-book/exmaples/esg/outputs/esg_polarity_labels/esg_polarity_labels(2)_export.parquet\n",
"INFO:ekorpkit.config:Saving config to /workspace/projects/ekorpkit-book/exmaples/esg/outputs/esg_polarity_labels/configs/esg_polarity_labels(2)_config.yaml\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"(1158, 6)\n"
]
},
{
"data": {
"text/html": [
"
\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" id | \n",
" text | \n",
" annot_id | \n",
" annotator | \n",
" origin | \n",
" labels | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 97756 | \n",
" 세계 백신 생산의 60%를 담당한 인도가 자국 코로나19 확산 탓에 기능을 못하는 ... | \n",
" 20328 | \n",
" 3 | \n",
" prediction | \n",
" Neutral | \n",
"
\n",
" \n",
" 1 | \n",
" 97667 | \n",
" 美서 한미 백신기업 파트너십 행사 개최 22일(현지시간) 미국 워싱턴 DC에서 열... | \n",
" 20327 | \n",
" 3 | \n",
" prediction | \n",
" Neutral | \n",
"
\n",
" \n",
" 2 | \n",
" 97650 | \n",
" [머니투데이 워싱턴=공동취재단 , 서울=이소은 기자] 삼성바이오로직스가 22일(이... | \n",
" 20326 | \n",
" 3 | \n",
" prediction | \n",
" Neutral | \n",
"
\n",
" \n",
" 3 | \n",
" 97627 | \n",
" 영국표준협회 ISO22301 취득 2018년 1·2공장 국내 첫 인증후 최근 3공... | \n",
" 20325 | \n",
" 3 | \n",
" prediction | \n",
" Neutral | \n",
"
\n",
" \n",
" 4 | \n",
" 97593 | \n",
" 경구용 치료제 2만 명분 이미 확보 식품의약품안전처가 경구용 코로나19 치료제(먹... | \n",
" 20324 | \n",
" 3 | \n",
" prediction | \n",
" Neutral | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" id text annot_id \\\n",
"0 97756 세계 백신 생산의 60%를 담당한 인도가 자국 코로나19 확산 탓에 기능을 못하는 ... 20328 \n",
"1 97667 美서 한미 백신기업 파트너십 행사 개최 22일(현지시간) 미국 워싱턴 DC에서 열... 20327 \n",
"2 97650 [머니투데이 워싱턴=공동취재단 , 서울=이소은 기자] 삼성바이오로직스가 22일(이... 20326 \n",
"3 97627 영국표준협회 ISO22301 취득 2018년 1·2공장 국내 첫 인증후 최근 3공... 20325 \n",
"4 97593 경구용 치료제 2만 명분 이미 확보 식품의약품안전처가 경구용 코로나19 치료제(먹... 20324 \n",
"\n",
" annotator origin labels \n",
"0 3 prediction Neutral \n",
"1 3 prediction Neutral \n",
"2 3 prediction Neutral \n",
"3 3 prediction Neutral \n",
"4 3 prediction Neutral "
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"time: 6.1 s (started: 2022-12-16 04:04:22 +00:00)\n"
]
}
],
"source": [
"ls.name = \"esg_polarity_labels\"\n",
"esg_polarity_data = ls.export_annotations(project_id=12)\n",
"print(esg_polarity_data.shape)\n",
"esg_polarity_data.head()"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"INFO:ekorpkit.io.fetch.labelstudio:fetching http://ekorpkit-labelstudio:8080/api/projects/13/export with {'exportType': 'JSON'} to /workspace/projects/ekorpkit-book/exmaples/esg/outputs/esg_topic_labels/esg_topic_labels(2)_annotations.json\n",
"INFO:ekorpkit.io.fetch.labelstudio:/workspace/projects/ekorpkit-book/exmaples/esg/outputs/esg_topic_labels/esg_topic_labels(2)_annotations.json is downloaded\n",
"INFO:ekorpkit.io.file:Saving dataframe to /workspace/projects/ekorpkit-book/exmaples/esg/outputs/esg_topic_labels/esg_topic_labels(2)_export.parquet\n",
"INFO:ekorpkit.config:Saving config to /workspace/projects/ekorpkit-book/exmaples/esg/outputs/esg_topic_labels/configs/esg_topic_labels(2)_config.yaml\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"(576, 6)\n"
]
},
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" id | \n",
" text | \n",
" annot_id | \n",
" annotator | \n",
" origin | \n",
" labels | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 201831 | \n",
" 지역>충남 | 경제>금융_재테크 | 지역>울산 [머니투데이 구경민 기자] 미래에셋... | \n",
" 20337 | \n",
" 1 | \n",
" prediction | \n",
" S-사회공헌 | \n",
"
\n",
" \n",
" 1 | \n",
" 201600 | \n",
" 패밀리 오피스 분야 전락적 MOU 이창헌(앞줄 오른쪽) 한국M&A거래소 회장과 류... | \n",
" 20336 | \n",
" 1 | \n",
" prediction | \n",
" UNKNOWN | \n",
"
\n",
" \n",
" 2 | \n",
" 201319 | \n",
" 01%)를 미래에셋증권과 이음프라이빗에쿼티(PE) 컨소시엄에 4500억원에 매각하기... | \n",
" 20335 | \n",
" 1 | \n",
" prediction | \n",
" UNKNOWN | \n",
"
\n",
" \n",
" 3 | \n",
" 200829 | \n",
" 다이렉트 IRP 운용·자산관리 수수료 전부 면제를 통한 비용부담 해소 은행 및 보... | \n",
" 20334 | \n",
" 1 | \n",
" prediction | \n",
" UNKNOWN | \n",
"
\n",
" \n",
" 4 | \n",
" 199893 | \n",
" 1999년 12월 자본금 500억원에 설립된 미래에셋증권은 약 20년 만에 200배... | \n",
" 20333 | \n",
" 1 | \n",
" prediction | \n",
" G-지배구조 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" id text annot_id \\\n",
"0 201831 지역>충남 | 경제>금융_재테크 | 지역>울산 [머니투데이 구경민 기자] 미래에셋... 20337 \n",
"1 201600 패밀리 오피스 분야 전락적 MOU 이창헌(앞줄 오른쪽) 한국M&A거래소 회장과 류... 20336 \n",
"2 201319 01%)를 미래에셋증권과 이음프라이빗에쿼티(PE) 컨소시엄에 4500억원에 매각하기... 20335 \n",
"3 200829 다이렉트 IRP 운용·자산관리 수수료 전부 면제를 통한 비용부담 해소 은행 및 보... 20334 \n",
"4 199893 1999년 12월 자본금 500억원에 설립된 미래에셋증권은 약 20년 만에 200배... 20333 \n",
"\n",
" annotator origin labels \n",
"0 1 prediction S-사회공헌 \n",
"1 1 prediction UNKNOWN \n",
"2 1 prediction UNKNOWN \n",
"3 1 prediction UNKNOWN \n",
"4 1 prediction G-지배구조 "
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"time: 3.42 s (started: 2022-12-16 04:04:28 +00:00)\n"
]
}
],
"source": [
"ls.name = \"esg_topic_labels\"\n",
"esg_topic_data = ls.export_annotations(project_id=13)\n",
"print(esg_topic_data.shape)\n",
"esg_topic_data.head()"
]
},
{
"cell_type": "markdown",
"metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"## Snorkel LabelModel"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"INFO:ekorpkit.config:Init batch - Batch name: esg_polarity_snorkel, Batch num: 2\n",
"INFO:ekorpkit.config:Init batch - Batch name: esg_polarity_snorkel, Batch num: 2\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"time: 640 ms (started: 2022-12-14 11:40:17 +00:00)\n"
]
}
],
"source": [
"from ekorpkit.tasks.label.snorkel import BaseSnorkel\n",
"\n",
"snorkel = BaseSnorkel(name=\"esg_polarity_snorkel\")"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"INFO:ekorpkit.io.file:Processing [1] files from ['/workspace/projects/ekorpkit-book/exmaples/esg/data/outputs/esg_polarity_labels/esg_polarity_labels(1)_export.parquet']\n",
"INFO:ekorpkit.io.file:Loading 1 dataframes from ['/workspace/projects/ekorpkit-book/exmaples/esg/data/outputs/esg_polarity_labels/esg_polarity_labels(1)_export.parquet']\n",
"INFO:ekorpkit.io.file:Loading data from /workspace/projects/ekorpkit-book/exmaples/esg/data/outputs/esg_polarity_labels/esg_polarity_labels(1)_export.parquet\n",
"INFO:ekorpkit.datasets.config:Splitting the dataframe into train and test with ratio 0.2\n",
"INFO:ekorpkit.datasets.config:Train data: (926, 7), Test data: (232, 7)\n",
"INFO:ekorpkit.datasets.config:Shuffling the dataframe with seed 12345\n",
"INFO:ekorpkit.datasets.config:Train data: (926, 7)\n",
"INFO:ekorpkit.datasets.config:Test data: (232, 7)\n",
"INFO:ekorpkit.io.file:Concatenating 2 dataframes\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"time: 23.6 ms (started: 2022-12-14 11:40:18 +00:00)\n"
]
}
],
"source": [
"data_file = \"/workspace/projects/ekorpkit-book/exmaples/esg/data/outputs/esg_polarity_labels/esg_polarity_labels(1)_export.parquet\"\n",
"\n",
"snorkel.load_datasets(data_files=data_file, test_split_ratio=0.2, seed=12345)"
]
},
{
"cell_type": "markdown",
"metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"## Writing Labeling Functions\n",
"\n",
"Each crowdworker can be thought of as a single labeling function, as each worker labels a subset of data points, and may have errors or conflicting labels with other workers / labeling functions. Labeling fucntions will simply return the label the worker submitted for a given text, and abstain if they didn't submit a label for it."
]
},
{
"cell_type": "markdown",
"metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"### Crowdworker labeling functions"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" def compose_worker_lfs(self):\n",
" labels_by_annotator = self.data.groupby(self.columns.annotator)\n",
" worker_dicts = {}\n",
" for worker_id in labels_by_annotator.groups:\n",
" worker_df = labels_by_annotator.get_group(worker_id)\n",
" worker_dicts[worker_id] = dict(zip(worker_df.id, worker_df.classes))\n",
"\n",
" log.info(f\"Number of workers: {len(worker_dicts)}\")\n",
"\n",
" def worker_lf(x, worker_dict):\n",
" return worker_dict.get(x.id, self.ABSTAIN)\n",
"\n",
" def make_worker_lf(worker_id):\n",
" worker_dict = worker_dicts[worker_id]\n",
" name = f\"worker_{worker_id}\"\n",
" return LabelingFunction(\n",
" name, f=worker_lf, resources={\"worker_dict\": worker_dict}\n",
" )\n",
"\n",
" worker_lfs = [make_worker_lf(worker_id) for worker_id in worker_dicts]\n",
" self.__worker_lfs__ = worker_lfs\n",
" return worker_lfs\n",
"\n",
"time: 1.34 ms (started: 2022-12-13 10:56:35 +00:00)\n"
]
}
],
"source": [
"eKonf.viewsource(snorkel.compose_worker_lfs)"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"INFO:ekorpkit.io.file:Concatenating 2 dataframes\n"
]
},
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" id | \n",
" text | \n",
" annot_id | \n",
" annotator | \n",
" origin | \n",
" labels | \n",
" classes | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 99621 | \n",
" 31일 김동관 한화솔루션 전략부문 대표는 P4G 기본세션 에너지부문 '더 푸르른 지... | \n",
" 19868 | \n",
" 3 | \n",
" prediction | \n",
" Neutral | \n",
" 1 | \n",
"
\n",
" \n",
" 1 | \n",
" 90918 | \n",
" 김 변호사는 2001년 LG화학이 화학분야 중간지주회사인 LG CI를 인적 분할할 ... | \n",
" 18929 | \n",
" 2 | \n",
" prediction | \n",
" Neutral | \n",
" 1 | \n",
"
\n",
" \n",
" 2 | \n",
" 108056 | \n",
" [머니투데이 김성은 기자] 한화솔루션의 그린에너지 사업부문인 한화큐셀이 글로벌 기... | \n",
" 19926 | \n",
" 3 | \n",
" prediction | \n",
" Positive | \n",
" 2 | \n",
"
\n",
" \n",
" 3 | \n",
" 90740 | \n",
" 2차전지 분야에서도 LG화학(현재는 LG에너지솔루션으로 분사)의 법인세 부담률은 ... | \n",
" 18927 | \n",
" 2 | \n",
" prediction | \n",
" Neutral | \n",
" 1 | \n",
"
\n",
" \n",
" 4 | \n",
" 93872 | \n",
" 김동관, P4G 정상회의 기조연설에서 기업 역할 강조 [아시아경제 황윤주 기자] ... | \n",
" 19823 | \n",
" 3 | \n",
" prediction | \n",
" Positive | \n",
" 2 | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" 1153 | \n",
" 102985 | \n",
" MIT 등 주요 10여개 대학 석·박사 및 학부생 대상 신학철 LG화학(05191... | \n",
" 19106 | \n",
" 2 | \n",
" prediction | \n",
" Neutral | \n",
" 1 | \n",
"
\n",
" \n",
" 1154 | \n",
" 108198 | \n",
" 18일 금융투자 업계에 따르면 LG화학은 17일 오후 4시 주주와 투자자를 대상으로... | \n",
" 19198 | \n",
" 2 | \n",
" prediction | \n",
" Neutral | \n",
" 1 | \n",
"
\n",
" \n",
" 1155 | \n",
" 89454 | \n",
" LG화학은 오는 16일까지 중국 선전(深圳)에서 열리는 '차이나플라스 2021'에... | \n",
" 18904 | \n",
" 2 | \n",
" prediction | \n",
" Positive | \n",
" 2 | \n",
"
\n",
" \n",
" 1156 | \n",
" 128683 | \n",
" [아시아경제 황윤주 기자] LG화학의 유럽 폴란드 공장이 지속가능경영의 모범사례로... | \n",
" 19628 | \n",
" 2 | \n",
" prediction | \n",
" Positive | \n",
" 2 | \n",
"
\n",
" \n",
" 1157 | \n",
" 109789 | \n",
" 한화솔루션은 오는 7월부터 2년 간 총 48t(톤)의 수소를 공급한다 또 이후 충... | \n",
" 19939 | \n",
" 3 | \n",
" prediction | \n",
" Positive | \n",
" 2 | \n",
"
\n",
" \n",
"
\n",
"
1158 rows × 7 columns
\n",
"
"
],
"text/plain": [
" id text annot_id \\\n",
"0 99621 31일 김동관 한화솔루션 전략부문 대표는 P4G 기본세션 에너지부문 '더 푸르른 지... 19868 \n",
"1 90918 김 변호사는 2001년 LG화학이 화학분야 중간지주회사인 LG CI를 인적 분할할 ... 18929 \n",
"2 108056 [머니투데이 김성은 기자] 한화솔루션의 그린에너지 사업부문인 한화큐셀이 글로벌 기... 19926 \n",
"3 90740 2차전지 분야에서도 LG화학(현재는 LG에너지솔루션으로 분사)의 법인세 부담률은 ... 18927 \n",
"4 93872 김동관, P4G 정상회의 기조연설에서 기업 역할 강조 [아시아경제 황윤주 기자] ... 19823 \n",
"... ... ... ... \n",
"1153 102985 MIT 등 주요 10여개 대학 석·박사 및 학부생 대상 신학철 LG화학(05191... 19106 \n",
"1154 108198 18일 금융투자 업계에 따르면 LG화학은 17일 오후 4시 주주와 투자자를 대상으로... 19198 \n",
"1155 89454 LG화학은 오는 16일까지 중국 선전(深圳)에서 열리는 '차이나플라스 2021'에... 18904 \n",
"1156 128683 [아시아경제 황윤주 기자] LG화학의 유럽 폴란드 공장이 지속가능경영의 모범사례로... 19628 \n",
"1157 109789 한화솔루션은 오는 7월부터 2년 간 총 48t(톤)의 수소를 공급한다 또 이후 충... 19939 \n",
"\n",
" annotator origin labels classes \n",
"0 3 prediction Neutral 1 \n",
"1 2 prediction Neutral 1 \n",
"2 3 prediction Positive 2 \n",
"3 2 prediction Neutral 1 \n",
"4 3 prediction Positive 2 \n",
"... ... ... ... ... \n",
"1153 2 prediction Neutral 1 \n",
"1154 2 prediction Neutral 1 \n",
"1155 2 prediction Positive 2 \n",
"1156 2 prediction Positive 2 \n",
"1157 3 prediction Positive 2 \n",
"\n",
"[1158 rows x 7 columns]"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"time: 8.95 ms (started: 2022-12-14 11:41:05 +00:00)\n"
]
}
],
"source": [
"snorkel.data"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"INFO:ekorpkit.tasks.label.snorkel:Number of workers: 3\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"time: 3.54 ms (started: 2022-12-13 10:56:38 +00:00)\n"
]
}
],
"source": [
"worker_lfs = snorkel.compose_worker_lfs()"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"INFO:ekorpkit.tasks.label.snorkel:Applying worker lfs to train data\n",
"100%|██████████| 926/926 [00:00<00:00, 34148.60it/s]\n",
"INFO:ekorpkit.tasks.label.snorkel:Applying worker lfs to test data\n",
"100%|██████████| 232/232 [00:00<00:00, 33436.83it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"time: 40.2 ms (started: 2022-12-13 10:56:39 +00:00)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"\n"
]
}
],
"source": [
"snorkel.apply_worker_lfs(worker_lfs)"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"INFO:ekorpkit.tasks.label.snorkel:Training set coverage: 100.0%\n"
]
},
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" j | \n",
" Polarity | \n",
" Coverage | \n",
" Overlaps | \n",
" Conflicts | \n",
" Correct | \n",
" Incorrect | \n",
" Emp. Acc. | \n",
"
\n",
" \n",
" \n",
" \n",
" worker_1 | \n",
" 0 | \n",
" [0, 1, 2] | \n",
" 0.012959 | \n",
" 0.0 | \n",
" 0.0 | \n",
" 12 | \n",
" 0 | \n",
" 1.0 | \n",
"
\n",
" \n",
" worker_2 | \n",
" 1 | \n",
" [0, 1, 2] | \n",
" 0.588553 | \n",
" 0.0 | \n",
" 0.0 | \n",
" 545 | \n",
" 0 | \n",
" 1.0 | \n",
"
\n",
" \n",
" worker_3 | \n",
" 2 | \n",
" [0, 1, 2] | \n",
" 0.398488 | \n",
" 0.0 | \n",
" 0.0 | \n",
" 369 | \n",
" 0 | \n",
" 1.0 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" j Polarity Coverage Overlaps Conflicts Correct Incorrect \\\n",
"worker_1 0 [0, 1, 2] 0.012959 0.0 0.0 12 0 \n",
"worker_2 1 [0, 1, 2] 0.588553 0.0 0.0 545 0 \n",
"worker_3 2 [0, 1, 2] 0.398488 0.0 0.0 369 0 \n",
"\n",
" Emp. Acc. \n",
"worker_1 1.0 \n",
"worker_2 1.0 \n",
"worker_3 1.0 "
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"time: 13.8 ms (started: 2022-12-13 10:56:40 +00:00)\n"
]
}
],
"source": [
"summary = snorkel.lf_summary()\n",
"summary"
]
},
{
"cell_type": "markdown",
"metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"## Train LabelModel And Generate Probabilistic Labels"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"100%|██████████| 100/100 [00:01<00:00, 86.08epoch/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"time: 1.19 s (started: 2022-12-13 10:56:43 +00:00)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"\n"
]
}
],
"source": [
"snorkel.fit()"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"LabelModel Accuracy for train: 1.000\n",
"LabelModel Accuracy for test: 1.000\n",
"time: 5.52 ms (started: 2022-12-13 10:56:45 +00:00)\n"
]
}
],
"source": [
"snorkel.eval()"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {
"pycharm": {
"name": "#%%\n"
},
"scrolled": false
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"100%|██████████| 1158/1158 [00:00<00:00, 37554.83it/s]\n",
"INFO:ekorpkit.io.file:Saving dataframe to /workspace/projects/ekorpkit-book/exmaples/esg/data/outputs/esg_polarity_snorkel/esg_polarity_snorkel(1)_preds.parquet\n",
"INFO:ekorpkit.config:Saving config to /workspace/projects/ekorpkit-book/exmaples/esg/data/outputs/esg_polarity_snorkel/configs/esg_polarity_snorkel(1)_config.yaml\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"time: 581 ms (started: 2022-12-13 10:56:48 +00:00)\n"
]
}
],
"source": [
"preds = snorkel.predict()"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"INFO:ekorpkit.io.file:Saving dataframe to /workspace/projects/ekorpkit-book/exmaples/esg/data/outputs/esg_polarity_snorkel/esg_polarity_snorkel(1)_preds.parquet\n",
"INFO:ekorpkit.io.file:Processing [1] files from ['esg_polarity_snorkel(0)_preds.parquet']\n",
"INFO:ekorpkit.io.file:Loading 1 dataframes from ['/workspace/projects/ekorpkit-book/exmaples/esg/data/outputs/esg_polarity_snorkel/esg_polarity_snorkel(0)_preds.parquet']\n",
"INFO:ekorpkit.io.file:Loading data from /workspace/projects/ekorpkit-book/exmaples/esg/data/outputs/esg_polarity_snorkel/esg_polarity_snorkel(0)_preds.parquet\n"
]
},
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" id | \n",
" text | \n",
" labels | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 97756 | \n",
" 세계 백신 생산의 60%를 담당한 인도가 자국 코로나19 확산 탓에 기능을 못하는 ... | \n",
" Neutral | \n",
"
\n",
" \n",
" 1 | \n",
" 97667 | \n",
" 美서 한미 백신기업 파트너십 행사 개최 22일(현지시간) 미국 워싱턴 DC에서 열... | \n",
" Neutral | \n",
"
\n",
" \n",
" 2 | \n",
" 97650 | \n",
" [머니투데이 워싱턴=공동취재단 , 서울=이소은 기자] 삼성바이오로직스가 22일(이... | \n",
" Neutral | \n",
"
\n",
" \n",
" 3 | \n",
" 97627 | \n",
" 영국표준협회 ISO22301 취득 2018년 1·2공장 국내 첫 인증후 최근 3공... | \n",
" Neutral | \n",
"
\n",
" \n",
" 4 | \n",
" 97593 | \n",
" 경구용 치료제 2만 명분 이미 확보 식품의약품안전처가 경구용 코로나19 치료제(먹... | \n",
" Neutral | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" 1153 | \n",
" 88550 | \n",
" 산업통상자원부는 현대글로비스와 LG화학의 전기차 택시에 대한 배터리 대여사업을 승인... | \n",
" Neutral | \n",
"
\n",
" \n",
" 1154 | \n",
" 88439 | \n",
" [헤럴드경제 정세희 기자]신학철 LG화학 부회장은 “동시대를 앞서나가는 디지털 전... | \n",
" Positive | \n",
"
\n",
" \n",
" 1155 | \n",
" 88413 | \n",
" 갈등의 골이 깊어지면서 '시계제로' 상태에 빠진 아시아나항공 인수전이 무산될 가능성... | \n",
" Negative | \n",
"
\n",
" \n",
" 1156 | \n",
" 88407 | \n",
" 그간 경남도와 창원시는 주력산업인 제조업의 성장이 둔화하면서 어려운 시기를 겪었으나... | \n",
" Positive | \n",
"
\n",
" \n",
" 1157 | \n",
" 88382 | \n",
" 이와 함께 지난 7일 한샘은 삼성전자와 전략적 사업협력 업무협약(MOU)을 체결한... | \n",
" Neutral | \n",
"
\n",
" \n",
"
\n",
"
1158 rows × 3 columns
\n",
"
"
],
"text/plain": [
" id text labels\n",
"0 97756 세계 백신 생산의 60%를 담당한 인도가 자국 코로나19 확산 탓에 기능을 못하는 ... Neutral\n",
"1 97667 美서 한미 백신기업 파트너십 행사 개최 22일(현지시간) 미국 워싱턴 DC에서 열... Neutral\n",
"2 97650 [머니투데이 워싱턴=공동취재단 , 서울=이소은 기자] 삼성바이오로직스가 22일(이... Neutral\n",
"3 97627 영국표준협회 ISO22301 취득 2018년 1·2공장 국내 첫 인증후 최근 3공... Neutral\n",
"4 97593 경구용 치료제 2만 명분 이미 확보 식품의약품안전처가 경구용 코로나19 치료제(먹... Neutral\n",
"... ... ... ...\n",
"1153 88550 산업통상자원부는 현대글로비스와 LG화학의 전기차 택시에 대한 배터리 대여사업을 승인... Neutral\n",
"1154 88439 [헤럴드경제 정세희 기자]신학철 LG화학 부회장은 “동시대를 앞서나가는 디지털 전... Positive\n",
"1155 88413 갈등의 골이 깊어지면서 '시계제로' 상태에 빠진 아시아나항공 인수전이 무산될 가능성... Negative\n",
"1156 88407 그간 경남도와 창원시는 주력산업인 제조업의 성장이 둔화하면서 어려운 시기를 겪었으나... Positive\n",
"1157 88382 이와 함께 지난 7일 한샘은 삼성전자와 전략적 사업협력 업무협약(MOU)을 체결한... Neutral\n",
"\n",
"[1158 rows x 3 columns]"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"time: 140 ms (started: 2022-12-13 10:56:54 +00:00)\n"
]
}
],
"source": [
"snorkel.save_preds(preds, columns = ['id', 'text', \"labels\"])\n",
"eKonf.load_data(\"esg_polarity_snorkel(0)_preds.parquet\", snorkel.batch_dir)"
]
},
{
"cell_type": "markdown",
"metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"## Build a dataset using the data generated by the label model\n"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"pycharm": {
"name": "#%%\n"
},
"scrolled": false
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"INFO:ekorpkit.pipelines.pipe:Applying pipeline: OrderedDict([('load_dataframe', 'load_dataframe'), ('reset_index', 'reset_index'), ('split_sampling', 'split_sampling')])\n",
"INFO:ekorpkit.base:Applying pipe: functools.partial()\n",
"INFO:ekorpkit.io.file:Processing [1] files from ['esg_polarity_snorkel_data.parquet']\n",
"INFO:ekorpkit.io.file:Loading 1 dataframes from ['../data/esg/esg_polarity_snorkel_data.parquet']\n",
"INFO:ekorpkit.io.file:Loading data from ../data/esg/esg_polarity_snorkel_data.parquet\n",
"INFO:ekorpkit.base:Applying pipe: functools.partial()\n",
"INFO:ekorpkit.base:Applying pipe: functools.partial()\n",
"INFO:ekorpkit.io.file:Saving dataframe to ../data/esg/esg_polarity_kr/esg_polarity_kr-train.parquet\n",
"INFO:ekorpkit.io.file:Saving dataframe to ../data/esg/esg_polarity_kr/esg_polarity_kr-test.parquet\n",
"INFO:ekorpkit.io.file:Saving dataframe to ../data/esg/esg_polarity_kr/esg_polarity_kr-dev.parquet\n",
"INFO:ekorpkit.datasets.base:Dataset esg_polarity_kr built with 13616 rows\n",
"INFO:ekorpkit.io.file:Processing [1] files from ['esg_polarity_kr-train.parquet']\n",
"INFO:ekorpkit.io.file:Loading 1 dataframes from ['../data/esg/esg_polarity_kr/esg_polarity_kr-train.parquet']\n",
"INFO:ekorpkit.io.file:Loading data from ../data/esg/esg_polarity_kr/esg_polarity_kr-train.parquet\n",
"INFO:ekorpkit.info.column:index: index, index of data: None, columns: ['id', 'text', 'labels'], id: ['id']\n",
"INFO:ekorpkit.info.column:Adding id [split] to ['id']\n",
"INFO:ekorpkit.info.column:Added id [split], now ['id', 'split']\n",
"INFO:ekorpkit.info.column:Added a column [split] with value [train]\n",
"INFO:ekorpkit.io.file:Processing [1] files from ['esg_polarity_kr-dev.parquet']\n",
"INFO:ekorpkit.io.file:Loading 1 dataframes from ['../data/esg/esg_polarity_kr/esg_polarity_kr-dev.parquet']\n",
"INFO:ekorpkit.io.file:Loading data from ../data/esg/esg_polarity_kr/esg_polarity_kr-dev.parquet\n",
"INFO:ekorpkit.info.column:Added a column [split] with value [dev]\n",
"INFO:ekorpkit.io.file:Processing [1] files from ['esg_polarity_kr-test.parquet']\n",
"INFO:ekorpkit.io.file:Loading 1 dataframes from ['../data/esg/esg_polarity_kr/esg_polarity_kr-test.parquet']\n",
"INFO:ekorpkit.io.file:Loading data from ../data/esg/esg_polarity_kr/esg_polarity_kr-test.parquet\n",
"INFO:ekorpkit.info.column:Added a column [split] with value [test]\n",
"INFO:ekorpkit.base:Using batcher with minibatch size: 38\n",
"INFO:ekorpkit.utils.batch.batcher: backend: joblib minibatch_size: 38 procs: 230 input_split: False merge_output: True len(data): 8713 len(args): 5\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "335249fda7564a7e9cca6452448fa267",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"apply len_bytes to num_bytes: 0%| | 0/230 [00:00, ?it/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"INFO:ekorpkit.info.stat: >> elapsed time to calculate statistics: 0:00:00.276040\n",
"INFO:ekorpkit.base:Using batcher with minibatch size: 10\n",
"INFO:ekorpkit.utils.batch.batcher: backend: joblib minibatch_size: 10 procs: 230 input_split: False merge_output: True len(data): 2179 len(args): 5\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "e473ff6e5be34d769676053eb77e604e",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"apply len_bytes to num_bytes: 0%| | 0/218 [00:00, ?it/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"INFO:ekorpkit.info.stat: >> elapsed time to calculate statistics: 0:00:00.250046\n",
"INFO:ekorpkit.base:Using batcher with minibatch size: 12\n",
"INFO:ekorpkit.utils.batch.batcher: backend: joblib minibatch_size: 12 procs: 230 input_split: False merge_output: True len(data): 2724 len(args): 5\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "1f41984c90d144a39c58f0ffe3c34fd3",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"apply len_bytes to num_bytes: 0%| | 0/227 [00:00, ?it/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"INFO:ekorpkit.info.stat: >> elapsed time to calculate statistics: 0:00:00.253649\n",
"INFO:ekorpkit.io.file:Saving dataframe to ../data/esg/esg_polarity_kr/esg_polarity_kr-train.parquet\n",
"INFO:ekorpkit.io.file:Saving dataframe to ../data/esg/esg_polarity_kr/esg_polarity_kr-dev.parquet\n",
"INFO:ekorpkit.io.file:Saving dataframe to ../data/esg/esg_polarity_kr/esg_polarity_kr-test.parquet\n"
]
}
],
"source": [
"cfg = eKonf.compose(\"dataset=dataset_build\")\n",
"cfg.name = \"esg_polarity_kr\"\n",
"cfg.data_dir = data_dir\n",
"cfg.data_file = \"esg_polarity_snorkel_data.parquet\"\n",
"cfg.force.build = True\n",
"cfg.pipeline.split_sampling.stratify_on = \"labels\"\n",
"cfg.pipeline.split_sampling.random_state = 123\n",
"cfg.pipeline.split_sampling.test_size = 0.2\n",
"cfg.pipeline.split_sampling.dev_size = 0.2\n",
"cfg.pipeline.reset_index.drop_index = True\n",
"cfg.verbose = False\n",
"esg_polarity_ds = eKonf.instantiate(cfg)\n",
"esg_polarity_ds.persist()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": []
}
],
"metadata": {
"celltoolbar": "Tags",
"colab": {
"include_colab_link": true,
"name": "config.ipynb",
"provenance": []
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
},
"vscode": {
"interpreter": {
"hash": "d4d1e4263499bec80672ea0156c357c1ee493ec2b1c70f0acce89fc37c4a6abe"
}
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"state": {
"00a060c5fe6146de9354bc94b26a78d1": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"05a20c14c6b8478ab89e443518304ef5": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"09d71c94e2f34c55814f4bb269371e1e": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"layout": "IPY_MODEL_5e58ddac8c2f47e0a78ae559e0835d12",
"style": "IPY_MODEL_ba14042ab3de4bf6aceb29359568ff0a",
"value": " 227/227 [00:00<00:00, 930.21it/s]"
}
},
"0bb26117a19f46fbbe952878c2f963c2": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"0c04e4b0522144c483cc0a4fb07c1c82": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"layout": "IPY_MODEL_ccb49b049a5a4f238fec143e958ffe00",
"style": "IPY_MODEL_ce38faea895a41f1a79a0b6b644075af",
"value": " 230/230 [00:00<00:00, 923.04it/s]"
}
},
"0e4ae05ead6e41e5b23b0c22e5dcde25": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"description_width": ""
}
},
"108109c4947248e08fe655995d9c3a6c": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"167f6f1f2f5b47cfafa8423c8d7b5609": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"description_width": ""
}
},
"17dc65438c224acd8eddd045c64a0620": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"layout": "IPY_MODEL_68e100834656476a9d114ad859cf7410",
"style": "IPY_MODEL_967d43472ce14308a131dd03b49e3144",
"value": " 227/227 [00:01<00:00, 788.67it/s]"
}
},
"19757b016b244f43ae19e0b9ae1667c8": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"1b12c1acb6154d29be45407400e5cf51": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "FloatProgressModel",
"state": {
"bar_style": "success",
"layout": "IPY_MODEL_b5caf6b1dc8d453c985b9fc4047bc494",
"max": 227,
"style": "IPY_MODEL_264e00d8f14044d09415c3f38fec96fe",
"value": 227
}
},
"1b1985d0a20f40a2bbd6bdad2cfb8229": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "FloatProgressModel",
"state": {
"bar_style": "success",
"layout": "IPY_MODEL_35071c6714a342b7b4fe31d1c3bc2124",
"max": 227,
"style": "IPY_MODEL_b4c2eccee86f47b8b8c2a63ca416d20d",
"value": 227
}
},
"1bd08d2933984effa8d0497ca6f3f995": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"description_width": ""
}
},
"1da5ac26b6d8464999c08fe4d6f6b292": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"1eaabd793c1843628253a893e6ef1c9e": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"layout": "IPY_MODEL_96fed84e19cd46c3a4108084d2f264fa",
"style": "IPY_MODEL_6e9150db819847818085d18439643b69",
"value": " 218/218 [00:00<00:00, 952.90it/s]"
}
},
"1f41984c90d144a39c58f0ffe3c34fd3": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HBoxModel",
"state": {
"children": [
"IPY_MODEL_67ea04ed1a824b61bffd40b068973b6c",
"IPY_MODEL_d534079f61c643ee8c8876dffb947fff",
"IPY_MODEL_09d71c94e2f34c55814f4bb269371e1e"
],
"layout": "IPY_MODEL_1da5ac26b6d8464999c08fe4d6f6b292"
}
},
"21108c9174084c2c931691cd735543b8": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"description_width": ""
}
},
"247d944161c04250ae419f3f3e3e77bc": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"description_width": ""
}
},
"24cf2abb5f774849ba077c6c2efe259c": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"description_width": ""
}
},
"264e00d8f14044d09415c3f38fec96fe": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "ProgressStyleModel",
"state": {
"description_width": ""
}
},
"28c698f9045a4b95ac452a57c8fb8b92": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"2924098d88424ae69811c822d37942ee": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"2a9a1cf245214f7a994c721340284f49": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "FloatProgressModel",
"state": {
"bar_style": "success",
"layout": "IPY_MODEL_df3901a2705f428ea1b5119d43bd2a2c",
"max": 227,
"style": "IPY_MODEL_dbd798ae664d4774ae217c7d6f700b08",
"value": 227
}
},
"2bd472c9fe9446f2ad989ad4f313d3c4": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "ProgressStyleModel",
"state": {
"description_width": ""
}
},
"2c8624de880a4139b3bd824d778971b5": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"layout": "IPY_MODEL_108109c4947248e08fe655995d9c3a6c",
"style": "IPY_MODEL_992b43b1c275453f92460b6031dda400",
"value": "apply len_bytes to num_bytes: 100%"
}
},
"30725a5c92454b0eab96a308a7df6034": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"description_width": ""
}
},
"32e28d44b1a944418ff2b41dcf6544eb": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"layout": "IPY_MODEL_824bdef02e174b078f4815c247fe3755",
"style": "IPY_MODEL_167f6f1f2f5b47cfafa8423c8d7b5609",
"value": "apply len_bytes to num_bytes: 100%"
}
},
"335249fda7564a7e9cca6452448fa267": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HBoxModel",
"state": {
"children": [
"IPY_MODEL_5f4737c88cd34c7a90a38ba6f2c198ba",
"IPY_MODEL_d3aeef69cc4c4293a35e8cddbcfa068c",
"IPY_MODEL_0c04e4b0522144c483cc0a4fb07c1c82"
],
"layout": "IPY_MODEL_e14485869ee4468eb37cc1c343fa7fed"
}
},
"35071c6714a342b7b4fe31d1c3bc2124": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"35f07f8397114e39a6c1b57605345e4d": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"3aa97f397b3d432db6773310ba871b7a": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"description_width": ""
}
},
"3ee2b841a3364d86a884a0f0b7c39edb": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"layout": "IPY_MODEL_58c8c386d3074741a0ec0cf601bcb536",
"style": "IPY_MODEL_30725a5c92454b0eab96a308a7df6034",
"value": "apply len_bytes to num_bytes: 100%"
}
},
"3fa50da172cd428fbe089788fc52e8b0": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "FloatProgressModel",
"state": {
"bar_style": "success",
"layout": "IPY_MODEL_b919678a7fca4f55b4d0a42799ae4ca0",
"max": 227,
"style": "IPY_MODEL_fbdeed28da5b4df584e2a3ac3e86007b",
"value": 227
}
},
"44c04fb32eb04e979ff8a7a57f1985c1": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"48a5ed14694b415997b2ad645af2d076": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"4c61ca2de49a409ca16309f1754d2ee5": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"description_width": ""
}
},
"4cd1321c74ed4ec0b35a69b6c1e136b3": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"4ed0a8434b6f47a4ab1d99bbadf0b5cb": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"4f7d20b531634c2b9b0e74162d81adba": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HBoxModel",
"state": {
"children": [
"IPY_MODEL_f16b842679574e4b853f4bf4d433412f",
"IPY_MODEL_2a9a1cf245214f7a994c721340284f49",
"IPY_MODEL_798d16d2fda649e89eb84d6bcdbd2ca2"
],
"layout": "IPY_MODEL_f0f93505b1324962ae1fd4371b4e9644"
}
},
"5261ef5ba4924becaaa36b3f43289259": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"540983805a0746b4a1aee109d0cc2a29": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"58c8c386d3074741a0ec0cf601bcb536": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"592e4fd1582d48489fca96722a7df822": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"description_width": ""
}
},
"5c79fc579a974026a49797914618d07a": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HBoxModel",
"state": {
"children": [
"IPY_MODEL_b971ff25f9354eb49c26460a4dfa34da",
"IPY_MODEL_1b12c1acb6154d29be45407400e5cf51",
"IPY_MODEL_c145f4fc6c074d8b9d45912eb9ccbbe9"
],
"layout": "IPY_MODEL_ce6ff6d5a8304cb5a0949f7597754b38"
}
},
"5e58ddac8c2f47e0a78ae559e0835d12": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"5f4737c88cd34c7a90a38ba6f2c198ba": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"layout": "IPY_MODEL_35f07f8397114e39a6c1b57605345e4d",
"style": "IPY_MODEL_21108c9174084c2c931691cd735543b8",
"value": "apply len_bytes to num_bytes: 100%"
}
},
"67ea04ed1a824b61bffd40b068973b6c": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"layout": "IPY_MODEL_05a20c14c6b8478ab89e443518304ef5",
"style": "IPY_MODEL_592e4fd1582d48489fca96722a7df822",
"value": "apply len_bytes to num_bytes: 100%"
}
},
"68e100834656476a9d114ad859cf7410": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"6e3ccb7d83be4d7aaad4e759e4784f04": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "FloatProgressModel",
"state": {
"bar_style": "success",
"layout": "IPY_MODEL_4cd1321c74ed4ec0b35a69b6c1e136b3",
"max": 227,
"style": "IPY_MODEL_e7212cc1842b4d5cba8b8fd48523a632",
"value": 227
}
},
"6e9150db819847818085d18439643b69": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"description_width": ""
}
},
"70f98184088d49e2acb93e654111059d": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"7114e2fe188e4f039aba3c8ecd7fa256": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "ProgressStyleModel",
"state": {
"description_width": ""
}
},
"776ea55ae16a4d68bf7ce8939f8c119b": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"798d16d2fda649e89eb84d6bcdbd2ca2": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"layout": "IPY_MODEL_2924098d88424ae69811c822d37942ee",
"style": "IPY_MODEL_24cf2abb5f774849ba077c6c2efe259c",
"value": " 227/227 [00:00<00:00, 997.50it/s]"
}
},
"7e46ae14112d477e9f9037afaa482175": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"layout": "IPY_MODEL_19757b016b244f43ae19e0b9ae1667c8",
"style": "IPY_MODEL_fe3731d27bd44879b3d57ea7540a2cc8",
"value": " 227/227 [00:00<00:00, 485.24it/s]"
}
},
"81d9733fea6944debb40db2bd88d33ac": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"layout": "IPY_MODEL_70f98184088d49e2acb93e654111059d",
"style": "IPY_MODEL_9ffcfb7c627f4dda9ea28e0a61bcb858",
"value": " 227/227 [00:11<00:00, 139.87it/s]"
}
},
"82279914885e43409811754691738e03": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HBoxModel",
"state": {
"children": [
"IPY_MODEL_e39fc4b747fb4a63b5652453f6d30712",
"IPY_MODEL_1b1985d0a20f40a2bbd6bdad2cfb8229",
"IPY_MODEL_17dc65438c224acd8eddd045c64a0620"
],
"layout": "IPY_MODEL_5261ef5ba4924becaaa36b3f43289259"
}
},
"824bdef02e174b078f4815c247fe3755": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"8bcc1a8d1e51442abac5460678d416e0": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "ProgressStyleModel",
"state": {
"description_width": ""
}
},
"8f0facb32cee44f3b4828bc70a0d7073": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"layout": "IPY_MODEL_f854288b71854cf0bba197230ea93fb4",
"style": "IPY_MODEL_94e5087d91bb4b4b8ca518c1e80420c3",
"value": "apply len_bytes to num_bytes: 100%"
}
},
"8fdef9e7080f419496b0e54403b9ec07": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"94e5087d91bb4b4b8ca518c1e80420c3": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"description_width": ""
}
},
"967d43472ce14308a131dd03b49e3144": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"description_width": ""
}
},
"96fed84e19cd46c3a4108084d2f264fa": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"992b43b1c275453f92460b6031dda400": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"description_width": ""
}
},
"994f5f22e429466999bc45089f5d6e6c": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"9ffcfb7c627f4dda9ea28e0a61bcb858": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"description_width": ""
}
},
"a15eed4e9aa84d10aabf07831c48e526": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "FloatProgressModel",
"state": {
"bar_style": "success",
"layout": "IPY_MODEL_cefd58848d8e459db61ae40c961b1673",
"max": 218,
"style": "IPY_MODEL_d47641bef66d490db4d967f714a0515d",
"value": 218
}
},
"a4fffae6d2364a0e912609d6297d5211": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"acb37e2ec3af4ea5b0ecfd2f9b0633f6": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HBoxModel",
"state": {
"children": [
"IPY_MODEL_8f0facb32cee44f3b4828bc70a0d7073",
"IPY_MODEL_c4403ea1f52a4f73b41a30d591e980ac",
"IPY_MODEL_81d9733fea6944debb40db2bd88d33ac"
],
"layout": "IPY_MODEL_44c04fb32eb04e979ff8a7a57f1985c1"
}
},
"b46dcd83eb604b0d822164003b691b48": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"layout": "IPY_MODEL_48a5ed14694b415997b2ad645af2d076",
"style": "IPY_MODEL_247d944161c04250ae419f3f3e3e77bc",
"value": " 227/227 [00:00<00:00, 855.15it/s]"
}
},
"b4c2eccee86f47b8b8c2a63ca416d20d": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "ProgressStyleModel",
"state": {
"description_width": ""
}
},
"b5caf6b1dc8d453c985b9fc4047bc494": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"b919678a7fca4f55b4d0a42799ae4ca0": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"b971ff25f9354eb49c26460a4dfa34da": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"layout": "IPY_MODEL_540983805a0746b4a1aee109d0cc2a29",
"style": "IPY_MODEL_3aa97f397b3d432db6773310ba871b7a",
"value": "apply len_bytes to num_bytes: 100%"
}
},
"ba14042ab3de4bf6aceb29359568ff0a": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"description_width": ""
}
},
"c145f4fc6c074d8b9d45912eb9ccbbe9": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"layout": "IPY_MODEL_28c698f9045a4b95ac452a57c8fb8b92",
"style": "IPY_MODEL_0e4ae05ead6e41e5b23b0c22e5dcde25",
"value": " 227/227 [00:00<00:00, 998.55it/s]"
}
},
"c4403ea1f52a4f73b41a30d591e980ac": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "FloatProgressModel",
"state": {
"bar_style": "success",
"layout": "IPY_MODEL_0bb26117a19f46fbbe952878c2f963c2",
"max": 227,
"style": "IPY_MODEL_7114e2fe188e4f039aba3c8ecd7fa256",
"value": 227
}
},
"c619a9ab6e49433a9550ed2aee815aa1": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HBoxModel",
"state": {
"children": [
"IPY_MODEL_2c8624de880a4139b3bd824d778971b5",
"IPY_MODEL_6e3ccb7d83be4d7aaad4e759e4784f04",
"IPY_MODEL_7e46ae14112d477e9f9037afaa482175"
],
"layout": "IPY_MODEL_e6c5b97083774ce18aeee9c142452177"
}
},
"ccb49b049a5a4f238fec143e958ffe00": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"ce38faea895a41f1a79a0b6b644075af": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"description_width": ""
}
},
"ce6ff6d5a8304cb5a0949f7597754b38": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"cefd58848d8e459db61ae40c961b1673": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"d3aeef69cc4c4293a35e8cddbcfa068c": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "FloatProgressModel",
"state": {
"bar_style": "success",
"layout": "IPY_MODEL_00a060c5fe6146de9354bc94b26a78d1",
"max": 230,
"style": "IPY_MODEL_8bcc1a8d1e51442abac5460678d416e0",
"value": 230
}
},
"d47641bef66d490db4d967f714a0515d": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "ProgressStyleModel",
"state": {
"description_width": ""
}
},
"d534079f61c643ee8c8876dffb947fff": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "FloatProgressModel",
"state": {
"bar_style": "success",
"layout": "IPY_MODEL_4ed0a8434b6f47a4ab1d99bbadf0b5cb",
"max": 227,
"style": "IPY_MODEL_2bd472c9fe9446f2ad989ad4f313d3c4",
"value": 227
}
},
"dbd798ae664d4774ae217c7d6f700b08": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "ProgressStyleModel",
"state": {
"description_width": ""
}
},
"df3901a2705f428ea1b5119d43bd2a2c": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"e14485869ee4468eb37cc1c343fa7fed": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"e39fc4b747fb4a63b5652453f6d30712": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"layout": "IPY_MODEL_a4fffae6d2364a0e912609d6297d5211",
"style": "IPY_MODEL_1bd08d2933984effa8d0497ca6f3f995",
"value": "apply len_bytes to num_bytes: 100%"
}
},
"e473ff6e5be34d769676053eb77e604e": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HBoxModel",
"state": {
"children": [
"IPY_MODEL_32e28d44b1a944418ff2b41dcf6544eb",
"IPY_MODEL_a15eed4e9aa84d10aabf07831c48e526",
"IPY_MODEL_1eaabd793c1843628253a893e6ef1c9e"
],
"layout": "IPY_MODEL_994f5f22e429466999bc45089f5d6e6c"
}
},
"e6c5b97083774ce18aeee9c142452177": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"e7212cc1842b4d5cba8b8fd48523a632": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "ProgressStyleModel",
"state": {
"description_width": ""
}
},
"f0f93505b1324962ae1fd4371b4e9644": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"f16b842679574e4b853f4bf4d433412f": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"layout": "IPY_MODEL_776ea55ae16a4d68bf7ce8939f8c119b",
"style": "IPY_MODEL_4c61ca2de49a409ca16309f1754d2ee5",
"value": "apply len_bytes to num_bytes: 100%"
}
},
"f854288b71854cf0bba197230ea93fb4": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"fbdeed28da5b4df584e2a3ac3e86007b": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "ProgressStyleModel",
"state": {
"description_width": ""
}
},
"fd1cfe9ea63441319c98b69a27d0f94c": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HBoxModel",
"state": {
"children": [
"IPY_MODEL_3ee2b841a3364d86a884a0f0b7c39edb",
"IPY_MODEL_3fa50da172cd428fbe089788fc52e8b0",
"IPY_MODEL_b46dcd83eb604b0d822164003b691b48"
],
"layout": "IPY_MODEL_8fdef9e7080f419496b0e54403b9ec07"
}
},
"fe3731d27bd44879b3d57ea7540a2cc8": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"description_width": ""
}
}
},
"version_major": 2,
"version_minor": 0
}
}
},
"nbformat": 4,
"nbformat_minor": 1
}