docs: public static void writeWord2VecModel(Word2Vec vectors, OutputStream stream) throws IOException {
          ZipOutputStream zipfile = new ZipOutputStream(new BufferedOutputStream(new CloseShieldOutputStream(stream)));
  
          ZipEntry syn0 = new ZipEntry("syn0.txt");
          zipfile.putNextEntry(syn0);
  
          // writing out syn0
          File tempFileSyn0 = DL4JFileUtils.createTempFile("word2vec", "0");
          File tempFileSyn1 = DL4JFileUtils.createTempFile("word2vec", "1");
          File tempFileSyn1Neg = DL4JFileUtils.createTempFile("word2vec", "n");
          File tempFileCodes = DL4JFileUtils.createTempFile("word2vec", "h");
          File tempFileHuffman = DL4JFileUtils.createTempFile("word2vec", "h");
          File tempFileFreqs = DL4JFileUtils.createTempFile("word2vec", "f");
          tempFileSyn0.deleteOnExit();
          tempFileSyn1.deleteOnExit();
          tempFileSyn1Neg.deleteOnExit();
          tempFileFreqs.deleteOnExit();
          tempFileCodes.deleteOnExit();
          tempFileHuffman.deleteOnExit();
  
          try {
              writeWordVectors(vectors.lookupTable(), tempFileSyn0);
  
              FileUtils.copyFile(tempFileSyn0, zipfile);
  
              // writing out syn1
              INDArray syn1 = ((InMemoryLookupTable<VocabWord>) vectors.getLookupTable()).getSyn1();
  
              if (syn1 != null)
                  try (PrintWriter writer = new PrintWriter(new FileWriter(tempFileSyn1))) {
                      for (int x = 0; x < syn1.rows(); x++) {
                          INDArray row = syn1.getRow(x);
                          StringBuilder builder = new StringBuilder();
                          for (int i = 0; i < row.length(); i++) {
                              builder.append(row.getDouble(i)).append(" ");
                          }
                          writer.println(builder.toString().trim());
                      }
                  }
  
              ZipEntry zSyn1 = new ZipEntry("syn1.txt");
              zipfile.putNextEntry(zSyn1);
  
              FileUtils.copyFile(tempFileSyn1, zipfile);
  
              // writing out syn1
              INDArray syn1Neg = ((InMemoryLookupTable<VocabWord>) vectors.getLookupTable()).getSyn1Neg();
  
              if (syn1Neg != null)
                  try (PrintWriter writer = new PrintWriter(new FileWriter(tempFileSyn1Neg))) {
                      for (int x = 0; x < syn1Neg.rows(); x++) {
                          INDArray row = syn1Neg.getRow(x);
                          StringBuilder builder = new StringBuilder();
                          for (int i = 0; i < row.length(); i++) {
                              builder.append(row.getDouble(i)).append(" ");
                          }
                          writer.println(builder.toString().trim());
                      }
                  }
  
              ZipEntry zSyn1Neg = new ZipEntry("syn1Neg.txt");
              zipfile.putNextEntry(zSyn1Neg);
  
              FileUtils.copyFile(tempFileSyn1Neg, zipfile);
  
  
              ZipEntry hC = new ZipEntry("codes.txt");
              zipfile.putNextEntry(hC);
  
              // writing out huffman tree
              try (PrintWriter writer = new PrintWriter(new FileWriter(tempFileCodes))) {
                  for (int i = 0; i < vectors.getVocab().numWords(); i++) {
                      VocabWord word = vectors.getVocab().elementAtIndex(i);
                      StringBuilder builder = new StringBuilder(encodeB64(word.getLabel())).append(" ");
                      for (int code : word.getCodes()) {
                          builder.append(code).append(" ");
                      }
  
                      writer.println(builder.toString().trim());
                  }
              }
  
              FileUtils.copyFile(tempFileCodes, zipfile);
  
              ZipEntry hP = new ZipEntry("huffman.txt");
              zipfile.putNextEntry(hP);
  
              // writing out huffman tree
              try (PrintWriter writer = new PrintWriter(new FileWriter(tempFileHuffman))) {
                  for (int i = 0; i < vectors.getVocab().numWords(); i++) {
                      VocabWord word = vectors.getVocab().elementAtIndex(i);
                      StringBuilder builder = new StringBuilder(encodeB64(word.getLabel())).append(" ");
                      for (int point : word.getPoints()) {
                          builder.append(point).append(" ");
                      }
  
                      writer.println(builder.toString().trim());
                  }
              }
  
              FileUtils.copyFile(tempFileHuffman, zipfile);
  
              ZipEntry hF = new ZipEntry("frequencies.txt");
              zipfile.putNextEntry(hF);
  
              // writing out word frequencies
              try (PrintWriter writer = new PrintWriter(new FileWriter(tempFileFreqs))) {
                  for (int i = 0; i < vectors.getVocab().numWords(); i++) {
                      VocabWord word = vectors.getVocab().elementAtIndex(i);
                      StringBuilder builder = new StringBuilder(encodeB64(word.getLabel())).append(" ")
                              .append(word.getElementFrequency()).append(" ")
                              .append(vectors.getVocab().docAppearedIn(word.getLabel()));
  
                      writer.println(builder.toString().trim());
                  }
              }
  
              FileUtils.copyFile(tempFileFreqs, zipfile);
  
              ZipEntry config = new ZipEntry("config.json");
              zipfile.putNextEntry(config);
              //log.info("Current config: {}", vectors.getConfiguration().toJson());
              try (ByteArrayInputStream bais = new ByteArrayInputStream(vectors.getConfiguration().toJson().getBytes(StandardCharsets.UTF_8))) {
                  IOUtils.copy(bais, zipfile);
              }
  
              zipfile.flush();
              zipfile.close();
          } finally {
              for (File f : new File[]{tempFileSyn0, tempFileSyn1, tempFileSyn1Neg, tempFileCodes, tempFileHuffman, tempFileFreqs}) {
                  try {
                      f.delete();
                  } catch (Exception e) {
                      //Ignore, is temp file
                  }
              }
          }
      }