推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
rogwan
V2EX  ›  Python

chardet 检测编码出现错误,一般用什么方式纠正呢?

  •  
  •   rogwan · Sep 16, 2017 · 2374 views
    This topic created in 3186 days ago, the information mentioned may be changed or developed.

    汉字编码的字符,识别出来是 Russian:

    {'encoding': 'ISO-8859-5', 'language': 'Russian', 'confidence': 0.21185371684458437}
    

    当然 confidence 也显示的很低的。出现这种 confidence 过低的情况,基本就是误判了,有什么方式纠正吗?

    2 replies    2017-09-16 16:38:01 +08:00
    DoctorCat
        1
    DoctorCat  
       Sep 16, 2017
    只能优化算法了吧。
    官方给了个原理性的 paper 链接: http://www-archive.mozilla.org/projects/intl/UniversalCharsetDetection.html
    可以重点看看 GB2312 的 confidence 计算方式
    janxin
        2
    janxin  
       Sep 16, 2017 via iPhone
    要内容够多越多越准
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5994 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 56ms · UTC 01:57 · PVG 09:57 · LAX 18:57 · JFK 21:57
    ♥ Do have faith in what you're doing.