MCPcopy
hub / github.com/RasaHQ/rasa / test_split_data_by_label

Function test_split_data_by_label

tests/utils/tensorflow/test_model_data.py:27–39  ·  view source on GitHub ↗
(model_data: RasaModelData)

Source from the content-addressed store, hash-verified

25
26
27def test_split_data_by_label(model_data: RasaModelData):
28 split_model_data = model_data._split_by_label_ids(
29 model_data.data, model_data.get("label", "ids")[0], np.array([0, 1])
30 )
31
32 assert len(split_model_data) == 2
33 for s in split_model_data:
34 assert len(set(s.get("label", "ids")[0])) == 1
35
36 for key, attribute_data in split_model_data[0].items():
37 for sub_key, features in attribute_data.items():
38 assert len(features) == len(model_data.data[key][sub_key])
39 assert len(features[0]) == 2
40
41
42def test_split_data_by_none_label(model_data: RasaModelData):

Callers

nothing calls this directly

Calls 3

_split_by_label_idsMethod · 0.80
itemsMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…