Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARKNLP-988] Updating EntityRuler documentation #14168

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions docs/en/annotator_entries/EntityRuler.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ There are multiple ways and formats to set the extraction resource. It is possib
set as the "format" field in the `option` parameter map and depending on the file type, additional parameters might
need to be set.

To enable regex extraction, `setEnablePatternRegex(true)` needs to be called.

If the file is in a JSON format, then the rule definitions need to be given in a list with the fields "id", "label"
and "patterns":
```
Expand Down Expand Up @@ -110,8 +108,7 @@ entityRuler = EntityRulerApproach() \
"patterns.csv",
ReadAs.TEXT,
{"format": "csv", "delimiter": "\\|"}
) \
.setEnablePatternRegex(True)
)
pipeline = Pipeline().setStages([
documentAssembler,
tokenizer,
Expand Down Expand Up @@ -163,7 +160,6 @@ val entityRuler = new EntityRulerApproach()
ReadAs.TEXT,
{"format": "csv", "delimiter": "|")}
)
.setEnablePatternRegex(true)

val pipeline = new Pipeline().setStages(Array(
documentAssembler,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class AhoCorasickAutomaton(
private def getAlphabetErrorMessage(char: Char): String = {
val workshopURL = "https://github.com/JohnSnowLabs/spark-nlp/"
val alphabetExample =
"blob/master/examples/python/annotation/text/english/entity-ruler/EntityRuler_Alphabet.ipynb"
"blob/master/examples/python/training/english/entity-ruler/EntityRuler_Alphabet.ipynb"
val errorMessage: String =
s"""Char $char not found in the alphabet. Your data could have unusual characters not found
|in your document's language, which requires setting up a custom alphabet.
Expand Down
Loading