def get_text_from_html(html):
  """Returns a plaintext representation of HTML content."""

  try:
    soup = bs4.BeautifulSoup(html, "html.parser")
  except:  # pylint: disable=bare-except
    # Some docs don't parse
    return ""
  # Remove script and style tags
  for s in soup(["script", "style"]):
    s.decompose()
  return "\n".join([s for s in _soup_strings(soup)])
Returns a plaintext representation of HTML content.
tensor2tensor/data_generators/wikisum/html.py