Add high-level task inference pipelines

Abierto
#7,736 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
30/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
csharp, machine-learning

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
C#
Estrellas
9.4k
Forks
2k
Merge medio
2 d 18 h
PR fusionados (30 d)
64

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de dotnet/machinelearning

Todos los issues de dotnet/machinelearning

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.