陳柏龍
    • 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
      • Invitee
    • 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
    • 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 Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync 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
Invitee
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
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
# 論文心得及想法 這裡就記錄一些我讀論文的 murmur 、心得及簡短摘要。 ## Convolutional Neural Networks for Sentence Classification 讀論文順便做一些心得或其他 murmur ### Abstract - 不懂啥是 pre-trained word vectors > 我似乎有點概念了,不過先讀完這篇在仔細研究 > ... 我會了 > 交給你惹 (我把我查到的放在下面) - static vectors --- 我懂ㄖ - 總之這篇的 CNN 模型中在 7 個任務表現中, 提升了其中 4 個(情感分析及問題分類) ### 1 Introduction - 第一段:語義相近的詞向量在低維向量空間中,歐氏或是餘弦距離下是要接近的 - 第二段:CNN 這種可以萃取局部特徵的模型被實證出在語義分析、資料檢索、語句模型及其他傳統 NLP 項目上有優異的表現 - 第三段:ㄜ...後半段不太懂,應該就是指我們可以拿預訓練過的詞特徵來做任務就是了,task-specific vectors by having multiple channels不太懂 - Razavian 是啥 ? - 這篇的模型只用一層卷積層(感覺在現今似乎可以改良,用 FCN 或是多層,反正就是深度) ### 2 Model ![](https://i.imgur.com/x44opn2.jpg) - 模型結構就圖同上圖,跟一般的 CNN 不太一樣 - ⊕ 是一個特殊運算子,用來串聯詞向量 - 公式懶得打QQ - 這裡的激活函數用 tanh (或許可以改良成 relu 或是 selu (再看看)) - max-over-time pooling >就每個濾鏡卷出來的東西直接做池化變成只剩一個,所以 n 個濾鏡最後就會有 n 個對全連接層做輸入,可以應付不同長度的句子 - 問題 1 :第一層的卷積操作是單通道的還是多通道 ? (前面好像有提到不過我先糊塗過去) > 不過感覺單通道比較合理,因為每一個句子長度不一樣 > - 我看到後面發現我想錯了 - 後來加了一點變化(請看 3.2 ) #### 2.1 Regularization - 就講一下正規化的方法 - 這張表有一點看不懂![](https://i.imgur.com/25muDK2.jpg) - 不太懂沒預訓練的要怎麼處理 In one of the model variants, we experiment with having two ‘channels’ of word vectors—one that is kept staticthroughout training and onethat isfine-tuned viabackpropagation (section 3.2). > 可能輸入 word vector 前面再多一層 one-hot encoding 作為輸入 > 原來的雙通道輸入就變成第一隱藏層 - 好先這樣晚點再補充 ### 3 Datasets and Experimental Setup - 介紹一下資料集 ## Convolutional Neural Networks for Sentence Classification-------上台報告摘要 這篇論文做的事,就是用 CNN 去處理句子。 - 把每一個句子轉換成一張圖片 - 做句子的分類(情感,評分(正面、負面)) - 模型為 CNN 的變體,在卷積層中,濾鏡的掃描方式是單維掃描 > word vector 為 k 的話 ,濾鏡形狀就是 n * k (n 是要調的超參數) ### Abstract 這篇用了 CNN 模型去對 pre-trained word vectors 做語句分類,從結果來看,簡單的 CNN 模型在經過一些調整後,在 multiple benchmarks 就可以獲得優異的表現,再加入 task-specific(客製化的概念吧?)的 word vector,可以讓結果有進一步的提升。 最後在 7 資料集中提升了其中 4 個的準確率(和前人的模型比較) 大家可能有問題的關鍵字 - **pre-trained word vectors** - **static vectors** - **task-specific word vectors** ### 1 Introduction 前面的部分沒有甚麼,就是一值在吹捧 Deep Learnig,我都快變成信徒了。 - 本次的 CNN 模型只有一層卷積層 - **pre-trained word vectors** Mikolov 從 Google News 的一億個單詞預訓練好的 **繼續吹捧** 一開始先讓這些 word vector 固定住(static),去建模,然後稍微調整超參數(hyperparameters),就可以達到很好的效果,之後再把這些 word vector 根據這些資料集在做訓練,準確率可以得到進一步的提升,最後他們嘗試了**雙管齊下** (both pre-trained and task-specific vectors by having multiple channels.) ### 2 Model ![](https://i.imgur.com/x44opn2.jpg) 模型結構就圖同上圖,跟一般的 CNN 不太一樣 為 輸入詞(應該是 one-hot encoging 還沒查到) - word vector - conv(variant) - max-over-time pooling - fully connected softmax output(每個類別的機率) - 語句矩陣 每個句子的詞都被轉為 word vector 合併成一張類似圖片的矩陣 - 卷積層(有 padding) 濾鏡移動方式和一般的 CNN 不同 激活函數使用 tanh > 問題 : 有些 word vector 不在預先練好的詞庫中,要怎麼處理 ? > - 不知道是不是答案,它裡面有說:Words not present in the set of pre-trained words are initialized randomly. - 池化層 採用 **max-over-time pooling**,所以一個濾鏡最後會只萃取出一個特徵。這種方式的好處是可以克服句子長短不一的問題。 - 全連接 softmax 層 把池化後的 featrue 接上全連接 softmax 層做為輸出。 - 3.2 提到了一個模型的變化(雙通道) #### 2.1 Regularization 正規化的方法(防止過度配適) 在倒數第二層加上 - Dropout (拿掉一定比例的 feature) - l2 限制項(不讓倒數第二層連到的 l2 範數大於某個值) ![](https://i.imgur.com/25muDK2.jpg) - 關於模型變化 > 可能輸入 word vector 前面再多一層 one-hot encoding 作為輸入 > 原來的雙通道輸入就變成第一隱藏層 ### 3 Datasets and Experimental Setup - 介紹一下資料集 #### 3.1 說明怎麼調參 #### 3.2 Pre-trained Word Vectors **初始化的 word vector** 用 word2vec 預先訓練好的模型得到的。 ## 實作 本來想用 TensorFlow 做,但是發現短時間內還無法熟練操作,而且 Keras 似乎做得出來,所以 TF 的部份等我比較熟練再說,先用 Keras 做吧! **參考資料** - [TensorFlow 版本,由 Denny Britz 實作](https://github.com/dennybritz/cnn-text-classification-tf) - [Keras 實作,作者 Alexander Rakhlin 有看過 Denny Britz 那篇](https://github.com/alexander-rakhlin/CNN-for-Sentence-Classification-in-Keras) - [原論文作者實作](https://github.com/yoonkim/CNN_sentence) - [NLTK 初學指南(一)](https://medium.com/pyladies-taiwan/nltk-%E5%88%9D%E5%AD%B8%E6%8C%87%E5%8D%97-%E4%B8%80-%E7%B0%A1%E5%96%AE%E6%98%93%E4%B8%8A%E6%89%8B%E7%9A%84%E8%87%AA%E7%84%B6%E8%AA%9E%E8%A8%80%E5%B7%A5%E5%85%B7%E7%AE%B1-%E6%8E%A2%E7%B4%A2%E7%AF%87-2010fd7c7540) - [以 gensim 訓練中文詞向量](http://zake7749.github.io/2016/08/28/word2vec-with-gensim/) - [word2vec](https://code.google.com/archive/p/word2vec/) - [論文資料集](https://github.com/AcademiaSinicaNLPLab/sentiment_dataset) 我先照著做 Alexander Rakhlin 的 Keras 實作部分,試著理解他的代碼 ### 資料處理部分 **data_helpers** 作一些資料處理 - load_data_and_labels - 讀資料的部分會有 error 我在 code 裡加了忽略 error 的指令 > positive_examples = list(open("./data/rt-polarity.pos",errors='ignore').readlines()) - clean_str,清理資料 - 把一些縮寫('ll、'd、n't)前面加了空白,方便斷詞,例如他會想把 didn't 弄成 did 跟 n't - 正規表達式,[參考](https://www.crifan.com/python_re_sub_detailed_introduction/) > string = re.sub(r"[^A-Za-z0-9(),!?\'\`]", " ", string) 不太懂 - str.strip(char) : 移除頭尾的字,例如 str.strip() 可以去掉該字串的頭尾空白 - pad_sentences - 把全部的句子作填補<PAD/>的處理,讓每個句子一樣長 - 不懂為何補<PAD/> - ...其他有待理解 - 目前問題 1. 跑出來的東西好像不太對, x, y, vocabulary, vocabulary_inv_list = load_data() 的部分 **w2v** 這個模組就是要把得到 word2vec 嵌入層的權重 #### 9/30 希望進度 希望下次上課前能把資料處理好 第 4 周上課以前作好基礎模型 ## 立諭參一腳 Convolutional Neural Networks for Sentence Classification ### Abstract 論文中報告了一系列的卷積神經網路(CNN)的模型測試,這些模型都是基於預訓練的詞向量的輸入來進行訓練的。 他們用了一個簡單的CNN模型,效果就還不錯?(跟國泰一樣嘛?),調整了一點參數跟輸入靜態的詞向量,調整參數大師是他。 透過CNN模型可改善現有的七個技術中的4個技術,包括情感分析及問題分類。 [Word Embeddings - 單詞嵌入](http://ahogrammer.com/2017/01/20/the-list-of-pretrained-word-embeddings/) [Word2Vec的簡介](https://zhuanlan.zhihu.com/p/26306795) [cs224d的講義](https://cs224d.stanford.edu/lectures/CS224d-Lecture13.pdf) 變成詞向量就跟圖像辨識很像惹,池化後卷積再丟入全連接層訓練一下就很棒惹。 在目前的工作中,我們描述了一系列基於word2vec構建的卷積神經網絡的測試。 儘管對超參數的調整很少,但是具有一層卷積的簡單CNN表現得非常好。 我們的結果增加了公認的證據,即非監督的單詞向量訓練是NLP深度學習的重要組成部分 ## ### 摘要 - 缺乏 - 平行化資料(parallel data) - 適合的評估方式(reliable evaluation metrics) - 為了克服上述缺點 - 多任務訓練 - 對抗訓練 - 風格轉移後跟人的判斷有高度相關 - 本論文賣點 - 建立了一個新聞標題資料集以推動後續研究 - 提出了兩種評估的指標 - 1 轉換強度 - 2 內容保留程度 - 和人類評估的結果有高度相關 - 提供了**兩種**不需要平行語料的模型,各自有不同優勢 ### 近期工作 **電腦視覺的風格轉移** - Gatys, Ecker, and Bethge (2016) 將內容(content)和風格(stlye)分開 設計簡單模型將圖片變色 一種風格可以用一張圖片表示 **但是這招不適合用在文本上** **因為短文或是句子並無足夠的風格資訊** - Zhu et al. (2017) - 提出了 CycleGAN - cycle training - ... > 看不懂我應該要先會 GAN - Li et al. (2017) 也提出了一種方法 將風格轉移問題當作是領域適應問題(domain adaptation problem) 有特殊的指標 但對文本來說沒有相似的指標 #### 自然語言處理的風格轉移 - Jhamtani et al. (2017) - 將現代英文轉成莎士比亞英文(使用平行語料) - pointer network(Vinyals, Fortunato, and Jaitly 2015) - *但是其他任務沒辦法這樣搞,要消耗很多資源(??不太確定是這樣翻)* - 其他任務很少有這類平行語料 近期沒有使用平行語料的工作 - Mueller, Gifford, and Jaakkola (2017) 使用 VAE - Shen et al. (2017) 本論文認為**內容保留**是一個重要的評估指標 **Ficler and Gold-berg (2017)** 用 CRNN 控制生成文本時的語言風格 上述研究工作和本次論文探討的工作相比起來 上述的工作在轉移風格時並沒有代表風格的來源語句 **重要名詞** - CRNN(conditioned recurrent neural networks) 之後要會的 #### 領域分離的對抗網路 - 分離問題 - 懶得寫 - **maximize joint maximum mean discrepancy** 對抗網路如何控制生成還未經太多考驗 ### 模型 兩種模型 - 1 多重解碼器 - 2 風格嵌入 - 學習句子內容的表示 - 多重解碼器 - 每一種解碼器都是一種風格 Chen et al. (2017) used an adversarial network to separate the shared and the private features for multi-task learning to help chinese word segmentation 用對抗式網路做中文斷詞 --- **暫停** - 複習 GRU

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