From e842e181df57c06039ec1724fc0dd8b875b8f4d4 Mon Sep 17 00:00:00 2001 From: Samuel Xu Date: Tue, 6 Dec 2022 07:32:46 -0500 Subject: [PATCH] Documentation fixes (#20607) --- docs/source/en/main_classes/pipelines.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/source/en/main_classes/pipelines.mdx b/docs/source/en/main_classes/pipelines.mdx index ecb8891bf6..f6c63a983f 100644 --- a/docs/source/en/main_classes/pipelines.mdx +++ b/docs/source/en/main_classes/pipelines.mdx @@ -41,19 +41,19 @@ the hub already defines it: ```python >>> pipe = pipeline(model="roberta-large-mnli") >>> pipe("This restaurant is awesome") -[{'label': 'POSITIVE', 'score': 0.9998743534088135}] +[{'label': 'NEUTRAL', 'score': 0.7313136458396912}] ``` -To call a pipeline on many items, you can either call with a *list*. +To call a pipeline on many items, you can call it with a *list*. ```python >>> pipe = pipeline("text-classification") ->>> pipe(["This restaurant is awesome", "This restaurant is aweful"]) +>>> pipe(["This restaurant is awesome", "This restaurant is awful"]) [{'label': 'POSITIVE', 'score': 0.9998743534088135}, {'label': 'NEGATIVE', 'score': 0.9996669292449951}] ``` -To iterate of full datasets it is recommended to use a `dataset` directly. This means you don't need to allocate +To iterate over full datasets it is recommended to use a `dataset` directly. This means you don't need to allocate the whole dataset at once, nor do you need to do batching yourself. This should work just as fast as custom loops on GPU. If it doesn't don't hesitate to create an issue.