标签: watson-nlu

Watson NLU - 没有为语言检测提供足够的文本

我正在与 Watson NLU 合作并尝试对某些文本进行情感分析。问题是某些文本太小,无法检测到它是什么语言(例如:优质的服务)。有没有办法让我指定如果无法进行语言检测,则应将其视为英语?

我的 NLU (Java) 的片段是这样的:

SentimentOptions sentiment = new SentimentOptions.Builder()
    .targets(targets)
    .document(true)
    .build();


Features features = new Features.Builder()
    .sentiment(sentiment)
    .build();


AnalyzeOptions parameters = new AnalyzeOptions.Builder()
    .text(text)
    .features(features)
    .build();

AnalysisResults response = service
    .analyze(parameters)
    .execute();

String mySentiment = response.getSentiment().getDocument().getLabel();
Run Code Online (Sandbox Code Playgroud)

java ibm-watson watson-nlu

3
推荐指数
1
解决办法
1607
查看次数

WatsonException:错误:不支持的文本语言,代码:400

我正在使用自然语言理解 api。我正在使用“hmmmm nawa ohh wen am I gona win dstin”,但出现错误

WatsonException: Error: unsupported text language, Code: 400 
Run Code Online (Sandbox Code Playgroud)

我的代码是:

response = natural_language_understanding.analyze(
    text='hmmmm nawa ohh wen am I gona win ds tin',
    features=[features.Sentiment(), features.Keywords(), features.Emotion(), features.Categories()])
Run Code Online (Sandbox Code Playgroud)

如何将这些类型的文本传递给 NLU api。需要帮忙。

python watson watson-nlu ibm-cloud

3
推荐指数
1
解决办法
2244
查看次数

标签 统计

watson-nlu ×2

ibm-cloud ×1

ibm-watson ×1

java ×1

python ×1

watson ×1