2017 © Pedro Peláez
 

library dandelion-php

image

giulioprinaricotti/dandelion-php

  • Sunday, February 18, 2018
  • by giulioprinaricotti
  • Repository
  • 1 Watchers
  • 0 Stars
  • 53 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

dandelion-php

Unofficial Dandelion Swagger API definition, (*1)

This PHP package is automatically generated by the Swagger Codegen project:, (*2)

  • API version: 0.0.1
  • Build package: io.swagger.codegen.languages.PhpClientCodegen

Requirements

PHP 5.4.0 and later, (*3)

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:, (*4)

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/giulioprinaricotti/dandelion-php.git"
    }
  ],
  "require": {
    "giulioprinaricotti/dandelion-php": "*@dev"
  }
}

Then run composer install, (*5)

Manual Installation

Download the files and include autoload.php:, (*6)

    require_once('/path/to/dandelion-php/autoload.php');

Tests

To run the unit tests:, (*7)

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:, (*8)

setApiKey('token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// DandelionPHP\Configuration::getDefaultConfiguration()->setApiKeyPrefix('token', 'Bearer');

$api_instance = new DandelionPHP\Api\DefaultApi();
$text = "text_example"; // string | use \"text\" when you have plain text that doesn't need any pre-processing
$include = "include_example"; // string | Returns more information on annotated entities: \"types\" adds type information from DBpedia or dandelion. DBpedia types are extracted based on the lang parameter (e.g. if lang=en, types are extracted from DBpedia english). Please notice that different DBpedia instances may contain different types for the same resource; \"categories\" adds category information from DBpedia/Wikipedia; \"abstract\" adds the text of the Wikipedia abstract; \"image\" adds a link to an image depicting the tagged entity, as well as a link to the image thumbnail, served by Wikipedia. Please check the licensing terms of each image on Wikipedia before using it in your app; \"lod\" adds links to equivalent (sameAs) entities in Linked Open Data repositories or other websites. It currently only supports DBpedia and Wikipedia; \"alternate_labels\" adds some other names used when referring to the entity.
$lang = "lang_example"; // string | The language of the text to be annotated; currently English, French, German, Italian and Portuguese are supported. Leave this parameter out to let the Entity Extraction API automatically detect the language for you.
$country = "country_example"; // string | This parameter specifies the country which we assume VAT and telephone numbers to be coming from. This is important to get correct results, as different countries may adopt different formats.
$top_entities = 56; // int | The number of most important entities that must be included in the response.

try {
    $result = $api_instance->getEntitiesFromText($text, $include, $lang, $country, $top_entities);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->getEntitiesFromText: ', $e->getMessage(), PHP_EOL;
}

?>

Documentation for API Endpoints

All URIs are relative to https://api.dandelion.eu/datatxt, (*9)

Class Method HTTP request Description
DefaultApi getEntitiesFromText GET /nex/v1 Entity Extraction
DefaultApi getSentiment GET /sent/v1

Documentation For Models

Documentation For Authorization

api_key

  • Type: API key
  • API key parameter name: token
  • Location: URL query string

Author

g.prinaricotti@gmail.com, (*10)

The Versions

18/02 2018

dev-master

9999999-dev http://swagger.io

  Sources   Download

proprietary

The Requires

  • php >=5.4
  • ext-curl *
  • ext-json *
  • ext-mbstring *

 

The Development Requires

api php swagger sdk