Skip to content

ReviewPulse v2.2.0 — Modular Package Refactor

Choose a tag to compare

@lfariabr lfariabr released this 03 May 18:24
· 128 commits to main since this release

ReviewPulse v2.2.0 — Modular Package Refactor

Release date: 2026-05-04

Summary

ReviewPulse v2.2.0 completes the modular package refactor track. The release keeps model behavior, thresholds, artifacts, output filenames, and the Streamlit app experience unchanged while moving major responsibilities out of legacy flat modules.

The public compatibility surface remains intact: existing commands such as python -m src.evaluate, python -m src.train, python -m src.train_bert, and imports from src.inference continue to work.

Highlights

  • Split data concerns into src.data:
    • src/data/parser.py
    • src/data/preprocess.py
    • src/data/features.py
  • Split tokenization concerns into src.tokenization:
    • src/tokenization/vocab.py
    • src/tokenization/sequence.py
    • src/tokenization/bert.py
  • Split model definitions into src.models:
    • src/models/baseline.py
    • src/models/bilstm.py
    • src/models/bert.py
  • Split training orchestration into src.training:
    • src/training/baseline.py
    • src/training/bilstm.py
    • src/training/bert.py
  • Split single-text inference into src.inference:
    • src/inference/loaders.py
    • src/inference/predictors.py
    • src/inference/registry.py
    • src/inference/api.py
  • Split batch evaluation into src.evaluation:
    • src/evaluation/metrics.py
    • src/evaluation/plots.py
    • src/evaluation/errors.py
    • src/evaluation/bilstm.py
    • src/evaluation/bert.py
    • src/evaluation/runner.py
  • Moved Streamlit service helpers to src/app/service.py.
  • Added or preserved compatibility wrappers for legacy import paths and CLI commands.
  • Updated submission checklist, README, and architecture documentation for the final modular layout.

Compatibility Wrappers Kept

The following wrappers remain to protect older imports and commands:

  • src/evaluate.py wraps src.evaluation and remains compatible with python -m src.evaluate.
  • src/inference.py and src/inference/__init__.py preserve the existing src.inference API.
  • src/baseline.py wraps src.training.baseline.
  • src/train.py wraps src.training.bilstm.
  • src/train_bert.py wraps src.training.bert.
  • src/parser.py wraps src.data.parser.
  • src/preprocess.py wraps src.data.preprocess.
  • src/features.py wraps src.data.features.
  • src/dataset.py and src/dataset_bert.py preserve legacy tokenization imports.
  • src/model.py and src/model_bert.py preserve legacy model imports.
  • src/app_service.py wraps src.app.service.

Behavior And Artifact Guarantees

No retraining is required from v2.1.0 to v2.2.0.

Unchanged:

  • Prediction threshold: 0.5
  • App command: streamlit run app.py
  • Baseline artifact: outputs/baseline.joblib
  • BiLSTM checkpoint: outputs/bilstm.pt
  • Vocabulary artifact: outputs/vocab.json
  • DistilBERT checkpoint: outputs/distilbert.pt
  • Evaluation output filenames under outputs/
  • Existing model metrics and checkpoint formats

DistilBERT remains integrated in the app. The only open DistilBERT deployment item is external checkpoint hosting, tracked in Issue #28.

Validation

Latest verified fast suite:

.venv/bin/python3 -m pytest tests/ -q -m "not slow"
# 204 passed, 5 deselected

Issue-specific validation was run during the modular refactor PRs:

.venv/bin/python3 -m pytest tests/test_inference.py tests/test_boundaries.py -q
.venv/bin/python3 -m pytest tests/test_evaluate.py tests/test_boundaries.py -q

Warnings observed locally:

  • UndefinedMetricWarning in small mocked DistilBERT evaluation tests where one class has no predicted samples.
  • PytestCacheWarning because .pytest_cache was not writable in the local execution environment.

Both warnings are non-blocking and unrelated to app behavior.

Related Pull Requests

  • #61 — data module refactor
  • #62 — tokenization module refactor
  • #63 — training package refactor
  • #64 — tests migrated to new import paths
  • #66 — inference package refactor
  • #67 — evaluation package refactor
  • #65 — final submission checklist

Known Follow-Ups

  • Issue #28: host large model checkpoints outside git for deployment.
  • Issue #59: remove compatibility wrappers when all consumers have moved to package-native imports.