1. 학습
  2. /
  3. 강의
  4. /
  5. spaCy로 배우는 Advanced NLP

Connected

연습 문제

Vocab, 해시와 렉심

왜 이 코드에서 오류가 발생할까요?

from spacy.lang.en import English
from spacy.lang.de import German

# Create an English and German nlp object
nlp = English()
nlp_de = German()
# Get the ID for the string 'Bowie'
bowie_id = nlp.vocab.strings['Bowie']
print(bowie_id)

# Look up the ID for 'Bowie' in the vocab
print(nlp_de.vocab.strings[bowie_id])

English 언어 클래스는 이미 nlp 객체로 제공되어 있어요.

지침

50 XP

가능한 답변