合并 Azure 认知服务情绪结果
我正在使用Azure认知服务来计算58个文档的情感。所有这些都具有超过5000个字符,这意味着角色限制始终超过。我以为我可以通过将每个文档分为更多的部分并合并响应来对每个文档提出更多要求,但这是我被困的地方。响应包含整体文档情感类(正,中性和负面),三个类别的百分比以及每个句子的相同信息。句子结果会产生最后一个吗?换句话说,我可以从两个不同的API调用中获得三个类别的三个百分比值吗?
这是一个例子:
INPUT DOCUMENT: This API seems great. How the hell is overall score calculated? I wonder if anyone knows. I'll cry until someone answers.
RESPONSE:
Document Sentiment: mixed
Overall scores: positive=0.50; neutral=0.02; negative=0.47
Sentence: This API seems great.
Sentence 1 sentiment: positive
Sentence score:
Positive=1.00
Neutral=0.00
Negative=0.00
Sentence: How the hell is overall score calculated?
Sentence 2 sentiment: negative
Sentence score:
Positive=0.01
Neutral=0.05
Negative=0.95
Sentence: I wonder if anyone knows.
Sentence 3 sentiment: neutral
Sentence score:
Positive=0.04
Neutral=0.92
Negative=0.04
Sentence: I'll cry until someone answers.
Sentence 4 sentiment: neutral
Sentence score:
Positive=0.03
Neutral=0.52
Negative=0.46
主要问题:有什么方法可以从句子中计算总体情感?另外,Azure计算得分的方式是否已知? 如果您知道句子结果无法带给最后一个,您能建议我做任何我想实现的目标吗? 非常感谢您。
I am using Azure Cognitive Services in order to calculate the sentiment of 58 documents. All of those have way more than 5000 characters, meaning that the character limit is always exceeded. I have thought that I could make more requests for each document, by dividing each document into more pieces and than merging the responses, but this is where I am stuck. The response contains overall document sentiment class (positive, neutral and negative), percentages of the three classes and the same information for each sentence. Do the sentences results generate the final one? In other words, could I get three percentage values for the three classes from two different api calls?
This is an example:
INPUT DOCUMENT: This API seems great. How the hell is overall score calculated? I wonder if anyone knows. I'll cry until someone answers.
RESPONSE:
Document Sentiment: mixed
Overall scores: positive=0.50; neutral=0.02; negative=0.47
Sentence: This API seems great.
Sentence 1 sentiment: positive
Sentence score:
Positive=1.00
Neutral=0.00
Negative=0.00
Sentence: How the hell is overall score calculated?
Sentence 2 sentiment: negative
Sentence score:
Positive=0.01
Neutral=0.05
Negative=0.95
Sentence: I wonder if anyone knows.
Sentence 3 sentiment: neutral
Sentence score:
Positive=0.04
Neutral=0.92
Negative=0.04
Sentence: I'll cry until someone answers.
Sentence 4 sentiment: neutral
Sentence score:
Positive=0.03
Neutral=0.52
Negative=0.46
Main question: Is there any way to calculate the overall sentiment from only the sentences ones? Also, is the way Azure calculates this score known?
If you know the sentences results can not bring to the final one, could you suggest me any way to do what I want to achieve?
Thank you very much in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
坦率地说,要要求的程序并不是那么可接受。但是,有一种方法可以通过程序化方法来做到这一点。
1。创建字典
在字典变量中取出个体响应。
2。将值附加到列表中
附加您进入列表 3的值
。使用这些值创建一个数据框
dataFrame可以帮助管理列明智的数据模式。
4。平均每列
获取每列的平均值。
这将起作用
To be frank the procedure which is being requested is not that much acceptable. But there is a way to do that with programmatic approach.
1. Creating dictionary
Take individual responses in a dictionary variable.
2. Append the values into the list
Append the values u got into the list
3. Create a dataframe with those values
Dataframe can help to manage the column wise data pattern.
4. Mean each column
Get the mean of each column.
This will work