class SolrCorpus(object):
def __iter__(self):
for doc in solr.query('default',query_def).docs:
yield doc
I was wondering if something like this would prevent from keeping the entire result set in memory, while performing the query only once, at the same time.
Also, I noticed that for measuring coherence for LDA models I need to pass my texts as parameters for CoherenceModel. Wouldn't this mean that I'd need to keep all processed texts that were used to create my corpus and dictionary in memory, to pass to CoherenceModel?
Thanks!