real-brilliant / bert_chinese_pytorch Goto Github PK
View Code? Open in Web Editor NEWbert for chinese text classification
bert for chinese text classification
.json的文件怎么生成的啊。。。我现在有每行的格式是:label\t文本的.txt文件,不知道怎么变成代码里可以用的json文件。。。
求教
我使用example转feature的时候加载时间很长,经常卡在那里不动,请问你有遇到过吗
直接把do_train参数取消,提示:
Output directory (path) already exists and is not empty.
您好,请问‘’Weights of BertForSequenceClassification not initialized from pretrained model: ['classifier.weight', 'classifier.bias']‘’这种情况您碰到过吗,这样权重无法加载,预训练模型的意义也发挥不出来。
不过现在好像在
model = BertForSequenceClassification.from_pretrained(args.bert_model, cache_dir=PYTORCH_PRETRAINED_BERT_CACHE / 'distributed_{}'.format( args.local_rank))
这一行会报如下的错误:
File "/root/anaconda3/envs/liu37/lib/python3.7/site-packages/pytorch_pretrained_bert/modeling.py", line 581, in from_pretrained model = cls(config, *inputs, **kwargs) TypeError: __init__() missing 1 required positional argument: 'num_labels'
我也是这个问题,请问你解决了吗?
Originally posted by @Zhaohaoran1997 in #1 (comment)
抱歉打扰您。我在运行过程中又遇到了模型出错问题。
这个问题我在pytor_pretrained_bert的issue里看到过,但作者说2018年11月就已经解决了这个问题,我看我现在运行的代码中也包含了修正后的部分。不知道我这现在是什么情况?
应该在哪添加啊,我看from_pretrained代码里没找到
Traceback (most recent call last):
File "bert.py", line 651, in
main()
File "bert.py", line 541, in main
cache_dir=PYTORCH_PRETRAINED_BERT_CACHE / 'distributed_{}'.format(args.local_rank))
File "/home/lindseywang/.local/lib/python3.6/site-packages/pytorch_pretrained_bert/modeling.py", line 581, in from_pretrained
model = cls(config, *inputs, **kwargs)
TypeError: init() missing 1 required positional argument: 'num_labels'
请问这是因为什么呢?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.