{ "cells": [ { "cell_type": "markdown", "metadata": { "id": "b518b04cbfe0" }, "source": [ "##### Copyright 2020 The TensorFlow Authors." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "cellView": "form", "execution": { "iopub.execute_input": "2022-12-14T22:21:02.707589Z", "iopub.status.busy": "2022-12-14T22:21:02.707132Z", "iopub.status.idle": "2022-12-14T22:21:02.710907Z", "shell.execute_reply": "2022-12-14T22:21:02.710387Z" }, "id": "906e07f6e562" }, "outputs": [], "source": [ "#@title Licensed under the Apache License, Version 2.0 (the \"License\");\n", "# you may not use this file except in compliance with the License.\n", "# You may obtain a copy of the License at\n", "#\n", "# https://www.apache.org/licenses/LICENSE-2.0\n", "#\n", "# Unless required by applicable law or agreed to in writing, software\n", "# distributed under the License is distributed on an \"AS IS\" BASIS,\n", "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n", "# See the License for the specific language governing permissions and\n", "# limitations under the License." ] }, { "cell_type": "markdown", "metadata": { "id": "6e083398b477" }, "source": [ "# 전처리 레이어 처리" ] }, { "cell_type": "markdown", "metadata": { "id": "64010bd23c2e" }, "source": [ "
![]() | \n",
" ![]() | \n",
" ![]() | \n",
" ![]() | \n",
"
TextVectorization
레이어가 동작하는 것을 볼 수 있습니다.\n",
"\n",
"이러한 모델을 훈련할 때에는 최상의 성능을 위해 `TextVectorization` 레이어를 입력 파이프라인의 일부로 사용해야 합니다."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "28c2f2ff61fb"
},
"source": [
"### 멀티-핫 인코딩을 사용하여 텍스트를 ngram의 밀집 행렬로 인코딩하기\n",
"\n",
"다음은 `Dense` 레이어로 전달될 텍스트를 전처리하는 방법입니다."
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"execution": {
"iopub.execute_input": "2022-12-14T22:21:51.667922Z",
"iopub.status.busy": "2022-12-14T22:21:51.667427Z",
"iopub.status.idle": "2022-12-14T22:21:52.359161Z",
"shell.execute_reply": "2022-12-14T22:21:52.358463Z"
},
"id": "7bae1c223cd8"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"WARNING:tensorflow:5 out of the last 1567 calls to