code: @Deprecated
      public static void writeWordVectors(@NonNull Word2Vec vec, @NonNull BufferedWriter writer) throws IOException {
          int words = 0;
  
          String str = vec.getVocab().numWords() + " " + vec.getLayerSize() + " " + vec.getVocab().totalNumberOfDocs();
          log.debug("Saving header: {}", str);
          writer.write(str + "\n");
  
          for (String word : vec.vocab().words()) {
              if (word == null) {
                  continue;
              }
              StringBuilder sb = new StringBuilder();
              sb.append(word.replaceAll(" ", WHITESPACE_REPLACEMENT));
              sb.append(" ");
              INDArray wordVector = vec.getWordVectorMatrix(word);
              for (int j = 0; j < wordVector.length(); j++) {
                  sb.append(wordVector.getDouble(j));
                  if (j < wordVector.length() - 1) {
                      sb.append(" ");
                  }
              }
              sb.append("\n");
              writer.write(sb.toString());
              words++;
          }
  
          try {
              writer.flush();
          } catch (Exception e) {
          }
          log.info("Wrote " + words + " with size of " + vec.lookupTable().layerSize());
      }
docs: Writes the word vectors to the given BufferedWriter. Note that this assumes an in memory cache.
  BufferedWriter can be writer to local file, or hdfs file, or any compatible to java target.
  
  @param vec    the word2vec to write
  @param writer - BufferedWriter, where all data should be written to
  the path to write
  @throws IOException