Я использую IBM Watson Natural Language Understanding для анализа заданной строки.В настоящее время я следую примеру, данному здесь .Я использую инструмент сборки maven, чтобы добавить зависимости.Я получаю исключение нулевой точки.
Я удалил ключ API для этого сообщения.
public static void main(String[] args) {
try {
IamOptions options = new IamOptions.Builder()
.apiKey("{APK}")
.build();
NaturalLanguageUnderstanding service = new NaturalLanguageUnderstanding("2018-03-16", options);
service.setEndPoint("{https://gateway.watsonplatform.net/natural-language-understanding/api}");
String text = "Differences in how writing systems represent language raise important questions about the extent to which the\n" +
"role of linguistic skills such as phonological awareness (PA) and morphological awareness (MA) in reading\n" +
"is universal. In this meta-analysis, the authors examined the relationship between PA, MA, and reading\n" +
"(accuracy, fluency, and comprehension) in 2 languages (English and Chinese) representing different writing\n" +
"systems (alphabetic and logographic). A random-effects model analysis of data from 64 studies with native\n" +
"speakers of each language revealed significant correlations between PA, MA, and all reading outcomes in both\n" +
"languages. The correlations remained significant even after controlling for each other’s effect on reading.\n" +
"However, PA was a stronger correlate of reading in English than in Chinese. MA was as good a correlate of\n" +
"reading in English as in";
CategoriesOptions categories = new CategoriesOptions();
Features features = new Features.Builder()
.categories(categories)
.build();
AnalyzeOptions parameters = new AnalyzeOptions.Builder()
.text(text)
.features(features)
.build();
AnalysisResults response = service
.analyze(parameters)
.execute();
System.out.println(response);
} catch (Exception e) {
System.out.println(e.getMessage());
}
}