def filter_data(self, min_len, max_len):
        """
        Preserves only samples which satisfy the following inequality:
            min_len <= sample sequence length <= max_len

        :param min_len: minimum sequence length
        :param max_len: maximum sequence length
        """
        logging.info(f'Filtering data, min len: {min_len}, max len: {max_len}')

        initial_len = len(self.src)
        filtered_src = []
        for src in self.src:
            if min_len <= len(src) <= max_len:
                filtered_src.append(src)

        self.src = filtered_src
        filtered_len = len(self.src)
        logging.info(f'Pairs before: {initial_len}, after: {filtered_len}')
def filter_data ( self , min_len , max_len ) : logging . info ( f'Filtering data, min len: {min_len}, max len: {max_len}' ) initial_len = len ( self . src ) filtered_src = [ ] for src in self . src : if min_len <= len ( src ) <= max_len : filtered_src . append ( src ) self . src = filtered_src filtered_len = len ( self . src ) logging . info ( f'Pairs before: {initial_len}, after: {filtered_len}' )
Preserves only samples which satisfy the following inequality:
            min_len <= sample sequence length <= max_len

        :param min_len: minimum sequence length
        :param max_len: maximum sequence length