Skip to content

Commit

Permalink
make mypy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
theorm committed Oct 23, 2024
1 parent 1661253 commit 2ed13e7
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions impresso/resources/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
from impresso.api_client.models.impresso_named_entity_recognition_request import (
ImpressoNamedEntityRecognitionRequest,
)
from impresso.api_client.models.impresso_named_entity_recognition_request_method import (
ImpressoNamedEntityRecognitionRequestMethod,
)
from impresso.api_models import ImpressoNerResponse
from impresso.data_container import DataContainer
from impresso.resources.base import Resource
Expand Down Expand Up @@ -65,7 +68,9 @@ def ner(self, text: str) -> NerContainer:
"""
result = perform_ner.sync(
client=self._api_client,
body=ImpressoNamedEntityRecognitionRequest(text=text, method="ner"),
body=ImpressoNamedEntityRecognitionRequest(
text=text, method=ImpressoNamedEntityRecognitionRequestMethod.NER
),
)
raise_for_error(result)

Expand All @@ -88,7 +93,9 @@ def ner_nel(self, text: str) -> NerContainer:
"""
result = perform_ner.sync(
client=self._api_client,
body=ImpressoNamedEntityRecognitionRequest(text=text, method="ner-nel"),
body=ImpressoNamedEntityRecognitionRequest(
text=text, method=ImpressoNamedEntityRecognitionRequestMethod.NER_NEL
),
)
raise_for_error(result)

Expand All @@ -111,7 +118,9 @@ def nel(self, text: str) -> NerContainer:
"""
result = perform_ner.sync(
client=self._api_client,
body=ImpressoNamedEntityRecognitionRequest(text=text, method="nel"),
body=ImpressoNamedEntityRecognitionRequest(
text=text, method=ImpressoNamedEntityRecognitionRequestMethod.NEL
),
)
raise_for_error(result)

Expand Down

0 comments on commit 2ed13e7

Please sign in to comment.