25 releases

Uses old Rust 2015

0.10.3 Jan 6, 2021
0.10.2 Dec 31, 2019
0.10.1 Nov 22, 2018
0.9.0 Mar 23, 2018
0.2.4 Mar 17, 2016

#578 in Machine learning

Download history 40/week @ 2024-03-30 13/week @ 2024-04-06

65 downloads per month

MIT license

35KB
577 lines

bosonnlp-rs

Build Status Coverage Status Crates.io docs.rs

BosonNLP SDK for Rust

Installation

Add it to your Cargo.toml:

[dependencies]
bosonnlp = "0.10"

Add extern crate bosonnlp to your crate root and your're good to go!

Build

$ cargo build --release

Test

First you need to export a shell variable called BOSON_API_TOKEN and then run:

$ cargo test

License

This work is released under the MIT license. A copy of the license is provided in the LICENSE file.


lib.rs:

BosonNLP SDK for Rust

安装

Cargo.toml 增加如下内容:

[dependencies]
bosonnlp = "0.10"

使用教程

API Token 申请请访问 http://bosonnlp.com

extern crate bosonnlp;

use bosonnlp::BosonNLP;

fn main() {
    let nlp = BosonNLP::new(env!("BOSON_API_TOKEN"));
    let rs = nlp.sentiment(&["这家味道还不错"], "food").unwrap();
    assert_eq!(1, rs.len());
}

可以在 BosonNLP 文档网站 阅读详细的 BosonNLP REST API 文档。

Dependencies

~5–20MB
~282K SLoC