Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions chapters/ko/chapter2/4.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,11 @@ tokenizer.save_pretrained("directory_on_my_computer")

텍스트를 숫자로 바꾸는 것은 _인코딩_으로 알려져 있습니다. 인코딩은 토큰화, 토큰을 입력 ID로 바꾸는 두 단계에 걸쳐 수행됩니다.

첫 번째 단계는 이미 봤던 것처럼 텍스트를 흔히 *토큰*이라고 부르는 단어(또는 단어의 일부, 구두점 기호 등)로 나누는 것입니다. There are multiple rules that can govern that process, which is why we need to instantiate the tokenizer using the name of the model, to make sure we use the same rules that were used when the model was pretrained.
첫 번째 단계는 이미 봤던 것처럼 텍스트를 흔히 *토큰*이라고 부르는 단어(또는 단어의 일부, 구두점 기호 등)로 나누는 것입니다. 이 과정에는 여러 가지 규칙이 적용될 수 있기 때문에, 모델이 사전학습(pretrained)될 때 사용된 동일한 규칙을 따르도록 모델 이름을 사용해 토크나이저를 인스턴스화해야 합니다.

두 번째 단계는 생성된 토큰들을 숫자로 변환해 텐서로 만들고 모델로 넘겨주는 것입니다. 이 과정을 위해 토크나이저는 `from_pretrained()` 메서드로 인스턴스화할 때 다운로드한 *단어 사전*을 가지고 있습니다. 여기서도 모델이 사전학습될 때 사용한 것과 동일한 단어 사전을 사용해야 합니다.

두 단계를 더 잘 이해하기 위해, 단계별로 알아봅시다. Note that we will use some methods that perform parts of the tokenization pipeline separately to show you the intermediate results of those steps, but in practice, you should call the tokenizer directly on your inputs (as shown in the section 2).
두 단계를 더 잘 이해하기 위해, 단계별로 알아봅시다. 참고로, 여기서는 각 단계의 중간 결과를 보여주기 위해 토크나이저 내부의 일부 메서드를 개별적으로 사용할 것입니다. 하지만 실제 사용 시에는 입력에 대해 토크나이저를 바로 호출하는 방식(2절에서 보여준 방식)을 사용하는 것이 좋습니다.

### 토큰화[[tokenization]]

Expand Down