word embeddings rappel embeddings pas word embeddings est
play

Word embeddings Rappel Embeddings ( pas Word Embeddings ) Est une - PowerPoint PPT Presentation

Word embeddings Rappel Embeddings ( pas Word Embeddings ) Est une lookup table Formalisme: Index dun mot: w i Table dembeddings (lookup matrix): V Embedding: e i e i = V( w i ) Reprsentation dun mot


  1. Word embeddings

  2. Rappel Embeddings ( pas Word Embeddings )

  3. Est une “lookup table” Formalisme: ● Index d’un mot: w i ● Table d’embeddings (lookup matrix): V ● Embedding: e i ● e i = V( w i )

  4. Représentation d’un mot Différentes possibilités: Vecteur One-hot ● ○ Chat : [0,0,… 0, 1 ,0,0,0,0,0,0,0,0,0…] ● Vecteur de context ○ Chat : [ 1 ,0,… 0, 0 ,0,0,0, 1 ,0,0, 1 ,0,0…] félin litière lait chat

  5. Vecteurs de contexte “Chap. 15: Vector Semantics.” Speech and Language Processing: an Introduction to Natural Language Processing, Computational L inguistics, and Speech Recognition, by Dan Jurafsky and James H. Martin, Dorling Kindersley Pvt, Ltd., 2014.

  6. Vecteurs de contexte “Chap. 15: Vector Semantics.” Speech and Language Processing: an Introduction to Natural Language Processing, Computational L inguistics, and Speech Recognition, by Dan Jurafsky and James H. Martin, Dorling Kindersley Pvt, Ltd., 2014.

  7. Vecteurs de contexte “Chap. 15: Vector Semantics.” Speech and Language Processing: an Introduction to Natural Language Processing, Computational L inguistics, and Speech Recognition, by Dan Jurafsky and James H. Martin, Dorling Kindersley Pvt, Ltd., 2014.

  8. Vecteurs de contexte “Chap. 15: Vector Semantics.” Speech and Language Processing: an Introduction to Natural Language Processing, Computational L inguistics, and Speech Recognition, by Dan Jurafsky and James H. Martin, Dorling Kindersley Pvt, Ltd., 2014.

  9. Vecteurs de contexte Vecteurs très grands (taille du vocabulaire) ● Contiennent beaucoup de 0 ● ● On cherche donc une manière de réduire la dimensionnalité pour : ○ Efficacité en mémoire ○ Facile d’utilisation pour des classificateurs Moins de paramètres ○ Des dimensions peuvent se recouper ○

  10. Décomposition en valeurs singulières “Chap. 15: Vector Semantics.” Speech and Language Processing: an Introduction to Natural Language Processing, Computational L inguistics, and Speech Recognition, by Dan Jurafsky and James H. Martin, Dorling Kindersley Pvt, Ltd., 2014.

  11. On conserve les top k valeurs singulières “Chap. 15: Vector Semantics.” Speech and Language Processing: an Introduction to Natural Language Processing, Computational L inguistics, and Speech Recognition, by Dan Jurafsky and James H. Martin, Dorling Kindersley Pvt, Ltd., 2014.

  12. On utilise ensuite seulement la matrice W “Chap. 15: Vector Semantics.” Speech and Language Processing: an Introduction to Natural Language Processing, Computational L inguistics, and Speech Recognition, by Dan Jurafsky and James H. Martin, Dorling Kindersley Pvt, Ltd., 2014.

  13. Méthodes à réseaux de neurones

  14. GloVe “A weighted least squares regression model” L’idée est de prédire le nombre de co -occurrences X ij (ou le log ) des mots w i et w j S’apparente à Word2Vec (ou encore FastText)

  15. GloVe w j w i 25

  16. GloVe Perte = v( w i ) * v( w j ) + b i + b j - log (X ij )

  17. GloVe Perte = v( w i ) * v( w j ) + b i + b j - log (25)

  18. Word2Vec 2 algorithmes: Skip-Gram ● CBOW (Contextual Bag of Words) ●

  19. Word2Vec

  20. CBOW

  21. CBOW

  22. CBOW - Negative Sampling litière chat softmax

  23. CBOW - Negative Sampling café chat litière pomme feuille

  24. CBOW - Negative Sampling score entre un mot w et un context C

  25. CBOW - Comment obtenir un score Produit vectoriel entre v C et v w

  26. CBOW - Comment obtenir un score = <wh, whe, her, ere, re>, <where>

  27. CBOW - Phrase Representations v (New) + v (York) ≈ Boston?

  28. CBOW - Phrase Representations v (New) + v (York) ≈ Issshhh?

  29. CBOW - Phrase Representations New York => New_York

  30. Démo FastText

  31. Recap FastText … le petit chat saute sur ...

  32. Recap FastText le petit saute sur [-2.2, 2.3, 2.4] [-0.2, -1.3, 0.4] [-3.2, 1.3, 0.5] [-3.2, 1.3, 0.5] chat [0.2, 1.3, 3.4] w i c 1 c 2 c 3 c 4 C Negative sampling: score + marteau [1.2, -1.3, -3.4] - n i score

  33. ELMo On le verra dans la section modèles de langue..!

  34. Vecteurs de phrases

  35. Comment obtenir la représentation d’une phrase? Prendre la moyenne des embeddings de mots ● Utiliser une idée similaire à Skip-Gram! ●

  36. Skip-Thought Vectors Idée de base: Étant donné un triplet de phrases ( s i-1 , s i , s i+1 ) ● Encoder la phrase s i ○ ○ Générer les phrases s i-1 et s i+1

  37. Skip-Thought Vectors

  38. Skip-Thought Vectors

  39. Skip-Thought Vectors

  40. Skip-Thought Vectors

  41. Skip-Thought Vectors

  42. Skip-Thought Vectors

  43. Skip-Thought Vectors

  44. Skip-Thought Vectors

  45. Skip-Thought Vectors Modèles de langue

  46. Skip-Thought Vectors Au final, on se sert de ça!

  47. Skip-Thought Vectors Probabilité d’avoir généré la phrase suivante Probabilité d’avoir généré la phrase précédente

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend