0Pricing
NLP Academy · レッスン

Masked Language Modeling

BERT が生テキストから学習する仕組み

「Masked Language Modeling」はCoddyKit上の無料NLP Academyレッスンです。 これはレッスン2/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはNLP Academy学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 NLP Academyコースには全4レッスンが含まれています。

このレッスンの一部はまだ翻訳されておらず、英語で表示されています。

Learning Without Labels

BERT trains on plain text with no human labels at all. This clever trick is called self-supervised learning.

The Fill-in-the-Blank Game

BERT learns by hiding some words and guessing them back. That game is masked language modeling, or MLM for short.

Hiding a Word

A random word gets swapped for a special placeholder. Here the model must recover what the mask is covering up.

text = "the cat sat on the [MASK]"
# model should predict: mat

Predict the Missing Word

BERT reads everything around the blank and ranks likely fills. Strong guesses come from using the full context.

Why Hiding Helps

To fill a blank well, the model must learn grammar, facts, and word relationships. The blank forces real understanding.

The Famous 15 Percent

BERT masks about 15 percent of the words in each sentence during training. That ratio balances signal and difficulty.

Both Sides at Once

Unlike left-to-right models, BERT sees words before and after the blank. This bidirectional view makes its guesses far richer.

A Second Task

Original BERT also guessed if one sentence follows another. That extra job is next sentence prediction, teaching it about flow.

Pre-training, Then Reuse

This slow, expensive MLM phase is the pre-training step. You download the result and reuse it without redoing the work.

Try It in Code

A fill-mask pipeline lets you watch MLM in action and see BERT rank its top predictions for any blank.

from transformers import pipeline
fm = pipeline("fill-mask", model="bert-base-uncased")
fm("Paris is the [MASK] of France.")

Knowledge for Free

After MLM, BERT holds a huge store of language knowledge ready to power your tasks. All of it came from raw text.

Quick Check

What does masked language modeling ask BERT to do?

Recap

BERT learns by filling masked blanks using both sides of a sentence. This self-supervised MLM builds deep language knowledge. ✅

よくある質問

「Masked Language Modeling」レッスンは無料ですか?

はい。「Masked Language Modeling」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、NLP Academyコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 NLP Academyコースには全4レッスンが含まれています。

「Masked Language Modeling」で何を学びますか?

BERT が生テキストから学習する仕組み ブラウザで直接実行するハンズオンコードでNLP Academyを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。

NLP Academyを始めるのに経験は必要ですか?

事前経験は必要ありません。CoddyKitのNLP Academyは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン2/4です。

「Masked Language Modeling」レッスンにはどのくらい時間がかかりますか?

ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。

このNLP Academyレッスンでコードを書いて実行できますか?

はい。すべてのNLP Academyレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。

このコースのすべてのレッスン

  1. 文脈で単語の意味が変わる理由
  2. Masked Language Modeling
  3. BERT で文を埋め込みに変換する
  4. 適切な学習済みモデルを選ぶ
← NLP Academyに戻る