gensim.corpora.ShardedCorpus.shard_by_offset

ShardedCorpus.shard_by_offset(offset)[source]

Determine which shard the given offset belongs to. If the offset is greater than the number of available documents, raises a ValueError.

Assumes that all shards have the same size.