SlideShare une entreprise Scribd logo
1  sur  24
Télécharger pour lire hors ligne
Word embeddings
et leurs applications
Toulouse Data Science
30/06/2016
Camille Pradel
1
Plan
• Représentations symboliques du sens des mots
• Représentations vectorielles basées sur la similarité distributionnelle
• Co-occurences et réduction de dimensions
• Réseaux de neurones
• Propriétés remarquables
• Applications
Représentations symboliques du sens des mots
• WordNet : 117 659 synsets (synonym set), un groupe de mots
interchangeables, dénotant un sens ou un usage particulier
1. car, auto, automobile, machine, motorcar -- (4-wheeled motor vehicle;
usually propelled by an internal combustion engine; he needs a car to get to
work)
2. car, railcar, railway car, railroad car -- (a wheeled vehicle adapted to the
rails of railroad; three cars had jumped the rails)
3. car, gondola -- (car suspended from an airship and carrying personnel and
cargo and power plant)
4. car, elevator car -- (where passengers ride up and down; the car was on the
top floor)
5. cable car, car -- (a conveyance for passengers or freight on a cable railway;
they took a cable car to the top of the mountain)
• Relations sémantiques entre les synsets
• Relations d'hyperonymie/hyponymie
car, auto, automobile, machine, motorcar
-> motor vehicle, automotive vehicle
-> vehicle
-> conveyance, transport
-> instrumentality, instrumentation
-> artifact, artefact
-> object, physical object
-> entity, something
Représentations symboliques du sens des mots
• Relations sémantiques entre les synsets
• Relation de méronymie/holonymie
car, auto, automobile, machine, motorcar
HAS PART: accelerator, accelerator pedal, gas pedal, gas, throttle, gun
HAS PART: air bag
HAS PART: auto accessory
HAS PART: automobile engine
HAS PART: automobile horn, car horn, motor horn, horn
Représentations symboliques du sens des mots
• Limites
• Manque de nuances
Adept = expert = good = practiced = proficient = skillful
• Pas à jour
wicked, badass, nifty, crack, ace, wizard, genius, ninjia
• Subjective
• Chère à construire
• Compromis couverture VS exhaustivité
• Difficile de déduire une mesure de similarité entre les mots
Représentations symboliques du sens des mots
Représentations basées sur la similarité
distributionnelle
Hypothèse distributionnelle: les mots qui apparaissent
dans des contextes similaires ont tendance à être similaires.
Le chat s’allonge sur le paillasson.
Le chaton s’allonge sur le paillasson.
Le chien s’allonge sur le paillasson.
Mon chat m’a griffé.
Mon chaton m’a griffé.
garantie pour conclure un prêt avec une autre banque, dans un autre pays. "Le blanchisseur
centrale européenne perdra sa crédibilité. Cette banque centrale, enfin, sera contrainte de serrer
des emprunts en marks. Voici que cette banque fait maintenant ouvertement part de sa
Philosophical Investigation
Wittgenstein, L
1953
Sur le plan thématique:
Sur le plan sémantique:
Matrices de co-occurrences
I like deep learning
I like NLP
I enjoy flying
• Limites:
• Augmente en taille avec le vocabulaire
• Consomme de l’espace de stockage
• Vecteurs creux -> modèles peu robustes
Réduction de dimensions
• Enregistrer les informations les plus importantes dans un nombre
réduit de dimensions (en général entre 25 et 1000)
• Analyse en composante principale (PCA)
• Décomposition en valeur singulière (SVD)
• …
Réseaux de neurones
• SVD
• Complexité quadratique -> passage à l’échelle compliqué
• Difficile de prendre en compte de nouveaux documents
 apprendre directement des vecteurs de mots de dimension réduite
