Crate bosonnlp [] [src]

BosonNLP SDK for Rust

安装

Cargo.toml 增加如下内容:

[dependencies]
bosonnlp = "0.2"

使用教程

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(&vec!["这家味道还不错".to_owned()], "food").unwrap();
    assert_eq!(1, rs.len());
}

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

Modules

task

Structs

BosonNLP

BosonNLP REST API 访问的封装

ClusterContent

聚类任务单个输入内容

CommentsCluster

典型意见

ConvertedTime

时间转换结果

Dependency

依存文法

NamedEntity

命名实体

Tag

词性标注

TaskPushResp

聚类任务提交响应

TaskStatusResp

聚类任务状态响应

TextCluster

文本聚类

Enums

ErrorKind

The kind of an error.

TaskStatus

聚类任务状态

Traits

IntoClusterInput

将其他类型转换成聚类需要的数据类型

Type Definitions

Result

Convenient wrapper around std::Result.