Repository navigation
v0.2.1
Added
htmlsift --versionprints the htmlsift and Python versions and the installed backends: onnxruntime formini, torch and transformers forbase.drop_title=Trueinextract()and--drop-titlein the CLI leave out the page title that starts the content: the first selected line, when it comes from anh1–h6orpelement holding only that line and matches the page's<title>orog:title. Applies totext,htmlandmarkdown. 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 ofU+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.textoutput 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.minimemory 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 bareNo module named 'torch', and only after downloading the ~1 GB base bundle. It now raisesImportErrorbefore any download, naming the missing packages andpip install "htmlsift[full]". The CLI prints the same message.
Full changelog: v0.2.0...v0.2.1