• Learning representations by back-propagating errors (Rumelhart et al., 1986)
• A neural probabilistic language model (Bengio et al., 2003)
• NLP (almost) from Scratch (Collobert & Weston, 2008)
• word2vec (Mikolov et al. 2013)
Réseaux de neurones
• Utilisation d’un réseau de neurones pour apprendre une tâche fictive
• Prédire le contexte d’un mot
• Prédire un mot en fonction de son contexte
Démo: ronxin.github.io/wevi/
Efficient estimation of word
representations in vector space
Mikolov, T., Chen, K.,
Corrado, G. & Dean, J.
2013
Représentation naïve sous forme vectorielle
chaque mot est considéré comme une symbole atomique
One-hot
encoding
Chien [ 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 … 0 0 0 ]
Bateau [ 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 … 0 0 0 ]
Hôtel [ 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 … 0 0 0 ]
Motel [ 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 … 0 0 0 ]
Taille du vocabulaire
Réseaux de neurones
An improved model of
semantic similarity based
on lexical co-occurrence
Rohde, D. L., Gonnerman,
L. M., and Plaut, D. C.
2006
Emergence de motifs
syntaxiques
Propriétés remarquables
An improved model of
semantic similarity based
on lexical co-occurrence
Rohde, D. L., Gonnerman,
L. M., and Plaut, D. C.
2006
Emergence de motifs
sémantiques
Propriétés remarquables
Propriétés remarquables
• Relations linéaires
• Analogies syntaxiques
apple − apples ≈ car − cars ≈ family − families
• Analogies sémantiques
shirt − clothing ≈ chair − furniture
king − man ≈ queen − woman
Efficient estimation of word representations in vector space
Mikolov, T., Chen, K., Corrado, G., & Dean, J.
2013
GloVe: Global Vectors for
Word Representation
Jeffrey Pennington,
Richard Socher, and
Christopher D. Manning.
2014
Capture du genre
Propriétés remarquables
GloVe: Global Vectors for
Word Representation
Jeffrey Pennington,
Richard Socher, and
Christopher D. Manning.
2014
Superlatifs
Propriétés remarquables
GloVe: Global Vectors for
Word Representation
Jeffrey Pennington,
Richard Socher, and
Christopher D. Manning.
2014
Compagnie - CEO
Propriétés remarquables
Applications
Distances, analogies, OK. Quoi d’autre?
Applications
• Identifier l’intrus dans une liste
https://github.com/dhammack/Word2VecExample
math shopping reading science
eight six seven five three owe nine
breakfast cereal dinner lunch
england spain france italy greece germany portugal australia
Applications
• Dice utilise des modèles de vecteurs de mots pour
rapprocher des mots-clés liés
• Analytics -> Business Intelligence
Implementing Conceptual Search in Solr using LSA and
Word2Vec - Simon Hughes
http://fr.slideshare.net/lucidworks/implementing-conceptual-
search-in-solr-using-lsa-and-word2vec-presented-by-simon-
hughes-dicecom
Applications
A Word is Worth a Thousand Vectors - Chris Moody
http://multithreaded.stitchfix.com/blog/2015/03/11/word-is-
worth-a-thousand-vectors/
ITEM_3469
pregnant
ITEM_3469 ITEM_3469 ITEM_3469
Applications
• Embeddings à plus grande échelle
• Traduction statistique
• Robots conversationnels
• Description d’image
et de vidéos
https://vimeo.com/146492001
Sources "pédagogiques"
• CS224d: Deep Learning for Natural Language Processing - Richard Socher
• http://cs224d.stanford.edu/syllabus.html
• https://www.youtube.com/watch?v=T8tQZChniMk (Lecture 2)
• word2vec parameter learning explained - Xin Rong
• http://arxiv.org/abs/1411.2738
• Grounding distributional semantics in the visual world - Marco Baroni
• http://clic.cimec.unitn.it/marco/publications/lectures/marco-grounding-ds-vl-2015.pdf
• Understanding Dimensionality Reduction- Principal Component Analysis And Singular Value
Decomposition - Priya Rana
• http://hpc-asia.com/understanding-dimensionality-reduction-principal-component-analysis-and-singular-
value-decomposition/
• A Beginner’s Guide to word2vec AKA What’s the Opposite of Canada? - Will Critchlow
• https://www.distilled.net/resources/a-beginners-guide-to-word2vec-aka-whats-the-opposite-of-canada/
• Page Wikipedia sur WordNet
• https://fr.wikipedia.org/wiki/WordNet

Contenu connexe

En vedette

Nabil bouzerna - Mémoire d'ingénieur / Master Thesis ENSIIE - ADVESTIGO - 2007
Nabil bouzerna - Mémoire d'ingénieur / Master Thesis ENSIIE - ADVESTIGO - 2007  Nabil bouzerna - Mémoire d'ingénieur / Master Thesis ENSIIE - ADVESTIGO - 2007
Nabil bouzerna - Mémoire d'ingénieur / Master Thesis ENSIIE - ADVESTIGO - 2007 Nabil Bouzerna
 
