使用 ibm_watson python 包中的“ToneAnalyzerV3”,如何排除特定音调?
Using `ToneAnalyzerV3` from the ibm_watson python package, how can I exclude a specific tone from being included?
这 returns 来自分析仪的所有音调
# returns all tones (anger, fear, sadness, tentative, analytical
tone_analysis = tone_analyzer.tone({'text': text}, content_type='application/json').get_result()
如何从分析中排除 'analytical' 音调?
抱歉,答案(截至 2017-09-21)似乎是“你不能”。
python-sdk 的文档说明了这一点。 http://watson-developer-cloud.github.io/python-sdk/v1.0.2/apis/watson_developer_cloud.tone_analyzer_v3.html
具体见:
在 ToneAnalyzerV3.tone() 下,参数 tones - 您不能再将音调列表指定到 return:
tones (list[str]) – 2017-09-21
: Deprecated. The service continues to
accept the parameter for backward-compatibility, but the parameter no
longer affects the response.
在ToneAnalyzerV3.DocumentAnalysis()下,属性色调-服务只有returns scores of value >= 0.5的色调,这意味着你不能做你自己的softmax来排除分析:
Attr list[ToneScore] tones:
(optional) 2017-09-21
: An array of ToneScore objects that provides the results of the analysis for each qualifying tone of the
document. The array includes results for any tone whose score is at
least 0.5. The array is empty if no tone has a score that meets this
threshold.
在ToneAnalyzerV3.SentenceAnalysis()下,属性音-同样的故事:
Attr list[ToneScore] tones: (optional) 2017-09-21
: An array of
ToneScore objects that provides the results of the analysis for each
qualifying tone of the sentence. The array includes results for any
tone whose score is at least 0.5. The array is empty if no tone has a
score that meets this threshold.
这 returns 来自分析仪的所有音调
# returns all tones (anger, fear, sadness, tentative, analytical
tone_analysis = tone_analyzer.tone({'text': text}, content_type='application/json').get_result()
如何从分析中排除 'analytical' 音调?
抱歉,答案(截至 2017-09-21)似乎是“你不能”。
python-sdk 的文档说明了这一点。 http://watson-developer-cloud.github.io/python-sdk/v1.0.2/apis/watson_developer_cloud.tone_analyzer_v3.html
具体见:
在 ToneAnalyzerV3.tone() 下,参数 tones - 您不能再将音调列表指定到 return:
tones (list[str]) –
2017-09-21
: Deprecated. The service continues to accept the parameter for backward-compatibility, but the parameter no longer affects the response.
在ToneAnalyzerV3.DocumentAnalysis()下,属性色调-服务只有returns scores of value >= 0.5的色调,这意味着你不能做你自己的softmax来排除分析:
Attr list[ToneScore] tones: (optional)
2017-09-21
: An array of ToneScore objects that provides the results of the analysis for each qualifying tone of the document. The array includes results for any tone whose score is at least 0.5. The array is empty if no tone has a score that meets this threshold.
在ToneAnalyzerV3.SentenceAnalysis()下,属性音-同样的故事:
Attr list[ToneScore] tones: (optional)
2017-09-21
: An array of ToneScore objects that provides the results of the analysis for each qualifying tone of the sentence. The array includes results for any tone whose score is at least 0.5. The array is empty if no tone has a score that meets this threshold.