From 4bcb4ea2f8e440aa5eccde0b95063814bc0a061f Mon Sep 17 00:00:00 2001 From: kkaris Date: Wed, 24 Jul 2024 15:22:23 -0700 Subject: [PATCH] Update docstring --- gilda/api.py | 9 +++++---- gilda/ner.py | 7 ++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/gilda/api.py b/gilda/api.py index 1c988e8..afd971f 100644 --- a/gilda/api.py +++ b/gilda/api.py @@ -120,11 +120,12 @@ def annotate( ---------- text : str The text to be annotated. - sent_split_fun : Callable, optional + sent_split_fun : Callable[str, Iterable[Tuple[int, int]]], optional A function that splits the text into sentences. The default is - :func:`nltk.tokenize.sent_tokenize`. The function should take a string - as input and return an iterable of strings corresponding to the sentences - in the input text. + :func:`nltk.tokenize.PunktSentenceTokenizer.span_tokenize`. The function + should take a string as input and return an iterable of coordinate pairs + corresponding to the start and end coordinates for each sentence in the + input text. organisms : list[str], optional A list of organism names to pass to the grounder. If not provided, human is used. diff --git a/gilda/ner.py b/gilda/ner.py index d6cc126..39a5009 100644 --- a/gilda/ner.py +++ b/gilda/ner.py @@ -81,9 +81,10 @@ def annotate( The Gilda grounder to use for grounding. sent_split_fun : Callable[str, Iterable[Tuple[int, int]]], optional A function that splits the text into sentences. The default is - :func:`nltk.tokenize.sent_tokenize`. The function should take a string - as input and return an iterable of coordinate pairs corresponding to the - start and end coordinates for each sentence in the input text. + :func:`nltk.tokenize.PunktSentenceTokenizer.span_tokenize`. The function + should take a string as input and return an iterable of coordinate pairs + corresponding to the start and end coordinates for each sentence in the + input text. organisms : list[str], optional A list of organism names to pass to the grounder. If not provided, human is used.