Skip to content

Commit

Permalink
F13-67 fixed typo
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianWolfschmidtAA committed Mar 26, 2024
1 parent c8b88b6 commit 23a79e0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/intelligence_layer/evaluation/evaluation/graders.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,15 @@ def _tokenize_text(
@classmethod
def _get_scores_per_language(cls, text_chunks: Sequence[str]) -> dict[str, float]:
scores_per_language: dict[str, float] = {}
for test_chunk in text_chunks:
for text_chunk in text_chunks:
try:
languages_with_probs: Sequence[LangdetectLanguage] = detect_langs(
test_chunk
text_chunk
)
for language in languages_with_probs:
scores_per_language[language.lang] = scores_per_language.get(
language.lang, 0
) + language.prob * len(test_chunk)
) + language.prob * len(text_chunk)
except LangDetectException:
continue # skip text_chunk in case language cannot be determined
return cls._normalize_dict(scores_per_language)
Expand Down

0 comments on commit 23a79e0

Please sign in to comment.