prokbert.prokbert_tokenizer.ProkBERTTokenizer.save_vocabulary

ProkBERTTokenizer.save_vocabulary(save_directory: str, filename_prefix: Optional[str] = None) Tuple[str]

Saves the tokenizer’s vocabulary to a file in the specified directory.

This method writes the vocabulary tokens to a text file, with each token on a new line. The filename can be prefixed with an optional string for clearer identification.

Parameters
  • save_directory (str) – The directory where the vocabulary file will be saved.

  • filename_prefix (Optional[str]) – An optional prefix to the filename of the vocabulary file. Defaults to None, which means no prefix is added.

Returns

A tuple containing the path to the saved vocabulary file.

Return type

Tuple[str]

Usage Example:
>>> tokenizer = ProkBERTTokenizer()
>>> saved_path = tokenizer.save_vocabulary("/path/to/save", filename_prefix="prokbert_")
>>> print(saved_path)
...