Skip to content

Commit d864150

Browse files
committed
Update docstrings
1 parent f8d8c33 commit d864150

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

transformers_interpret/explainers/question_answering.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,14 @@ def __call__(
371371
question (str): The question text
372372
text (str): The text or context from which the model finds an answers
373373
embedding_type (int, optional): The embedding type word(0), position(1), all(2) to calculate attributions for.
374-
Defaults to 2.
374+
Defaults to 2.
375+
internal_batch_size (int, optional): Divides total #steps * #examples
376+
data points into chunks of size at most internal_batch_size,
377+
which are computed (forward / backward passes)
378+
sequentially. If internal_batch_size is None, then all evaluations are
379+
processed in one batch.
380+
n_steps (int, optional): The number of steps used by the approximation
381+
method. Default: 50.
375382
376383
Returns:
377384
dict: Dict for start and end position word attributions.

transformers_interpret/explainers/sequence_classification.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,13 @@ def __call__(
306306
index (int, optional): Optional output index to provide attributions for. Defaults to None.
307307
class_name (str, optional): Optional output class name to provide attributions for. Defaults to None.
308308
embedding_type (int, optional): The embedding type word(0) or position(1) to calculate attributions for. Defaults to 0.
309-
309+
internal_batch_size (int, optional): Divides total #steps * #examples
310+
data points into chunks of size at most internal_batch_size,
311+
which are computed (forward / backward passes)
312+
sequentially. If internal_batch_size is None, then all evaluations are
313+
processed in one batch.
314+
n_steps (int, optional): The number of steps used by the approximation
315+
method. Default: 50.
310316
Returns:
311317
list: List of tuples containing words and their associated attribution scores.
312318
"""

transformers_interpret/explainers/zero_shot_classification.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,13 @@ def __call__(
292292
Defaults to "this text is about {} .".
293293
include_hypothesis (bool, optional): Alternative option to include hypothesis text in attributions
294294
and visualization. Defaults to False.
295-
295+
internal_batch_size (int, optional): Divides total #steps * #examples
296+
data points into chunks of size at most internal_batch_size,
297+
which are computed (forward / backward passes)
298+
sequentially. If internal_batch_size is None, then all evaluations are
299+
processed in one batch.
300+
n_steps (int, optional): The number of steps used by the approximation
301+
method. Default: 50.
296302
Returns:
297303
list: List of tuples containing words and their associated attribution scores.
298304
"""

0 commit comments

Comments
 (0)