The powerful Natural Language Processing APIs (v2) let you perform part of speech tagging, entity identification, sentence parsing, and much more to help you understand the meaning of unstructured text.
Cloudmersive NLP API provides advanced machine learning-based natural language processing to detect language, sentiment, meaning and intent of text content.
- API version: v1
- Package version: 2.1.0
PHP 5.5 and later
To install the bindings via Composer, add the following to composer.json
:
{
"repositories": [
{
"type": "git",
"url": "https://github.com/cloudmersive/cloudmersive_nlp_api_client.git"
}
],
"require": {
"cloudmersive/cloudmersive_nlp_api_client": "*@dev"
}
}
Then run composer install
Download the files and include autoload.php
:
require_once('/path/to/cloudmersive_nlp_api_client/vendor/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: Apikey
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Apikey', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Apikey', 'Bearer');
$apiInstance = new Swagger\Client\Api\AnalyticsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$input = new \Swagger\Client\Model\HateSpeechAnalysisRequest(); // \Swagger\Client\Model\HateSpeechAnalysisRequest | Input hate speech analysis request
try {
$result = $apiInstance->analyticsHateSpeech($input);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AnalyticsApi->analyticsHateSpeech: ', $e->getMessage(), PHP_EOL;
}
?>
All URIs are relative to https://api.cloudmersive.com
Class | Method | HTTP request | Description |
---|---|---|---|
AnalyticsApi | analyticsHateSpeech | POST /nlp-v2/analytics/hate-speech | Perform Hate Speech Analysis and Detection on Text |
AnalyticsApi | analyticsProfanity | POST /nlp-v2/analytics/profanity | Perform Profanity and Obscene Language Analysis and Detection on Text |
AnalyticsApi | analyticsSentiment | POST /nlp-v2/analytics/sentiment | Perform Sentiment Analysis and Classification on Text |
AnalyticsApi | analyticsSimilarity | POST /nlp-v2/analytics/similarity | Perform Semantic Similarity Comparison of Two Strings |
AnalyticsApi | analyticsSubjectivity | POST /nlp-v2/analytics/subjectivity | Perform Subjectivity and Objectivity Analysis on Text |
ExtractEntitiesApi | extractEntitiesPost | POST /nlp-v2/extract-entities | Extract entities from string |
LanguageDetectionApi | languageDetectionGetLanguage | POST /nlp-v2/language/detect | Detect language of text |
LanguageTranslationApi | languageTranslationTranslateDeuToEng | POST /nlp-v2/translate/language/deu/to/eng | Translate German to English text with Deep Learning AI |
LanguageTranslationApi | languageTranslationTranslateEngToDeu | POST /nlp-v2/translate/language/eng/to/deu | Translate English to German text with Deep Learning AI |
LanguageTranslationApi | languageTranslationTranslateEngToFra | POST /nlp-v2/translate/language/eng/to/fra | Translate English to French text with Deep Learning AI |
LanguageTranslationApi | languageTranslationTranslateEngToRus | POST /nlp-v2/translate/language/eng/to/rus | Translate English to Russian text with Deep Learning AI |
LanguageTranslationApi | languageTranslationTranslateFraToEng | POST /nlp-v2/translate/language/fra/to/eng | Translate French to English text with Deep Learning AI |
LanguageTranslationApi | languageTranslationTranslateRusToEng | POST /nlp-v2/translate/language/rus/to/eng | Translate Russian to English text with Deep Learning AI |
ParseApi | parseParseString | POST /nlp-v2/parse/tree | Parse string to syntax tree |
PosTaggerApi | posTaggerTagAdjectives | POST /nlp-v2/pos/tag/adjectives | Part-of-speech tag a string, filter to adjectives |
PosTaggerApi | posTaggerTagAdverbs | POST /nlp-v2/pos/tag/adverbs | Part-of-speech tag a string, filter to adverbs |
PosTaggerApi | posTaggerTagNouns | POST /nlp-v2/pos/tag/nouns | Part-of-speech tag a string, filter to nouns |
PosTaggerApi | posTaggerTagPronouns | POST /nlp-v2/pos/tag/pronouns | Part-of-speech tag a string, filter to pronouns |
PosTaggerApi | posTaggerTagSentence | POST /nlp-v2/pos/tag/sentence | Part-of-speech tag a string |
PosTaggerApi | posTaggerTagVerbs | POST /nlp-v2/pos/tag/verbs | Part-of-speech tag a string, filter to verbs |
RephraseApi | rephraseEnglishRephraseSentenceBySentence | POST /nlp-v2/rephrase/rephrase/eng/by-sentence | Rephrase, paraphrase English text sentence-by-sentence using Deep Learning AI |
SegmentationApi | segmentationGetSentences | POST /nlp-v2/segmentation/sentences | Extract sentences from string |
SegmentationApi | segmentationGetWords | POST /nlp-v2/segmentation/words | Get words in input string |
SpellcheckApi | spellcheckCheckSentence | POST /nlp-v2/spellcheck/check/sentence | Check if sentence is spelled correctly |
SpellcheckApi | spellcheckCorrectJson | POST /nlp-v2/spellcheck/check/word | Find spelling corrections |
- CheckSentenceRequest
- CheckSentenceResponse
- CheckWordRequest
- CheckWordResponse
- CorrectWordInSentence
- Entity
- ExtractEntitiesRequest
- ExtractEntitiesResponse
- GetWordsRequest
- GetWordsResponse
- HateSpeechAnalysisRequest
- HateSpeechAnalysisResponse
- LanguageDetectionRequest
- LanguageDetectionResponse
- LanguageTranslationRequest
- LanguageTranslationResponse
- ParseRequest
- ParseResponse
- PosRequest
- PosResponse
- PosSentence
- PosTaggedWord
- ProfanityAnalysisRequest
- ProfanityAnalysisResponse
- RephraseRequest
- RephraseResponse
- RephrasedSentence
- RephrasedSentenceOption
- SentenceSegmentationRequest
- SentenceSegmentationResponse
- SentimentAnalysisRequest
- SentimentAnalysisResponse
- SimilarityAnalysisRequest
- SimilarityAnalysisResponse
- SubjectivityAnalysisRequest
- SubjectivityAnalysisResponse
- WordPosition
- Type: API key
- API key parameter name: Apikey
- Location: HTTP header