spaCy로 엔터티 추출하기
엔터티와 해당 라벨을 나열합니다
spaCy로 엔터티 추출하기은(는) CoddyKit의 무료 NLP Academy 강의입니다. 이것은 4개 중 2번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 NLP Academy 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. NLP Academy 강의에는 총 4개의 강의가 포함되어 있습니다.
이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.
spaCy Does the Work
spaCy ships a trained NER component that finds entities for you. You feed it text and read back labeled spans. 🐍
Load a Model
First load a pipeline that includes NER. The small English model en_core_web_sm is a quick, friendly starting point.
import spacy
nlp = spacy.load("en_core_web_sm")Process Your Text
Pass a string into the pipeline to get a Doc object. The Doc holds tokens, sentences, and the entities spaCy found.
doc = nlp("Sundar Pichai leads Google in California.")The ents Property
Every Doc exposes doc.ents, a tuple of detected entities. Loop over it to inspect each one individually.
for ent in doc.ents:
print(ent)Read the Text
Each entity has a .text attribute holding the exact words matched. This is the raw span lifted from your sentence.
print(ent.text) # e.g. Sundar PichaiRead the Label
Use .label_ (with the trailing underscore) to get a readable label string like PERSON, ORG, or GPE.
print(ent.label_) # e.g. PERSONPutting It Together
One small loop prints both the text and label of every entity, turning a sentence into clean structured data.
for ent in doc.ents:
print(ent.text, ent.label_)Character Positions
Entities also expose start_char and end_char, the offsets in the original string. Handy for highlighting matches later.
print(ent.start_char, ent.end_char)Explain a Label
Forgot what GPE means? Call spacy.explain for a plain-English description of any entity label.
spacy.explain("GPE") # 'Countries, cities, states'Entities Are Spans
Each entity is a Span, a slice of the Doc. So it behaves like a mini-document you can further inspect token by token.
Collect Into a List
A quick comprehension gathers every entity into a list of tuples, ready to save, count, or feed into a report.
results = [(e.text, e.label_) for e in doc.ents]Quick Check
Which attribute gives the readable entity label?
Recap
Load a model, run nlp() on text, then loop doc.ents reading .text and .label_. That is core NER in spaCy. ✅
자주 묻는 질문
“spaCy로 엔터티 추출하기” 강의는 무료인가요?
네 — “spaCy로 엔터티 추출하기” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 NLP Academy 강의 전체를 잠금 해제할 수 있습니다. NLP Academy 강의에는 총 4개의 강의가 포함되어 있습니다.
“spaCy로 엔터티 추출하기”에서 뭘 배우나요?
엔터티와 해당 라벨을 나열합니다 브라우저에서 직접 실행하는 실습 코드로 NLP Academy을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.
NLP Academy을(를) 시작하는 데 경험이 필요한가요?
사전 경험은 필요하지 않습니다. CoddyKit의 NLP Academy은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 2번째 강의입니다.
“spaCy로 엔터티 추출하기” 강의는 얼마나 걸리나요?
대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.
이 NLP Academy 강의에서 코드를 작성하고 실행할 수 있나요?
네. 모든 NLP Academy 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.
이 강의의 모든 강의
- 엔터티로 간주되는 것은 무엇일까요?
- spaCy로 엔터티 추출하기
- displaCy로 엔터티 시각화하기
- 사용자 지정 엔터티 규칙 추가하기