NLTK使用Krippendorff Alpha仅在1个分歧的情况下输出零的NLTK通道协议

发布于 2025-01-25 15:39:43 字数 1311 浏览 1 评论 0原文

我有一个 sequence-labeling NLP中的任务标记一个句子中的每个单词。例如,对于句子[a,b,c,d]

ann 1。提供[[0,1,2],[0,1],[0],[0],[0]]

ann 2。 2],[0],[0],[0,1]]

我使用nltk的协议模块计算Krippendorff的alpha(因为这是一个多标签任务)。为了计算alpha,我确实

task_data = [
('coder0', 'word0', frozenset([0, 1, 2])), 
('coder0', 'word1', frozenset([0, 1])), 
('coder0', 'word2', frozenset([0])), 
('coder0', 'word2', frozenset([0])),

('coder1', 'word0', frozenset([0, 2])), 
('coder1', 'word1', frozenset([0])), 
('coder1', 'word2', frozenset([0])), 
('coder1', 'word2', frozenset([0, 1]))
]

task = AnnotationTask(distance = masi_distance)
task.load_array(task_data)
print(task.alpha())

使用了上述代码,我收到了alpha的数字非常低。要调查,我以一个示例示例:

task_data = [
('coder1','Item0',frozenset(['l1'])), 

('coder2','Item0',frozenset(['l1', 'l2']))
]

task = AnnotationTask(distance = masi_distance)

task.load_array(task_data)

然后将task.alpha()作为零。

我的问题是:

  1. 这是计算序列标签和多标签任务协议的正确方法吗?
  2. 为什么对于玩具示例,alpha为零?我尝试计算Masi-Distance,但这不是零。
  3. 对于此类任务,还有其他更好/可靠的指标吗?

I have a sequence-labeling task in NLP, where the annotators are asked to provide 1 or more labels to each word in a sentence. For e.g., for a sentence [a, b, c, d]

Ann 1. provided [[0, 1, 2], [0, 1], [0], [0]]

Ann 2. provided [[0, 2], [0], [0], [0, 1]]

I used the NLTK's agreement module to calculate the Krippendorff's Alpha (since this is a multi-label task). To calculate the alpha, I did

task_data = [
('coder0', 'word0', frozenset([0, 1, 2])), 
('coder0', 'word1', frozenset([0, 1])), 
('coder0', 'word2', frozenset([0])), 
('coder0', 'word2', frozenset([0])),

('coder1', 'word0', frozenset([0, 2])), 
('coder1', 'word1', frozenset([0])), 
('coder1', 'word2', frozenset([0])), 
('coder1', 'word2', frozenset([0, 1]))
]

task = AnnotationTask(distance = masi_distance)
task.load_array(task_data)
print(task.alpha())

Using the above code, I received very low numbers for alpha. To investigate, I took a sample example:

task_data = [
('coder1','Item0',frozenset(['l1'])), 

('coder2','Item0',frozenset(['l1', 'l2']))
]

task = AnnotationTask(distance = masi_distance)

task.load_array(task_data)

and I get the task.alpha() as ZERO.

My questions are:

  1. Is this the correct way of calculating agreement for a sequence labeling and multi-label task?
  2. Why for the toy example alpha is zero? I tried calculating Masi-distance and it's non-zero.
  3. Is there any other better/reliable metric for such a task?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文