# tfr.utils.parse_keys_and_weights

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/ranking/blob/v0.5.3/tensorflow_ranking/python/utils.py#L446-L475) |

Parses the encoded key to keys and weights.

    tfr.utils.parse_keys_and_weights(
        key: str
    ) -> Dict[str, float]

This parse function will remove all spaces. Different keys are split by ","
and then weight associated with key is split by ":".

<br />

<br />

<br />

| ## Args ||
|---|---|
| `key` | A string represents a key, or a string of multiple keys, split by ",", and weighted by the weights split by ":". For example, key = 'softmax_loss:0.9,sigmoid_cross_entropy_loss:0.1'. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A dict from keys to weights. ||

<br />