Hello, and thank you for your time to answer. Currently working on Emojify. In " Exercise 1 - sentence_to_avg" at "
Initialize the average word vector, should have the same shape as your word vectors.
avg = np.zeros(word_to_vec_map['of'].shape)" part I cant initilize the avg to a certain shape. I tryed hardcoding but it is not working as said in description. I am trying to write as it is described, trying to get one of the "word_to_vec_map" keys and use it's shape. However even though I can output it, I cant use it in avg
===
for key, value in word_to_vec_map.items():
continue
print (key, value)
print(word_to_vec_map[âofâ])
print(word_to_vec_map[âofâ].shape)
print("===")
# Initialize the average word vector, should have the same shape as your word vectors.
avg = np.zeros(word_to_vec_map[âofâ].shape)
Output:
===
[âmorrocanâ, âcouscousâ, âisâ, âmyâ, âfavoriteâ, âdishâ]
[ 0.70853 0.57088 -0.4716 0.18048 0.54449 0.72603
0.18157 -0.52393 0.10381 -0.17566 0.078852 -0.36216
-0.11829 -0.83336 0.11917 -0.16605 0.061555 -0.012719
-0.56623 0.013616 0.22851 -0.14396 -0.067549 -0.38157
-0.23698 -1.7037 -0.86692 -0.26704 -0.2589 0.1767
3.8676 -0.1613 -0.13273 -0.68881 0.18444 0.0052464
-0.33874 -0.078956 0.24185 0.36576 -0.34727 0.28483
0.075693 -0.062178 -0.38988 0.22902 -0.21617 -0.22562
-0.093918 -0.80375 ]
(50,)
[0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
0. 0.]
avg =
[0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
0. 0.]
[âaâ, âa_nwâ, âc_wâ, âa_sâ]
After that it gives key error at the avg part. I am stuck and burned out