artstorm/monkeylearn-api
最新稳定版本:0.5
Composer 安装命令:
composer require artstorm/monkeylearn-api
包简介
MonkeyLearn API v2 client
关键字:
README 文档
README
An easy to use client to consume MonkeyLearn API v2 with PHP.
Install
Via Composer
$ composer require artstorm/monkeylearn-api
Requirements
- PHP >= 5.4.0.
- PHP Curl.
Basic usage of MonkeyLearn API PHP Client
$token = 'monkeylearn-api-token'; $client = new Artstorm\MonkeyLearn\Client($token); $textToClassify = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'; $module = 'module_id'; $response = $client->classification->classify($textToClassify, $module); print_r($response->result());
Debug and Sandbox
MonkeyLearn has a Sandbox mode that can be used for custom modules. There is
also an option to include debug data in the responses. These options can be
enabled with the methods Client::sandbox() and Client::debug(). The methods
are chainable.
$response = $client->sandbox()->classification->classify($text, $module); $response = $client->debug()->classification->classify($text, $module); $response = $client->sandbox()->debug()->classification->classify($text, $module);
Query Limits
To find out current query limits with MonkeyLearn API, that information is available in the response object.
$response = $client->classification->classify($text, $module); $limits = $response->limits();
License
The library is open-sourced software licensed under the MIT license.
统计信息
- 总下载量: 38
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-09-05