定制 artstorm/monkeylearn-api 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

artstorm/monkeylearn-api

最新稳定版本:0.5

Composer 安装命令:

composer require artstorm/monkeylearn-api

包简介

MonkeyLearn API v2 client

README 文档

README

Build Status Scrutinizer Code Quality Scrutinizer Coverage Status StyleCI MIT licensed

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

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-09-05