Einführung in NLP mit Deep Learning Hans-Peter Zorn Minds mastering Machines, Köln, 26.4.2018
NLP ist auf einmal überall Zusammenfassung aggregated reviews Dokumentklassifikation Übersetzung Dialogsysteme / Chatbots Question Answering AI Deep Learning 2
Embed, Encode, Attend, Predict The new deep learning formula for state-of-theart NLP models Matthew Honnibal, explosion.io (SpaCy) - https://explosion.ai/blog/deep-learning-formula-nlp 3
Ein neuronales Netz X Y Hidden 4
Repräsentation von Sprache Bag-of-Words, Vectorspace-Model 1 5 1 Wenn 1 Fliegen 2 Hinter 3 Nach 4 1 Wenn fliegen hinter fliegen fliegen, fliegen fliegen nach Embeddings 5
Embed Encode Attend Predict
0 0 0 0 0 1 0 0 Vectorspace Modell Embed Embeddings 7
Emdedding Table/Layer ID 1 0.905 0.505 0.8750 2.5992.1213.6020 3.8355.758.5278 Effizientes Mapping von Merkmalen zu Embeddings Gewichte beim Training gelernt 8
Pre-trained embeddings Word2vec, GloVe, fasttext King Queen Woman Große Corpora: CommonCrawl, Wikipedia CBOW, Skip-gram, Character-ngrams (Morphologie) 9
Embed Encode Attend Predict
Recurrent Neural Networks hinter wenn Fliegen Input wird schrittweise dem Netz präsentiert Output ist Input für den nächsten Schritt CNN auch möglich 11
Recurrent Neural Networks unfolded A A A A Timesteps Long-term dependencies LSTM/GRU Padding notwendig wenn fliegen hinter fliegen 12
Encoder-Decoder (Seq2Seq) Neural machine translation When flies fly behind Input reversed Fliegen Wenn fliegen hinter hinter fliegen fliegen wenn Sequence to Sequence Learning with Neural Networks, Ilya Sutskever, Oriol Vinyals, Quoc V. Le, 2014 13
Embed Encode Attend Predict Les Chatfield/Flickr
Attention https://www.tensorflow.org/tutorials/seq2seq, CC-BY 3.0 15
Embed Encode Attend Predict
Predict Klassifikation (softmax) Sentiment Inhalt Decoder Zusammenfassung Keyword Extraction 17
Example: Using Natural Language to Query nosql Databases Masterarbeit Sebastian Blank, inovex/kit-aifb Predict 18
Fragen in natürlicher Sprache an Elasticsearch Who was the writer of true lies? James Cameron, Claude Zidi model 19
Fragen in natürlicher Sprache an Elasticsearch Who was the writer of true lies? Question James Cameron, Claude Zidi Answer model Query 20
Reinforcement Learning to the Rescue
Reinforcement Learning Agent interagiert mit Umgebung Lernen und durch Bestrafung/Belohnung Source: Wikipedia/megajuice 22
Model selection & Implementation Basic idea Who was the writer of true lies? James Cameron, Claude Zidi model Query field: Query entity: name true lies Response field: author Zhong, Socher (2017): Seq2SQL: Generating Structured Queries from Natural Language using Reinforcement Learning 23
Model selection & Implementation Basic idea +25 Who was the writer of true lies? James Cameron, Claude Zidi model Query field: Query entity: name true lies Response field: author 25
Model selection & Implementation Basic idea Who was the writer of true lies? -1 Thriller model Query field: Query entity: name true lies Response field: author 26
Model selection & Implementation Basic idea Who was the writer of true lies? -2 <error> model Query field: Query entity: name true lies Response field: author 27
28
What movies did Temuera Morrison act in? After 10 epochs After 20 epochs 29
What movies did Temuera Morrison act in? After 30 epochs After 40 epochs 30
Perfromance-Vergleich MBs 256 31
Generalisierung 32
Conclusion State of the Art DL4NLP: Embed, Encode, Attend, Predict Es funktioniert! Erstaunlich gut auf dem relativ klar definierten Datensatz Mittels Reinforcement Learning können nicht-differenzierbare Bruchstellen (z.b. nosql) überbrückt werden. 33
Vielen Dank! Hans-Peter Zorn Data Management & Analytics Head of Machine Perception & AI inovex GmbH Ludwig-Erhard-Allee 6 76133 Karlsruhe Sie möchten individuelle Beratung? Nehmen Sie Kontakt mit uns auf! info@inovex.de Mobil: +49 (0)173 3181 093 Mail: hzorn@inovex.de