nerdexam
Google

PROFESSIONAL-MACHINE-LEARNING-ENGINEER · Question #265

You are working on a prototype of a text classification model in a managed Vertex AI Workbench notebook. You want to quickly experiment with tokenizing text by using a Natural Language Toolkit…

The correct answer is D. Install the NLTK library from a Jupyter cell by using the !pip install nltk --user command. To quickly experiment with a new Python library like NLTK in a managed Vertex AI Workbench notebook, install it directly from a Jupyter cell.

Submitted by tunde_lagos· Apr 18, 2026Data processing and feature engineering

Question

You are working on a prototype of a text classification model in a managed Vertex AI Workbench notebook. You want to quickly experiment with tokenizing text by using a Natural Language Toolkit (NLTK) library. How should you add the library to your Jupyter kernel?

Options

  • AInstall the NLTK library from a terminal by using the pip install nltk command.
  • BWrite a custom Dataflow job that uses NLTK to tokenize your text and saves the output to Cloud
  • CCreate a new Vertex AI Workbench notebook with a custom image that includes the NLTK library.
  • DInstall the NLTK library from a Jupyter cell by using the !pip install nltk --user command.

How the community answered

(43 responses)
  • A
    2% (1)
  • B
    2% (1)
  • C
    7% (3)
  • D
    88% (38)

Why each option

To quickly experiment with a new Python library like NLTK in a managed Vertex AI Workbench notebook, install it directly from a Jupyter cell.

AInstall the NLTK library from a terminal by using the pip install nltk command.

Installing from a terminal is possible but less integrated for quick experimentation within the notebook's active kernel, and the `--user` flag is important for user-specific installations.

BWrite a custom Dataflow job that uses NLTK to tokenize your text and saves the output to Cloud

Writing a custom Dataflow job is a solution for large-scale data processing, not for quickly adding a library to a local notebook environment for prototyping.

CCreate a new Vertex AI Workbench notebook with a custom image that includes the NLTK library.

Creating a new custom image for a notebook is a more involved process suitable for complex, persistent dependencies or production environments, not for rapid, ad-hoc experimentation.

DInstall the NLTK library from a Jupyter cell by using the !pip install nltk --user command.Correct

Running `!pip install nltk --user` directly within a Jupyter cell in a Vertex AI Workbench notebook is the quickest and most convenient way to install a Python library for immediate use and experimentation without requiring environment restarts or custom image creation.

Concept tested: Managing Python packages in Jupyter notebooks

Source: https://cloud.google.com/vertex-ai/docs/workbench/managed/run-environment#install_custom_packages

Topics

#Vertex AI Workbench#Jupyter Notebooks#Python Package Management#NLTK

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-MACHINE-LEARNING-ENGINEER Practice