Skip to main content

NLP Lab Experiments

Notebook-ready implementations of the seven complete NLP lab programs supplied in the lab manual. The examples are adapted to run in Jupyter Notebook and Google Colab, with malformed indentation and syntax corrected and code comments removed from the inserted programs.

Install the plnlab distribution; the Python import name remains NLP.

Install

pip install plnlab

Use in Jupyter or Google Colab

%pip install plnlab
import NLP
NLP.p1()

Run the setup and call in one cell. Calling p1() replaces that cell's input with the program source. Review and run the replacement cell yourself. The package checks and installs the known third-party dependency needed by that experiment when it is missing. It does not install packages during import or run the program automatically.

When NLP.p1() runs, the package sends a frontend delete-cell request for the cell immediately above the current cell, regardless of that cell's contents, before replacing the current cell. This uses the notebook frontend in the same way that cell insertion uses IPython's frontend hooks; support depends on the frontend exposing its notebook cell model. Keep only the launcher cell above the call when using this cleanup behavior.

Programs

Call Program
NLP.p1() Text preprocessing: tokenization, filtration, script validation, stop-word removal, and stemming
NLP.p2() Unigram, bigram, and trigram probability estimates
NLP.p3() Minimum edit distance with test cases and a dynamic-programming table
NLP.p4() Top-down and bottom-up parsing from a context-free grammar
NLP.p5() Add-one-smoothed Naive Bayes movie-review classification
NLP.p6() NLTK corpora, custom corpus, frequency distributions, POS tags, dictionaries, and word segmentation
NLP.p7() WordNet synonyms and antonyms for “active”

The manual includes an eighth experiment prompt about low-resource machine translation, but it does not include a corresponding program listing. This release contains the seven program listings that were provided.

Release

Build distributions from this directory:

python -m build

Upload using a PyPI API token stored in the PYPI_API_TOKEN environment variable:

TWINE_USERNAME=__token__ TWINE_PASSWORD="$PYPI_API_TOKEN" python -m twine upload dist/*

Do not put the token in source code, notebook cells, or shell history.

Release files for plnlab 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for plnlab 0.1.3
File Size Uploaded
plnlab-0.1.3.tar.gz 10.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for plnlab 0.1.3
File Interpreter ABI Platform
plnlab-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 20.8 kB

Release files / plnlab-0.1.3.tar.gz

Download URL plnlab-0.1.3.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
47cb27f232b96935ed5a961227139bdb3f4ca9f2214f7705967e1fdd9725d8fe
BLAKE2b-256 checksum
How to use checksums
a6086abf492147b8ac5999c2b7a538bbf2936c755b9e1a96e685f684bc9a5d12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.11

Release files / plnlab-0.1.3-py3-none-any.whl

Download URL plnlab-0.1.3-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4262cb4bfa912e861d2d0db1a3682c5b824217c5f01fbd360fb1be0ce57df0cd
BLAKE2b-256 checksum
How to use checksums
27055be237902c6bacf1f2381af3fa54bebe4f3b3ce1e3a382a3366cd0d6482c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.11

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page