cloudmersive/cloudmersive_nlp_api_client

2.1.0 2020-06-21 02:51 UTC

README

强大的自然语言处理API(v2)让您执行词性标注、实体识别、句子解析等操作,以帮助您理解非结构化文本的意义。

Cloudmersive NLP API 提供基于高级机器学习的自然语言处理技术,以检测文本内容中的语言、情感、意义和意图。

  • API版本:v1
  • 包版本:2.1.0

要求

PHP 5.5 及以上

安装与使用

Composer

要通过 Composer 安装绑定,请在 composer.json 中添加以下内容

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/cloudmersive/cloudmersive_nlp_api_client.git"
    }
  ],
  "require": {
    "cloudmersive/cloudmersive_nlp_api_client": "*@dev"
  }
}

然后运行 composer install

手动安装

下载文件并包含 autoload.php

    require_once('/path/to/cloudmersive_nlp_api_client/vendor/autoload.php');

测试

要运行单元测试

composer install
./vendor/bin/phpunit

入门指南

请按照 安装过程 进行操作,然后运行以下命令

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: Apikey
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Apikey', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Apikey', 'Bearer');

$apiInstance = new Swagger\Client\Api\AnalyticsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$input = new \Swagger\Client\Model\HateSpeechAnalysisRequest(); // \Swagger\Client\Model\HateSpeechAnalysisRequest | Input hate speech analysis request

try {
    $result = $apiInstance->analyticsHateSpeech($input);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AnalyticsApi->analyticsHateSpeech: ', $e->getMessage(), PHP_EOL;
}

?>

API端点文档

所有URI都相对于 https://api.cloudmersive.com

模型文档

授权文档

Apikey

  • 类型:API密钥
  • API密钥参数名:Apikey
  • 位置:HTTP头部

作者