2018 fue un punto de inflexión para el desarrollo de modelos de aprendizaje automático destinados a resolver problemas de procesamiento de texto (o, más correctamente, procesar lenguaje natural (PNL)). La comprensión conceptual de cómo presentar palabras y oraciones para la extracción más precisa de sus significados semánticos y las relaciones entre ellos está creciendo rápidamente. Además, la comunidad de PNL promueve herramientas increíblemente poderosas que se pueden descargar y usar de forma gratuita en sus modelos y canalizaciones. Este punto de inflexión también se denomina momento ImageNet de NLP , en referencia al momento hace varios años, cuando desarrollos similares aceleraron significativamente el desarrollo del aprendizaje automático en el campo de los problemas de visión por computadora.
![transformador-ber-ulmfit-elmo](https://habrastorage.org/webt/uh/cd/qv/uhcdqv--w2t4i8srv9rtzjgk9ac.png)
(ULM-FiT no tiene nada que ver con Korzhik, pero no ocurrió algo mejor)
– BERT', , NLP. BERT – , NLP-. , , BERT', . , , , .
![bert-transfer-learning](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-clasificación-spam](https://habrastorage.org/webt/mx/eo/u_/mxeou__qytr_9_2m6pxjo2icemc.png)
, , (classifier) BERT' . (fine-tuning), Semi-supervised Sequence Learning ULMFiT.
, : , . . («» « »).
![conjunto de datos etiquetados como spam](https://habrastorage.org/webt/hy/qr/pa/hyqrpadlqytj81eqk3xtkyr3fcu.png)
BERT':
- (sentiment analysis)
- (fact-checking):
- : . : «» (Claim) « » (Not Claim)
- / :
- : (Claim sentence). : «» «»
- Full Fact – , . , , ( , , , )
- :
, BERT', , .
![base-bert-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’ , .
![bert-base-bert-large-encoders](https://habrastorage.org/webt/6k/ce/se/6kcesezyar2zqppjc31sfkcsxak.png)
BERT' ( « » (Transformer Blocks)): 12 24 . (768 1024 ) «» (attention heads)(12 16 ), , (6 , 512 , 8 «» ).
![bert-input-output](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]).
![vector-salida-bert](https://habrastorage.org/webt/at/9b/xe/at9bxefqh-vnkxlc-xkuxlgi13s.png)
. , .
![clasificador de 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):
![incrustación de guantes](https://habrastorage.org/webt/l1/u-/ad/l1u-admk5irbjkb__sq90albkx0.png)
«stick» GloVe – 200 ( 2 ).
.
![cajas de vectores](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-incrustación-robin-williams](https://habrastorage.org/webt/jr/rt/hb/jrrthbwj9xdzd4vgs5ckjgayv0m.png)
.
, , ELMo , . (bi-directional LSTM), .
![incrustación de palabras elmo](https://habrastorage.org/webt/bf/yw/qq/bfywqqcnnk6cw6hr3l3fbl-xq-i.png)
ELMo NLP. ELMo LSTM , , .
ELMo?
ELMo – , (language modeling). , , .
![Bert-language-modeling](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-forward-backward-language-model-embedded](https://habrastorage.org/webt/0w/re/y4/0wrey4vtsshgd7wcgvi_k_cguzk.png)
ELMo
ELMo ( ) ( ).
![incrustación de 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 . , .. , – , , .
![Openai-transformador-lenguaje-modelado](https://habrastorage.org/webt/8d/l0/4k/8dl04ko7gbfw9kiq_jlg5ve281w.png)
OpenAI Transformer 7000
, OpenAI Transformer , . ( «» « »):
![Openai-transformador-oración-clasificación](https://habrastorage.org/webt/-l/fo/hr/-lfohrojznururmmrni-ykoqnog.png)
OpenAI , . :
![transformaciones de entrada abierta](https://habrastorage.org/webt/mb/aw/na/mbawnanchccikwp7z4hhe1n0tbi.png)
, ?
BERT:
OpenAI Transformer , . - LSTM . ELMo , OpenAI Transformer . , , ( – « , »)?
« », – .
(masked language model)
« », – .
« !» – . – « , .»
« », – .
![BERT-lenguaje-modelado-enmascarado-lm](https://habrastorage.org/webt/z7/m-/qm/z7m-qmmtz724m8viviqejgzsmjs.png)
BERT «» 15% .
– , BERT , « » (masked language model) ( «-»).
15% , BERT , . .
OpenAI Transformer, , - (, ? , ?).
, BERT , : ( ); , ?
![predicción-siguiente-oración-bert](https://habrastorage.org/webt/rz/hr/jf/rzhrjfq5iyequzyykq9tp0urdic.png)
, BERT – . , .. BERT WordPieces, – .
BERT' .
![bert-tareas](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).
![incrustaciones bert-contexualizadas](https://habrastorage.org/webt/ob/pa/a6/obpaa6snqryacqb9vbyaahue7zc.png)
? . 6 ( , 96,4):
![bert-feature-extract-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 .