title: Creating Dictionary and Integer Key for List of Strings in Python
body: <p>I have a list of unicode string lists. </p>
  
  <p>Each string list represents a different document with the strings representing the authors' names. Some documents have only one author while other documents can have multiple co-authors.</p>
  
  <p>For example, a sample of authorship of three documents looks like this:</p>
  
  <pre><code>authors = [[u'Smith, J.', u'Williams, K.', u'Daniels, W.'], [u'Smith, J.'], [u'Williams, K.', u'Daniels, W.']]
  </code></pre>
  
  <p>I want to convert my list into a dictionary and list.</p>
  
  <p>First, a dictionary that provides an integer key for each name:</p>
  
  <pre><code>author_name = {0: u'Smith, J.', 1: u'Williams, K.', 2: u'Daniels, W.'}
  </code></pre>
  
  <p>Second, a list that identifies the authors for each document by the integer key:</p>
  
  <pre><code>doc_author = [[0, 1, 2], [0], [1, 2]]
  </code></pre>
  
  <p>What is the most efficient way to create these?</p>
  
  <p>FYI: I need my author data in this format to run a pre-built author-topic LDA algorithm written in Python.</p>