从列表中提取属性
我是Python的新手,我对待从列表中提取情绪,并将每个属性放在其相应的系列中以训练机器学习算法 例如,列表中的一个实例,我想在新系列中放愤怒,其值= 0.013736263736263736等。
“{'愤怒':”, '0.013736263736263736,',, “'预期':”, '0.0027472527472527475,',, “'厌恶':”, '0.03296703296703297,',, “'害怕':”, '0.0027472527472527475,',, “'喜悦':”, '0.0,', “'消极的':”, '0.06043956043956044,',, “'积极的':”, '0.019230769230769232,',,, “'悲伤':”, '0.0027472527472527475,',, “'惊喜':”, '0.008241758241758242,',, “'相信':”, '0.019230769230769232}'] 提前致谢
I am a novice in python and I treat to extract emotions from list and put each attribute to its corresponding series to train machine learning algorithms
for example this one instance in list and I want put anger in new series with its value= 0.013736263736263736 and so on.
"{'anger':",
'0.013736263736263736,',
"'anticipation':",
'0.0027472527472527475,',
"'disgust':",
'0.03296703296703297,',
"'fear':",
'0.0027472527472527475,',
"'joy':",
'0.0,',
"'negative':",
'0.06043956043956044,',
"'positive':",
'0.019230769230769232,',
"'sadness':",
'0.0027472527472527475,',
"'surprise':",
'0.008241758241758242,',
"'trust':",
'0.019230769230769232}']
thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过多种方式操纵字典和情感,让我显示一些:
1。将项目添加到集合,样本
您可以看到输出:
2。将项目添加到收集中,以情感,示例
您可以看到输出(请参阅“值” 1.0有关'is'):
3。将项目添加到收集中,并使用所有情感列表,示例
您可以看到输出(请参阅double值[0.5,0.5]有关'iss'):
You can manipulate with dictionary and sentiment in many ways, let me show a few:
1. Add item to collection, sample
you can see outputs:
2. Add item to collection with sum of sentiments, sample
you can see outputs (see value 1.0 for 'is'):
3. Add item to collection with list of all sentiments, sample
you can see outputs (see double values [0.5, 0.5] for 'is'):