diff --git a/src/transformers/pipelines/token_classification.py b/src/transformers/pipelines/token_classification.py index 04a80b32dd58cf..0dd91761899c24 100644 --- a/src/transformers/pipelines/token_classification.py +++ b/src/transformers/pipelines/token_classification.py @@ -172,7 +172,8 @@ def __call__(self, inputs: Union[str, List[str]], **kwargs): corresponding input, or each entity if this pipeline was instantiated with an aggregation_strategy) with the following keys: - - **word** (`str`) -- The token/word classified. + - **word** (`str`) -- The token/word classified. This is obtained by decoding the selected tokens. If you + want to have the exact string in the original sentence, use `start` and `stop`. - **score** (`float`) -- The corresponding probability for `entity`. - **entity** (`str`) -- The entity predicted for that token/word (it is named *entity_group* when *aggregation_strategy* is not `"none"`.