The following API allows you to analyze text for language, entities (places, people), key phrases, sentiment (positive, neutral, negative), and syntax (pronouns, verbs, adjectives).
amplify add predictions, then use the following answers:
1? Please select from one of the categories below (Use arrow keys)2 `Interpret`3? What would you like to interpret? (Use arrow keys)4 `Interpret Text`5? Provide a friendly name for your resource6 `interpretText`7? What kind of interpretation would you like? (Use arrow keys)8 `All`9? Who should have access? (Use arrow keys)10 `Auth and Guest users`
amplify push to create the resources in the cloud.
Here is an example of sending text for interpretation such as sentiment analysis or natural language characteristics.
1Amplify.Predictions.interpret(2 "I like to eat spaghetti",3 result -> Log.i("MyAmplifyApp", result.getSentiment().getValue().toString()),4 error -> Log.e("MyAmplifyApp", "Interpret failed", error)5);
As a result of running this code, you will see the sentiment of the text printed to the console.