这是所需的地图。我希望输出是中性的。
{anger: 0.0, contempt: 0.02, disgust: 0.0, fear: 0.0, happiness: 0.0, neutral: 0.978, sadness: 0.002, surprise: 0.0}
Map themap={"anger": 0.0, "contempt": 0.02, "disgust": 0.0, "fear": 2.0, "happiness": 0.0, "neutral": 0.978, "sadness": 0.002, "surprise": 0.0};
var thevalue=0.0;
var thekey;
themap.forEach((k,v){
if(v>thevalue) {
thevalue = v;
thekey = k;
}
});
print (thekey);
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句