cloudmersive-nlp-api-client

CloudmersiveNlpApiClient - the Ruby gem for the nlpapiv2

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.

This SDK is automatically generated by the Swagger Codegen project:

  • API version: v1
  • Package version: 2.0.9
  • Build package: io.swagger.codegen.languages.RubyClientCodegen

Installation

Build a gem

To build the Ruby code into a gem:

gem build cloudmersive-nlp-api-client.gemspec

Then either install the gem locally:

gem install ./cloudmersive-nlp-api-client-2.0.9.gem

(for development, run gem install --dev ./cloudmersive-nlp-api-client-2.0.9.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'cloudmersive-nlp-api-client', '~> 2.0.9'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:

gem 'cloudmersive-nlp-api-client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'cloudmersive-nlp-api-client'

# Setup authorization
CloudmersiveNlpApiClient.configure do |config|
  # Configure API key authorization: Apikey
  config.api_key['Apikey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['Apikey'] = 'Bearer'
end

api_instance = CloudmersiveNlpApiClient::AnalyticsApi.new

input = CloudmersiveNlpApiClient::HateSpeechAnalysisRequest.new # HateSpeechAnalysisRequest | Input hate speech analysis request


begin
  #Perform Hate Speech Analysis and Detection on Text
  result = api_instance.analytics_hate_speech(input)
  p result
rescue CloudmersiveNlpApiClient::ApiError => e
  puts "Exception when calling AnalyticsApi->analytics_hate_speech: #{e}"
end

Documentation for API Endpoints

All URIs are relative to https://api.cloudmersive.com

Class Method HTTP request Description
CloudmersiveNlpApiClient::AnalyticsApi analytics_hate_speech POST /nlp-v2/analytics/hate-speech Perform Hate Speech Analysis and Detection on Text
CloudmersiveNlpApiClient::AnalyticsApi analytics_profanity POST /nlp-v2/analytics/profanity Perform Profanity and Obscene Language Analysis and Detection on Text
CloudmersiveNlpApiClient::AnalyticsApi analytics_sentiment POST /nlp-v2/analytics/sentiment Perform Sentiment Analysis and Classification on Text
CloudmersiveNlpApiClient::AnalyticsApi analytics_similarity POST /nlp-v2/analytics/similarity Perform Semantic Similarity Comparison of Two Strings
CloudmersiveNlpApiClient::AnalyticsApi analytics_subjectivity POST /nlp-v2/analytics/subjectivity Perform Subjectivity and Objectivity Analysis on Text
CloudmersiveNlpApiClient::ExtractEntitiesApi extract_entities_post POST /nlp-v2/extract-entities Extract entities from string
CloudmersiveNlpApiClient::LanguageDetectionApi language_detection_get_language POST /nlp-v2/language/detect Detect language of text
CloudmersiveNlpApiClient::LanguageTranslationApi language_translation_translate_deu_to_eng POST /nlp-v2/translate/language/deu/to/eng Translate German to English text with Deep Learning AI
CloudmersiveNlpApiClient::LanguageTranslationApi language_translation_translate_eng_to_deu POST /nlp-v2/translate/language/eng/to/deu Translate English to German text with Deep Learning AI
CloudmersiveNlpApiClient::LanguageTranslationApi language_translation_translate_eng_to_rus POST /nlp-v2/translate/language/eng/to/rus Translate English to Russian text with Deep Learning AI
CloudmersiveNlpApiClient::LanguageTranslationApi language_translation_translate_rus_to_eng POST /nlp-v2/translate/language/rus/to/eng Translate Russian to English text with Deep Learning AI
CloudmersiveNlpApiClient::ParseApi parse_parse_string POST /nlp-v2/parse/tree Parse string to syntax tree
CloudmersiveNlpApiClient::PosTaggerApi pos_tagger_tag_adjectives POST /nlp-v2/pos/tag/adjectives Part-of-speech tag a string, filter to adjectives
CloudmersiveNlpApiClient::PosTaggerApi pos_tagger_tag_adverbs POST /nlp-v2/pos/tag/adverbs Part-of-speech tag a string, filter to adverbs
CloudmersiveNlpApiClient::PosTaggerApi pos_tagger_tag_nouns POST /nlp-v2/pos/tag/nouns Part-of-speech tag a string, filter to nouns
CloudmersiveNlpApiClient::PosTaggerApi pos_tagger_tag_pronouns POST /nlp-v2/pos/tag/pronouns Part-of-speech tag a string, filter to pronouns
CloudmersiveNlpApiClient::PosTaggerApi pos_tagger_tag_sentence POST /nlp-v2/pos/tag/sentence Part-of-speech tag a string
CloudmersiveNlpApiClient::PosTaggerApi pos_tagger_tag_verbs POST /nlp-v2/pos/tag/verbs Part-of-speech tag a string, filter to verbs
CloudmersiveNlpApiClient::RephraseApi rephrase_english_rephrase_sentence_by_sentence POST /nlp-v2/rephrase/rephrase/eng/by-sentence Rephrase, paraphrase English text sentence-by-sentence using Deep Learning AI
CloudmersiveNlpApiClient::SegmentationApi segmentation_get_sentences POST /nlp-v2/segmentation/sentences Extract sentences from string
CloudmersiveNlpApiClient::SegmentationApi segmentation_get_words POST /nlp-v2/segmentation/words Get words in input string
CloudmersiveNlpApiClient::SpellcheckApi spellcheck_check_sentence POST /nlp-v2/spellcheck/check/sentence Check if sentence is spelled correctly
CloudmersiveNlpApiClient::SpellcheckApi spellcheck_correct_json POST /nlp-v2/spellcheck/check/word Find spelling corrections

Documentation for Models

Documentation for Authorization

Apikey

  • Type: API key
  • API key parameter name: Apikey
  • Location: HTTP header