SDKs overview
Cloudmersive Natural Language Processing (NLP) offers a suite of Software Development Kits (SDKs) and client libraries designed to facilitate interaction with its NLP API. These SDKs abstract the underlying HTTP requests and response parsing, enabling developers to integrate NLP functionalities into their applications using familiar programming language constructs. The SDKs cover various operations, including sentiment analysis, language detection, text summarization, and named entity recognition, as detailed in the Cloudmersive NLP API documentation.
Developers can utilize these SDKs to perform tasks such as:
- Analyzing sentiment from text inputs (e.g., determining if a customer review is positive, negative, or neutral).
- Detecting the language of a given text string without explicit language headers.
- Summarizing lengthy documents or articles into concise overviews.
- Identifying and extracting named entities such as people, organizations, locations, and dates from unstructured text.
- Performing part-of-speech tagging to analyze grammatical structure.
Official SDKs by language
Cloudmersive maintains official SDKs for several programming languages. These libraries are developed to align with the core API features and are typically updated to support new functionalities or improvements to existing endpoints. The table below outlines the primary official SDKs, their typical package names, installation commands, and general maturity status.
| Language | Package Manager/Repository | Installation Command | Maturity |
|---|---|---|---|
| C# | NuGet | Install-Package Cloudmersive.APIClient.NET.NLP |
Stable |
| Java | Maven/Gradle | (Maven) <dependency><groupId>com.cloudmersive.client</groupId><artifactId>Cloudmersive.APIClient.NET.NLP</artifactId><version>2.0.0</version></dependency> |
Stable |
| Node.js | npm | npm install cloudmersive-nlp-api-client |
Stable |
| PHP | Composer | composer require cloudmersive/cloudmersive-nlp-api-client |
Stable |
| Python | pip | pip install cloudmersive-nlp-api-client |
Stable |
| Ruby | RubyGems | gem install cloudmersive-nlp-api-client |
Stable |
| Go | Go Modules | go get github.com/cloudmersive/cloudmersive-nlp-api-client-go |
Stable |
The version numbers provided in the installation commands are examples and may vary; developers should refer to the official Cloudmersive NLP API documentation or the respective package manager repositories for the latest versions and detailed installation instructions.
Installation
Installation of the Cloudmersive NLP SDKs typically follows standard practices for each programming ecosystem. Below are general guidelines for installing the SDKs in different environments. Ensure you have the respective package manager installed and configured before proceeding.
C# (.NET)
For .NET projects, the Cloudmersive NLP SDK can be installed via NuGet Package Manager. Open your project in Visual Studio, right-click on your project in the Solution Explorer, and select "Manage NuGet Packages...". Search for Cloudmersive.APIClient.NET.NLP and click Install. Alternatively, you can use the Package Manager Console:
Install-Package Cloudmersive.APIClient.NET.NLP
This command adds the necessary references to your project, allowing you to import Cloudmersive NLP classes.
Java (Maven/Gradle)
For Java projects, you can add the Cloudmersive NLP SDK as a dependency in your pom.xml (Maven) or build.gradle (Gradle) file. For Maven, add the following to your <dependencies> block:
<dependency>
<groupId>com.cloudmersive.client</groupId>
<artifactId>Cloudmersive.APIClient.NET.NLP</artifactId>
<version>2.0.0</version> <!-- Check for the latest version -->
</dependency>
For Gradle, add this to your dependencies block in build.gradle:
implementation 'com.cloudmersive.client:Cloudmersive.APIClient.NET.NLP:2.0.0' // Check for the latest version
After adding the dependency, your build tool will download and include the library.
Node.js
Node.js developers can install the SDK using npm (Node Package Manager) from their project directory:
npm install cloudmersive-nlp-api-client
This command downloads the package and adds it to your node_modules folder, making it available for import in your JavaScript or TypeScript files.
PHP
For PHP projects, Composer is the recommended package manager. Navigate to your project root in the terminal and run:
composer require cloudmersive/cloudmersive-nlp-api-client
Composer will install the SDK and generate an autoloader file, which you should include in your application.
Python
Python developers can install the Cloudmersive NLP SDK using pip:
pip install cloudmersive-nlp-api-client
This makes the cloudmersive_nlp_api_client module available for import in your Python scripts.
Ruby
For Ruby projects, the SDK is available as a Gem. Install it using the RubyGems package manager:
gem install cloudmersive-nlp-api-client
After installation, you can require the gem in your Ruby code.
Go
Go modules are used for dependency management in Go projects. To install the Cloudmersive NLP Go SDK, run:
go get github.com/cloudmersive/cloudmersive-nlp-api-client-go
This command downloads the module and adds it to your go.mod file, integrating it into your Go project. For additional context on modern Go module practices, developers may consult the Go documentation on managing dependencies.
Quickstart example
This quickstart example demonstrates how to perform sentiment analysis using the Cloudmersive NLP API through its Python SDK. Before running, ensure you have installed the Python SDK and obtained your API key from the Cloudmersive pricing page or dashboard.
Python Sentiment Analysis
First, create a Python file (e.g., sentiment_analysis.py) and add the following code:
import cloudmersive_nlp_api_client
from cloudmersive_nlp_api_client.rest import ApiException
import os
# Configure API key authorization: Apikey
configuration = cloudmersive_nlp_api_client.Configuration(host="https://api.cloudmersive.com")
configuration.api_key['Apikey'] = 'YOUR_API_KEY'
# Create an instance of the API class
api_instance = cloudmersive_nlp_api_client.SentimentApi(cloudmersive_nlp_api_client.ApiClient(configuration))
try:
# Perform sentiment analysis on a text string
input_text = "Cloudmersive NLP provides excellent tools for text processing."
api_response = api_instance.sentiment_analyse_text(input_text)
print("Sentiment Analysis Result:")
print(f" Sentiment Score: {api_response.sentiment_score}")
print(f" Sentiment Classification: {api_response.sentiment_classification}")
input_text_negative = "This product is terrible and does not work as advertised."
api_response_negative = api_instance.sentiment_analyse_text(input_text_negative)
print("\nSentiment Analysis Result (Negative Example):")
print(f" Sentiment Score: {api_response_negative.sentiment_score}")
print(f" Sentiment Classification: {api_response_negative.sentiment_classification}")
except ApiException as e:
print(f"Exception when calling SentimentApi->sentiment_analyse_text: {e}")
Replace 'YOUR_API_KEY' with your actual Cloudmersive API key. This script initializes the API client with your key, then calls the sentiment_analyse_text method to analyze two different text strings. The results, including a sentiment score and classification (e.g., "Positive", "Negative", "Neutral"), are printed to the console. This example illustrates the basic pattern for making calls to the Cloudmersive NLP API using the Python SDK.
Community libraries
While Cloudmersive provides official SDKs for major programming languages, the open-source community may occasionally develop additional client libraries or tools that interact with the Cloudmersive NLP API. These community-contributed projects can offer alternative implementations, specialized functionalities, or integrations with specific frameworks not directly covered by the official SDKs. Developers often create such libraries to suit particular use cases or to provide wrappers in less common programming languages.
However, it is important to note that community libraries are not officially supported or maintained by Cloudmersive. Their reliability, security, and compatibility with the latest API versions can vary. Before adopting a community-developed library, developers are advised to:
- Review the project's documentation and source code for clarity and quality.
- Check the project's activity on platforms like GitHub to assess its maintenance status and community support.
- Verify compatibility with the current Cloudmersive NLP API specifications.
- Consider the licensing terms of the community library.
As of this writing, specific widely adopted community libraries for Cloudmersive NLP are not extensively documented outside of the official channels. Developers interested in contributing or seeking community projects should explore developer forums, GitHub repositories, or package manager listings for potential third-party integrations. For critical applications, relying on the official SDKs and documentation is generally recommended to ensure full compatibility and access to support resources. Developers can also consult general guidelines on client-side API interaction best practices when reviewing such libraries.