Skip to content

Commit

Permalink
Fix: encode_cand_and_refs function name and imports in tokenization.
Browse files Browse the repository at this point in the history
  • Loading branch information
Labbeti committed Nov 9, 2023
1 parent 96504e9 commit 6ee5be1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/aac_metrics/functional/meteor.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def meteor(

n_candidates = len(candidates)
encoded_cands_and_mrefs = [
encore_cand_and_refs(cand, refs)
_encode_cand_and_refs(cand, refs)
for cand, refs in zip(candidates, mult_references)
]
del candidates, mult_references
Expand Down Expand Up @@ -211,7 +211,7 @@ def meteor(
return meteor_score


def encore_cand_and_refs(candidate: str, references: list[str]) -> bytes:
def _encode_cand_and_refs(candidate: str, references: list[str]) -> bytes:
# SCORE ||| reference 1 words ||| ... ||| reference N words ||| candidate words
candidate = candidate.replace("|||", "").replace(" ", " ")
score_line = " ||| ".join(("SCORE", " ||| ".join(references), candidate))
Expand Down
3 changes: 2 additions & 1 deletion src/aac_metrics/utils/tokenization.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import tempfile
import time

from typing import Any, Hashable, Iterable, Optional
from pathlib import Path
from typing import Any, Hashable, Iterable, Optional, Union

from aac_metrics.utils.checks import check_java_path, is_mono_sents
from aac_metrics.utils.collections import flat_list, unflat_list
Expand Down

0 comments on commit 6ee5be1

Please sign in to comment.