# tfio.experimental.text.decode_libsvm

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/io/blob/v0.24.0/tensorflow_io/python/experimental/text_ops.py#L21-L38) |

Convert Libsvm records to a tensor of label and a tensor of feature.

    tfio.experimental.text.decode_libsvm(
        content, num_features, dtype=None, label_dtype=None
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `content` | A `Tensor` of type `string`. Each string is a record/row in the Libsvm format. |
| `num_features` | The number of features. |
| `dtype` | The type of the output feature tensor. Default to tf.float32. |
| `label_dtype` | The type of the output label tensor. Default to tf.int64. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| `features` | A `SparseTensor` of the shape `[input_shape, num_features]`. |
| `labels` | A `Tensor` of the same shape as content. |

<br />