code: def runTest(self):
      document_assembler = (
          DocumentAssembler()
          .setInputCol("text")
          .setOutputCol("document")
      )
      sentence_detector = (
          SentenceDetector()
          .setInputCols(["document"])
          .setOutputCol("sentence")
      )
      tokenizer = (
          Tokenizer().setInputCols(["sentence"]).setOutputCol("token")
      )
  
      sentence_embeddings = (
          RoBertaSentenceEmbeddings.pretrained()
          .setInputCols(["document"])
          .setOutputCol("sentence_embeddings")
      )
  
      document_similarity_ranker = (
          DocumentSimilarityRankerApproach()
          .setInputCols("sentence_embeddings")
          .setOutputCol("doc_similarity_rankings")
          .setSimilarityMethod("brp")
          .setNumberOfNeighbours(10)
          .setBucketLength(2.0)
          .setNumHashTables(3)
          .setVisibleDistances(True)
          .setIdentityRanking(True)
      )
  
      document_similarity_ranker_finisher = (
          DocumentSimilarityRankerFinisher()
          .setInputCols("doc_similarity_rankings")
          .setOutputCols(
              "finished_doc_similarity_rankings_id",
              "finished_doc_similarity_rankings_neighbors",
          )
          .setExtractNearestNeighbor(True)
      )
  
      pipeline = Pipeline(
          stages=[
              document_assembler,
              sentence_detector,
              tokenizer,
              sentence_embeddings,
              document_similarity_ranker,
              document_similarity_ranker_finisher,
          ]
      )
  
      model = pipeline.fit(self.data)
  
      (
          model.transform(self.data)
          .select(
              "text",
              "finished_doc_similarity_rankings_id",
              "finished_doc_similarity_rankings_neighbors",
          )
          .show(10, False)
      )
  
file_path: spark-nlp/python/test/annotator/similarity/doc_similarity_ranker_test.py
imports: import unittest
  import pytest
  from sparknlp.annotator import *
  from sparknlp.annotator.similarity.document_similarity_ranker import *
  from sparknlp.base import *
  from test.util import SparkSessionForTest
label_desc: Use image node_id 2 for calling the DocumentSimilarityRankerTestSpec obj's underlying member method code with example usage: obj.runTest() without return types