transformers/tests/pipelines
Nicolas Patry 2351729f7d
Adding top_k argument to text-classification pipeline. (#17606)
* Adding `top_k` and `sort` arguments to `text-classification` pipeline.

- Deprecate `return_all_scores` as `top_k` is more uniform with other
  pipelines, and a superset of what `return_all_scores` can do.
  BC is maintained though.
  `return_all_scores=True` -> `top_k=None`
  `return_all_scores=False` -> `top_k=1`

- Using `top_k` will imply sorting the results, but using no argument
  will keep the results unsorted for backward compatibility.

* Remove `sort`.

* Fixing the test.

* Remove bad doc.
2022-06-09 18:33:10 +02:00
..
__init__.py [Test refactor 1/5] Per-folder tests reorganization (#15725) 2022-02-23 15:46:28 -05:00
test_pipelines_audio_classification.py [Test refactor 1/5] Per-folder tests reorganization (#15725) 2022-02-23 15:46:28 -05:00
test_pipelines_automatic_speech_recognition.py Black preview (#17217) 2022-05-12 16:25:55 -04:00
test_pipelines_common.py Black preview (#17217) 2022-05-12 16:25:55 -04:00
test_pipelines_conversational.py [Test refactor 1/5] Per-folder tests reorganization (#15725) 2022-02-23 15:46:28 -05:00
test_pipelines_feature_extraction.py [Test refactor 1/5] Per-folder tests reorganization (#15725) 2022-02-23 15:46:28 -05:00
test_pipelines_fill_mask.py [Test refactor 1/5] Per-folder tests reorganization (#15725) 2022-02-23 15:46:28 -05:00
test_pipelines_image_classification.py [Test refactor 1/5] Per-folder tests reorganization (#15725) 2022-02-23 15:46:28 -05:00
test_pipelines_image_segmentation.py Add ForInstanceSegmentation models to image-segmentation pipelines (#15937) 2022-03-09 10:19:05 +01:00
test_pipelines_object_detection.py [Test refactor 1/5] Per-folder tests reorganization (#15725) 2022-02-23 15:46:28 -05:00
test_pipelines_question_answering.py Adding batch_size test to QA pipeline. (#17330) 2022-05-19 14:28:12 -04:00
test_pipelines_summarization.py Black preview (#17217) 2022-05-12 16:25:55 -04:00
test_pipelines_table_question_answering.py Black preview (#17217) 2022-05-12 16:25:55 -04:00
test_pipelines_text_classification.py Adding top_k argument to text-classification pipeline. (#17606) 2022-06-09 18:33:10 +02:00
test_pipelines_text_generation.py Black preview (#17217) 2022-05-12 16:25:55 -04:00
test_pipelines_text2text_generation.py Fixing return type tensor with num_return_sequences>1. (#16828) 2022-04-20 16:11:51 +02:00
test_pipelines_token_classification.py Attention mask is important in the case of batching... (#16222) 2022-03-18 10:02:12 +01:00
test_pipelines_translation.py Black preview (#17217) 2022-05-12 16:25:55 -04:00
test_pipelines_zero_shot_image_classification.py The tests were not updated after the addition of torch.diag (#15890) 2022-03-03 15:33:49 +01:00
test_pipelines_zero_shot.py Black preview (#17217) 2022-05-12 16:25:55 -04:00