I want to add an AI Agent
specially Part of Speech tagging
in Android
application. Can I do it using AlchemyApi
? Or any other Library that works in Android? I tried StanfordCoreNLP
but I am unable to use it in Android
. This link is not working for downloading Alchemy AndoidSDK Api
. I read a lot of links even Can I use it in Android or not? Kindly guide.
Asked
Active
Viewed 548 times
-2

Awais
- 101
- 1
- 1
- 5
1 Answers
2
compile 'com.ibm.watson.developer_cloud:java-sdk:3.3.0'
Add that to your Gradle And look here for examples
AlchemyLanguage service = new AlchemyLanguage();
service.setApiKey("<api_key>");
Map<String,Object> params;
params = new HashMap<String, Object>();
params.put(AlchemyLanguage.TEXT, "IBM Watson won the Jeopardy television show hosted by Alex Trebek");
CombinedResults combinedResults=service.getCombinedResults(params).execute();
List<SAORelation> relationObject=combinedResults.getRelations();
for (SAORelation relation: relationObject){
System.out.println(relation.getSentence());
}
Look here for a demo of what the Alchemy Api can do

ketrox
- 889
- 1
- 12
- 23
-
`api key`? Is it from `AlchemyApi key` or `IBM-Alchemy Api` ke? – Awais Aug 25 '16 at 07:41
-
On compiling your code, After taking `api key`. it is giving the error `I/CredentialUtils: JNDI string lookups is not available.` – Awais Aug 26 '16 at 11:55
-
That's not an error This method private static String getKeyUsingJNDI(String serviceName) should always return null on Android due to the javax functions being unsupported it's just a warning – ketrox Aug 26 '16 at 11:58