How to Rephrase & Paraphrase English Text Sentence-by-Sentence using Deep Learning AI: NLP API

Cloudmersive
2 min readApr 8, 2022

If you’re trying to incorporate advanced Deep Learning & Neural NLP into your project, look no further. Our Sentence Rephrasing API is capable of automatically voicing input sentences differently, and it provides up to 10 suggestions for each input, leaving ample options to choose from.

It’s quick and easy to get started incorporating this API in Java using the code provided below, or you can alternatively visit our API console page to find snippets available in 12 additional programming languages.

Start Java SDK installation with Maven by adding a reference to the repository in pom.xml:

<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>

Wrap that up by adding a reference to the dependency in pom.xml:

<dependencies>
<dependency>
<groupId>com.github.Cloudmersive</groupId>
<artifactId>Cloudmersive.APIClient.Java</artifactId>
<version>v4.25</version>
</dependency>
</dependencies>

Finally, add import classes and call the NLP function:

// Import classes:
//import com.cloudmersive.client.invoker.ApiClient;
//import com.cloudmersive.client.invoker.ApiException;
//import com.cloudmersive.client.invoker.Configuration;
//import com.cloudmersive.client.invoker.auth.*;
//import com.cloudmersive.client.RephraseApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();// Configure API key authorization: Apikey
ApiKeyAuth Apikey = (ApiKeyAuth) defaultClient.getAuthentication("Apikey");
Apikey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Apikey.setApiKeyPrefix("Token");
RephraseApi apiInstance = new RephraseApi();
RephraseRequest input = new RephraseRequest(); // RephraseRequest | Input rephrase request
try {
RephraseResponse result = apiInstance.rephraseTranslateDeuToEng(input);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling RephraseApi#rephraseTranslateDeuToEng");
e.printStackTrace();
}

Just like that, you now have a Deep Learning AI at your disposal.

--

--

Cloudmersive

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.