Crate summary

Source
Expand description

Extract the sentences which best summarize a document.

The algorithm uses a heuristic which identifies a “core” sentence based on tf-idf cosine distance to the document at large, and then gathers all sentences that have small cosine distances to the “core” sentence.

§Example

let summarizer = Summarizer::new(Language::English);
let text = "See Spot. See Spot run. Run Spot, run!";
let n = 2.try_into().unwrap();
for sentence in summarizer.summarize_sentences(text, n) {
    println!("{sentence}");
}

Structs§

Summarizer
Document summarizer.

Enums§

Language
A document’s language.