0Pricing
NLP Academy · 강의

바이그램과 트라이그램 설명

토큰 위에서 슬라이딩 윈도우를 적용합니다

바이그램과 트라이그램 설명은(는) CoddyKit의 무료 NLP Academy 강의입니다. 이것은 4개 중 2번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 NLP Academy 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. NLP Academy 강의에는 총 4개의 강의가 포함되어 있습니다.

이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.

Naming the N-Grams

The n in n-gram is just a number. Pick n and you decide how many neighboring words each feature bundles together.

Meet the Bigram

A bigram is an n-gram of size two, every adjacent pair of words. It is the most common upgrade over plain single words. 👍

Bigrams in Action

From four words you get three overlapping pairs. Notice how each bigram shares one word with the next one.

words = "i love clean code".split()
bigrams = list(zip(words, words[1:]))
print(bigrams)

Meet the Trigram

A trigram takes three words at a time. It captures even more context, like is not good as one unit.

words = "this is not good".split()
trigrams = list(zip(words, words[1:], words[2:]))
print(trigrams)

How Many Do You Get?

For a sentence of N words, you get N minus n plus one n-grams. So 4 words give 3 bigrams and 2 trigrams.

The Window Slides

Each n-gram comes from a small window moving one word forward. Overlap is the point, since shared words stitch context together.

A Reusable Helper

You can build any n-gram with one tidy function using zip. Change the value of n and the same code handles bigrams or trigrams.

def ngrams(words, n):
    return list(zip(*[words[i:] for i in range(n)]))

Bigger N, More Context

Higher values of n hold longer phrases, so they capture context more precisely. That power comes with a cost you will meet soon.

Bigger N, Rarer Grams

The longer the run, the less often that exact sequence repeats. Large n-grams become rare, appearing in few documents.

Why Bigrams Are Popular

Bigrams hit a sweet spot: enough context to catch not bad, common enough to repeat across texts. That balance makes them a reliable default.

Mixing Sizes

You rarely use one size alone. Most pipelines combine unigrams and bigrams so the model sees both single words and their key pairs.

Quick Check

How many bigrams come from the sentence text is just data, which has four words?

Recap: Bigrams and Trigrams

A bigram joins two words, a trigram joins three. Bigger n holds more context but appears less often. Next you will let scikit-learn build them. ⚙️

자주 묻는 질문

“바이그램과 트라이그램 설명” 강의는 무료인가요?

네 — “바이그램과 트라이그램 설명” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 NLP Academy 강의 전체를 잠금 해제할 수 있습니다. NLP Academy 강의에는 총 4개의 강의가 포함되어 있습니다.

“바이그램과 트라이그램 설명”에서 뭘 배우나요?

토큰 위에서 슬라이딩 윈도우를 적용합니다 브라우저에서 직접 실행하는 실습 코드로 NLP Academy을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.

NLP Academy을(를) 시작하는 데 경험이 필요한가요?

사전 경험은 필요하지 않습니다. CoddyKit의 NLP Academy은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 2번째 강의입니다.

“바이그램과 트라이그램 설명” 강의는 얼마나 걸리나요?

대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.

이 NLP Academy 강의에서 코드를 작성하고 실행할 수 있나요?

네. 모든 NLP Academy 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.

이 강의의 모든 강의

  1. 단일 단어가 의미를 잃는 이유
  2. 바이그램과 트라이그램 설명
  3. scikit-learn의 N-그램 특성
  4. 알맞은 N-그램 범위 선택하기
← NLP Academy(으)로 돌아가기