12个版本
0.3.4 | 2024年4月7日 |
---|---|
0.3.3 | 2021年2月24日 |
0.3.2 | 2020年12月25日 |
0.3.0 | 2020年5月10日 |
0.1.1 | 2018年3月17日 |
#301 in 算法
每月下载量:149
12KB
211 行
RAKE.rs
该库为Rust提供了快速自动关键词提取(RAKE)算法的多语言实现。
如何使用
- 将
rake
添加到Cargo.toml
的dependencies
中
rake = "0.3"
- 导入模块
use rake::*;
- 创建
Rake
结构体的新实例
let text = "a long text";
let sw = StopWords::from_file("path/to/stop_words_list.txt").unwrap();
let r = Rake::new(sw);
let keywords = r.run(text);
- 遍历关键词
keywords.iter().for_each(
|&KeywordScore {
ref keyword,
ref score,
}| println!("{}: {}", keyword, score),
);
依赖
~2.5–4MB
~76K SLoC