SODA-IIoT4ConnectedCars: Spread updates between cars with limited Internet ac...
SODA-IIoT4ConnectedCars: Spread updates between cars with limited Internet ac...SODA-IIoT4ConnectedCars: Spread updates between cars with limited Internet ac...
SODA-IIoT4ConnectedCars: Spread updates between cars with limited Internet ac...Nabil Bouzerna
 
Wireless gesture controlled robotic arm
Wireless gesture controlled robotic armWireless gesture controlled robotic arm
Wireless gesture controlled robotic armsneha daise paulson
 
La reconnaissance gestuelle
La reconnaissance gestuelleLa reconnaissance gestuelle
La reconnaissance gestuellebeblop
 
Glass Camp - Meetup #15 Presse & Media @Presstalis - Décembre 2014
Glass Camp - Meetup #15 Presse & Media @Presstalis - Décembre 2014Glass Camp - Meetup #15 Presse & Media @Presstalis - Décembre 2014
Glass Camp - Meetup #15 Presse & Media @Presstalis - Décembre 2014Glasscamp
 
Future@SystemX - Nabil Bouzerna - Experiment IMM Project
Future@SystemX - Nabil Bouzerna - Experiment IMM ProjectFuture@SystemX - Nabil Bouzerna - Experiment IMM Project
Future@SystemX - Nabil Bouzerna - Experiment IMM ProjectNabil Bouzerna
 
SODA-IIoT4Automotive: Blockchain to keep the Automotive ECU up-to-date
SODA-IIoT4Automotive: Blockchain to keep the Automotive ECU up-to-dateSODA-IIoT4Automotive: Blockchain to keep the Automotive ECU up-to-date
SODA-IIoT4Automotive: Blockchain to keep the Automotive ECU up-to-dateNabil Bouzerna
 
Gesture Recognition Technology-Seminar PPT
Gesture Recognition Technology-Seminar PPTGesture Recognition Technology-Seminar PPT
Gesture Recognition Technology-Seminar PPTSuraj Rai
 
38 gestures of body language
38 gestures of body language38 gestures of body language
38 gestures of body languagemelodeepop
 
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017Carol Smith
 

En vedette (14)

Nabil bouzerna - Mémoire d'ingénieur / Master Thesis ENSIIE - ADVESTIGO - 2007
Nabil bouzerna - Mémoire d'ingénieur / Master Thesis ENSIIE - ADVESTIGO - 2007  Nabil bouzerna - Mémoire d'ingénieur / Master Thesis ENSIIE - ADVESTIGO - 2007
Nabil bouzerna - Mémoire d'ingénieur / Master Thesis ENSIIE - ADVESTIGO - 2007
 
Deaf and dumb
Deaf and dumbDeaf and dumb
Deaf and dumb
 
SODA-IIoT4ConnectedCars: Spread updates between cars with limited Internet ac...
SODA-IIoT4ConnectedCars: Spread updates between cars with limited Internet ac...SODA-IIoT4ConnectedCars: Spread updates between cars with limited Internet ac...
SODA-IIoT4ConnectedCars: Spread updates between cars with limited Internet ac...
 
Wireless gesture controlled robotic arm
Wireless gesture controlled robotic armWireless gesture controlled robotic arm
Wireless gesture controlled robotic arm
 
La reconnaissance gestuelle
La reconnaissance gestuelleLa reconnaissance gestuelle
La reconnaissance gestuelle
 
Glass Camp - Meetup #15 Presse & Media @Presstalis - Décembre 2014
Glass Camp - Meetup #15 Presse & Media @Presstalis - Décembre 2014Glass Camp - Meetup #15 Presse & Media @Presstalis - Décembre 2014
Glass Camp - Meetup #15 Presse & Media @Presstalis - Décembre 2014
 
Future@SystemX - Nabil Bouzerna - Experiment IMM Project
Future@SystemX - Nabil Bouzerna - Experiment IMM ProjectFuture@SystemX - Nabil Bouzerna - Experiment IMM Project
Future@SystemX - Nabil Bouzerna - Experiment IMM Project
 
SODA-IIoT4Automotive: Blockchain to keep the Automotive ECU up-to-date
SODA-IIoT4Automotive: Blockchain to keep the Automotive ECU up-to-dateSODA-IIoT4Automotive: Blockchain to keep the Automotive ECU up-to-date
SODA-IIoT4Automotive: Blockchain to keep the Automotive ECU up-to-date
 
