diff --git a/klue_re.ipynb b/klue_re.ipynb index 389e40e..a0d909f 100644 --- a/klue_re.ipynb +++ b/klue_re.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "impressive-sociology", + "id": "concerned-regulation", "metadata": {}, "source": [ "# BERT를 활용한 관계추출(Relation Extraction, RE)\n", @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "august-garden", + "id": "lightweight-application", "metadata": {}, "source": [ "# 필요한 라이브러리를 설치합니다.\n", @@ -39,43 +39,43 @@ { "cell_type": "code", "execution_count": 1, - "id": "collective-number", + "id": "inner-crime", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Requirement already satisfied: datasets in /opt/conda/lib/python3.7/site-packages (1.8.0)\n", - "Requirement already satisfied: huggingface-hub<0.1.0 in /opt/conda/lib/python3.7/site-packages (from datasets) (0.0.13)\n", - "Requirement already satisfied: requests>=2.19.0 in /opt/conda/lib/python3.7/site-packages (from datasets) (2.25.1)\n", - "Requirement already satisfied: importlib-metadata in /opt/conda/lib/python3.7/site-packages (from datasets) (3.7.3)\n", - "Requirement already satisfied: pandas in /opt/conda/lib/python3.7/site-packages (from datasets) (1.2.5)\n", - "Requirement already satisfied: multiprocess in /opt/conda/lib/python3.7/site-packages (from datasets) (0.70.12.2)\n", - "Requirement already satisfied: numpy>=1.17 in /opt/conda/lib/python3.7/site-packages (from datasets) (1.18.5)\n", - "Requirement already satisfied: pyarrow<4.0.0,>=1.0.0 in /opt/conda/lib/python3.7/site-packages (from datasets) (3.0.0)\n", - "Requirement already satisfied: tqdm<4.50.0,>=4.27 in /opt/conda/lib/python3.7/site-packages (from datasets) (4.49.0)\n", - "Requirement already satisfied: xxhash in /opt/conda/lib/python3.7/site-packages (from datasets) (2.0.2)\n", - "Requirement already satisfied: fsspec in /opt/conda/lib/python3.7/site-packages (from datasets) (2021.6.1)\n", + "Requirement already satisfied: datasets in /opt/conda/lib/python3.7/site-packages (1.9.0)\n", + "Requirement already satisfied: tqdm>=4.27 in /opt/conda/lib/python3.7/site-packages (from datasets) (4.59.0)\n", "Requirement already satisfied: packaging in /opt/conda/lib/python3.7/site-packages (from datasets) (20.9)\n", + "Requirement already satisfied: pandas in /opt/conda/lib/python3.7/site-packages (from datasets) (1.3.0)\n", "Requirement already satisfied: dill in /opt/conda/lib/python3.7/site-packages (from datasets) (0.3.4)\n", - "Requirement already satisfied: typing-extensions in /opt/conda/lib/python3.7/site-packages (from huggingface-hub<0.1.0->datasets) (3.7.4.3)\n", + "Requirement already satisfied: xxhash in /opt/conda/lib/python3.7/site-packages (from datasets) (2.0.2)\n", + "Requirement already satisfied: huggingface-hub<0.1.0 in /opt/conda/lib/python3.7/site-packages (from datasets) (0.0.13)\n", + "Requirement already satisfied: pyarrow!=4.0.0,>=1.0.0 in /opt/conda/lib/python3.7/site-packages (from datasets) (4.0.1)\n", + "Requirement already satisfied: numpy>=1.17 in /opt/conda/lib/python3.7/site-packages (from datasets) (1.18.5)\n", + "Requirement already satisfied: multiprocess in /opt/conda/lib/python3.7/site-packages (from datasets) (0.70.12.2)\n", + "Requirement already satisfied: fsspec>=2021.05.0 in /opt/conda/lib/python3.7/site-packages (from datasets) (2021.6.1)\n", + "Requirement already satisfied: importlib-metadata in /opt/conda/lib/python3.7/site-packages (from datasets) (3.7.3)\n", + "Requirement already satisfied: requests>=2.19.0 in /opt/conda/lib/python3.7/site-packages (from datasets) (2.25.1)\n", "Requirement already satisfied: filelock in /opt/conda/lib/python3.7/site-packages (from huggingface-hub<0.1.0->datasets) (3.0.12)\n", + "Requirement already satisfied: typing-extensions in /opt/conda/lib/python3.7/site-packages (from huggingface-hub<0.1.0->datasets) (3.7.4.3)\n", "Requirement already satisfied: pyparsing>=2.0.2 in /opt/conda/lib/python3.7/site-packages (from packaging->datasets) (2.4.7)\n", - "Requirement already satisfied: chardet<5,>=3.0.2 in /opt/conda/lib/python3.7/site-packages (from requests>=2.19.0->datasets) (4.0.0)\n", - "Requirement already satisfied: certifi>=2017.4.17 in /opt/conda/lib/python3.7/site-packages (from requests>=2.19.0->datasets) (2020.12.5)\n", "Requirement already satisfied: idna<3,>=2.5 in /opt/conda/lib/python3.7/site-packages (from requests>=2.19.0->datasets) (2.10)\n", + "Requirement already satisfied: chardet<5,>=3.0.2 in /opt/conda/lib/python3.7/site-packages (from requests>=2.19.0->datasets) (4.0.0)\n", "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /opt/conda/lib/python3.7/site-packages (from requests>=2.19.0->datasets) (1.26.4)\n", + "Requirement already satisfied: certifi>=2017.4.17 in /opt/conda/lib/python3.7/site-packages (from requests>=2.19.0->datasets) (2020.12.5)\n", "Requirement already satisfied: zipp>=0.5 in /opt/conda/lib/python3.7/site-packages (from importlib-metadata->datasets) (3.4.1)\n", - "Requirement already satisfied: python-dateutil>=2.7.3 in /opt/conda/lib/python3.7/site-packages (from pandas->datasets) (2.8.1)\n", "Requirement already satisfied: pytz>=2017.3 in /opt/conda/lib/python3.7/site-packages (from pandas->datasets) (2021.1)\n", + "Requirement already satisfied: python-dateutil>=2.7.3 in /opt/conda/lib/python3.7/site-packages (from pandas->datasets) (2.8.1)\n", "Requirement already satisfied: six>=1.5 in /opt/conda/lib/python3.7/site-packages (from python-dateutil>=2.7.3->pandas->datasets) (1.15.0)\n", "Requirement already satisfied: sklearn in /opt/conda/lib/python3.7/site-packages (0.0)\n", "Requirement already satisfied: scikit-learn in /opt/conda/lib/python3.7/site-packages (from sklearn) (0.24.2)\n", - "Requirement already satisfied: threadpoolctl>=2.0.0 in /opt/conda/lib/python3.7/site-packages (from scikit-learn->sklearn) (2.1.0)\n", - "Requirement already satisfied: joblib>=0.11 in /opt/conda/lib/python3.7/site-packages (from scikit-learn->sklearn) (1.0.1)\n", "Requirement already satisfied: scipy>=0.19.1 in /opt/conda/lib/python3.7/site-packages (from scikit-learn->sklearn) (1.4.1)\n", - "Requirement already satisfied: numpy>=1.13.3 in /opt/conda/lib/python3.7/site-packages (from scikit-learn->sklearn) (1.18.5)\n" + "Requirement already satisfied: numpy>=1.13.3 in /opt/conda/lib/python3.7/site-packages (from scikit-learn->sklearn) (1.18.5)\n", + "Requirement already satisfied: threadpoolctl>=2.0.0 in /opt/conda/lib/python3.7/site-packages (from scikit-learn->sklearn) (2.1.0)\n", + "Requirement already satisfied: joblib>=0.11 in /opt/conda/lib/python3.7/site-packages (from scikit-learn->sklearn) (1.0.1)\n" ] } ], @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "organic-valley", + "id": "critical-trading", "metadata": {}, "source": [ "# 필요한 라이브러리를 import 합니다." @@ -95,7 +95,7 @@ { "cell_type": "code", "execution_count": 2, - "id": "looking-relevance", + "id": "regulated-musician", "metadata": {}, "outputs": [], "source": [ @@ -106,14 +106,13 @@ "from tqdm import tqdm\n", "from datasets import load_dataset\n", "from datasets.arrow_dataset import Dataset\n", - "from transformers import AutoTokenizer, AutoModel, AdamW\n", - "from transformers.models.bert.modeling_bert import BertPreTrainedModel, BertForSequenceClassification\n", + "from transformers import AutoTokenizer, AutoModelForSequenceClassification, AdamW\n", "from torch.utils.data import DataLoader" ] }, { "cell_type": "markdown", - "id": "smaller-truth", + "id": "mineral-justice", "metadata": {}, "source": [ "# GPU 사용을 위해 device를 설정합니다." @@ -122,7 +121,7 @@ { "cell_type": "code", "execution_count": 3, - "id": "musical-concord", + "id": "pediatric-monday", "metadata": {}, "outputs": [], "source": [ @@ -131,7 +130,7 @@ }, { "cell_type": "markdown", - "id": "valued-delta", + "id": "earned-thirty", "metadata": {}, "source": [ "# KLUE RE 데이터셋을 가져옵니다." @@ -140,7 +139,7 @@ { "cell_type": "code", "execution_count": 4, - "id": "induced-breast", + "id": "proprietary-pioneer", "metadata": {}, "outputs": [ { @@ -157,7 +156,7 @@ }, { "cell_type": "markdown", - "id": "higher-compact", + "id": "modern-rendering", "metadata": {}, "source": [ "# 데이터셋은 train과 validation 데이터로 구성되어 있습니다. \n", @@ -169,7 +168,7 @@ { "cell_type": "code", "execution_count": 5, - "id": "respective-labor", + "id": "dried-fellowship", "metadata": {}, "outputs": [ { @@ -177,11 +176,11 @@ "text/plain": [ "DatasetDict({\n", " train: Dataset({\n", - " features: ['guid', 'label', 'object_entity', 'sentence', 'source', 'subject_entity'],\n", + " features: ['guid', 'sentence', 'subject_entity', 'object_entity', 'label', 'source'],\n", " num_rows: 32470\n", " })\n", " validation: Dataset({\n", - " features: ['guid', 'label', 'object_entity', 'sentence', 'source', 'subject_entity'],\n", + " features: ['guid', 'sentence', 'subject_entity', 'object_entity', 'label', 'source'],\n", " num_rows: 7765\n", " })\n", "})" @@ -198,7 +197,7 @@ }, { "cell_type": "markdown", - "id": "increasing-clarity", + "id": "geological-engagement", "metadata": {}, "source": [ "# 데이터 구성\n", @@ -208,24 +207,24 @@ { "cell_type": "code", "execution_count": 6, - "id": "assisted-brooklyn", + "id": "bearing-budapest", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'guid': 'klue-re-v1_train_00000',\n", - " 'label': 0,\n", - " 'object_entity': {'word': '조지 해리슨',\n", - " 'start_idx': 13,\n", - " 'end_idx': 18,\n", - " 'type': 'PER'},\n", " 'sentence': '〈Something〉는 조지 해리슨이 쓰고 비틀즈가 1969년 앨범 《Abbey Road》에 담은 노래다.',\n", - " 'source': 'wikipedia',\n", " 'subject_entity': {'word': '비틀즈',\n", " 'start_idx': 24,\n", " 'end_idx': 26,\n", - " 'type': 'ORG'}}" + " 'type': 'ORG'},\n", + " 'object_entity': {'word': '조지 해리슨',\n", + " 'start_idx': 13,\n", + " 'end_idx': 18,\n", + " 'type': 'PER'},\n", + " 'label': 0,\n", + " 'source': 'wikipedia'}" ] }, "execution_count": 6, @@ -239,7 +238,7 @@ }, { "cell_type": "markdown", - "id": "established-platform", + "id": "irish-shoulder", "metadata": {}, "source": [ "# train데이터에서 각 label의 수를 살펴보겠습니다.\n", @@ -256,7 +255,7 @@ { "cell_type": "code", "execution_count": 7, - "id": "english-royalty", + "id": "miniature-token", "metadata": {}, "outputs": [ { @@ -315,7 +314,7 @@ }, { "cell_type": "markdown", - "id": "accredited-weapon", + "id": "broke-basket", "metadata": {}, "source": [ "# 개체 양 끝에 special token을 추가합니다.\n", @@ -333,7 +332,7 @@ { "cell_type": "code", "execution_count": 8, - "id": "surface-squad", + "id": "creative-asbestos", "metadata": {}, "outputs": [], "source": [ @@ -369,7 +368,7 @@ { "cell_type": "code", "execution_count": 9, - "id": "efficient-absorption", + "id": "threaded-client", "metadata": {}, "outputs": [], "source": [ @@ -381,7 +380,7 @@ { "cell_type": "code", "execution_count": 10, - "id": "exclusive-travel", + "id": "bored-replication", "metadata": {}, "outputs": [ { @@ -409,7 +408,7 @@ }, { "cell_type": "markdown", - "id": "pointed-earthquake", + "id": "auburn-logic", "metadata": {}, "source": [ "# klue/bert-base 모델을 사용할 예정이므로 모델에 맞는 tokenizer를 가져옵니다." @@ -418,7 +417,7 @@ { "cell_type": "code", "execution_count": 11, - "id": "southwest-retrieval", + "id": "beginning-penetration", "metadata": {}, "outputs": [], "source": [ @@ -428,7 +427,7 @@ { "cell_type": "code", "execution_count": 12, - "id": "color-footwear", + "id": "initial-drawing", "metadata": {}, "outputs": [], "source": [ @@ -437,7 +436,7 @@ }, { "cell_type": "markdown", - "id": "recreational-given", + "id": "opening-links", "metadata": {}, "source": [ "# tokenizer를 이용한 토큰화 결과가 어떻게 나오는지 살펴보도록 하겠습니다.\n", @@ -447,7 +446,7 @@ { "cell_type": "code", "execution_count": 13, - "id": "exact-senegal", + "id": "french-nitrogen", "metadata": {}, "outputs": [], "source": [ @@ -457,7 +456,7 @@ { "cell_type": "code", "execution_count": 14, - "id": "fatty-finance", + "id": "improved-tourist", "metadata": {}, "outputs": [ { @@ -478,7 +477,7 @@ { "cell_type": "code", "execution_count": 15, - "id": "electoral-witch", + "id": "answering-replica", "metadata": {}, "outputs": [], "source": [ @@ -490,7 +489,7 @@ }, { "cell_type": "markdown", - "id": "metropolitan-bathroom", + "id": "ranging-reception", "metadata": {}, "source": [ "토큰화 결과로 Bert모델의 입력으로 필요한 input_ids, token_type_ids, attention_mask가 나오는 것을 확인할 수 있습니다.\n", @@ -501,7 +500,7 @@ { "cell_type": "code", "execution_count": 16, - "id": "pretty-luther", + "id": "fixed-heater", "metadata": {}, "outputs": [ { @@ -521,7 +520,7 @@ }, { "cell_type": "markdown", - "id": "wrong-corpus", + "id": "patent-korea", "metadata": {}, "source": [ "토큰화 된 문장을 다시 디코딩 해봄으로써 원본 문장을 얻을 수 있는지 확인해봅니다.\n", @@ -532,7 +531,7 @@ { "cell_type": "code", "execution_count": 17, - "id": "cellular-arrow", + "id": "becoming-browser", "metadata": {}, "outputs": [ { @@ -552,7 +551,7 @@ }, { "cell_type": "markdown", - "id": "variable-channels", + "id": "sunset-questionnaire", "metadata": {}, "source": [ "# Special token 추가\n", @@ -564,7 +563,7 @@ { "cell_type": "code", "execution_count": 18, - "id": "matched-investor", + "id": "positive-blame", "metadata": {}, "outputs": [], "source": [ @@ -574,7 +573,7 @@ }, { "cell_type": "markdown", - "id": "secondary-paris", + "id": "unlike-terminology", "metadata": {}, "source": [ "데이터로더 및 학습에 필요한 값들을 설정합니다." @@ -583,7 +582,7 @@ { "cell_type": "code", "execution_count": 19, - "id": "developmental-intersection", + "id": "assumed-parts", "metadata": {}, "outputs": [], "source": [ @@ -601,7 +600,7 @@ }, { "cell_type": "markdown", - "id": "literary-engagement", + "id": "nearby-packet", "metadata": {}, "source": [ "# 학습에 이용할 데이터셋과 데이터로더를 만들어 줍니다." @@ -610,7 +609,7 @@ { "cell_type": "code", "execution_count": 20, - "id": "trying-consent", + "id": "domestic-hampshire", "metadata": {}, "outputs": [], "source": [ @@ -635,7 +634,7 @@ { "cell_type": "code", "execution_count": 21, - "id": "thick-effectiveness", + "id": "tracked-regression", "metadata": {}, "outputs": [], "source": [ @@ -648,7 +647,7 @@ }, { "cell_type": "markdown", - "id": "electronic-payday", + "id": "virtual-vertex", "metadata": {}, "source": [ "# klue/bert-base 모델을 로드합니다.\n", @@ -669,7 +668,7 @@ { "cell_type": "code", "execution_count": 22, - "id": "rocky-justice", + "id": "refined-cornell", "metadata": {}, "outputs": [ { @@ -685,12 +684,12 @@ } ], "source": [ - "model = BertForSequenceClassification.from_pretrained(model_name, num_labels=num_labels).to(device)" + "model = AutoModelForSequenceClassification.from_pretrained(model_name, num_labels=num_labels).to(device)" ] }, { "cell_type": "markdown", - "id": "electronic-asian", + "id": "enormous-germany", "metadata": {}, "source": [ "모델 구성의 마지막에 있는 classifier 부분을 보시면 출력 차원이 30으로 설정되어 있는 것을 확인할 수 있습니다." @@ -699,7 +698,7 @@ { "cell_type": "code", "execution_count": 23, - "id": "attached-particle", + "id": "congressional-south", "metadata": {}, "outputs": [ { @@ -1015,7 +1014,7 @@ }, { "cell_type": "markdown", - "id": "alternate-import", + "id": "modular-party", "metadata": {}, "source": [ "# Bert Embedding Layer을 resize합니다.\n", @@ -1032,7 +1031,7 @@ { "cell_type": "code", "execution_count": 24, - "id": "stunning-worthy", + "id": "editorial-johnston", "metadata": {}, "outputs": [ { @@ -1052,7 +1051,7 @@ }, { "cell_type": "markdown", - "id": "promising-yesterday", + "id": "polar-intention", "metadata": {}, "source": [ "학습 도중 Loss, Accuracy 계산 및 저장을 간단하게 하기 위해 AverageMeter를 클래스를 이용합니다." @@ -1061,7 +1060,7 @@ { "cell_type": "code", "execution_count": 25, - "id": "hourly-bridges", + "id": "numerical-pitch", "metadata": {}, "outputs": [], "source": [ @@ -1081,7 +1080,7 @@ }, { "cell_type": "markdown", - "id": "laughing-electricity", + "id": "developed-qatar", "metadata": {}, "source": [ "# Model fine-tuning\n", @@ -1095,7 +1094,7 @@ { "cell_type": "code", "execution_count": 26, - "id": "silver-algeria", + "id": "modern-ancient", "metadata": {}, "outputs": [ { @@ -1116,7 +1115,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "100%|██████████| 4059/4059 [14:11<00:00, 4.77it/s]\n", + "100%|██████████| 4059/4059 [14:15<00:00, 4.74it/s]\n", "100%|██████████| 971/971 [01:07<00:00, 14.30it/s]\n", " 0%| | 0/4059 [00:00\n" ] @@ -1134,8 +1133,8 @@ "name": "stderr", "output_type": "stream", "text": [ - "100%|██████████| 4059/4059 [14:10<00:00, 4.77it/s]\n", - "100%|██████████| 971/971 [01:07<00:00, 14.30it/s]\n", + "100%|██████████| 4059/4059 [14:17<00:00, 4.73it/s]\n", + "100%|██████████| 971/971 [01:08<00:00, 14.18it/s]\n", " 0%| | 0/4059 [00:00\n" ] @@ -1152,15 +1151,15 @@ "name": "stderr", "output_type": "stream", "text": [ - "100%|██████████| 4059/4059 [14:10<00:00, 4.77it/s]\n", - "100%|██████████| 971/971 [01:07<00:00, 14.32it/s]" + "100%|██████████| 4059/4059 [14:16<00:00, 4.74it/s]\n", + "100%|██████████| 971/971 [01:08<00:00, 14.17it/s]" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "train_loss: 0.3608, train_acc: 87.74%, val_loss: 0.7518, val_acc: 75.54%\n", + "train_loss: 0.3583, train_acc: 0.8792, val_loss: 0.8018, val_acc: 0.7415\n", "====================================================================================================\n" ] }, @@ -1204,7 +1203,7 @@ " \n", " results = {\n", " 'loss': loss_save.avg,\n", - " 'acc': acc_save.avg * 100,\n", + " 'acc': acc_save.avg,\n", " }\n", " \n", " return results\n", @@ -1231,13 +1230,13 @@ " val_loss, val_acc = val_results['loss'], val_results['acc']\n", " \n", " \n", - " print(f'train_loss: {train_loss:.4f}, train_acc: {train_acc:.2f}%, val_loss: {val_loss:.4f}, val_acc: {val_acc:.2f}%')\n", + " print(f'train_loss: {train_loss:.4f}, train_acc: {train_acc:.4f}, val_loss: {val_loss:.4f}, val_acc: {val_acc:.4f}')\n", " print('=' * 100)" ] }, { "cell_type": "markdown", - "id": "ongoing-tooth", + "id": "steady-climb", "metadata": {}, "source": [ "# 학습된 모델을 저장합니다." @@ -1246,7 +1245,7 @@ { "cell_type": "code", "execution_count": 27, - "id": "consistent-cassette", + "id": "built-petite", "metadata": {}, "outputs": [], "source": [ @@ -1256,7 +1255,7 @@ }, { "cell_type": "markdown", - "id": "nervous-positive", + "id": "amended-debut", "metadata": {}, "source": [ "# Validation 결과 확인\n", @@ -1266,7 +1265,7 @@ { "cell_type": "code", "execution_count": 28, - "id": "small-planet", + "id": "expanded-shopping", "metadata": {}, "outputs": [ { @@ -1289,7 +1288,7 @@ { "cell_type": "code", "execution_count": 29, - "id": "pediatric-wednesday", + "id": "retained-works", "metadata": {}, "outputs": [], "source": [ @@ -1303,7 +1302,7 @@ { "cell_type": "code", "execution_count": 30, - "id": "assigned-slovak", + "id": "fleet-kidney", "metadata": {}, "outputs": [], "source": [ @@ -1320,7 +1319,7 @@ }, { "cell_type": "markdown", - "id": "prime-device", + "id": "configured-chase", "metadata": {}, "source": [ "0번 라벨은 \"관계 없음\"이므로 해당 문장에 대해서 예측이 정확하게 됐음을 알 수 있습니다." @@ -1329,7 +1328,7 @@ { "cell_type": "code", "execution_count": 31, - "id": "indoor-stuff", + "id": "million-mailing", "metadata": {}, "outputs": [ { @@ -1349,7 +1348,7 @@ }, { "cell_type": "markdown", - "id": "leading-rebecca", + "id": "educated-receiver", "metadata": {}, "source": [ "다음으로 관계가 있는 문장에 대한 예측 결과를 살펴보겠습니다." @@ -1358,7 +1357,7 @@ { "cell_type": "code", "execution_count": 32, - "id": "architectural-engagement", + "id": "little-showcase", "metadata": {}, "outputs": [ { @@ -1381,7 +1380,7 @@ { "cell_type": "code", "execution_count": 33, - "id": "enormous-shift", + "id": "local-cancer", "metadata": {}, "outputs": [], "source": [ @@ -1395,7 +1394,7 @@ { "cell_type": "code", "execution_count": 34, - "id": "aware-savage", + "id": "interpreted-airport", "metadata": {}, "outputs": [], "source": [ @@ -1412,7 +1411,7 @@ }, { "cell_type": "markdown", - "id": "found-option", + "id": "particular-compensation", "metadata": {}, "source": [ "3번 라벨은 \"org:place_of_headquarters\" 이므로 해당 문장에 대해서 예측이 정확하게 됐음을 알 수 있습니다." @@ -1421,7 +1420,7 @@ { "cell_type": "code", "execution_count": 35, - "id": "advanced-creek", + "id": "domestic-vietnam", "metadata": {}, "outputs": [ { @@ -1441,7 +1440,7 @@ }, { "cell_type": "markdown", - "id": "continuous-professor", + "id": "wrapped-invite", "metadata": {}, "source": [ "# 모델 평가\n", @@ -1455,7 +1454,7 @@ { "cell_type": "code", "execution_count": 36, - "id": "surgical-hours", + "id": "wrapped-phoenix", "metadata": {}, "outputs": [], "source": [ @@ -1479,14 +1478,14 @@ { "cell_type": "code", "execution_count": 37, - "id": "literary-granny", + "id": "metric-cruise", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "100%|██████████| 971/971 [01:07<00:00, 14.45it/s]\n" + "100%|██████████| 971/971 [01:07<00:00, 14.32it/s]\n" ] } ], @@ -1517,22 +1516,22 @@ }, { "cell_type": "markdown", - "id": "functional-cotton", + "id": "theoretical-background", "metadata": {}, "source": [ - "약 63.58의 F1 score를 기록했습니다. 하이퍼파라미터, 모델 구조 등을 변경시켜 더 높은 F1 score를 기록해보세요!" + "약 61.93의 F1 score를 기록했습니다. 하이퍼파라미터, 모델 구조 등을 변경시켜 다양한 학습을 시도해보세요!" ] }, { "cell_type": "code", "execution_count": 38, - "id": "general-attitude", + "id": "imposed-globe", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "63.58118361153262" + "61.93164001254312" ] }, "execution_count": 38, @@ -1546,7 +1545,7 @@ }, { "cell_type": "markdown", - "id": "bigger-action", + "id": "local-insulation", "metadata": {}, "source": [ "학습된 모델은 Huggingface Model Hub에 배포되어 있고, 언제든지 다운받아서 활용이 가능합니다.\n", @@ -1556,7 +1555,7 @@ }, { "cell_type": "markdown", - "id": "capable-found", + "id": "shared-dating", "metadata": {}, "source": [ "# Reference" @@ -1564,7 +1563,7 @@ }, { "cell_type": "markdown", - "id": "noble-first", + "id": "drawn-trick", "metadata": {}, "source": [ "### klue-transformers-tutorial\n",