diff --git a/.gitignore b/.gitignore index 53e248b6d..cbd5be92d 100644 --- a/.gitignore +++ b/.gitignore @@ -109,3 +109,5 @@ venv.bak/ resources/taggers/ regression_train/ /doc_build/ + +scripts/ \ No newline at end of file diff --git a/flair/embeddings/token.py b/flair/embeddings/token.py index 76173bac8..7cfbd73b9 100644 --- a/flair/embeddings/token.py +++ b/flair/embeddings/token.py @@ -454,13 +454,14 @@ def __init__( path_to_char_dict: Optional[Union[str, Dictionary]] = None, char_embedding_dim: int = 25, hidden_size_char: int = 25, + name: str = "Char", ) -> None: """Instantiates a bidirectional lstm layer toi encode words by their character representation. Uses the default character dictionary if none provided. """ super().__init__() - self.name = "Char" + self.name = name self.static_embeddings = False self.instance_parameters = self.get_instance_parameters(locals=locals()) @@ -556,6 +557,7 @@ def to_params(self) -> Dict[str, Any]: "path_to_char_dict": self.char_dictionary, "char_embedding_dim": self.char_embedding_dim, "hidden_size_char": self.hidden_size_char, + "name": self.name, }