Class MlNetIntentClassifier
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
modelPathstringPath to the ML.NET
.zipmodel file.
Properties
IsModelLoaded
Returns true when a model has been successfully loaded.
public bool IsModelLoaded { get; }
Property Value
ModelPath
Returns the model file path being used.
public string ModelPath { get; }
Property Value
Methods
Classify(string)
public IntentClassification Classify(string prompt)
Parameters
promptstring
Returns
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()