<p>Gensim is data source agnostic. For most of its functionality, it just requires a list of sentences as a document. Actually these documents can even consist of made-up words (i.e. for using word2vec <a href="https://arxiv.org/abs/1403.6652" rel="nofollow noreferrer">on graphs</a>).</p>

<p>For parsing wikipedia dumps and other common corpus types, it provides <a href="https://github.com/RaRe-Technologies/gensim/tree/master/gensim/corpora" rel="nofollow noreferrer">some utility classes</a>. Check its <a href="http://radimrehurek.com/gensim/apiref.html" rel="nofollow noreferrer">API docs</a> of <code>corpora.*</code></p>
Gensim data parsing
<p>Okay, this is a specific question about what data structure is required when providing training data to the Gensim python library. In particular, there must be an implicit understanding of what constitutes a document in any data that it is provided (otherwise it wouldn't, for instance, be able to find the tf-idf).</p>

<p>For a specific example, the wikipedia dump is used in the tutorials for the library for training purposes. The wikipedia dump is provided in XML. What gives gensim an understanding of separate documents? Is this understanding predicated on the nesing of xml elements? </p>