train.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:hh-page-classifier 作者: TeamHG-Memex 项目源码 文件源码
def extract_features(doc):
    html = doc['html'] or ''
    if not doc_is_extra_sampled(doc):
        try:
            html = gzip.decompress(base64.b64decode(html)).decode('utf8')
        except Exception:
            pass  # support not compressed html too
    text = html_text.extract_text(html)
    try:
        lang = langdetect.detect(text)
    except LangDetectException:
        lang = None
    return {
        'text': text,
        'language': lang,
    }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号