论文阅读-Event Detection without Triggers

Event Detection without Triggers(腾讯、NAACL2019、源码&无数据集源码
原文链接:原文链接
(1)背景
事件检测(Event detection)的目标是检测文本中是否含有事件并对其进行分类。传统的事件检测任务往往首先识别文本中的事件触发词(Event trigger),然后对触发词进行分类。这类任务需要预定义触发词字典并耗费大量时间对触发词进行标注。为减少人工成本,本文提出了无触发词的事件检测模型,在ACE2005英文数据集上取得了较好的效果。
无触发词的事件检测任务存在的挑战:
1) 多标签问题(Multi-label problem):每个事件文本可能含有零个或多个事件。
2) 触发词稀缺问题(Trigger absence problem):样本中可能不含触发词
为解决以上问题本文将多标签分类任务(Multi-label classification)转化为多个二分类任务(Multiple binary classification),如下图所示。
在这里插入图片描述
(2)模型与工作
在这里插入图片描述
本文的数据集是ACE2005英文数据集,该数据集有8个大类,33个子类,本文设置了34类(33个真实类型和1个代表空的NA类型)event type。本文的整体思想是将句子及其对应的事件类型送入模型中提取相关特征向量最后送入二分类模型中进行分类。模型的处理流程如下。
1) 输入&预处理
对于给定的句子,使用Stanford CoreNLP分词工具进行分词处理。模型的输入是词token及其对应的tag,实体及其对应的tag。
2) 生成词/实体向量
使用Skim-gram模型从NYT语料中学习词向量。为每个entity tag随机初始化一个embedding table,将所有的输入word token和entity tag通过look up table转化为低维的向量d_w和d_e。
3) 生成event type embedding
将事件类型(event type)随机初始化为两个相同的向量t_1和t_2,其中t_1是用来捕获句子的局部特征,t_2是用来捕获句子的全局特征。
4)特征提取层(LSTM layer)
该层的输入是word embedding与entity embedding的拼接。该层最后一个单元记录了当前句子的全局信息,如模型图中红色虚线圈中的部分所示。
5)注意力层(Attention layer)
注意力层的输入是当前句子对应的事件类型的向量t_1和特征提取层输出的隐层向量h。该层输出的注意力得分α对应每个token。通过训练,注意力机制对隐层的触发词向量关注度最大。如下图所示。
在这里插入图片描述
对每个token计算注意力的公式如下:
在这里插入图片描述
最后得到当前句子的向量表示S_att:
在这里插入图片描述
其中α = [α1, …, αn]对应每个token的注意力得分,H= [h1, h2, …, hn],对应每个token的隐层向量。
6)模型预测层(输出层)
该层的输入是V_att和V_globa,其中V_att是事件类型向量t_1与句子特征向量S_att的点积,它表征的是句子的局部特征(主要捕获触发词的特征),V_globa是LSTM层最后一个单元的输出向量h_n与事件类型向量t_2的点积,表征句子的全局信息。最后通过以下公式得到二分类的预测输出。
在这里插入图片描述
其中σ代表sigmoid函数,λ ∈ [0, 1]是一个权衡V_att和V_globa的超参数。模型预测的阈值是0.5,即若以上公式计算的值大于等于0.5则当前event type的预测值为1,表示当前句子包含该event type。
实验
本文做了很多对比实验。这里只列举其中一个实验结果。
在这里插入图片描述
MC开头的是多分类实验(Multi-class classfication)BC开头的是二分类实验(Binary classfication)。
从实验结果可以看出二分类比多分类实验效果号很多,因为二分类可以解决文章开头提到的多标签问题(一个句子中可能包含多个事件)。

关注我的微信公众号,一起变强!
在这里插入图片描述

### Notification Workflow in Software Development In software development, notifications play an essential role in informing users or systems about specific events or changes within applications. The notification workflow typically involves several stages from event detection to delivery. #### Event Detection The process begins when certain predefined conditions are met inside the system. These could be user actions such as submitting a form, completing a task, or reaching milestones like deadlines being approached. In some cases, these triggers might also come from external sources through APIs or webhooks[^1]. #### Processing Logic Once triggered, processing logic determines what type of message should be sent based on rules defined either statically during development time or dynamically via configuration files. This stage may involve checking permissions, personalizing messages according to recipient preferences (e.g., language), and determining appropriate channels for sending out alerts—email, SMS, push notifications, etc.[^2] #### Queue Management To ensure reliable delivery even under high load scenarios where immediate response isn't always possible due to resource constraints, many implementations use queues. Messages get placed into this buffer temporarily until they can safely reach their destination without causing performance issues elsewhere within the application stack[^3]. ```python import queue def enqueue_notification(notification): q = queue.Queue() q.put(notification) def send_notifications(): while not q.empty(): notify = q.get() # Send each notification here... ``` #### Delivery Mechanism Finally, once processed and dequeued appropriately, actual transmission occurs over chosen mediums directly connecting back-end services with end-users' devices. For instance, emails would go through SMTP servers; mobile pushes require integration with platform-specific providers like Firebase Cloud Messaging (FCM).
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值