Metadata-Version: 2.4
Name: nlpkit14
Version: 0.3.0
Summary: Execute fourteen NLP practical programs with commented source and expected outputs
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: nltk<4,>=3.9
Requires-Dist: spacy<4,>=3.8
Requires-Dist: scikit-learn<2,>=1.5
Requires-Dist: requests<3,>=2.32
Requires-Dist: beautifulsoup4<5,>=4.12
Provides-Extra: models
Requires-Dist: torch<3,>=2.4; extra == "models"
Requires-Dist: transformers<5,>=4.45; extra == "models"
Requires-Dist: benepar<0.3,>=0.2.0; extra == "models"
Requires-Dist: sentencepiece<1,>=0.2; extra == "models"

# nlpkit14 0.3.0

Run the fourteen programs from the supplied IA1 question/code/output document.

```python
import nlpkit14 as n
n.q1()       # Actually runs question 1 and prints computed output
n.source(1)  # Shows the code, question and expected output as comments
n.questions()
```

Question numbers 1–7 are B1–B7. Numbers 8–14 are C1–C7. The question, expected output, and extra notes are comments in each bundled standalone Python program. Exercise calls print only the program's output. No expected-output text is substituted for model computation.

## Install and prepare online once

Install the shared wheel, then prepare the basic data and spaCy model:

```sh
python -m pip install ./nlpkit14-0.3.0-py3-none-any.whl
python -c "import nlpkit14 as n; n.setup()"
```

For all exercises, install the model extra and run the complete setup (large downloads):

```sh
python -m pip install './nlpkit14-0.3.0-py3-none-any.whl[models]'
python -c "import nlpkit14 as n; n.setup(models=True)"
```

This is a local release of the new nlpkit14 project, not yet uploaded to PyPI. Do not use pip install nlpkit14 until publication succeeds.

## Offline installation

On an internet-connected machine with the SAME OS, architecture and Python version as the offline machine, download the wheel and dependencies:

```sh
python -m pip download --dest wheelhouse './nlpkit14-0.3.0-py3-none-any.whl[models]'
```

Install and run setup online on that matching machine. Copy the wheelhouse, both installed spaCy model packages (or their installation wheels), and the full data/cache folder to the offline machine. Model data defaults to ~/.nlpkit14; set NLPKIT14_DATA before setup/import to choose a portable folder. Copying the entire prepared Python environment is platform specific; do not copy a Mac environment to Windows.

On the offline computer:

```sh
python -m pip install --no-index --find-links=wheelhouse nlpkit14==0.3.0
```

Install the spaCy model wheels from local storage too. Keep the copied data folder at ~/.nlpkit14 or point NLPKIT14_DATA to it. Model and dependency archives are not included in this small library wheel.

q8 fetches https://www.bnmit.org/ and requires internet even after setup. Other exercises can run without internet after all their requirements are installed. No downloads run implicitly from q1–q14. Missing packages/data raise their real installation errors rather than producing fake results.

## Output fidelity

The original algorithms and sample input are preserved. Downloads are moved to explicit setup. HTTP errors are checked. BERT uses evaluation mode and local cached model files. The raw Good–Turing demonstration is not a normalized probability estimator. The document's classifier fits its vocabulary before splitting and is an educational example, not an unbiased evaluation pipeline. Model outputs, parse trees, POS tags and similarity values can differ from the commented reference output. The document's B5 reference omits POS lines that the code actually prints. Read TEST_RESULTS.md for exactly which programs were executed.
