Repository: RasaHQ/rasa
Pull request: Remove deprecated SingleStateFeaturizer subclasses and method.
**Proposed changes**:
Removes deprecated `SingleStateFeaturizer` subclasses: `BinarySingleStateFeaturizer` and `LabelTokenizerSingleStateFeaturizer`. Deprecated method `encode_all_actions` of `SingleStateFeaturizer` has been deleted.

No links need to be removed from the docs/changelog as these components did not have sections in the docs (that weren't autogenerated from the class definitions).

They also did not have any tests (!) so tests remain unchanged.

**Status (please check what you already did)**:
- [x] deprecated code has been removed.
- [x] updated the changelog (please check [changelog](https://github.com/RasaHQ/rasa/tree/main/changelog) for instructions)
- [x] reformat files using `black` (please check [Readme](https://github.com/RasaHQ/rasa#code-style) for instructions)


Problem statement:
3.0 Deprecation Warnings: Remove deprecated featurizers
**Background**
These warnings were found in:
- rasa.core.featurizers.single_state_featurizer.py:L382, L410
```
"f""'{self.__class__.__name__}' is deprecated and ""
f""will be removed in Rasa Open Source 3.0.0. ""
f""It is recommended to use the '{SingleStateFeaturizer.__name__}' instead."""
```
- rasa.nlu.utils.hugging_face.hf_transformers.py:L66
```
"f""'{self.__class__.__name__}' is deprecated and ""
f""will be removed in the future. ""
 f""It is recommended to use the '{LanguageModelFeaturizer.__name__}' instead."""
```

**Definition of Done**:
- [x] resolve warnings in 3.0 version
- [x]  Removed the deprecated featurizers from the codebase.
- [x] Added a changelog entry for 3.0 saying we've removed the previously deprecated featurizers
- [x] Removed the references in the docs

Hints from issue discussion:
Since tokenization and featurization tests are tightly coupled, I'm removing `rasa/nlu/utils/hugging_face/hf_transformers.py` as part of https://github.com/RasaHQ/rasa/pull/9120/ .

Commit message: Merge branch 'main' into remove-deprecated-state-featurizers

Patch to review:
diff --git a/changelog/8879.removal.md b/changelog/8879.removal.md
new file mode 100644
index 000000000000..be7110d74c9c
--- /dev/null
+++ b/changelog/8879.removal.md
@@ -0,0 +1,3 @@
+Follow through on removing deprecated dialogue policy state featurizers: `BinarySingleStateFeature` and `LabelTokenizerSingleStateFeaturizer`.
+
+Remove deprecated `SingleStateFeaturizer` method `encode_all_actions`. Use `encode_all_labels` instead.
diff --git a/rasa/core/featurizers/single_state_featurizer.py b/rasa/core/featurizers/single_state_featurizer.py
index 1d1f50279248..06f54ce7ba27 100644
--- a/rasa/core/featurizers/single_state_featurizer.py
+++ b/rasa/core/featurizers/single_state_featurizer.py
@@ -4,14 +4,12 @@
 from typing import List, Optional, Dict, Text, Set, Any
 from collections import defaultdict
 
-import rasa.shared.utils.io
 from rasa.nlu.extractors.extractor import EntityTagSpec
 from rasa.nlu.utils import bilou_utils
 from rasa.nlu.utils.bilou_utils import BILOU_PREFIXES
 from rasa.shared.core.domain import SubState, State, Domain
 from rasa.shared.nlu.interpreter import NaturalLanguageInterpreter, RegexInterpreter
 from rasa.shared.core.constants import PREVIOUS_ACTION, ACTIVE_LOOP, USER, SLOTS
-from rasa.shared.constants import DOCS_URL_MIGRATION_GUIDE
 from rasa.shared.core.trackers import is_prev_action_listen_in_state
 from rasa.shared.nlu.constants import (
     ENTITIES,
@@ -371,30 +369,6 @@ def encode_all_labels(
             for action in domain.action_names_or_texts
         ]
 
-    def encode_all_actions(
-        self, domain: Domain, interpreter: NaturalLanguageInterpreter
-    ) -> List[Dict[Text, List[Features]]]:
-        """Encodes all actions from the domain using the given interpreter.
-
-        This method is deprecated and will be removed in Rasa Open Source 3.0.0 .
-        It is recommended to use `encode_all_labels` instead.
-
-        Args:
-            domain: The domain that contains the actions.
-            interpreter: The interpreter used to encode the actions.
-
-        Returns:
-            A list of encoded actions.
-        """
-        rasa.shared.utils.io.raise_deprecation_warning(
-            f"'{self.__class__.__name__}.encode_all_actions' is deprecated and "
-            f"will be removed in Rasa Open Source 3.0.0. "
-            f"It is recommended to use the method 'encode_all_labels' instead.",
-            docs=DOCS_URL_MIGRATION_GUIDE,
-        )
-
-        return self.encode_all_labels(domain, interpreter)
-
 
 class IntentTokenizerSingleStateFeaturizer(SingleStateFeaturizer):
     """A SingleStateFeaturizer for use with policies that predict intent labels."""
@@ -428,45 +402,3 @@ def encode_all_labels(
             A list of encoded labels.
         """
         return [self._encode_intent(intent, interpreter) for intent in domain.intents]
-
-
-class BinarySingleStateFeaturizer(SingleStateFeaturizer):
-    """Dialogue State featurizer which features the state as binaries."""
-
-    def __init__(self) -> None:
-        """Creates featurizer."""
-        super().__init__()
-        rasa.shared.utils.io.raise_deprecation_warning(
-            f"'{self.__class__.__name__}' is deprecated and "
-            f"will be removed in Rasa Open Source 3.0.0. "
-            f"It is recommended to use the '{SingleStateFeaturizer.__name__}' instead.",
-            docs=DOCS_URL_MIGRATION_GUIDE,
-        )
-
-    def _extract_state_features(
-        self,
-        sub_state: SubState,
-        interpreter: NaturalLanguageInterpreter,
-        sparse: bool = False,
-    ) -> Dict[Text, List[Features]]:
-        # create a special method that doesn't use passed interpreter
-        name_attribute = self._get_name_attribute(set(sub_state.keys()))
-        if name_attribute:
-            return {
-                name_attribute: self._create_features(sub_state, name_attribute, sparse)
-            }
-
-        return {}
-
-
-class LabelTokenizerSingleStateFeaturizer(SingleStateFeaturizer):
-    def __init__(self, *args: Any, **kwargs: Any) -> None:
-        super().__init__()
-        # it is hard to fully mimic old behavior, but SingleStateFeaturizer
-        # does the same thing if nlu pipeline is configured correctly
-        rasa.shared.utils.io.raise_deprecation_warning(
-            f"'{self.__class__.__name__}' is deprecated and "
-            f"will be removed in Rasa Open Source 3.0.0. "
-            f"It is recommended to use the '{SingleStateFeaturizer.__name__}' instead.",
-            docs=DOCS_URL_MIGRATION_GUIDE,
-        )


Code review comments:
diff_hunk: @@ -0,0 +1,3 @@
+Follow through on removing deprecated dialogue policy state featurizers: `BinarySingleStateFeature` and `LabelTokenizerSingleStateFeaturizer`.
+
+Remove deprecated `SingleStateFeaturizer` method `encode_all_actions`. Use `encode_all_labels` instead.
path: changelog/8879.removal.md
text: @user1:
```suggestion
Removed the deprecated method `encode_all_actions` of `SingleStateFeaturizer`. Use `encode_all_labels` instead.
```