Closed Bug 1882524 Opened 2 years ago Closed 7 months ago

Improve page text extraction

Categories

(Core :: Machine Learning: General, enhancement)

enhancement

Tracking

()

RESOLVED DUPLICATE of bug 1990609

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

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.

Readability is already parsing that structure but does not grab that specific field in its metadata

added https://github.com/mozilla/readability/issues/846

Whiteboard: [genai]

We have the page extractor component now, let's track work there.

Status: NEW → RESOLVED
Closed: 7 months ago
Duplicate of bug: page-extractor
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.