Python (nltk) - UnicodeDecodeError: 'ascii' codec can't decode byte

前端 未结 4 1953
轻奢々
轻奢々 2020-12-06 12:10

I\'m new to NLTK. I\'m getting this error and I\'ve searched around for encoding/decoding and specifically the UnicodeDecodeError but this error seems specific to the NLTK s

4条回答
  •  醉梦人生
    2020-12-06 12:51

    Try using the module "textclean"

    >>> pip install textclean
    

    Python code

    from textclean.textclean import textclean
    text = textclean.clean("John's big idea isn't all that bad.")
    print pos_tag(word_tokenize(text))
    

提交回复
热议问题