L'année 2018 a marqué un tournant dans le développement de modèles d'apprentissage automatique visant à résoudre des problèmes de traitement de texte (ou, plus exactement, de traitement du langage naturel (PNL)). Une compréhension conceptuelle de la façon de présenter des mots et des phrases pour l'extraction la plus précise de leurs significations sémantiques et des relations entre eux se développe rapidement. De plus, la communauté NLP promeut des outils incroyablement puissants qui peuvent être téléchargés et utilisés gratuitement dans leurs modèles et pipelines. Ce point de basculement est également appelé moment ImageNet de la PNL , se référant au moment il y a plusieurs années, lorsque des développements similaires ont considérablement accéléré le développement de l'apprentissage automatique dans le domaine des problèmes de vision par ordinateur.
![transformateur-ber-ulmfit-elmo](https://habrastorage.org/webt/uh/cd/qv/uhcdqv--w2t4i8srv9rtzjgk9ac.png)
(ULM-FiT n'a rien à voir avec Korzhik, mais quelque chose de mieux ne s'est pas produit)
– BERT', , NLP. BERT – , NLP-. , , BERT', . , , , .
![apprentissage-transfert-bert](https://habrastorage.org/webt/pz/zk/xy/pzzkxyzmqf21r5rik00228zntwm.png)
BERT'. 1: ( ); 2: .
BERT , NLP-, , : Semi-supervised Sequence learning ( – Andrew Dai Quoc Le), ELMo ( – Matthew Peters AI2 UW CSE), ULMFiT ( – fast.ai Jeremy Howard Sebastian Ruder), OpenAI Transformer ( – OpenAI Radford, Narasimhan, Salimans, Sutskever) (Vaswani et al).
, , BERT'. , , .
:
BERT – . :
![Bert-classification-spam](https://habrastorage.org/webt/mx/eo/u_/mxeou__qytr_9_2m6pxjo2icemc.png)
, , (classifier) BERT' . (fine-tuning), Semi-supervised Sequence Learning ULMFiT.
, : , . . («» « »).
![jeu de données étiqueté comme spam](https://habrastorage.org/webt/hy/qr/pa/hyqrpadlqytj81eqk3xtkyr3fcu.png)
BERT':
- (sentiment analysis)
- (fact-checking):
- : . : «» (Claim) « » (Not Claim)
- / :
- : (Claim sentence). : «» «»
- Full Fact – , . , , ( , , , )
- :
, BERT', , .
![bert-base-bert-large](https://habrastorage.org/webt/i3/u4/fq/i3u4fq9cclcq0-zeqfk56b5y78i.png)
BERT' :
- BERT BASE () – OpenAI Transformer;
- BERT LARGE () – , (state of the art), .
, BERT – . . , – BERT’ , .
![codeurs bert-base-bert-large](https://habrastorage.org/webt/6k/ce/se/6kcesezyar2zqppjc31sfkcsxak.png)
BERT' ( « » (Transformer Blocks)): 12 24 . (768 1024 ) «» (attention heads)(12 16 ), , (6 , 512 , 8 «» ).
![entrée-sortie-bert](https://habrastorage.org/webt/ed/7k/go/ed7kgoai63syz-koc-_tlqs0gwk.png)
[CLS] , . CLS .
, , BERT , . (self-attention) , .
![bert-encoders-input](https://habrastorage.org/webt/jp/kd/qs/jpkdqszmo06ogw7xbfk1tqmz0kw.png)
, ( , ). .
hidden_size (768 BERT'). , , ( [CLS]).
![vecteur-sortie-bert](https://habrastorage.org/webt/at/9b/xe/at9bxefqh-vnkxlc-xkuxlgi13s.png)
. , .
![classificateur bert](https://habrastorage.org/webt/ee/lg/99/eelg99xutp6h7oztqyyz3hv-5e4.png)
(, «», « », « », «» .), .
, , , VGGNet .
![vgg-net-classifier](https://habrastorage.org/webt/sl/37/yf/sl37yfo6xriqw24ule31ukksi8q.png)
. , NLP- , : Word2Vec GloVe. , , , .
, . Word2Vec , ( ), , (.. , «» – «» «» – «»), (, , «» «» , «» «»).
, , , . , Word2Vec GloVe. GloVe «stick» ( – 200):
![enfilage des gants](https://habrastorage.org/webt/l1/u-/ad/l1u-admk5irbjkb__sq90albkx0.png)
«stick» GloVe – 200 ( 2 ).
.
![boîtes vectorielles](https://habrastorage.org/webt/gz/ji/ee/gzjieex8v-pmouar89ocbbzan-e.png)
ELMo:
GloVe, «stick» . « », – NLP- ( Peters et. al., 2017, McCann et. al., 2017 Peters et. al., 2018 ELMo). – « «stick» , . , – , , ?». (contextualized word-embeddings).
![elmo-encastrement-robin-williams](https://habrastorage.org/webt/jr/rt/hb/jrrthbwj9xdzd4vgs5ckjgayv0m.png)
.
, , ELMo , . (bi-directional LSTM), .
![intégration des mots elmo](https://habrastorage.org/webt/bf/yw/qq/bfywqqcnnk6cw6hr3l3fbl-xq-i.png)
ELMo NLP. ELMo LSTM , , .
ELMo?
ELMo – , (language modeling). , , .
![Modélisation du langage Bert](https://habrastorage.org/webt/mq/j1/bo/mqj1bozk08fff_cglqbdcatcuao.png)
ELMo: «Let's stick to», – . . , . , , , , «hang», «out» ( «hang out»), «camera».
, LSTM - ELMo. , .
, ELMo LSTM – , «» , .
![Elmo-avant-arrière-en-langue-incorporation de modèle](https://habrastorage.org/webt/0w/re/y4/0wrey4vtsshgd7wcgvi_k_cguzk.png)
ELMo
ELMo ( ) ( ).
![enrobage elmo](https://habrastorage.org/webt/d8/dq/ch/d8dqchc0wxmoxmg2e79fnahk3ru.png)
ULM-FiT: NLP
ULM-FiT , – . ULM-FiT .
NLP , , , .
, , , , NLP- LSTM. .
- . ? , (.. , )?
, , NLP-. . : , ( ).
![openai-transformer-1](https://habrastorage.org/webt/3p/-d/q3/3p-dq3wsky9bqnz6mdfv6-y-r2o.png)
OpenAI Transformer
12 . - , . , ( ).
: , . 7 . , .. , – , , .
![modélisation du langage openai-transformer](https://habrastorage.org/webt/8d/l0/4k/8dl04ko7gbfw9kiq_jlg5ve281w.png)
OpenAI Transformer 7000
, OpenAI Transformer , . ( «» « »):
![openai-transformer-sentence-classification](https://habrastorage.org/webt/-l/fo/hr/-lfohrojznururmmrni-ykoqnog.png)
OpenAI , . :
![transformations openai-input](https://habrastorage.org/webt/mb/aw/na/mbawnanchccikwp7z4hhe1n0tbi.png)
, ?
BERT:
OpenAI Transformer , . - LSTM . ELMo , OpenAI Transformer . , , ( – « , »)?
« », – .
(masked language model)
« », – .
« !» – . – « , .»
« », – .
![BERT-langage-modélisation-masqué-lm](https://habrastorage.org/webt/z7/m-/qm/z7m-qmmtz724m8viviqejgzsmjs.png)
BERT «» 15% .
– , BERT , « » (masked language model) ( «-»).
15% , BERT , . .
OpenAI Transformer, , - (, ? , ?).
, BERT , : ( ); , ?
![bert-next-phrase-prediction](https://habrastorage.org/webt/rz/hr/jf/rzhrjfq5iyequzyykq9tp0urdic.png)
, BERT – . , .. BERT WordPieces, – .
BERT' .
![bert-tasks](https://habrastorage.org/webt/03/8i/a7/038ia7qjndp3qhcz8pdkcd_14nw.png)
a) : MNLI, QQP, QNLI, STS-B, MRPC, RTE, SWAG; b) : SST-2, CoLA; c) - : SQuAD v1.1; d) : CoNLL-2003 NER.
BERT
– BERT. ELMo, BERT' . – , , , , (named-entity recognition).
![intégrations contextualisées bert](https://habrastorage.org/webt/ob/pa/a6/obpaa6snqryacqb9vbyaahue7zc.png)
? . 6 ( , 96,4):
![bert-feature-extraction-contextualized-embeddings](https://habrastorage.org/webt/ir/vr/sv/irvrsv9mefroz7io6ilnjng3fo4.png)
- BERT'
BERT – BERT FineTuning with Cloud TPUs, Google Colab. Cloud TPU, , .. BERT' TPU, CPU GPU.
– BERT':
PyTorch- BERT'. AllenNLP BERT'a .