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

Method first_data_example

rasa/utils/tensorflow/model_data.py:355–367  ·  view source on GitHub ↗

Return the data with just one feature example per key, sub-key. Returns: The simplified data.

(self)

Source from the content-addressed store, hash-verified

353 self.data = OrderedDict(sorted(self.data.items()))
354
355 def first_data_example(self) -> Data:
356 """Return the data with just one feature example per key, sub-key.
357
358 Returns:
359 The simplified data.
360 """
361 out_data: Data = {}
362 for key, attribute_data in self.data.items():
363 out_data[key] = {}
364 for sub_key, features in attribute_data.items():
365 feature_slices = [feature[:1] for feature in features]
366 out_data[key][sub_key] = cast(List[FeatureArray], feature_slices)
367 return out_data
368
369 def does_feature_exist(self, key: Text, sub_key: Optional[Text] = None) -> bool:
370 """Check if feature key (and sub-key) is present and features are available.

Callers 2

_prepare_for_trainingMethod · 0.80
trainMethod · 0.80

Calls 1

itemsMethod · 0.80

Tested by

no test coverage detected