We have made available some NLP services over a REST API. The services, collectively called Cloud NLP, currently include sentiment analysis and language detection. Additional services will be added over the next few weeks. Cloud NLP requires an API key that you can get for free by contacting us or by consuming Cloud NLP through the Mashape API Marketplace.
The Cloud NLP Java client SDK is now available on GitHub. It is licensed under the Apache Software License, version 2.0. The Maven dependency information is:
<dependency> <groupId>com.mtnfog.cloudnlp</groupId> <artifactId>cloud-nlp-java-sdk</artifactId> <version>1.0.0</version> </dependency>
The Cloud NLP Java client SDK includes support for accessing the Cloud NLP services directly with a Mountain Fog API key or through Mashape. It’s easy to use:
CloudNlpClient client = new CloudNlpStandardClient(API_KEY, CloudNlpStandardClient.MTNFOG_CLOUDNLP_ENDPOINT); String language = cloudNlpClient.detectLanguage("This is english text."); int sentiment = cloudNlpClient.analyzeSentiment("This widget is great!");
Similarly, to use Cloud NLP via Mashape just change to the CloudNlpMashapeClient:
CloudNlpClient cloudNlpClient = new CloudNlpMashapeClient(MASHAPE_API_KEY); String language = cloudNlpClient.detectLanguage("This is english text."); int sentiment = cloudNlpClient.analyzeSentiment("This widget is great!");
And that’s it. As mentioned earlier, look for more natural language processing services to be added to Cloud NLP in the near future!Share this post