Add high-level task inference pipelines

オープン
#7,736 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
30/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
csharp, machine-learning

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
C#
スター
9.4k
フォーク
2k
平均マージ
2日 18時間
マージ済み PR(30日)
64

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

dotnet/machinelearning のほかの issue

dotnet/machinelearning の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。