Skip to content

Commit

Permalink
Mod: Update code format and docstring.
Browse files Browse the repository at this point in the history
  • Loading branch information
Labbeti committed Nov 2, 2023
1 parent 0dc3bc2 commit c5017ec
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/aac_metrics/utils/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@ def _setup_logging(pkg_name: str, verbose: int) -> None:
level = logging.INFO
else:
level = logging.DEBUG

pkg_logger.setLevel(level)
2 changes: 1 addition & 1 deletion src/aac_metrics/utils/imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

@cache
def _package_is_available(package_name: str) -> bool:
"""Returns True if package is installed."""
"""Returns True if package is installed in the current python environment."""
try:
return find_spec(package_name) is not None
except AttributeError:
Expand Down
8 changes: 4 additions & 4 deletions src/aac_metrics/utils/tokenization.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@

# Path to the stanford corenlp jar
FNAME_STANFORD_CORENLP_3_4_1_JAR = osp.join(
"aac-metrics", "stanford_nlp", "stanford-corenlp-3.4.1.jar"
"aac-metrics",
"stanford_nlp",
"stanford-corenlp-3.4.1.jar",
)
# Punctuations to be removed from the sentences
PTB_PUNCTUATIONS = (
Expand Down Expand Up @@ -61,7 +63,7 @@ def ptb_tokenize_batch(
"""Use PTB Tokenizer to process sentences. Should be used only with all the sentences of a subset due to slow computation.
:param sentences: The sentences to tokenize.
:param audio_ids: The optional audio names. None will use the audio index as name. defaults to None.
:param audio_ids: The optional audio names for the PTB Tokenizer program. None will use the audio index as name. defaults to None.
:param cache_path: The path to the external directory containing the JAR program. defaults to the value returned by :func:`~aac_metrics.utils.paths.get_default_cache_path`.
:param java_path: The path to the java executable. defaults to the value returned by :func:`~aac_metrics.utils.paths.get_default_java_path`.
:param tmp_path: The path to a temporary directory. defaults to the value returned by :func:`~aac_metrics.utils.paths.get_default_tmp_path`.
Expand Down Expand Up @@ -246,8 +248,6 @@ def preprocess_mult_sents(
:param verbose: The verbose level. defaults to 0.
:returns: The multiple sentences processed by the tokenizer.
"""

# Flat list
flatten_sents, sizes = flat_list(mult_sentences)
flatten_sents = preprocess_mono_sents(
sentences=flatten_sents,
Expand Down

0 comments on commit c5017ec

Please sign in to comment.