Skip to content

bitermplus: v0.11.0

Latest

Choose a tag to compare

@maximtrp maximtrp released this 26 May 13:30
1724d7f

Bug fixes

  • Coherence: last document's words were silently skipped due to a wrong boundary (w_rj = W
    instead of n_dw.indptr[d+1]). Could also cause out-of-bounds memory access when vocabulary size
    exceeded total non-zeros. Now correct for all documents.
  • BTMClassifier mixed-case input: documents with capital letters or punctuation produced
    all-zero topic vectors because raw whitespace splitting did not match the lowercased,
    token-pattern-filtered vocabulary. fit() and transform() now tokenize via the fitted
    CountVectorizer's analyzer.
  • set_params(vectorizer_params=None): crashed on the next fit() with TypeError. The
    constructor no longer rewrites None to {}.
  • BTM.transform(): invalid infer_type now raises ValueError listing valid options instead
    of silently producing a memoryview assignment error.
  • seed=0: previously fell back to time(NULL) (second-level granularity, so two models
    created in the same second got identical seeds). Now uses OS entropy via
    np.random.default_rng(None).

Performance

  • Coherence: removed a redundant inner loop that re-ran the same idempotent check M times per
    word. ~20× faster on the coherence hot path with default M=20.

API

  • BTMClassifier.fit() and fit_transform() now accept a verbose parameter (default False).
    Previously the tqdm progress bar was hardcoded on with no way to suppress it. Note: training is
    now silent by default; pass verbose=True to restore the progress bar.

Internal

  • Removed dead code (_parse_words in get_vectorized_docs, unused time cimport).
  • Added regression tests for the coherence boundary, mixed-case input,
    set_params(vectorizer_params=None), and invalid infer_type.

Full Changelog: v0.10.0...v0.11.0