Skip to main content

Crate keywords

Crate keywords 

Source
Expand description

Keyword extraction for English and Japanese text.

rsc scans a text and returns the keywords it contains, each carrying a score. English is matched by pattern; Japanese is tokenised with mecab first so that terms are found on word boundaries rather than by substring search.

use keywords::rsc::{extract_keywords, load_keywords, Language};

let text = "Large Language Models improved Text Summarization.";
let found = extract_keywords(text, load_keywords(), Language::English);
let total: isize = found.iter().map(|k| k.score).sum();

A database of 1,864 terms is embedded in the crate; rsc::load_keywords_from_rsc loads your own instead. The first Japanese tokenisation downloads a MeCab dictionary (about 66 MB) to ~/.mecab/dic/ and caches it there.

Modulesยง

mecab
rsc