title: How should I debug
body: <pre><code>    def clean_str(string):
          string = re.sub(r&quot;\\&quot;, &quot;&quot;, string)
          string = re.sub(r&quot;\'&quot;, &quot;&quot;, string)
          string = re.sub(r&quot;\&quot;&quot;, &quot;&quot;, string)
          return string.strip().lower()
  
      input_data = pd.read_csv('E:\\data\\rawData\\labeledTrainData.tsv', sep='\t')#导入数据
  
      for idx in range(input_data.review.shape[0]):
          text = BeautifulSoup(input_data.review[idx], features=&quot;html5lib&quot;)
          text = clean_str(text.get_text().encode('ascii', 'ignore'))
          texts.append(text)
          sentences = tokenize.sent_tokenize(text)
          reviews.append(sentences)
          labels.append(input_data.sentiment[idx])
  </code></pre>
  <hr />
  <p>bug:</p>
  <p>Using TensorFlow backend.</p>
  <pre><code>    Traceback (most recent call last):
        File &quot;e:/python程序库/wu.py&quot;, line 379, in &lt;module&gt;
          text = clean_str(text.get_text().encode('ascii', 'ignore'))
        File &quot;e:/python程序库/wu.py&quot;, line 370, in clean_str
          string = re.sub(r&quot;\\&quot;, &quot;&quot;, string)
        File &quot;C:\Users\29091\Anaconda3\lib\re.py&quot;, line 192, in sub
          return _compile(pattern, flags).sub(repl, string, count)
      TypeError: cannot use a string pattern on a bytes-like object
  </code></pre>