1
Fork 0
mirror of https://github.com/Steffo99/unimore-bda-6.git synced 2024-11-21 15:34:18 +00:00

Remove unused _adapt_string_lookup_layer

This commit is contained in:
Steffo 2023-02-15 17:29:58 +01:00
parent 1c839aecb6
commit 7645596007
Signed by: steffo
GPG key ID: 2A24051445686895

View file

@ -74,15 +74,6 @@ class TensorflowSentimentAnalyzer(BaseSentimentAnalyzer, metaclass=abc.ABCMeta):
return dataset
def _adapt_string_lookup_layer(self, dataset: tensorflow.data.Dataset) -> None:
"""
Adapt the `.string_lookup_layer` to the given dataset.
"""
log.debug("Preparing dataset to adapt %s...", self.string_lookup_layer)
dataset = dataset.map(lambda text, category: text)
log.debug("Adapting %s...", self.string_lookup_layer)
self.string_lookup_layer.adapt(dataset)
def train(self, training_dataset_func: CachedDatasetFunc, validation_dataset_func: CachedDatasetFunc) -> None:
if self.failed:
log.error("Tried to train a failed model.")