dom-content-extraction-0.3.3 has been yanked.
dom-content-extraction
Rust implementation of Fei Sun, Dandan Song and Lejian Liao paper:
Content Extraction via Text Density (CETD)
use ;
let dtree = from_document; // &scraper::Html
let sorted_nodes = dtree.sorted_nodes;
let node_id = sorted_nodes.last.unwrap.node_id;
println!;
dtree.calculate_density_sum;
let extracted_content = dtree.extract_content;
println!
Add it it with:
or add to you Cargo.toml
dom-content-extraction = "0.3"
Run examples
Check examples.
This one will extract content from generated "lorem ipsum" page
There is scoring example i'm trying to implement scoring. You will need to download GoldenStandard and finalrun-input datasets from:
https://sigwac.org.uk/cleaneval/
and unpack archives into data/ directory.
As far as i see there is problem opening some files:
But overall extraction works pretty well:
Overall Performance:
Files processed: 370
Average Precision: 0.87
Average Recall: 0.82
Average F1 Score: 0.75
Desired features
- implement normal scoring
- create real world dataset