← Back to all sparks
W

word2vec

AI-ASSISTANTS
Velocity0.0

Distributed Representations of Words

word2vec for R spent its 0.4 release proving two training paths give identical embeddings

nlpembeddingsword2vecr-packagebnosac
Current state
word2vec is a standalone C++ word2vec implementation wrapped for R, part of the bnosac NLP family. Version 0.4.0 made word2vec() a generic with character and list methods, so models can be trained from a list of tokenised sentences instead of only from a file on disk, and reordered the vocabulary so both paths produce identical embeddings given identical tokenisation. The 2025 release is documentation and a DESCRIPTION DOI note.
Where it's heading
Development has been about widening the input surface and the comparison surface rather than the algorithm: encoding arguments, cosine as an alternative to dot similarity, doc2vec applied to already-trained models, and finally in-memory tokenised input. The vocabulary sorting change in 0.4.0 is the notable one — it altered embeddings slightly for everyone upgrading, in exchange for reproducibility between the two training paths. Since then the package has moved only when the wider bnosac set does.
Prediction
With both training paths unified and the recent release confined to packaging, there is no visible thread pointing at further feature work; the next release most likely arrives with the next CRAN sweep across the sibling packages.

Recent moves

  1. 8mo ago

    Documentation braces and arXiv DOI note

    Documentation wording in word2vec_similarity and a DESCRIPTION DOI note. Part of the same CRAN sweep that touched doc2vec and BTM the same day.

    View source ↗
  2. 2y ago

    Train from tokenised sentence lists; word2vec becomes generic

    Makes word2vec() a generic with character and list methods so models can be trained from in-memory tokenised sentences, and sorts the vocabulary by frequency then token so both paths yield the same embeddings. Users upgrading get slightly different vectors as a result — a deliberate trade for reproducibility across input types.

    View source ↗
  3. 5y ago

    Cosine similarity option in word2vec_similarity

    Adds a type argument allowing cosine similarity alongside the default dot product, answering a user request. Small but changes what the comparison function can express.

    View source ↗
  4. 5y ago

    doc2vec usable on trained models; txt_clean_word2vec added

    Allows doc2vec to run on an already-trained word2vec model and adds txt_clean_word2vec for corpus preparation. Extends the package past training into downstream use of the resulting vectors.

    View source ↗
  5. 5y ago

    Conditional udpipe example; encoding argument

    Guards an example on udpipe availability, bundled with the earlier addition of an encoding argument. Minor packaging and input handling.

    View source ↗
  6. 5y ago

    doc2vec support added

    Adds doc2vec to the package, extending it from word-level to document-level vectors. The first step of the broadening that 0.3.3 and 0.4.0 continue.

    View source ↗