Gesture Recognition
Gesture RecognitionGesture Recognition
Gesture Recognition
 
Gesture Recognition Technology-Seminar PPT
Gesture Recognition Technology-Seminar PPTGesture Recognition Technology-Seminar PPT
Gesture Recognition Technology-Seminar PPT
 
Gestures and body language
Gestures and body languageGestures and body language
Gestures and body language
 
Gesture recognition
Gesture recognitionGesture recognition
Gesture recognition
 
38 gestures of body language
38 gestures of body language38 gestures of body language
38 gestures of body language
 
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
AI and Machine Learning Demystified by Carol Smith at Midwest UX 2017
 

Word embeddings et leurs applications (Meetup TDS, 2016-06-30)

  • 1. Word embeddings et leurs applications Toulouse Data Science 30/06/2016 Camille Pradel 1
  • 2. Plan • Représentations symboliques du sens des mots • Représentations vectorielles basées sur la similarité distributionnelle • Co-occurences et réduction de dimensions • Réseaux de neurones • Propriétés remarquables • Applications
  • 3. Représentations symboliques du sens des mots • WordNet : 117 659 synsets (synonym set), un groupe de mots interchangeables, dénotant un sens ou un usage particulier 1. car, auto, automobile, machine, motorcar -- (4-wheeled motor vehicle; usually propelled by an internal combustion engine; he needs a car to get to work) 2. car, railcar, railway car, railroad car -- (a wheeled vehicle adapted to the rails of railroad; three cars had jumped the rails) 3. car, gondola -- (car suspended from an airship and carrying personnel and cargo and power plant) 4. car, elevator car -- (where passengers ride up and down; the car was on the top floor) 5. cable car, car -- (a conveyance for passengers or freight on a cable railway; they took a cable car to the top of the mountain)
  • 4. • Relations sémantiques entre les synsets • Relations d'hyperonymie/hyponymie car, auto, automobile, machine, motorcar -> motor vehicle, automotive vehicle -> vehicle -> conveyance, transport -> instrumentality, instrumentation -> artifact, artefact -> object, physical object -> entity, something Représentations symboliques du sens des mots
  • 5. • Relations sémantiques entre les synsets • Relation de méronymie/holonymie car, auto, automobile, machine, motorcar HAS PART: accelerator, accelerator pedal, gas pedal, gas, throttle, gun HAS PART: air bag HAS PART: auto accessory HAS PART: automobile engine HAS PART: automobile horn, car horn, motor horn, horn Représentations symboliques du sens des mots
  • 6. • Limites • Manque de nuances Adept = expert = good = practiced = proficient = skillful • Pas à jour wicked, badass, nifty, crack, ace, wizard, genius, ninjia • Subjective • Chère à construire • Compromis couverture VS exhaustivité • Difficile de déduire une mesure de similarité entre les mots Représentations symboliques du sens des mots
  • 7. Représentations basées sur la similarité distributionnelle Hypothèse distributionnelle: les mots qui apparaissent dans des contextes similaires ont tendance à être similaires. Le chat s’allonge sur le paillasson. Le chaton s’allonge sur le paillasson. Le chien s’allonge sur le paillasson. Mon chat m’a griffé. Mon chaton m’a griffé. garantie pour conclure un prêt avec une autre banque, dans un autre pays. "Le blanchisseur centrale européenne perdra sa crédibilité. Cette banque centrale, enfin, sera contrainte de serrer des emprunts en marks. Voici que cette banque fait maintenant ouvertement part de sa Philosophical Investigation Wittgenstein, L 1953 Sur le plan thématique: Sur le plan sémantique:
  • 8. Matrices de co-occurrences I like deep learning I like NLP I enjoy flying • Limites: • Augmente en taille avec le vocabulaire • Consomme de l’espace de stockage • Vecteurs creux -> modèles peu robustes
  • 9. Réduction de dimensions • Enregistrer les informations les plus importantes dans un nombre réduit de dimensions (en général entre 25 et 1000) • Analyse en composante principale (PCA) • Décomposition en valeur singulière (SVD) • …
  • 10. Réseaux de neurones • SVD • Complexité quadratique -> passage à l’échelle compliqué • Difficile de prendre en compte de nouveaux documents  apprendre directement des vecteurs de mots de dimension réduite • Learning representations by back-propagating errors (Rumelhart et al., 1986) • A neural probabilistic language model (Bengio et al., 2003) • NLP (almost) from Scratch (Collobert & Weston, 2008) • word2vec (Mikolov et al. 2013)
  • 11. Réseaux de neurones • Utilisation d’un réseau de neurones pour apprendre une tâche fictive • Prédire le contexte d’un mot • Prédire un mot en fonction de son contexte Démo: ronxin.github.io/wevi/ Efficient estimation of word representations in vector space Mikolov, T., Chen, K., Corrado, G. & Dean, J. 2013
  • 12. Représentation naïve sous forme vectorielle chaque mot est considéré comme une symbole atomique One-hot encoding Chien [ 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 … 0 0 0 ] Bateau [ 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 … 0 0 0 ] Hôtel [ 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 … 0 0 0 ] Motel [ 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 … 0 0 0 ] Taille du vocabulaire Réseaux de neurones
  • 13. An improved model of semantic similarity based on lexical co-occurrence Rohde, D. L., Gonnerman, L. M., and Plaut, D. C. 2006 Emergence de motifs syntaxiques Propriétés remarquables
  • 14. An improved model of semantic similarity based on lexical co-occurrence Rohde, D. L., Gonnerman, L. M., and Plaut, D. C. 2006 Emergence de motifs sémantiques Propriétés remarquables
  • 15. Propriétés remarquables • Relations linéaires • Analogies syntaxiques apple − apples ≈ car − cars ≈ family − families • Analogies sémantiques shirt − clothing ≈ chair − furniture king − man ≈ queen − woman Efficient estimation of word representations in vector space Mikolov, T., Chen, K., Corrado, G., & Dean, J. 2013
  • 16. GloVe: Global Vectors for Word Representation Jeffrey Pennington, Richard Socher, and Christopher D. Manning. 2014 Capture du genre Propriétés remarquables
  • 17. GloVe: Global Vectors for Word Representation Jeffrey Pennington, Richard Socher, and Christopher D. Manning. 2014 Superlatifs Propriétés remarquables
  • 18. GloVe: Global Vectors for Word Representation Jeffrey Pennington, Richard Socher, and Christopher D. Manning. 2014 Compagnie - CEO Propriétés remarquables
  • 20. Applications • Identifier l’intrus dans une liste https://github.com/dhammack/Word2VecExample math shopping reading science eight six seven five three owe nine breakfast cereal dinner lunch england spain france italy greece germany portugal australia
  • 21. Applications • Dice utilise des modèles de vecteurs de mots pour rapprocher des mots-clés liés • Analytics -> Business Intelligence Implementing Conceptual Search in Solr using LSA and Word2Vec - Simon Hughes http://fr.slideshare.net/lucidworks/implementing-conceptual- search-in-solr-using-lsa-and-word2vec-presented-by-simon- hughes-dicecom
  • 22. Applications A Word is Worth a Thousand Vectors - Chris Moody http://multithreaded.stitchfix.com/blog/2015/03/11/word-is- worth-a-thousand-vectors/ ITEM_3469 pregnant ITEM_3469 ITEM_3469 ITEM_3469
  • 23. Applications • Embeddings à plus grande échelle • Traduction statistique • Robots conversationnels • Description d’image et de vidéos https://vimeo.com/146492001
  • 24. Sources "pédagogiques" • CS224d: Deep Learning for Natural Language Processing - Richard Socher • http://cs224d.stanford.edu/syllabus.html • https://www.youtube.com/watch?v=T8tQZChniMk (Lecture 2) • word2vec parameter learning explained - Xin Rong • http://arxiv.org/abs/1411.2738 • Grounding distributional semantics in the visual world - Marco Baroni • http://clic.cimec.unitn.it/marco/publications/lectures/marco-grounding-ds-vl-2015.pdf • Understanding Dimensionality Reduction- Principal Component Analysis And Singular Value Decomposition - Priya Rana • http://hpc-asia.com/understanding-dimensionality-reduction-principal-component-analysis-and-singular- value-decomposition/ • A Beginner’s Guide to word2vec AKA What’s the Opposite of Canada? - Will Critchlow • https://www.distilled.net/resources/a-beginners-guide-to-word2vec-aka-whats-the-opposite-of-canada/ • Page Wikipedia sur WordNet • https://fr.wikipedia.org/wiki/WordNet