Universal classification
Universal classification is an advanced type of NLP classification that can be used to classify text data into predefined categories without the need to train a model on predefined examples. The TrueState Python SDK provides a high-level API for making predictions on your universal classification models.
from truestate.inference import classify
sample_text = "You should invest all of your money on the stock market!"
result = classify(sample_text, choices=["the text contains financial advice"])
print(result)
# {'the text contains financial advice': 0.995}