<commit_before># -*- coding:utf-8 -*-
#--
# Copyright (c) 2012-2014 Net-ng.
# All rights reserved.
#
# This software is licensed under the BSD License, as described in
# the file LICENSE.txt, which you should have received as part of
# this distribution.
#--

from lxml import etree
from lxml.html import clean


def clean_text(text):
    cc = clean.Cleaner()
    text = cc.clean_html(text)
    text = etree.fromstring(text).text
    return text<commit_msg>Fixed html cleaner. Fixes #4.<commit_after># -*- coding:utf-8 -*-
#--
# Copyright (c) 2012-2014 Net-ng.
# All rights reserved.
#
# This software is licensed under the BSD License, as described in
# the file LICENSE.txt, which you should have received as part of
# this distribution.
#--

from lxml import html


def clean_text(text):
    return html.fromstring(text).text_content()
{'fraction_non_alphanumeric': 0.11575178997613365, 'fraction_numerical': 0.022673031026252982, 'mean_word_length': 3.5846994535519126, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 3}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '308764', 'n_tokens_mistral': 274, 'n_tokens_neox': 256, 'n_words': 95}