Skip to content

Commit

Permalink
update type check (#1175)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenghaoMou authored Sep 20, 2023
1 parent f36caf4 commit beb605d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ def _get_nlp_recognizer(
) -> Union[Type[SpacyRecognizer], Type[StanzaRecognizer]]:
"""Return the recognizer leveraging the selected NLP Engine."""

if not nlp_engine or type(nlp_engine) is SpacyNlpEngine:
return SpacyRecognizer
if isinstance(nlp_engine, StanzaNlpEngine):
return StanzaRecognizer
if isinstance(nlp_engine, TransformersNlpEngine):
return TransformersRecognizer
if not nlp_engine or isinstance(nlp_engine, SpacyNlpEngine):
return SpacyRecognizer
else:
logger.warning(
"nlp engine should be either SpacyNlpEngine,"
Expand Down

0 comments on commit beb605d

Please sign in to comment.