Supervised Understanding of Word Embeddings

Supervised Understanding of Word Embeddings

[TOC]

tags: NLP,Embedding

論文網址

Introduction

預訓練的word embedding被廣泛用於自然語言處理中的轉移學習(transfer learning)

由於w2v是在unsupervised下學出來的,其維度無法很好與task做mapping,所以通常會再多加上一層linear(dense)來map到對應的問題,雖然這最後一層是optimized by task 但是這一層不那麼有解釋性:在這一層dense下,某一些維度可以被視為近似而有一部分的dimension則在有稀有單詞出現時才被激活,在使用LSTM或是CNN時,這一個現象更難被解釋,且在做完這一步之後很難transfer learning到不同的task上,因為已經被optimized過了。
在此文章中,研究有意義的投影,透過使用關鍵詞(supervision)的label來找出”supervised dimensions”(有意義的projection)

example:
投影到兩個 supervised dimension(sports,animal):SD1 trained for keywords related to sports word "bat" is closer to "ball" in this dimension compared to the projection of word "fly". On the other hand, SD2 is trained for keywords related to the animal category. Hence for this dimension, projections of "bat" and "fly" are closer to each other compared to "bat" and "ball".

  • Keeping dimensions aligned in a semantically coherent way
  • Obtaining groups of semantically similar words(semantic dictionary)
  • Each supervised dimension can be treated independently and does not influence the order of words in any other projection(因為沒有normalized)
  • 根據字的機率做排序有機會可以進一步完善 semantic dictionary on target topic
  • 在這種情況下的dictionary 可以被單個向量所表示
  • 由於基於主題所建構的相似性模型可進一步用於在語義表示空間中獲得document representation
  • 通過與另一種語言的embedding做對齊,可進一步或的該語言的semantic dictionary 而不必再重新訓練 supervised dimensions(因為是連續性的結構,可以很輕鬆的轉換到不同的task)例如,使用這些線性投影的學習權重來初始化高階網絡的可訓練層
  • 在各種網絡配置中,supervised dimensions可以提高F1 score

Embedding

  • Word vector
  • Contextual vector

    W2V + Dense

    傳統的model都是word embedding + dense(轉到高維度):會使得這些embedding在特定部分被激活,這些激活的詞可被視為主題或是字典集,但是這一功能沒有明確的可控制性(解釋性)。要有控制性的話,可以針對任務主題去增加或刪除單詞(選擇字典集)但是這樣做很耗時。

基於word embedding的半自動管理方式:
將新的關鍵字自動推薦到術語擴展字典集。SetExpander: End-to-end term set expan- sion based on multi-context term embeddings

在此文的設置中,使用一個簡單的線性邏輯分類器來訓練 feature。 在這項研究中,研究了這些投影的不同性質以及如何使用在高階網絡中投影中

Topic models

參考網址
相關:topic embedding,LDA2vec

Topic model(train on specific corpus) not optimized for final task。For example:medical words grouped into one topic,but cardiovascular diseases(心血管疾病)不會有一個獨立的topic。
換句話說,要控制model針對特定的性質有一個主題是非常困難的。

Interpretable dimension

  • 對unsupervised 降低維度透過AE or PCA,在此文中側重利用supervision 來提取出 interpretable dimensions

  • 像圖中所示,通過訓練二元分類器來使用詞嵌入的線性投影,而這個二元分類器透過使用主動式監督學習(on normalized vector:確保分類器有相似結果在cosine similarity的分數很高時,因此在相似主題(positive word)有較高的分數)
  • 由於正規化的詞向量位於超球面上,因此每個分類器在幾何上對應於一個hypercap。

    Step

  1. Logistic regression as classifier model(其他線性分類model也行)
  2. Initial stage:positive keywords(same topic) are provided
  3. Randomly sampled negative words are added to train a binary logistic regression.
  4. 其餘的字透過使永logistic regression來找出結果
  5. 排序的字中最高分數的加入初始的postive”關鍵字集”
  6. 重複3到5for few iteration來得到最終版本的分類器
  7. 通過添加 positive或negative關鍵字來管理(enrich)topic base projection and generalize level projection

Applications of Supervised Dimensions

  • 使用scikit-learn線性logistic回歸模型(正類權重為2)來增強positive word的效果。
  • 在L2 normalization之後,使用了Fasttext Common Crawl詞嵌入的前250k個詞
  • Transfer Learning

  • 用易於獲得的大型數據集學習部分或是整個NN的weight,ie.Language model,其後對應於特定的task來fine-tuned這一個task-specific loss functions
  • Model:Concatenated transformed embedding from unsupervised and supervised dense layer + multi-layer BiLSTM
  • 訓練好的logistic regression(keyword classifiers) 在network中被當成是nodes用來取代在dense layer中的權重。
  • Activation function可以更改,因為線性的初始化(Supervised)為後續的訓練提供了重要的基礎,允許這些預先訓練好的權重(Embedding and Supervised)可以被更改可以增加效能,除了原先訓練好的supervised dimensions,再加上隨機初始化的unsupervised dense可以增加準確度,dropout用來regularize這整個structure

Task:Identification on smoking status

(label:”previous smoker”, ”non-smoker”, ”current- smoker” and ”unknown”)
通過某些關鍵字選擇相關的句子,從報告的文字中判斷吸菸狀態

  • NLTK tokenizer
  • F1 score to assess performance
  • Standard BiLSTM
  • 在embedding後面接上unsupervised dense
  • 3846個 example
  • 5-fold cross-validation with 20 repetitions and reported the average for each configuration
  • Adam optimizer,lr=$10^{-3}$

    像是圖中所示在embedding後面加上dense 可以增加performance,此外,初始化過的linear keyword classifier提供了額外的(supervised)performance

The dense layer activations in this experiment can be precomputed since every word corresponds to a unique value. Thus our method can be considered as augmentation of word embedding dimensions via informative interpretable projections.

Dictionary Curation(詞典管理)

透過之前描述的supervised dimension,可以直接找出topic-specific dictionary(藉由上一節描述的embedding database的預測結果來做到),可以設定threshold來取得完整的word list,可以用來找尋關鍵字(KS)或是實體識別(NER)任務

✩這裡有一個主要的問題:要如何準確的判斷未被標記的部分被線性分類器正確的分對
$\quad$

對這些分類器進行評估,保留了10%帶有註釋的關鍵字以用來進行驗證
對30個不同的分類器(based on current data)計算(micro,macro)平均的 F1 score,就結果表明此方法可以用於創建具有”高度連貫性結構”??的topic-specific dictionary

Dictionary Curation on Multiple Languages(subtask)

在沒有重新訓練分類器來判斷不同語言的主題性(其他語言的字典)
可以使用一種語言訓練出來的分類器可以在多種語言上執行
作法:

  • 在基礎的word embedding上對齊

證明方法:

  • 預先訓練好一個分類器(用”smoking”,”smoker”,”tobacco”當成positive)
  • 並用 German(德語) 和Dutch(荷蘭語)對齊 word embedding
  • 排序(base on probability)
  • 用supervised dimension 可以減少將模型縮放到多種語言

Polysemy Representations(多意義表示)

Different projections of the same keyword contain different meanings in the word vector space. In other words, cosine similarities among words are different in sub-spaces. This can be verified by training specific supervised dimensions with a few keywords.
同一個關鍵詞在空間向量中的不同投影中有不同的含義
換句話說:一個單字在子空間中的cosine similarity是不一樣的。
可以使用一些關鍵字訓練特定的supervised dimension來驗證

實驗:用3個positive keywords 並且在supervised dimension上隨機取3個negative sample。圖中顯示了對詞彙表中其餘單詞投影的前8個在左半邊,選定keyword,第一個play 代表了 baseball-related的concept(用play+run+bat),而第二個代表了art。兩個都可以與play相關,且有”play”這個字在內。當在數入文本中出現了play這一個字,這兩個相關的supervised dimension會被activate,代表了它具有多義性的功能。同樣的bat在”animal”vs.”play”有不同的最高得分的單詞。

Interpretation of Supervised Dimensions

說明supervised dimensions 的可解釋性

Activated words in Dense layer outputs

為了檢測supervised dimension的相關性,研究了dense layer的outputs且蒐集了可以觸發各種supervised dimension的字典集。
使用在吸菸狀態的識別實驗中訓練好的分類器以及相同網路架構。
從dense layer(supervised)選擇了三個相關的dimensions(initializaed weight learned from classifier)且對這些dimensions找出分數最高的幾個字。同樣的,從random initialized(unsupervised)的dense layer 從三個output nodes選出分數最高的幾個words

  • 有趣的是,即使在經過fine-tuning之後,這些維度也大多保留了原本對主題訓練的特性,與之相對的unpuservised dimension在這些單詞之間則無連貫性的結構。

    Toy example from mtsamples for word “chest”,使用了另一個dataset中的unique words
    且激活值小於5的沒有被分配到任何分類器,且大多是由停用詞(stopword)組成。

Powered by Hexo and Hexo-theme-hiker

Copyright © 2020 - 2021 DSMI Lab's website All Rights Reserved.

UV : | PV :