nocodeapidotnet/php_sdk
Composer 安装命令:
composer require nocodeapidotnet/php_sdk
包简介
Web-socket server with URI parse and multi-process support
关键字:
README 文档
README
Installation
Preferred way to install is with Composer.
perform command in shell
composer require nocodeapidotnet/php_sdk
OR
just add
"require": {
"nocodeapidotnet/php_sdk": ">=0.1"
}
to your projects composer.json.
Configure
use NoCodeApi\Client;
use NoCodeApi\ClientConfig;
$config = new ClientConfig($_ENV['NOCODEAPI_JWT_TOKEN']);
$this->client = new Client($config);
Key Phrase Extraction API
/** @var \NoCodeApi\Component\KeyPhrases $keyPhrases */
$keyPhrases = $this->client->getKeyPhrases("Now, as a nation, we don't promise equal outcomes, but we were founded on the idea everybody should have an equal opportunity to succeed. No matter who you are, what you look like, where you come from, you can make it. That's an essential promise.");
$keyPhrases->getKeyPhrases();
// Data returned by getKeyPhrases() method example
/**
[
{
"Text": "promise equal outcomes",
"Score": 8,
"BeginOffset": 27,
"EndOffset": 49
},
{
"Text": "equal opportunity",
"Score": 4.5,
"BeginOffset": 108,
"EndOffset": 125
},
{
"Text": "essential promise",
"Score": 4.5,
"BeginOffset": 229,
"EndOffset": 246
},
{
"Text": "nation",
"Score": 1,
"BeginOffset": 10,
"EndOffset": 16
},
{
"Text": "founded",
"Score": 1,
"BeginOffset": 63,
"EndOffset": 70
},
{
"Text": "idea",
"Score": 1,
"BeginOffset": 78,
"EndOffset": 82
},
{
"Text": "succeed",
"Score": 1,
"BeginOffset": 129,
"EndOffset": 136
},
{
"Text": "matter",
"Score": 1,
"BeginOffset": 141,
"EndOffset": 147
},
{
"Text": "make",
"Score": 1,
"BeginOffset": 210,
"EndOffset": 214
},
{
"Text": "america",
"Score": 1,
"BeginOffset": false,
"EndOffset": 7
},
{
"Text": "start",
"Score": 1,
"BeginOffset": 269,
"EndOffset": 274
},
{
"Text": "determine",
"Score": 1,
"BeginOffset": 286,
"EndOffset": 295
},
{
"Text": "end",
"Score": 1,
"BeginOffset": 306,
"EndOffset": 309
},
{
"Text": "read",
"Score": 1,
"BeginOffset": false,
"EndOffset": 4
}
]
**/
Language Detection API
/** @var NoCodeApi\Entity\Language $lang */
$lang = $this->client->getLanguageDetection('Policjanci otrzymali zgłoszenie w tej sprawie po godz 9. Do wypadku doszło na ul. Kolonia Krakowskie Przedmieście.');
$lang->getLanguageCode(); // pl
$lang->getLanguage(); // Poland
$lang->getScore(); // 1
Sentiment Analysis API
/** @var NoCodeApi\Component\Emotions $emotions */
$emotions = $this->client->getEmotions('Genuine leather is the best production for bags imho, but I would not recommend this particular product.');
$emotions->getPositive(); // 0.12
$emotions->getNegative(); // 0.14
$emotions->getNeutral(); // 9.74
$emotions->getMixed(); // 9.97
Custom classification API
// Create by adding classification text and it's label
$this->client->createClassification('foo_bar_baz', 'It was actually different, but the most profitable part was at start'); // true/false
// Update
$this->client->updateClassification('foo_bar_baz', 'It was actually different, but the most profitable part was at start and in the end of a journey'); // true/false
// Classify the text
/** @var NoCodeApi\Entity\Classification $classification */
$classification = $this->client->getClassification('profitable part');
$classification->getLabel(); // getting the label of that successfully classified text
// Deleting classification
$this->client->deleteClassification('foo_bar_baz'); // true/false
Named Entity Recognition
$namedEntities = $this->client->getNamedEntities('Linus Torvalds is one of the best programmers in USA, Finland Helsinki and in the world');
$namedEntities->getEntitiesCount(); // 3
$namedEntities->getNamedEntities();
/**
[
[
"Text" => "Linus Torvalds",
"Label" => "PERSON"
],
[
"Text" => "USA",
"Label" => "GPE"
],
[
"Text" => "Finland Helsinki",
"Label" => "GPE"
],
]
**/
nocodeapidotnet/php_sdk 适用场景与选型建议
nocodeapidotnet/php_sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 8 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 03 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「sdk」 「no code api」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 nocodeapidotnet/php_sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 nocodeapidotnet/php_sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 nocodeapidotnet/php_sdk 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Memio's PrettyPrinter, used to generate PHP code from given Model
Promotional Codes Generator for Laravel 5.1
Zend Captcha bundle
Base Skeleton for Laravel Application
Alfabank REST API integration
Statistic of code usage inspired by Laravel Stats
统计信息
- 总下载量: 8
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-03-17