이제부터 앞 두 장에서 소개한 개념을 활용해서 언어 모델링 문제에 신경망을 적용하는 방법을
살펴봅니다. 다만 바로 다음 내용을 읽기 전에,
어떤 접근이 좋을지 잠시 고민해
보기 바랍니다.
10.1
지금까지 배운 내용만으로 언어 모델의 구축 방식을 명확하게 상상하기란 어려울 것입니다. 문
장의 길이는 다양하고, 이런 문장으로 구성된 문서는 길거나 짧을 수도 있을 겁니다. 그러면 신
경망으로 어떻게 문장의 다음 단어를 예측할 수 있을까요? 지금부터 알아봅시다!
우리는 신경망에서 범주형 변수를 독립변수로 사용하는 방식을 살펴봤습니다. 다음은 단일 범
주형 변수에 대해 우리가 밟았던 과정입니다.
1
범주형 변수에 존재할 수 있는 모든 수준의 목록을 만듭니다(이 목록을
vocab
(어휘사전)이라고 합니다).
2
각 수준을 매핑된
vocab
의 색인 번호로 치환합니다.
3
각 수준을 행으로 표현하는 임베딩 행렬을 만듭니다.
4
임베딩 행렬을 신경망의 첫 번째 계층으로 사용합니다(
2
단계에서 생성된 원시
vocab
의 색인 번호를 임베딩
행렬의 입력에 사용할 수 있습니다. 색인 번호를 표현하는 원-핫 인코딩된 벡터를 입력으로 사용할 때와
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.
O’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
I wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
I’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
I'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.