eric88525
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    --- ###### tags: nlp --- # A Frustratingly Easy Approach for Joint Entity and Relation Extraction [acl 2021](https://aclanthology.org/2021.naacl-main.5/) [參考1](https://zhuanlan.zhihu.com/p/359947282) [參考2](https://www.163.com/dy/article/FQURE38K0511DPVD.html) # 重點 + 提出了新的 pipeline,作法為讓 name entitie recognition 和 relation extraction 使用不同 encoder,最後設計出一套流程整合 + 提出了加速的方法 + 讓 entity marker 共享 position embedding + attention 調整 + 多種分析 + 不同加入 entity marker 的方式 + 共享 encoder + 跨句子的輸入 + Mitigating Error Propagation # 介紹 + **End-to-end relation extraction** 任務目標是 (1) 識別出 **name entities** (2) 找出實體間的 **relation**。 + 過去的作法為把兩者一起做 (共享預訓練模型或是整合成一個任務),並認為此 joint models 的作法能更好的捕捉實體和關係的資訊。但本篇將兩任務流程**分開**,並使用不同 encoder,最後在 ACE04, ACE05 and SciERC 達到了 SOTA + 可以這樣做的原因是作者觀察到: + name entity 和 relation model 會學到不同的 contextual representations + 在 input layer 就加入 entity information (塞入特別token) 是很重要的 + leveraginig(利用) cross-sentence information 對兩個任務都很有幫助 + 最後提出了加速流程的方法 # 方法 ## 目標 > Input 給予一串 tokens $X = x_1,...x_n$,可組合出 a set of spans $S={s_1,...s_m}$ (理論上要限制長度,含n個token的文章,會有 $n(n+1)/2$ 種排列) > Output A set of entities $Y_e = {(s_i,e):s_i \in S, e \in E}$ + s: span, e: entity type A set of relations $Y_r=\{(s_i,s_j,r):s_i,s_j \in S,r \in R\}$ + s:subject/object span, r:relation type > 整體架構 > ![](https://i.imgur.com/nesGtou.png) ## Entity model 這階段模型對 span 做 NER,看其是哪個類別 在給予 span $s_i \in S$,其特徵表示 $h_e$ 為開始 + 結束 token 和長度的 feature 串接而來 $$ h_e(s_i) = [x_{start(i)};x_{END(i)}; \phi(s_i) ] \\ $$ - $\phi(s_i)$ 代表 learned embeddings of span width features 最後丟入 linear + softmax 來分類 ![](https://i.imgur.com/oIbEM0F.png) ## Relation model 找到實體後,在實體前後加上 **type marker** [S:類別] 和 [O:類別],分別代表 subject 和 object。 實體關係表示為兩實體的開始特殊 token 串接而來,一樣丟入 linear + softmax 分類 **注意:** 這只能一次檢驗一種關係,並不是把所有的實體同時加入 marker ![](https://i.imgur.com/1Tlop44.png) 在實體前加入特殊 marker 的概念源自 + ERNIE: Enhanced language representation with informative entities + Matching the blanks: Distributional similarity for relation learning + Knowledge enhanced contextual word representations. ## Cross-sentence context 跨句的資訊能幫助任務,在 entity 和 relation model 固定 windows size 為 $W$ + 給予 n words 的輸入,那就會有 $(W-n)/2$ 種可能 (從左到右/右到左) ## Training & inference 兩個模型都用 cross entropy 當作 loss function,有 * 標示的為正解 ![](https://i.imgur.com/m4kRFQV.png) Relation model 只考慮正確的關係來訓練,作者有考慮訓練所有的 span (with pruning) 但沒啥用。 ## Efficient Batch Computations Entity pair 太多造成運行時間久,我們提出了近似模型有以下改動 + 不直接把 entity marker 插入句子,反而是共享 position embeddings + 如上面整體架構圖片所示,把所有的 marker **放到最後**,並共享 position embedding ![](https://i.imgur.com/h6TVRlp.png) P(-) 為 position id,如果我們想找出 A - B 的關係,那 <S:類別> 和 B 的 position embedding 是一樣的 此外強迫 text token 只關注(attend) text token,entity marker 則都關注。這改動能讓我們重複利用 text tokens,因為 text token 和 entity marker 是沒關聯的。 # 實驗結果 We evaluate our approach on three popular end-to-end relation extraction datasets: + ACE055 + ACE046 + SciERC (Luan et al., 2018). SOTA 等級的結果 ![](https://i.imgur.com/4ZuxE8Y.png) 在前面提到的加速 + For example, we obtain a **11.9×** speedup on ACE05 and a **8.7×** speedup on SciERC in the single-sentence setting. # 分析 ## 實體表示 論文對關係模型起關鍵作用的因素進行研究,首先就是分析不同實體表示方式的影響。文中共建了6種實體表達方式: * TEXT:直接提取原始文本中,實體span所對應的編碼表示。 * TEXTETYPE:在TEXT的基礎上,concatenate實體類別向量。 * MARKERS:將標識符S、/S、O、/O插入到原始文本中,但是標識符沒有實體類別信息。 * MARKERSETYPE:在MARKERS的基礎上,concatenate實體類別向量,這是一種隱式的融入實體類別的方法。 * MARKERSELOSS:在關係模型中,構建判別實體類別的輔助loss。 * TYPEDMARKERS:就是本文所採取的方法,實體類別“顯式”地插入到文本input中,如<S:Md> 和</S:Md>、<O:Md>和</O:Md>。 ![](https://i.imgur.com/bqxcoCY.png) ## 共享 Encode **共享 Encoder** 後反而變爛了,推測是因為輸入格式不同導致 ![](https://i.imgur.com/u55wLvv.png) ## Mitigating Error Propagation 誤差傳播 relation model 在訓練時只用正確的關係來訓練,但在 inference 時卻加入錯誤的 relation,這樣會造成**暴露偏差**。 加入錯誤關係的實驗,論文採用 10-way jacknifing(交叉驗證) 做相關實驗,發現效果變糟,同時論文也討論是否一定要用 type-marker。 ![](https://i.imgur.com/DoEE7l1.png) ## Effect of Cross-sentence Context 調整前面提到的 windows size $W$ ,得到了更高分 ![](https://i.imgur.com/16jPGnW.png)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully