0
0
NLPml~10 mins

spaCy installation and models in NLP - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to install spaCy using pip.

NLP
pip [1] spacy
Drag options to blanks, or click blank then click option'
Alist
Binstall
Cremove
Dupdate
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'pip update spacy' which is not the correct command to install.
Using 'pip remove spacy' which uninstalls the package.
2fill in blank
medium

Complete the code to download the English small model for spaCy.

NLP
python -m spacy [1] en_core_web_sm
Drag options to blanks, or click blank then click option'
Aremove
Binstall
Cupdate
Ddownload
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'install' instead of 'download' for spaCy models.
Trying to use pip to install the model directly.
3fill in blank
hard

Fix the error in the code to load the spaCy English model.

NLP
import spacy
nlp = spacy.[1]('en_core_web_sm')
Drag options to blanks, or click blank then click option'
Ainstall
Bdownload
Cload
Drun
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'download' or 'install' instead of 'load' in code.
Trying to run the model as a function.
4fill in blank
hard

Fill both blanks to create a spaCy pipeline and process text.

NLP
import spacy
nlp = spacy.[1]('en_core_web_sm')
doc = nlp([2])
Drag options to blanks, or click blank then click option'
Aload
B'Hello world!'
C'This is a test.'
Ddownload
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'download' instead of 'load' to get the model.
Passing a variable name instead of a string to the model.
5fill in blank
hard

Fill all three blanks to extract tokens from text using spaCy.

NLP
import spacy
nlp = spacy.[1]('en_core_web_sm')
doc = nlp([2])
tokens = [token.[3] for token in doc]
Drag options to blanks, or click blank then click option'
Aload
B'Natural Language Processing is fun!'
Ctext
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'download' instead of 'load'.
Passing a variable name instead of a string.
Using 'token' instead of 'token.text' to get token strings.