mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-25 23:38:59 +06:00
Doc pipelines (#6175)
* Init work on pipelines doc * Work in progress * Work in progress * Doc pipelines * Rm unwanted default * Apply suggestions from code review Lysandre comments Co-authored-by: Lysandre Debut <lysandre@huggingface.co> Co-authored-by: Lysandre Debut <lysandre@huggingface.co>
This commit is contained in:
parent
b6b2f2270f
commit
e4920c92d6
@ -207,3 +207,4 @@ conversion utilities for the following models:
|
|||||||
model_doc/dpr
|
model_doc/dpr
|
||||||
internal/modeling_utils
|
internal/modeling_utils
|
||||||
internal/tokenization_utils
|
internal/tokenization_utils
|
||||||
|
internal/pipelines_utils
|
40
docs/source/internal/pipelines_utils.rst
Normal file
40
docs/source/internal/pipelines_utils.rst
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
Utilities for pipelines
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
This page lists all the utility functions the library provides for pipelines.
|
||||||
|
|
||||||
|
Most of those are only useful if you are studying the code of the models in the library.
|
||||||
|
|
||||||
|
|
||||||
|
Argument handling
|
||||||
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. autoclass:: transformers.pipelines.ArgumentHandler
|
||||||
|
|
||||||
|
.. autoclass:: transformers.pipelines.ZeroShotClassificationArgumentHandler
|
||||||
|
|
||||||
|
.. autoclass:: transformers.pipelines.QuestionAnsweringArgumentHandler
|
||||||
|
|
||||||
|
|
||||||
|
Data format
|
||||||
|
~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. autoclass:: transformers.pipelines.PipelineDataFormat
|
||||||
|
:members:
|
||||||
|
|
||||||
|
.. autoclass:: transformers.pipelines.CsvPipelineDataFormat
|
||||||
|
:members:
|
||||||
|
|
||||||
|
.. autoclass:: transformers.pipelines.JsonPipelineDataFormat
|
||||||
|
:members:
|
||||||
|
|
||||||
|
.. autoclass:: transformers.pipelines.PipedPipelineDataFormat
|
||||||
|
:members:
|
||||||
|
|
||||||
|
|
||||||
|
Utilities
|
||||||
|
~~~~~~~~~
|
||||||
|
|
||||||
|
.. autofunction:: transformers.pipelines.get_framework
|
||||||
|
|
||||||
|
.. autoclass:: transformers.pipelines.PipelineException
|
@ -41,3 +41,9 @@ The other methods that are common to each model are defined in :class:`~transfor
|
|||||||
|
|
||||||
.. autoclass:: transformers.modeling_tf_utils.TFModelUtilsMixin
|
.. autoclass:: transformers.modeling_tf_utils.TFModelUtilsMixin
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
|
|
||||||
|
Generative models
|
||||||
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
Coming soon
|
||||||
|
@ -3,13 +3,23 @@ Pipelines
|
|||||||
|
|
||||||
The pipelines are a great and easy way to use models for inference. These pipelines are objects that abstract most
|
The pipelines are a great and easy way to use models for inference. These pipelines are objects that abstract most
|
||||||
of the complex code from the library, offering a simple API dedicated to several tasks, including Named Entity
|
of the complex code from the library, offering a simple API dedicated to several tasks, including Named Entity
|
||||||
Recognition, Masked Language Modeling, Sentiment Analysis, Feature Extraction and Question Answering.
|
Recognition, Masked Language Modeling, Sentiment Analysis, Feature Extraction and Question Answering. See the
|
||||||
|
:doc:`task summary <../task_summary>` for examples of use.
|
||||||
|
|
||||||
There are two categories of pipeline abstractions to be aware about:
|
There are two categories of pipeline abstractions to be aware about:
|
||||||
|
|
||||||
- The :func:`~transformers.pipeline` which is the most powerful object encapsulating all other pipelines
|
- The :func:`~transformers.pipeline` which is the most powerful object encapsulating all other pipelines.
|
||||||
- The other task-specific pipelines, such as :class:`~transformers.TokenClassificationPipeline`
|
- The other task-specific pipelines:
|
||||||
or :class:`~transformers.QuestionAnsweringPipeline`
|
|
||||||
|
- :class:`~transformers.ConversationalPipeline`
|
||||||
|
- :class:`~transformers.FeatureExtractionPipeline`
|
||||||
|
- :class:`~transformers.FillMaskPipeline`
|
||||||
|
- :class:`~transformers.QuestionAnsweringPipeline`
|
||||||
|
- :class:`~transformers.SummarizationPipeline`
|
||||||
|
- :class:`~transformers.TextClassificationPipeline`
|
||||||
|
- :class:`~transformers.TextGenerationPipeline`
|
||||||
|
- :class:`~transformers.TokenClassificationPipeline`
|
||||||
|
- :class:`~transformers.TranslationPipeline`
|
||||||
|
|
||||||
The pipeline abstraction
|
The pipeline abstraction
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
@ -21,61 +31,75 @@ other pipeline but requires an additional argument which is the `task`.
|
|||||||
|
|
||||||
|
|
||||||
The task specific pipelines
|
The task specific pipelines
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Parent class: Pipeline
|
|
||||||
=========================================
|
|
||||||
|
|
||||||
.. autoclass:: transformers.Pipeline
|
|
||||||
:members: predict, transform, save_pretrained
|
|
||||||
|
|
||||||
TokenClassificationPipeline
|
|
||||||
==========================================
|
|
||||||
|
|
||||||
.. autoclass:: transformers.TokenClassificationPipeline
|
|
||||||
|
|
||||||
NerPipeline
|
|
||||||
==========================================
|
|
||||||
|
|
||||||
This class is an alias of the :class:`~transformers.TokenClassificationPipeline` defined above. Please refer to that pipeline for
|
|
||||||
documentation and usage examples.
|
|
||||||
|
|
||||||
FillMaskPipeline
|
|
||||||
==========================================
|
|
||||||
|
|
||||||
.. autoclass:: transformers.FillMaskPipeline
|
|
||||||
|
|
||||||
FeatureExtractionPipeline
|
|
||||||
==========================================
|
|
||||||
|
|
||||||
.. autoclass:: transformers.FeatureExtractionPipeline
|
|
||||||
|
|
||||||
TextClassificationPipeline
|
|
||||||
==========================================
|
|
||||||
|
|
||||||
.. autoclass:: transformers.TextClassificationPipeline
|
|
||||||
|
|
||||||
QuestionAnsweringPipeline
|
|
||||||
==========================================
|
|
||||||
|
|
||||||
.. autoclass:: transformers.QuestionAnsweringPipeline
|
|
||||||
|
|
||||||
|
|
||||||
SummarizationPipeline
|
|
||||||
==========================================
|
|
||||||
|
|
||||||
.. autoclass:: transformers.SummarizationPipeline
|
|
||||||
|
|
||||||
|
|
||||||
TextGenerationPipeline
|
|
||||||
==========================================
|
|
||||||
|
|
||||||
.. autoclass:: transformers.TextGenerationPipeline
|
|
||||||
|
|
||||||
|
|
||||||
ConversationalPipeline
|
ConversationalPipeline
|
||||||
==========================================
|
==========================================
|
||||||
|
|
||||||
.. autoclass:: transformers.Conversation
|
.. autoclass:: transformers.Conversation
|
||||||
|
|
||||||
.. autoclass:: transformers.ConversationalPipeline
|
.. autoclass:: transformers.ConversationalPipeline
|
||||||
|
:special-members: __call__
|
||||||
|
:members:
|
||||||
|
|
||||||
|
FeatureExtractionPipeline
|
||||||
|
==========================================
|
||||||
|
|
||||||
|
.. autoclass:: transformers.FeatureExtractionPipeline
|
||||||
|
:special-members: __call__
|
||||||
|
:members:
|
||||||
|
|
||||||
|
FillMaskPipeline
|
||||||
|
==========================================
|
||||||
|
|
||||||
|
.. autoclass:: transformers.FillMaskPipeline
|
||||||
|
:special-members: __call__
|
||||||
|
:members:
|
||||||
|
|
||||||
|
NerPipeline
|
||||||
|
==========================================
|
||||||
|
|
||||||
|
This class is an alias of the :class:`~transformers.TokenClassificationPipeline` defined below. Please refer to that
|
||||||
|
pipeline for documentation and usage examples.
|
||||||
|
|
||||||
|
QuestionAnsweringPipeline
|
||||||
|
==========================================
|
||||||
|
|
||||||
|
.. autoclass:: transformers.QuestionAnsweringPipeline
|
||||||
|
:special-members: __call__
|
||||||
|
:members:
|
||||||
|
|
||||||
|
SummarizationPipeline
|
||||||
|
==========================================
|
||||||
|
|
||||||
|
.. autoclass:: transformers.SummarizationPipeline
|
||||||
|
:special-members: __call__
|
||||||
|
:members:
|
||||||
|
|
||||||
|
TextClassificationPipeline
|
||||||
|
==========================================
|
||||||
|
|
||||||
|
.. autoclass:: transformers.TextClassificationPipeline
|
||||||
|
:special-members: __call__
|
||||||
|
:members:
|
||||||
|
|
||||||
|
TextGenerationPipeline
|
||||||
|
==========================================
|
||||||
|
|
||||||
|
.. autoclass:: transformers.TextGenerationPipeline
|
||||||
|
:special-members: __call__
|
||||||
|
:members:
|
||||||
|
|
||||||
|
TokenClassificationPipeline
|
||||||
|
==========================================
|
||||||
|
|
||||||
|
.. autoclass:: transformers.TokenClassificationPipeline
|
||||||
|
:special-members: __call__
|
||||||
|
:members:
|
||||||
|
|
||||||
|
|
||||||
|
Parent class: :obj:`Pipeline`
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. autoclass:: transformers.Pipeline
|
||||||
|
:members:
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user