turicreate.text_classifier.TextClassifier.export_coreml¶
-
TextClassifier.
export_coreml
(filename)¶ Export the model in Core ML format.
Parameters: - filename: str
A valid filename where the model can be saved.
Examples
>>> model.export_coreml("MyTextMessageClassifier.mlmodel") >>> >>> from coremltools.models import MLModel >>> coreml_model = MLModel("MyTextMessageClassifier.mlmodel") >>> >>> test_input = tc.SArray(["Hi! How are you?"]) >>> bag_of_words = tc.text_analytics.count_words(test_input) >>> >>> # "text" is the input column name >>> coreml_model.predict({"text": bag_of_words[0]})