0Pricing
NLP Academy · レッスン

ステミング: 語幹まで切り詰める

running と runs を run に対応付ける

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

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

One Word, Many Forms

The verb run shows up as running, runs, and ran. To you they share a meaning, but raw text counts each one separately, splitting the signal. 🌱

Enter Stemming

Stemming chops the endings off a word to reach a rough root called the stem. The goal is to make related forms collapse into one shared token.

Rules, Not a Dictionary

A stemmer follows simple suffix rules instead of looking words up. It strips endings like ing, ed, and s, so it is fast but a bit crude.

The Porter Stemmer

NLTK ships the classic PorterStemmer. You create one instance, then call its stem method on any word you want reduced.

from nltk.stem import PorterStemmer
ps = PorterStemmer()
print(ps.stem('running'))

Forms Collapse Together

Feed in several forms of the same verb and they all reduce to the same stem. Now your counts can finally add up.

for w in ['running', 'runs', 'ran']:
    print(ps.stem(w))

Stems Are Not Real Words

Stemming is blunt. The word studies becomes studi, which is not a real word, but it still matches study and studied as one stem.

print(ps.stem('studies'))

Watch for Over-Stemming

Sometimes a stemmer cuts too far and merges unrelated words. This over-stemming can blur meanings, so always sanity-check the output on your text.

print(ps.stem('universal'))
print(ps.stem('university'))

Stem a Token List

In practice you stem every token in a document. A comprehension applies the stemmer across the whole list in one clean line.

words = ['cats', 'caring', 'cared']
print([ps.stem(w) for w in words])

Other Stemmers Exist

Porter is the default, but NLTK also offers the snappier SnowballStemmer, which supports many languages and fixes some Porter rough edges.

from nltk.stem import SnowballStemmer
sb = SnowballStemmer('english')
print(sb.stem('happily'))

Lowercase First

Stemmers expect lowercase input. Fold case before stemming, or Running and running may slip through as two different tokens again.

print(ps.stem('Running'.lower()))

When to Reach for It

Stemming trades precision for speed. It shines in search and large pipelines where a rough but fast match beats slow, exact analysis. ⚡

Quick Check

Let's lock in how stemming behaves.

Recap

You learned stemming chops suffixes with simple rules to collapse word forms into one stem. It is fast and rough, sometimes yielding non-words. Nice work! 🎉

よくある質問

「ステミング: 語幹まで切り詰める」レッスンは無料ですか?

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

「ステミング: 語幹まで切り詰める」で何を学びますか?

running と runs を run に対応付ける ブラウザで直接実行するハンズオンコードでNLP Academyを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。

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

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

「ステミング: 語幹まで切り詰める」レッスンにはどのくらい時間がかかりますか?

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

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

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

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

  1. 大文字小文字と空白が重要な理由
  2. 小文字化と空白の除去
  3. ステミング: 語幹まで切り詰める
  4. レンマ化: より賢い基本形への変換
← NLP Academyに戻る