Skip to content

ReviewPulse v2.1.0 - Refactor Track

Choose a tag to compare

@lfariabr lfariabr released this 01 May 20:04
· 140 commits to main since this release

ReviewPulse v2.1.0 — Refactor Track

Release date: 2026-05-02

Summary

ReviewPulse v2.1.0 is the maintainability release after the v2.0.0 DistilBERT milestone.

The application behavior remains the same: users can compare TF-IDF + Logistic Regression, BiLSTM + GloVe, and DistilBERT from the Streamlit interface. The main change is architectural: the codebase now has clearer boundaries around config, inference, evaluation, DistilBERT checkpointing, app loading, documentation, and tests.

Highlights

  • Completed the #30-#39 refactor track.
  • Centralized shared constants in src/config.py.
  • Introduced predictor classes and registry-based inference dispatch in src/inference.py.
  • Added runtime predictor registration for future models.
  • Separated evaluation metric computation from PNG/CSV artifact writing.
  • Added compute_metrics() as a pure evaluation helper.
  • Split DistilBERT support into:
    • src/dataset_bert.py
    • src/checkpoint_bert.py
    • src/train_bert.py
  • Moved Streamlit model loading and availability logic into src/app_service.py.
  • Moved demo samples into src/utils/samples.py.
  • Added model artifact policy and DistilBERT model-card notes to docs/architecture.md.
  • Added config contract tests and module boundary tests.

Documentation Reorganization

Documentation was reorganized to make the project history easier to follow:

File Purpose
docs/issueBreakdown-phase1.md Original assessment delivery: setup through app/report/presentation
docs/issueBreakdown-phase2.md Completed refactor track: Issues #30-#39
docs/issueBreakdown-phase3.md Proposed modular package refactor plan
docs/assessment-files/ Presentation outline, individual report template, and demo test cases
docs/architecture.md Current system architecture, artifact policy, and model-card notes

The README was updated to match the current module layout, test counts, artifact policy, and app capabilities.

Validation

Validated on 2026-05-02:

pytest tests/ -q -m "not slow"
# 189 passed, 5 deselected

pytest tests/
# 194 passed

Warnings observed:

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

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

Architecture State

The code is substantially cleaner than v2.0.0:

  • app.py is now mostly UI.
  • src/app_service.py owns Streamlit model loading and availability policy.
  • src/inference.py owns single-text prediction and model registry behavior.
  • src/evaluate.py owns batch metrics, plots, and error analysis.
  • src/checkpoint_bert.py owns DistilBERT checkpoint save/load behavior.
  • src/dataset_bert.py owns DistilBERT tokenizer and DataLoader helpers.
  • src/config.py owns shared constants.

The remaining architectural debt is package organization: src/ is still flat. The next proposed refactor is documented in docs/issueBreakdown-phase3.md.

Known Follow-Ups

  • Issue #28 remains open for hosting outputs/distilbert.pt outside git.
  • Issue #20 remains open if the final submission package/checklist still needs to be created.
  • Issue #21 remains open even though DistilBERT functionality has landed; decide whether to close it as completed or keep it as a broader transformer tracking issue.

Upgrade Notes

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

Existing commands still work:

python -m src.baseline
python -m src.train
python -m src.train_bert
python -m src.evaluate
streamlit run app.py
pytest tests/