title: How to split text into paragraphs using NLTK nltk.tokenize.texttiling?
body: <p>I found this <a href="https://stackoverflow.com/questions/25072167/split-text-into-paragraphs-nltk-usage-of-nltk-tokenize-texttiling">Split Text into paragraphs NLTK - usage of nltk.tokenize.texttiling?</a> explaining how to feed a text into texttiling, however I am unable to actually return a text tokenized by paragraph / topic change as shown here under texttiling <a href="http://www.nltk.org/api/nltk.tokenize.html" rel="nofollow noreferrer">http://www.nltk.org/api/nltk.tokenize.html</a>.</p>
  
  <p>When I feed my text into texttiling, I get the same untokenized text back, but as a list, which is of no use to me.</p>
  
  <pre><code>    tt = nltk.tokenize.texttiling.TextTilingTokenizer(w=20, k=10,similarity_method=0, stopwords=None, smoothing_method=[0], smoothing_width=2, smoothing_rounds=1, cutoff_policy=1, demo_mode=False)
  
      tiles = tt.tokenize(text) # same text returned
  </code></pre>
  
  <p>What I have are emails that follow this basic structure</p>
  
  <pre><code>    From: X
      To: Y                             (LOGISTICS)
      Date: 10/03/2017
  
      Hello team,                       (INTRO)
  
      Some text here representing
      the body                          (BODY)
      of the text.
  
      Regards,                          (OUTRO)
      X
  
      *****DISCLAIMER*****              (POST EMAIL DISCLAIMER)
      THIS EMAIL IS CONFIDENTIAL
      IF YOU ARE NOT THE INTENDED RECIPIENT PLEASE DELETE THIS EMAIL
  </code></pre>
  
  <p>If we call this email string s, it would look like</p>
  
  <pre><code>    s = "From: X\nTo: Y\nDate: 10/03/2017 Hello team,\nSome text here representing the body of the text. Regards,\nX\n\n*****DISCLAIMER*****\nTHIS EMAIL IS CONFIDENTIAL\nIF YOU ARE NOT THE INTENDED RECIPIENT PLEASE DELETE THIS EMAIL"
  </code></pre>
  
  <p>What I want to do is return these 5 sections / paragraphs of string s - LOGISTICS, INTRO, BODY, OUTRO, POST EMAIL DISCLAIMER - <em>separately</em> so I can remove everything but the BODY of the text. How can I return these 5 sections separately using nltk texttiling?</p>
  
  <p>*** Not all emails follow this same structure or have the same wording, so I can't use regular expressions.</p>