Skip to content

Commit

Permalink
-Fixed documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
saif-ellafi committed Dec 19, 2017
1 parent b43122f commit e4836d9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
24 changes: 15 additions & 9 deletions docs/components.html
Original file line number Diff line number Diff line change
Expand Up @@ -592,9 +592,10 @@ <h4 id="SentenceDetector" class="section-block"> 9. SentenceDetector: Sentence B
</ul>
<b>Example:</b><br>
</p>
<pre><code class="language-python">val sentenceDetector = new SentenceDetectorModel()
.setInputCols(Array("document"))
.setOutputCol("sentence")</code></pre>
<pre><code class="language-python">sentence_detector = SentenceDetectorModel() \
.setInputCols(["document"]) \
.setOutputCol("sentence") \
.setUseAbbreviations(True)</code></pre>
</div><!--//code-block-->
</div>
<div role="tabpanel" class="tab-pane" id="scala">
Expand Down Expand Up @@ -650,9 +651,12 @@ <h4 id="POSTagger" class="section-block"> 10. POSTagger: Part of speech tagger</
</ul>
<b>Example:</b><br>
</p>
<pre><code class="language-python">val posTagger = new PerceptronApproach()
.setInputCols(Array("sentence", "token"))
.setOutputCol("pos")</code></pre>
<pre><code class="language-python">pos_tagger = PerceptronApproach() \
.setInputCols(["token", "sentence"]) \
.setOutputCol("pos") \
.setCorpusPath("./src/main/resources/anc-pos-corpus") \
.setIterations(2) \
.fit(data)</code></pre>
</div><!--//code-block-->
</div>
<div role="tabpanel" class="tab-pane" id="scala">
Expand Down Expand Up @@ -680,7 +684,8 @@ <h4 id="POSTagger" class="section-block"> 10. POSTagger: Part of speech tagger</
</p>
<pre><code class="language-python">val posTagger = new PerceptronApproach()
.setInputCols(Array("sentence", "token"))
.setOutputCol("pos")</code></pre>
.setOutputCol("pos")
.fit(data)</code></pre>
</div><!--//code-block--></div>
</div>

Expand Down Expand Up @@ -996,8 +1001,9 @@ <h4 id="Finisher" class="section-block"> 15. Finisher: Getting data out </h4>
outputs annotation(s) values into string.
<br><b>Example:</b><br>
</p>
<pre><code class="language-python">val finisher = new Finisher()
.setInputCols("token")
<pre><code class="language-python">finisher = Finisher() \
.setInputCols(["sentiment"]) \
.setIncludeKeys(True)
</code></pre>

<b>Settable parameters are:</b>
Expand Down
3 changes: 1 addition & 2 deletions src/test/scala/com/johnsnowlabs/nlp/AnnotatorBuilder.scala
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,9 @@ object AnnotatorBuilder extends FlatSpec { this: Suite =>
}

def withFullPOSTagger(dataset: Dataset[Row]): Dataset[Row] = {
val posTagger = new PerceptronApproach()
new PerceptronApproach()
.setInputCols(Array("sentence", "token"))
.setOutputCol("pos")
posTagger
.fit(withFullPragmaticSentenceDetector(withTokenizer(dataset)))
.transform(withFullPragmaticSentenceDetector(withTokenizer(dataset)))
}
Expand Down

0 comments on commit e4836d9

Please sign in to comment.