Comments (10)
I found this question can be solved as below:
in utils.py change as follows:
def test_ner(results, path):
"""
Run perl script to evaluate model
"""
output_file = os.path.join(path, "ner_predict.utf8")
with open(output_file, "w", encoding='utf8') as f:
to_write = []
for block in results:
for line in block:
to_write.append(line + "\n")
to_write.append("\n")
f.writelines(to_write)
eval_lines = return_report(output_file)
return eval_lines
The reason is that only when you write the file use "utf8" can you open the file use "utf8", and it have nothing to do with the tensorflow version.
from chinesener.
请问你解决了吗?
from chinesener.
还没有,悲剧。
from chinesener.
What's wrong with it?My tensorflow is 1.4.
from chinesener.
@yyHaker ,good job, it help me solved this problem,thanks
from chinesener.
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa3 in position 0: invalid start byte
2018-02-02 12:08:27,160 - log\train.log - INFO - iteration:1 step:1000/1044, NER loss: 5.380470
2018-02-02 12:08:36,132 - log\train.log - INFO - evaluate:dev
Traceback (most recent call last):
运行到这还是那个编码问题,你们遇到了吗?
from chinesener.
This is still the encoding problem, you can debug to find the encoding problem
from chinesener.
@yyHaker Thanks!
from chinesener.
This is a encoding problem. If you coding in Linux ,please trans the coding by Notepad++.But ,if you coding in Windows ,Please use this :
import codecs
with codecs.open(filename, 'r', 'utf-8') as f:
#this is your process
from chinesener.
it is very easy. You just need to change the 'utf-8' to 'gbk' in the 'return_report' of 'utils.py'.
from chinesener.
Related Issues (20)
- dev文件识别出0个句子
- 程序正确运行的时候应该是什么样的啊? HOT 2
- 将该模型部署到TensorFlow Serving时如何定义Signature?
- ner_predict.utf8
- 参数意义及设置,是否有keras版本的?
- 这个数据集是哪个团队标注的呀 HOT 2
- 取作者全部数据集训练OK,但是取数据集中的前3000条训练数据为新的训练数据,验证及测试集数据不变,训练出错。 HOT 3
- Fatal Python error: Aborted
- 数据量
- 你好,为什么在线预测出来的标签是beio格式的,而不是bio
- 请问大家在别的领域运用模型需要训练新的Word2vec模型嘛 HOT 1
- 求助,这个报错是什么原因,用的自己的数据和删除部分自带的训练数据后都会有该错误 HOT 2
- 把数据集中的LOC换成其他字母后报keyerror HOT 1
- 报错No such file or directory: 'data\\example.train'该如何解决呢
- 请问这个在window下怎么调用main呢 我加上了train_file,test_file,dev_file 执行后没有任何效果
- 如何去掉BiLSTM层?
- 如何添加attention层? HOT 2
- TypeError: slice indices must be integers or None or have an __index__ method HOT 1
- 每次都要加载模型有什么办法加载一次么
- 我修改了clean和train的False为True 然后运行报出name 'tf' is not defined的错误是什么情况 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chinesener.