title: Python: Read .txt file without putting its content in strings
body: <p>I have created a .txt file which contains training data for a model. The training samples have a certain structure that looks like this:</p>
  
  <pre><code>("sample sentence",
  {"entities": [ ]})
  </code></pre>
  
  <p>I have like 600 of those which I need to put in a list in python. However, when I do the 'normal' python reading with <code>file.readlines()</code> etc., I get all the samples imported as strings that are basically the following:</p>
  
  <pre><code>'("sample sentence",'
  '{"entities": [ ]})'
  </code></pre>
  
  <p>what makes the training data invalid for the model.</p>
  
  <p>So my question is how can I tell python to read the .txt file without any string formatting but rather just read it as it is?</p>
  
  <p>//edit:</p>
  
  <p>The .txt is a file with training data that fits the training process for the spaCy models following the NER annotation scheme. An example of the training data with the NER annotation scheme from the spaCy documentation page:</p>
  
  <pre><code>TRAIN_DATA = [
       ("Uber blew through $1 million a week", {'entities': [(0, 4, 'ORG')]}),
       ("Google rebrands its business apps", {'entities': [(0, 6, "ORG")]})]
  </code></pre>
  
  <p>My .txt file looks exactly like this, except without the <code>[ ]</code> at the beginning and at the end of the .txt file and the line breaks in between. So this example would look like this in my .txt file:</p>
  
  <pre><code>("Uber blew through $1 million a week", 
  {'entities': [(0, 4, 'ORG')]}),
  
  ("Google rebrands its business apps", 
  {'entities': [(0, 6, "ORG")]})
  </code></pre>