It was written by Tomas Mikolov at Google in 2013 and written in C:
https://code.google.com/archive/p/word2vec/
But with Mojo 1.0 finally officially released this week, I wanted to see if me and my buddy Claude could improve on both the performance and clarity of the implementation.
This new implementation benchmarks at 3.3x faster than the classic C implementation (single-threaded) and 1.8x faster (with 8 threads). This was measured on my M2 Pro MBP from 2023, where I'm fully saturating the memory bandwidth, so more recent chipsets with faster memory buses might have even better relative performance.
I'm interested in getting benchmarks from users on more recent M series chips, and users on other platforms as well! Try it out and submit a PR with your measurements.
But the real win is: clarity. In this implementation, I wanted the code to be readable and well-commented, so that it acts as a teaching tool for implementing fast code in Mojo as well as understanding how the machine learning algorithm works.