code: public Collection<String> nearestLabels(INDArray labelVector, int topN) {
          if (labelsMatrix == null || labelsList == null || labelsList.isEmpty())
              extractLabels();
  
          List<BasicModelUtils.WordSimilarity> result = new ArrayList<>();
  
          // if list still empty - return empty collection
          if (labelsMatrix == null || labelsList == null || labelsList.isEmpty()) {
              log.warn("Labels list is empty!");
              return new ArrayList<>();
          }
  
          if (!normalizedLabels) {
              synchronized (this) {
                  if (!normalizedLabels) {
                      labelsMatrix.diviColumnVector(labelsMatrix.norm1(1));
                      normalizedLabels = true;
                  }
              }
          }
  
          INDArray similarity = Transforms.unitVec(labelVector).mmul(labelsMatrix.transpose());
          List<Double> highToLowSimList = getTopN(similarity, topN + 20);
  
          for (int i = 0; i < highToLowSimList.size(); i++) {
              String word = labelsList.get(highToLowSimList.get(i).intValue()).getLabel();
              if (word != null && !word.equals("UNK") && !word.equals("STOP")) {
                  INDArray otherVec = lookupTable.vector(word);
                  double sim = Transforms.cosineSim(labelVector, otherVec);
  
                  result.add(new BasicModelUtils.WordSimilarity(word, sim));
              }
          }
  
          Collections.sort(result, new BasicModelUtils.SimilarityComparator());
  
          return BasicModelUtils.getLabels(result, topN);
      }
docs: This method returns top N labels nearest to specified features vector
  
  @param labelVector
  @param topN
  @return