lsmonki/php-open-calais 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

lsmonki/php-open-calais

Composer 安装命令:

composer require lsmonki/php-open-calais

包简介

A PHP class for extracting entities and social tags from documents with the OpenCalais API http://www.opencalais.com/

README 文档

README

Open Calais Tags is a PHP class for extracting entities and tags from text using Open Calais. Calais performs semantic analysis of the text, using natural language processing to identify concepts like people, companies and technologies discussed in the text. These are especially useful for suggesting tags for your content such as website articles or blog posts. You could even automatically tag archived content that would take days to go through manually.

Calais is free for both personal and commercial use, and usage of this class requires a Calais API key. Getting an API key is an easy, automated process. Just click the "Request API Key" link at the top of their site.

Install via composer

Edit your composer.json file to include the following:

{
    "require": {
        "lsmonki/php-open-calais": "2.x"
    }
}

Usage

Basic usage is simple. Create an instance of the class with your API key, and call the getEntities method using your content string.

$oc = new \OpenCalais\OpenCalais('your-api-key');
$entities = $oc->getEntities($content);

Example input

April 7 (Bloomberg) . Yahoo! Inc., the Internet company that snubbed a $44.6 billion takeover bid from Microsoft Corp., may drop in Nasdaq trading after the software maker threatened to cut its bid if directors fail to give in soon. If Yahoo.s directors refuse to negotiate a deal within three weeks, Microsoft plans to nominate a board slate and take its case to investors, Chief Executive Officer Steve Ballmer said April 5 in a statement. He suggested the deal.s value might decline if Microsoft has to take those steps. The ultimatum may send Yahoo Chief Executive Officer Jerry Yang scrambling to find an appealing alternative for investors to avoid succumbing to Microsoft, whose bid was a 62 percent premium to Yahoo.s stock price at the time. The deadline shows Microsoft is in a hurry to take on Google Inc., which dominates in Internet search, said analysts including Canaccord Adams.s Colin Gillis.

Example output

Array
(
    [topics] => Array
        (
            [0] => Business_Finance
            [1] => Technology_Internet
        )

    [socialTag] => Array
        (
            [0] => Alibaba Group
            [1] => World Wide Web
            [2] => Yahoo!
            [3] => Steve Ballmer
            [4] => Microsoft
            [5] => Ballmer
            [6] => Jerry Yang
            [7] => Canaccord Genuity
        )

    [entities] => Array
        (
            [IndustryTerm] => Array
                (
                    [0] => software maker
                    [1] => Internet search
                    [2] => Internet
                )

            [Company] => Array
                (
                    [0] => Canaccord Adams
                    [1] => Yahoo
                    [2] => Google Inc.
                    [3] => Yahoo! Inc.
                    [4] => Microsoft Corp.
                )

            [Person] => Array
                (
                    [0] => Colin Gillis
                    [1] => Steve Ballmer
                    [2] => Jerry Yang
                )

            [Position] => Array
                (
                    [0] => Chief Executive Officer
                )

        )

)

Optional Settings

A number of settings exist which can be changed through public properties of the OpenCalais object: contentType (default: text/html), outputFormat (default: application/json). Refer to the OpenCalais documentation for more information.

This code is distributed under the MIT license. See http://www.opensource.org/licenses/mit-license.php

lsmonki/php-open-calais 适用场景与选型建议

lsmonki/php-open-calais 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 12.64k 次下载、GitHub Stars 达 3, 最近一次更新时间为 2015 年 12 月 28 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「metadata」 「semantic」 「opencalais」 「open calais」 「semantic analysis」 「semantic data」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 lsmonki/php-open-calais 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 lsmonki/php-open-calais 我们能提供哪些服务?
定制开发 / 二次开发

基于 lsmonki/php-open-calais 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 12.64k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 31
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 19
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-12-28