from skl2onnx.common.data_types import StringTensorType text = ["hello", "world"] data_type = StringTensorType(shape=[None])
from skl2onnx.common.data_types import StringTensorType text = ["hello", "world"] data_type = StringTensorType(shape=[len(text)])
from skl2onnx.common.data_types import StringTensorType text = ["hello", "world"] data_type = StringTensorType(shape=[None], doc_string="A tensor of strings.")In this example, we add a documentation string to the StringTensorType to explain what it represents. Overall, the StringTensorType is a useful data type in scikit-learn for representing text data in machine learning models.