GithubHelp home page GithubHelp logo

Python3中遇到UnicodeEncodeError: 'ascii' codec can't encode characters in ordinal not in range(128) about named_entity_recognition HOT 10 OPEN

luopeixiang avatar luopeixiang commented on June 27, 2024
Python3中遇到UnicodeEncodeError: 'ascii' codec can't encode characters in ordinal not in range(128)

from named_entity_recognition.

Comments (10)

TENGSP avatar TENGSP commented on June 27, 2024

同样问题,请问你解决了吗?

from named_entity_recognition.

lynlynnlynnn avatar lynlynnlynnn commented on June 27, 2024

同问,请问解决了吗?

from named_entity_recognition.

TENGSP avatar TENGSP commented on June 27, 2024

在运行到crf模型时出现上述错误,查了很久,试了各种方法也没有解决,请问有没有人知道该如何解决呢?
环境:win10 python3.8
编码方式查过了是utf-8没错,但一直出现这个错误。求大神支招!

求解决方法

from named_entity_recognition.

lln1997 avatar lln1997 commented on June 27, 2024

只能用linux运行

from named_entity_recognition.

BlackSpritee avatar BlackSpritee commented on June 27, 2024

找到报错的地方,变量名加str()转换一下,

from named_entity_recognition.

hujunyi96 avatar hujunyi96 commented on June 27, 2024

在字符串前加小写r

from named_entity_recognition.

1yangjianfei avatar 1yangjianfei commented on June 27, 2024

同问,请问解决了吗

from named_entity_recognition.

Hai-Chao-ren avatar Hai-Chao-ren commented on June 27, 2024

同问,在linux上运行crf时出现了这个问题

from named_entity_recognition.

jiayuanyuan67777 avatar jiayuanyuan67777 commented on June 27, 2024

我也遇到这个问题,求问怎么解决

from named_entity_recognition.

EstrellaXiao avatar EstrellaXiao commented on June 27, 2024

找到报错的地方,变量名加str()转换一下,

您好,请问是要加在哪里呢?

正在训练评估CRF模型...
Traceback (most recent call last):
File "D:\named_entity_recognition-master\named_entity_recognition-master\main.py", line 73, in
main()
File "D:\named_entity_recognition-master\named_entity_recognition-master\main.py", line 29, in main
crf_pred = crf_train_eval(
File "D:\named_entity_recognition-master\named_entity_recognition-master\evaluate.py", line 43, in crf_train_eval
crf_model.train(str(train_word_lists), str(train_tag_lists))
File "D:\named_entity_recognition-master\named_entity_recognition-master\models\crf.py", line 23, in train
self.model.fit(str(features), str(tag_lists))
File "D:\anaconda\lib\site-packages\sklearn_crfsuite\estimator.py", line 331, in fit
trainer.train(self.modelfile.name, holdout=-1 if X_dev is None else 1)
File "pycrfsuite/_pycrfsuite.pyx", line 359, in pycrfsuite._pycrfsuite.BaseTrainer.train
File "", line 15, in string.from_py.__pyx_convert_string_from_py_std__in_string
UnicodeEncodeError: 'ascii' codec can't encode characters in position 9-10: ordinal not in range(128)

from named_entity_recognition.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.