Skip to content

Commit

Permalink
Updated parallel_text_corpus.py
Browse files Browse the repository at this point in the history
  • Loading branch information
TaperChipmunk32 committed Oct 24, 2024
1 parent df7dabe commit ba5ef17
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 @@ -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]:
Expand Down

0 comments on commit ba5ef17

Please sign in to comment.