Unofficial Dandelion Swagger API definition
This PHP package is automatically generated by the Swagger Codegen project:
- API version: 0.0.1
- Build package: io.swagger.codegen.languages.PhpClientCodegen
PHP 5.4.0 and later
To install the bindings via Composer, add the following to composer.json
:
{
"repositories": [
{
"type": "git",
"url": "https://github.com/giulioprinaricotti/dandelion-php.git"
}
],
"require": {
"giulioprinaricotti/dandelion-php": "*@dev"
}
}
Then run composer install
Download the files and include autoload.php
:
require_once('/path/to/dandelion-php/autoload.php');
To run the unit tests:
composer install
./vendor/bin/phpunit
Please follow the installation procedure and then run the following:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: api_key
DandelionPHP\Configuration::getDefaultConfiguration()->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;
}
?>
All URIs are relative to https://api.dandelion.eu/datatxt
Class | Method | HTTP request | Description |
---|---|---|---|
DefaultApi | getEntitiesFromText | GET /nex/v1 | Entity Extraction |
DefaultApi | getSentiment | GET /sent/v1 |
- ApiResponseError
- EntityExtractionResponse
- EntityExtractionResponseAnnotation
- EntityExtractionResponseAnnotationLod
- EntityExtractionResponseTopEntity
- Type: API key
- API key parameter name: token
- Location: URL query string