Skip to content

Commit

Permalink
Fixed bug in parallel_text_corpus
Browse files Browse the repository at this point in the history
  • Loading branch information
TaperChipmunk32 committed Oct 22, 2024
1 parent b45a69b commit d8aa049
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions machine/corpora/parallel_text_corpus.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,8 +588,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(text_ids)]) & (
len(self._df[self._target_column].isin(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]:
Expand Down

0 comments on commit d8aa049

Please sign in to comment.