intent_classifier()
Perform inference with an Intent Classification model, on a single input string or a list of input strings.
For each input string, this will return the predicted intent label, which is one of the
classes that the model was trained on.
If no model is loaded, the base Intent Classification model tanaos/tanaos-intent-classifier-v1 will be used by default. For more information on what intents the base Intent Classification model is trained to recognize, see the model's Hugging Face page.
Arguments
- text str | list[str]
A string or a list of strings to classify. The model will return a label for each input string.
Response
A list[dict], each dict containing a "label" key with the predicted intent
label for the corresponding input string, and a "score" key with a float value
representing the model's confidence in its prediction.
- Python
from artifex import Artifex
intent_classifier = Artifex().intent_classifier
label = intent_classifier("Hey there, how are you doing?")
print(label)
- Response
[{'label': 'greeting', 'score': 0.9955}]