.toDF(&quot;text&quot;)</span>
<span class="sd">    &gt;&gt;&gt; result = pipeline.fit(data).transform(data)</span>
<span class="sd">    &gt;&gt;&gt; result.select(&quot;label.result&quot;).show(truncate=False)</span>
<span class="sd">    +------+</span>
<span class="sd">    |result|</span>
<span class="sd">    +------+</span>
<span class="sd">    |[pos] |</span>
<span class="sd">    |[neg] |</span>
<span class="sd">    +------+</span>
<span class="sd">    &quot;&quot;&quot;</span>
<div class="viewcode-bloc