Add high-level task inference pipelines

Ouverte
#7,736 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
5/5
Temps estimé
Plus d'une semaine
Accessibilité débutants
30/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
Active
Stack technique
csharp, machine-learning

Piste de recherche

Review the existing model backend and tokenizer APIs in the ML.NET codebase, such as those used for text classification. Examine the Hugging Face pipeline design for reference. The work involves designing abstract contracts for preprocessing, model execution, and post-processing, then implementing a concrete pipeline for a narrow task like text classification. 'Done' means a reusable pipeline abstraction that can accept batches, apply tokenization, run a model, and post-process results, with configuration points for customization.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

area-Meta enhancement untriaged

Is your feature request related to a problem? Please describe.
Hugging Face task pipelines provide a high-level path from application input to model result: preprocessing and tokenization, batched model invocation, and task-specific post-processing. In .NET, users migrating custom models generally have to compose these stages themselves and understand the different tokenizer, tensor, and inference-runtime APIs involved.

This makes otherwise common inference scenarios substantially harder to implement correctly and efficiently, especially for teams migrating from Python. #7384 can document how to assemble a pipeline, but it does not track providing a reusable product abstraction.

Describe the solution you'd like
Provide reusable, backend-aware inference pipeline abstractions for common tasks, beginning with a narrowly scoped task such as text classification. A pipeline should be able to:

  • Accept single inputs and batches.
  • Apply the configured tokenizer and produce the model's required inputs, including masks and token-type IDs where applicable.
  • Invoke a supported model backend without unnecessary conversions or copies.
  • Apply task-specific post-processing such as softmax, score selection, and label mapping.
  • Expose configuration and lower-level results for callers that need to customize individual stages.
  • Permit alternative tokenizer and model-runner implementations rather than coupling the abstraction to one model format.

The initial design could establish composable preprocessing, model-execution, and post-processing contracts before adding more task-specific pipelines.

Describe alternatives you've considered
Applications can implement their own pipeline for each model and task. Samples and migration documentation reduce the discovery cost, but they do not provide shared behavior, extension points, validation, or a consistent performance-oriented implementation.

Additional context
This request was identified while splitting the feedback in #7383, which originated in microsoft/semantic-kernel#9793. The original example was equivalent functionality to Hugging Face's TextClassificationPipeline, not necessarily API compatibility with that Python type.

[!NOTE]
This issue was drafted with AI assistance.

Langage dominant
C#
Étoiles
9.4k
Forks
2k
Merge moyen
2 j 18 h
PR mergées (30 j)
64

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de dotnet/machinelearning

Toutes les issues de dotnet/machinelearning

Issues similaires

Plus d'issues C#

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.