Académique Documents
Professionnel Documents
Culture Documents
TM.F - Word2vec
TM.F - Word2vec
4. Bibliographie
Représentation
(0) condition du bien etre
(1) etre important
des termes
(2) solution bien etre Bon, converger sur
4 observations
(3) important bien etre n’est pas évident
quoiqu’il en soit
L’ALGORITHME WORD2VEC
https://fr.wikipedia.org/wiki/Word_embedding
bien x1 bien
condition x2 condition
du x3 du
etre x4
etre
important x5 important
solution x6 solution
important
condition
solution
approprié des données tenant
bien
etre
du
condition du bien etre 1 1 1 1 0 0
compte du voisinage. Ex. voisinage etre important 0 0 0 1 1 0
solution du bien etre 1 0 0 1 0 1
important
important
condition
condition
solution
solution
Terme Terme
bien
etre
bien
etre
du
du
condition 0 1 0 0 0 0 du 0 0 1 0 0 0
du 0 0 1 0 0 0 bien 1 0 0 0 0 0
du 0 0 1 0 0 0 bien 1 0 0 0 0 0
bien 1 0 0 0 0 0 etre 0 0 0 1 0 0
bien 1 0 0 0 0 0 etre 0 0 0 1 0 0
bien 1 0 0 0 0 0 etre 0 0 0 1 0 0
etre 0 0 0 1 0 0 important 0 0 0 0 1 0
important 0 0 0 0 1 0 bien 1 0 0 0 0 0
etc. etc.
Ce sont ces données (pondération forcément binaire) que l’on présentera au réseau.
On est dans un (une sorte de) schéma d’apprentissage supervisé multi-cibles !
R.R. – Université Lyon 2 10
Modèle SKIP-GRAM (Mikolov et al., 2013)
0 bien x1 bien 0
1 condition x2 condition 0
0 du x3 du 1
0 etre x4
etre 0
0 important x5 important 0
0 solution x6 solution 0
important
condition
solution
Double tableau pour la sortie
bien
etre
du
condition du bien etre 1 1 1 1 0 0
maintenant : voisinages (t-1) et (t+1) etre important
solution du bien etre
0
1
0
0
0
0
1
1
1
0
0
1
important bien etre 1 0 0 1 1 0
important
condition
solution
Terme
bien
etre
du
condition 0 1 0 0 0 0
Entrée (terme t) solution 0 0 0 0 0 1
important
du 0 0 1 0 0 0
condition
solution
Terme du 0 0 1 0 0 0
bien
etre
important 0 0 0 0 1 0
du
du 0 0 1 0 0 0 etc.
du 0 0 1 0 0 0
bien 1 0 0 0 0 0
Sortie (voisin t + 1)
bien 1 0 0 0 0 0
important
condition
bien 1 0 0 0 0 0
solution
Terme
etc.
bien
etre
du
bien 1 0 0 0 0 0
bien 1 0 0 0 0 0
etre 0 0 0 1 0 0
etre 0 0 0 1 0 0
etre 0 0 0 1 0 0
etc.
bien 0
Ex. (condition → du → bien)
condition 1
du 0
(t-1)
0 bien x1
etre 0
0
important 0
condition x2
1 solution 0
du x3
0 etre x4
0 important x5
bien 1
0 solution x6
condition 0
du 0
(t+1)
(t) etre 0
important 0
solution 0
R.R. – Université Lyon 2 13
Modèle SKIP-GRAM – Voisinage plus étendu
https://fr.wikipedia.org/wiki/Word_embedding
https://fr.wikipedia.org/wiki/Word_embedding
Comment passer de la représentation des termes à celle des documents (composés de termes) ?
Word V1 V2
0 du -0.703333 1.077643 C1 C2
1 condition -0.828805 0.966393 (0) -0.690049 0.464660
2 solution -0.040079 0.911001 (1) -0.273938 0.470011
3 important -0.127894 0.830322 (2) -0.422713 0.241868
4 bien -0.808076 -0.295098 (3) -0.451984 0.214975
5 etre -0.419983 0.109700
−0.419983 + (−0.127894)
𝐶1 1 = = −0.273938
Calcul des 2
coordonnées du
0.109700 + 0.830322
document n°1 𝐶2(1) =
2
= 0.470011
Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. “Efficient Estimation of Word
Representations in Vector Space.” In Proceedings of Workshop at ICLR. (Sep 2013)
Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg Corrado, and Jeffrey Dean. “Distributed
Representations of Words and Phrases and their Compositionality.” In Proceedings of NIPS. (Oct
2013)