codag/alchemyapi-bundle

Symfony2 集成 AlchemyAPI 的 Bundle

安装量: 1,010

依赖关系: 0

建议者: 0

安全性: 0

星标: 2

关注者: 3

分支: 0

开放问题: 1

类型:symfony-bundle

v0.1.3 2014-12-25 15:11 UTC

This package is not auto-updated.

Last update: 2024-09-24 03:45:10 UTC


README

此 Bundle 为您的 Symfony2 项目提供 AlchemyAPI 集成。

Build Status Total Downloads Latest Stable Version

支持的 AlchemyAPI 方法

  • 作者提取
  • 概念标记
  • 内容抓取
  • 实体提取
    • WebAPI
  • 关键词提取
  • 语言检测
  • 微格式解析
  • RSS/ATOM
  • 关系提取
  • 情感分析
  • 文本分类
  • 文本提取

如果需要支持列表中未列出或尚未完成的方法,请提交一个 问题 或随时贡献!

安装

  1. 将 CodagAlchemyApiBundle 添加到您的 composer.json
  2. 启用该 Bundle
  3. 配置该 Bundle

步骤 1: 将 CodagAlchemyApiBundle 添加到您的 composer.json

{
    "require": {
        "codag/alchemyapi-bundle": "dev-master"
    }
}

更新项目依赖项

php composer.phar update codag/alchemyapi-bundle

步骤 2: 启用该 Bundle

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Codag\AlchemyApiBundle\CodagAlchemyApiBundle(),
    );
}

步骤 3: 配置该 Bundle

Yml 配置

# app/config/config.yml

codag_alchemy_api:
    api_key: 831370096236c6db90393a1d206010ffffffffff

用法

此 Bundle 提供服务 codag.alchemyapi

<?php
$alchemy = $this->get('codag.alchemyapi');

实体提取

HTML API

//TODO

文本 API

//TODO

Web API (URLGetRankedNamedEntities)

$alchemy = $this->alchemy;
$entityExtraction = $alchemy
    ->getEntityExtraction()
    ->getWeb();
$entityExtraction->setUrl($this->url);
$entityExtraction->setOutputMode('json');
$data = $entityExtraction->getData();

##贡献

如果 Bundle 无法让您自定义某个选项,我邀请您分支项目,创建功能分支,并提交拉取请求。

为了确保代码库的一致性,您应该确保代码遵循 编码标准

##许可

此 Bundle 在 MIT 许可下。查看完整的许可 此处