Python二进制分数只输出1个分数

Python二进制分数只输出1个分数,python,nlp,sentiment-analysis,Python,Nlp,Sentiment Analysis,我目前正在通过命令result=senti.gettouction(cs,score='binary')使用python库进行文本分析。首先,我在Jupyter笔记本中运行它,它运行得很好。它输出两个分数,分别为正面和负面情绪分数,如[(2,-1)]。但是,当我尝试在anaconda提示符或spyder中运行它时。它只输出1个值,比如[1],我不明白为什么。我想这是因为我在不同的环境下运行它。我想问一下,如何在anaconda提示符或其他IDE中运行此命令,以便正确输出结果?还是我做错了什么

我目前正在通过命令
result=senti.gettouction(cs,score='binary')
使用python库进行文本分析。首先,我在Jupyter笔记本中运行它,它运行得很好。它输出两个分数,分别为正面和负面情绪分数,如
[(2,-1)]
。但是,当我尝试在anaconda提示符或spyder中运行它时。它只输出1个值,比如
[1]
,我不明白为什么。我想这是因为我在不同的环境下运行它。我想问一下,如何在anaconda提示符或其他IDE中运行此命令,以便正确输出结果?还是我做错了什么

    if score == 'scale': # Returns from -1 to 1
        senti_score = [sum(senti_score[i:i+2])/4 for i in range(0, len(senti_score), 3)]
    elif score == 'binary': # Return 1 if positive and -1 if negative
        senti_score = [1 if senti_score[i] >= abs(senti_score[i+1]) else -1 for i in range(0, len(senti_score), 3)]
    elif score == 'trinary': # Return Positive and Negative Score and Neutral Score
        senti_score = [tuple(senti_score[i:i+3]) for i in range(0, len(senti_score), 3)]
    elif score == 'dual': # Return Positive and Negative Score
        senti_score = [tuple(senti_score[i:i+2]) for i in range(0, len(senti_score), 3)]
    else:
        return "Argument 'score' takes in either 'scale' (between -1 to 1) or 'binary' (two scores, positive and negative rating)"
    return senti_score
遇到同样的问题,查看源代码,发现文档错误。分数类型应使用“dual”