From ba5ef178a7062cfa830d8b425664b7777d8a8654 Mon Sep 17 00:00:00 2001 From: TaperChipmunk32 Date: Thu, 24 Oct 2024 12:40:40 -0500 Subject: [PATCH] Updated parallel_text_corpus.py --- machine/corpora/parallel_text_corpus.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/machine/corpora/parallel_text_corpus.py b/machine/corpora/parallel_text_corpus.py index 74be91c..b43d3db 100644 --- a/machine/corpora/parallel_text_corpus.py +++ b/machine/corpora/parallel_text_corpus.py @@ -617,8 +617,8 @@ def count(self, include_empty: bool = True, text_ids: Optional[Iterable[str]] = if include_empty: return len(self._df) return len(self._df[(self._df[self._source_column] != "") & (self._df[self._target_column] != "")]) - return len(self._df[self._df[self._source_column].isin(set(text_ids))]) & ( - len(self._df[self._target_column].isin(set(text_ids))) + return len(self._df[self._df[self._source_column].isin(cast(Sequence[str], text_ids))]) & ( + len(self._df[self._target_column].isin(cast(Sequence[str], text_ids))) ) def _get_rows(self, text_ids: Optional[Iterable[str]] = None) -> Generator[ParallelTextRow, None, None]: