Re:Show HN: Word2vec Algorithm in ~100sloc with NumPy
by BeetleB on Friday June 02, 2023 @03:23PM
(#36169605)
I sympathize with your position, but in this case the two liner is significantly more readable. I had no problem digesting it. I then looked at the longer version and it was a much higher cognitive load to digest that. I have to look at multiple for loops to realize they're merely counting the words in a corpus. The shorter version lets me see it immediately.
[ Parent
| on HN ]
Re:Show HN: Word2vec Algorithm in ~100sloc with NumPy
by NathanFulton on Sunday June 04, 2023 @07:21AM
(#36184724)
It's probably a matter of audience. For the folks I've been teaching lately, who mostly know some combination of Java/C++/MATLAB, the Pythonic version is probably harder to follow.
Anyways, now I have two ways of saying the same thing, which is always nice to have when teaching.