@classmethod<EOL><INDENT>def from_json(cls, json_str):<DEDENT>
vocab_dict = json.loads(json_str)<EOL>unknown_token = vocab_dict.get('<STR_LIT>')<EOL>vocab = cls(unknown_token=unknown_token)<EOL>vocab._idx_to_token = vocab_dict.get('<STR_LIT>')<EOL>vocab._token_to_idx = vocab_dict.get('<STR_LIT>')<EOL>if unknown_token:<EOL><INDENT>vocab._token_to_idx = DefaultLookupDict(vocab._token_to_idx[unknown_token],<EOL>vocab._token_to_idx)<EOL><DEDENT>vocab._reserved_tokens = vocab_dict.get('<STR_LIT>')<EOL>vocab._padding_token = vocab_dict.get('<STR_LIT>')<EOL>vocab._bos_token = vocab_dict.get('<STR_LIT>')<EOL>vocab._eos_token = vocab_dict.get('<STR_LIT>')<EOL>return vocab<EOL>
Deserialize Vocab object from json string.

        Parameters
        ----------
        json_str : str
            Serialized json string of a Vocab object.


        Returns
        -------
        Vocab