SDKs overview
Software Development Kits (SDKs) and client libraries for ELI provide pre-built functionality to interact with the ELI API. These tools encapsulate the API's RESTful endpoints, handling HTTP requests, response parsing, and authentication, which simplifies the integration process for developers. The ELI API enables programmatic access to its Natural Language Processing (NLP) services, including Sentiment Analysis, Entity Extraction, Text Summarization, and Topic Modeling ELI API reference documentation.
Using an SDK can reduce the amount of boilerplate code required, allowing developers to focus on application logic rather than low-level API communication. ELI officially supports SDKs for popular programming languages, ensuring compatibility and ongoing maintenance ELI documentation portal. Additionally, the open nature of the ELI API encourages the development of community-contributed libraries, which can offer specialized features or support for other languages and frameworks.
Official SDKs by language
ELI maintains official SDKs for Python, Node.js, and Java. These SDKs are designed to provide a consistent and reliable interface for accessing ELI's core NLP functionalities. Each SDK is tailored to the conventions and best practices of its respective language, aiming to offer an intuitive developer experience.
| Language | Package Name | Installation Command | Maturity |
|---|---|---|---|
| Python | eli-sdk-python |
pip install eli-sdk-python |
Stable |
| Node.js | @eli/sdk-node |
npm install @eli/sdk-node |
Stable |
| Java | com.eli:eli-sdk-java |
Maven: Add dependency; Gradle: Add dependency | Stable |
The official SDKs are regularly updated to reflect new API features and improvements, ensuring developers have access to the latest capabilities. For detailed information on specific SDK versions and their change logs, developers can consult the ELI SDKs documentation.
Installation
Installing ELI's official SDKs typically involves using the package manager specific to the programming language. Before installation, developers need to ensure they have the correct runtime environment set up, such as Python 3.x, Node.js 12+, or Java 8+.
Python SDK installation
The Python SDK is distributed via PyPI. Use pip to install:
pip install eli-sdk-python
It is recommended to use a virtual environment to manage dependencies for Python projects Python virtual environments guide.
Node.js SDK installation
The Node.js SDK is available on npm. Use npm or yarn to install:
npm install @eli/sdk-node
Or with Yarn:
yarn add @eli/sdk-node
Java SDK installation
For Java projects, the ELI SDK is typically managed using build automation tools like Maven or Gradle. You will need to add the appropriate dependency to your project's pom.xml (for Maven) or build.gradle (for Gradle).
Maven
Add the following to your pom.xml:
<dependency>
<groupId>com.eli</groupId>
<artifactId>eli-sdk-java</artifactId>
<version>1.0.0</version> <!-- Replace with the latest version -->
</dependency>
Gradle
Add the following to your build.gradle:
implementation 'com.eli:eli-sdk-java:1.0.0' // Replace with the latest version
Always refer to the official ELI Java SDK documentation for the most current version number.
Quickstart example
The following examples demonstrate how to perform a basic sentiment analysis using the official ELI SDKs. Before running these examples, ensure you have an API key, which can be obtained from your ELI account dashboard after signing up for a ELI pricing plan (a free tier is available).
Python quickstart: Sentiment analysis
This Python example uses the eli-sdk-python to analyze the sentiment of a given text:
from eli_sdk import ELIClient
# Initialize the client with your API key
api_key = "YOUR_ELI_API_KEY"
client = ELIClient(api_key=api_key)
text_to_analyze = "The new product launch was a resounding success and customers are loving it!"
try:
# Perform sentiment analysis
response = client.sentiment.analyze(text=text_to_analyze)
sentiment_score = response['sentiment']['score']
sentiment_label = response['sentiment']['label']
print(f"Text: '{text_to_analyze}'")
print(f"Sentiment Score: {sentiment_score}")
print(f"Sentiment Label: {sentiment_label}")
except Exception as e:
print(f"An error occurred: {e}")
Node.js quickstart: Sentiment analysis
This Node.js example uses the @eli/sdk-node to perform sentiment analysis:
const { ELIClient } = require('@eli/sdk-node');
// Initialize the client with your API key
const apiKey = "YOUR_ELI_API_KEY";
const client = new ELIClient(apiKey);
const textToAnalyze = "This service is incredibly frustrating and I'm very disappointed.";
async function analyzeSentiment() {
try {
const response = await client.sentiment.analyze({ text: textToAnalyze });
const { score, label } = response.sentiment;
console.log(`Text: '${textToAnalyze}'`);
console.log(`Sentiment Score: ${score}`);
console.log(`Sentiment Label: ${label}`);
} catch (error) {
console.error(`An error occurred: ${error.message}`);
}
}
analyzeSentiment();
Java quickstart: Sentiment analysis
This Java example demonstrates sentiment analysis using the eli-sdk-java:
import com.eli.sdk.ELIClient;
import com.eli.sdk.models.SentimentAnalysisRequest;
import com.eli.sdk.models.SentimentAnalysisResponse;
public class SentimentQuickstart {
public static void main(String[] args) {
// Replace with your actual API key
String apiKey = "YOUR_ELI_API_KEY";
ELIClient client = new ELIClient(apiKey);
String textToAnalyze = "Overall, the movie was decent, but some scenes dragged on too long.";
try {
SentimentAnalysisRequest request = new SentimentAnalysisRequest.Builder()
.text(textToAnalyze)
.build();
SentimentAnalysisResponse response = client.sentiment().analyze(request);
System.out.println("Text: '" + textToAnalyze + "'");
System.out.println("Sentiment Score: " + response.getSentiment().getScore());
System.out.println("Sentiment Label: " + response.getSentiment().getLabel());
} catch (Exception e) {
System.err.println("An error occurred: " + e.getMessage());
e.printStackTrace();
}
}
}
These examples illustrate the basic pattern for interacting with the ELI API using the official SDKs: initialize the client with your API key, prepare your request data, and call the relevant API method. Error handling is included to manage potential issues during API calls. More complex operations, such as entity extraction or topic modeling, follow similar patterns, as detailed in the full ELI API reference.
Community libraries
Beyond the officially supported SDKs, the ELI API's RESTful design allows developers to create and share their own client libraries in various programming languages ELI community resources. These community-driven efforts can provide support for additional languages, frameworks, or specific use cases not covered by the official offerings. For instance, developers might create wrappers for front-end frameworks like React or Angular, or integrations with data processing pipelines.
While community libraries offer flexibility, it is important to verify their maintenance status, security practices, and compatibility with the latest ELI API versions. Developers should consult the respective project repositories for documentation, licensing information, and support. The ELI documentation portal occasionally highlights notable community contributions, but developers are encouraged to explore platforms like GitHub for the most up-to-date listing of third-party tools compatible with ELI. Users of community libraries should be aware that support and updates for these resources are managed by their creators, not by ELI.