2个版本

0.4.1 2022年11月24日
0.4.0 2022年11月20日

#455 in 机器学习

Apache-2.0

20KB
356

gorse-rs

CI Crates.io

Rust推荐系统gorse的SDK

安装

[dependencies]
gorse_rs = "0.4.1"

用法

  • 使用异步客户端
use gorse_rs::{Feedback, Gorse};

let client = Gorse::new("http://127.0.0.1:8087", "api_key");

let feedback = vec![
    Feedback::new("star", "bob", "vuejs:vue", "2022-02-24"),
    Feedback::new("star", "bob", "d3:d3", "2022-02-25"),
    Feedback::new("star", "bob", "dogfalo:materialize", "2022-02-26"),
    Feedback::new("star", "bob", "mozilla:pdf.js", "2022-02-27"),
    Feedback::new("star", "bob", "moment:moment", "2022-02-28")
];
client.insert_feedback(&feedback).await;

client.get_recommend("100").await;
  • 使用阻塞客户端
use gorse_rs::Feedback;
use gorse_rs::blocking::Gorse;

let client = Gorse::new("http://127.0.0.1:8087", "api_key");

let feedback = vec![
    Feedback::new("star", "bob", "vuejs:vue", "2022-02-24"),
    Feedback::new("star", "bob", "d3:d3", "2022-02-25"),
    Feedback::new("star", "bob", "dogfalo:materialize", "2022-02-26"),
    Feedback::new("star", "bob", "mozilla:pdf.js", "2022-02-27"),
    Feedback::new("star", "bob", "moment:moment", "2022-02-28")
];
client.insert_feedback(&feedback);

client.get_recommend("100");

依赖项

~4–16MB
~241K SLoC