Skip to content

v0.2.1

Choose a tag to compare

@koivualeksi koivualeksi released this 08 Nov 20:11
· 21 commits to main since this release
1b63347

Added

  • htmlsift --version prints the htmlsift and Python versions and the installed backends: onnxruntime for mini, torch and transformers for base.
  • drop_title=True in extract() and --drop-title in the CLI leave out the page title that starts the content: the first selected line, when it comes from an h1–h6 or p element holding only that line and matches the page's <title> or og:title. Applies to text, html and markdown. Off by default.

Changed

  • With w3lib 2.6 or newer, the five bytes windows-1252 leaves undefined (0x81, 0x8D, 0x8F, 0x90, 0x9D) decode to C1 control characters, as in browsers, instead of U+FFFD.
  • output="text" (the default) returns plain text, as documented. Heading #, emphasis, inline-code and strikethrough markers, > quote prefixes, * * * rules and code-fence lines are no longer in it; list bullets, ordered-list numbers and table rows stay. Literal #, *, _ or | in the page text are kept. The selected content is the same as in 0.2.0, and the model input and predictions are unchanged.
  • text output renders the page a second time, without markers: about 3 ms per page more on one CPU core (mini, measured on CommonCrawl pages).
  • The lines as the model scored them, markers included, are still available through with_blocks=True.

Fixed

  • output="text" no longer contains lines made only of invisible characters (zero-width spaces and joiners, byte order marks, soft hyphens, control characters), which pages use as spacers.
  • mini memory on very long pages. The embedding step no longer grows with page length (a 3M-token page peaked at 39 GB, now 1.2 GB), and pages estimated above 100 MB hand their memory back to the system when they finish instead of keeping it for the life of the process. Output is unchanged; model time is about 15 % lower on CommonCrawl pages.
  • mode="base" without torch or transformers installed raised a bare No module named 'torch', and only after downloading the ~1 GB base bundle. It now raises ImportError before any download, naming the missing packages and pip install "htmlsift[full]". The CLI prints the same message.

Full changelog: v0.2.0...v0.2.1