Table of Contents

Class MlNetIntentClassifier

Namespace
JD.AI.Workflows
Assembly
JD.AI.Workflows.dll

ML.NET-based intent classifier that loads a pre-trained model from a .zip file and classifies prompts as workflow or conversation intent. Implements IPromptIntentClassifier so it is a drop-in replacement for TfIdfIntentClassifier.

public sealed class MlNetIntentClassifier : IPromptIntentClassifier, IHotSwappableClassifier, IDisposable
Inheritance
MlNetIntentClassifier
Implements
Inherited Members

Constructors

MlNetIntentClassifier(string)

Creates a classifier that loads its trained model from modelPath.

public MlNetIntentClassifier(string modelPath)

Parameters

modelPath string

Path to the ML.NET .zip model file.

Properties

IsModelLoaded

Returns true when a model has been successfully loaded.

public bool IsModelLoaded { get; }

Property Value

bool

ModelPath

Returns the model file path being used.

public string ModelPath { get; }

Property Value

string

Methods

Classify(string)

public IntentClassification Classify(string prompt)

Parameters

prompt string

Returns

IntentClassification

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

ReloadModel()

Reloads the model from disk, replacing the live prediction engine atomically. Thread-safe. Called by IIntentClassifierHotSwapper on file change.

public void ReloadModel()