Improve page text extraction
Categories
(Core :: Machine Learning: General, enhancement)
Tracking
()
People
(Reporter: tarek, Unassigned)
References
Details
(Whiteboard: [genai])
The current Readability lib in Firefox will extract text that includes headers and footers, which leads to a lot of noise when you want to perform inference on the web page
example (try reader mode) : https://edition.cnn.com/2023/09/27/australia/australia-seismic-blasting-whales-climate-intl-hnk/index.html
let's see if we can improve this
prior art: https://github.com/mozilla/fathom
| Reporter | ||
Comment 1•2 years ago
|
||
| Reporter | ||
Comment 2•2 years ago
•
|
||
Looks like CNN implements the article schema markup.
this snippet works on that page to extract the textual content:
const jsonLdScripts = document.querySelectorAll('script[type="application/ld+json"]');
jsonLdScripts.forEach(script => {
try {
const data = JSON.parse(script.innerText);
console.log(data["articleBody"]);
} catch (error) {
//
}
});
I suppose this could be leveraged by Readability to remove the clutter, as any text not in this article body should probably not be displayed.
| Reporter | ||
Comment 3•2 years ago
|
||
Readability is already parsing that structure but does not grab that specific field in its metadata
Updated•2 years ago
|
Updated•2 years ago
|
Comment 4•7 months ago
|
||
We have the page extractor component now, let's track work there.
Description
•