WordPiece與BPE的區別

2021-10-08 06:34:58 字數 718 閱讀 5073

博主在網上搜bert的wordpiece時,發現很多文章都說bert的wordpiece就是bpe(byte-pair encoding), 這個說法其實是不對的,wordpiece和bpe有相似性,但是並不是一回事。

wordpiece是這個:

wordpiece需要在訓練集上訓練乙個語言模型,每次挑選能最大化減少logloss的word unit。

bpe是統計詞對的頻數,每次挑選頻數最大的那個作為word unit。所以,wordpiece和bpe可不是一回事兒哦。

最後總結一下,bert使用的是wordpiece,可以參考文章[1],[2]。gpt使用的是bpe,可以參考文章 [3]。

[1] google』s neural machine translation system: bridging the gap between human and machine translation.

[2]japanese and korean voice search.

[3]neural machine translation of rare words with subword units.

一文讀懂BERT中的WordPiece

2018年最火的 要屬google的bert,不過今天我們不介紹bert的模型,而是要介紹bert中的乙個小模組wordpiece。現在基本效能好一些的nlp模型,例如openai gpt,google的bert,在資料預處理的時候都會有wordpiece的過程。wordpiece字面理解是把wor...

XmlNode與XmlElement的區別總結

今天在做c 操作xml文件的過程中,發現了兩個類 xmlnode和xmlelement。這兩個類的功能極其類似 因為我們一般都是在對element節點進行操作 上網蒐羅了半天,現在總結如下 1 通過繼承關係xmlelement繼承自xmllinkednode又繼承自xmlnode類,由此可知xmle...

DeleteDC 與 ReleaseDC的區別

deletedc 與 createdc 對應 releasedc 與 getdc 對應 借過來的 getdc 就要放還回去 releasedc 自已建立的 createdc 要自已刪除 deletedc 總之,要 用過之後,不留痕跡 還有以下的特殊情況,如cclientdc dc this 或cpa...