You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many of the annotators in annotator.py list requiredAnnotatorTypes() as a parameter when using either <annotatorName>().explainParams(), or dir(<annotatorName>).
However, when using <annotatorName>().setRequiredAnnotatorTypes on most of these annotators, the following error is thrown.
Py4JJavaError: An error occurred while calling o830.getParam.
: java.util.NoSuchElementException: Param requiredAnnotatorTypes does not exist.
The only place where the requiredAnnotatorTypes parameter is shown is in the class AnnotatorProperties of annotator.py starting on line 29.
The text was updated successfully, but these errors were encountered:
@clayms What annotator you use?
I tried with different annotators and it works for me:
print(PerceptronApproach().explainParams())
print(EntityExtractor().explainParams())
print(ViveknSentimentApproach().explainParams())
print(NorvigSweetingApproach().explainParams())
print(NerCrfApproach().explainParams())
Hi @aleksei-ai I have tried it with RegexTokenizer, Normalizer, Stemmer, Lemmatizer, RegexMatcher, EntityExtractor, DateMatcher, SentenceDetectorModel, PerceptronApproach, SentimentDetectorModel, NERRegexApproach, and NorvigSweetingApproach.
the .explainParams() method works on all of them, but when I try and use the .setRequiredAnnotatorTypes when building the annotator to use in a pipeline, that is when the error I referenced above is thrown.
Hi, setRequiredAnnotatorTypes() is a deprecated method and should not be used. This function in python code is just a mistake of a lingering code. Shall be deleted. Thank you @clayms
Required annotators are a fixed property of annotators, and cannot be modified per annotators inherent functionality.
Many of the annotators in annotator.py list
requiredAnnotatorTypes()
as a parameter when using either<annotatorName>().explainParams()
, ordir(<annotatorName>)
.However, when using
<annotatorName>().setRequiredAnnotatorTypes
on most of these annotators, the following error is thrown.The only place where the
requiredAnnotatorTypes
parameter is shown is in theclass AnnotatorProperties
of annotator.py starting on line 29.The text was updated successfully, but these errors were encountered: