  &gt;&gt;&gt; pipeline = Pipeline() \\</span>
<span class="sd">    ...     .setStages([</span>
<span class="sd">    ...       documentAssembler,</span>
<span class="sd">    ...       tokenizer,</span>
<span class="sd">    ...       embeddings</span>
<span class="sd">    ...     ])</span>
<span class="sd">    &gt;&gt;&gt; path = &quot;sherlockholmes.txt&quot;</span>
<span class="sd">    &gt;&gt;&gt; dataset = spark.read.text(path).toDF(&quot;text&quot;)</span>
<span class="sd">    &gt;&gt;&gt; pipelineModel