Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

触发词的问题 #49

Closed
xxllp opened this issue Aug 23, 2022 · 10 comments
Closed

触发词的问题 #49

xxllp opened this issue Aug 23, 2022 · 10 comments
Labels
discussion Discussion on DocEE and SentEE

Comments

@xxllp
Copy link

xxllp commented Aug 23, 2022

我又来了,还是有问题想请问下:

  1. 按照论文里面的pipeline 只有单触法词的模型训练(非伪触法词) ,触法词识别是先ner 然后作为图构建的节点
    在构建子图分解的时候 这个触法词节点是作为最大子团来的吗?
    2.代码里面 如何判断那些mention是伪触法词(或者触法词) 需要在span_context_list 里面获取对应的下标
@xxllp xxllp added the discussion Discussion on DocEE and SentEE label Aug 23, 2022
@Spico197
Copy link
Owner

您好,

  1. 是的;
  2. 暂时没有实现这个功能,默认经过BK算法后得到的完全图中所有节点都是伪触发词。可能会存在NER时识别为触发词,但是BK解码时不为触发词的情况,暂时还没有统计过。

@xxllp
Copy link
Author

xxllp commented Aug 25, 2022

这个里面 如果是多事件的话 多个trigger(或者伪触法词)对应的ner 词 在最终构建的子图矩阵里面的下标是怎么确定的呢 ?
我看到的是第一个位置应该是的 但是多个的这个我就没太搞懂了~~ 还是有啥判断方式

mention_type_list 这个里面是对应这块的所有mention的类型 ,但是有重复的 这个是怎么跟图矩阵对应上的

@Spico197
Copy link
Owner

或许这个函数里有您想要的答案。
NER部分得到的答案中,所有实体是一视同仁的,并不会区分它是不是伪触发词,除非人为定义它的实体类型为Trigger,那么可以通过从mention_type_list中找Trigger对应的mention。

通过这里的代码可以看出,mention类型只用来对mention的表示进行增强,在当前版本的PTPCG中,和图矩阵没有关系。

@xxllp
Copy link
Author

xxllp commented Aug 25, 2022

明白 在duee-fin 这种数据集上面 我其实也就是要知道人为定义的Trigger 的生成过程
比如 我将 单个mention_type_list 打印出来如下
[3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 9, 9, 9, 9, 9, 15, 15, 15, 15, 16, 17, 17, 16, 17, 17, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 16, 13, 19, 5, 21, 11, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]

但是最终的图矩阵shape torch.Size([18, 18]) 这二者是怎么对应上的 如果是去重数量上也对不上

@Spico197
Copy link
Owner

嗷嗷,明白了。您其实是在问mention和span(或者说,entity)之间的关系。一个实体在文中会出现多次,也就是有多个mention,所以同一实体的不同mention之间会做个max-pooling,以获得最终实体的表示。

@Spico197
Copy link
Owner

至于span的位置的话,预测的span会先转换为金标span的index,以便于邻接矩阵的loss求解:

(gold_span_idx2pred_span_idx[gold_span_idx], field_type)

@Spico197
Copy link
Owner

mention和span之间的位置对应关系可见这里:

# one span may have multiple mentions
# tzhu: just flatten the dranges and mentions from sentence-independent data orgnisation format to flat list format
(
span_mention_range_list,
mention_drange_list,
mention_type_list,
) = get_span_mention_info(span_dranges_list, doc_token_type_mat)

@xxllp
Copy link
Author

xxllp commented Aug 25, 2022

我通过span_mention_range_list 和 mention_type_list 的组合 拿到了指定类型的 下标
这样可以确定其在 相似矩阵的下标

@xxllp
Copy link
Author

xxllp commented Aug 25, 2022

这里面 如何获取span 对象所属的事件类别 还是只能从子图这块获得

@Spico197
Copy link
Owner

这里面 如何获取span 对象所属的事件类别 还是只能从子图这块获得

只能在最后的event record generation处获得

@Spico197 Spico197 changed the title 触法词的问题 触发词的问题 Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Discussion on DocEE and SentEE
Projects
None yet
Development

No branches or pull requests

2 participants