rxn.metrics.tokenize_file.classification_file_is_tokenized

rxn.metrics.tokenize_file.classification_file_is_tokenized(filepath)[source]

Whether a file contains tokenized classes or not. ‘1.2.3’ -> ‘1 1.2 1.2.3’

By default, this looks at the first non-empty line of the file only!

Raises
  • ValueError – for errors in tokenization or detokenization

  • RuntimeError – for empty files or files with empty lines only.

Parameters

filepath (Union[str, PathLike]) – path to the file.

Return type

bool