Comments (29)
我用您的代码跑了一下数据,eval accuracy 只有0.1,predict 的结果并没有图片中的80%那么高?
from bert-classification-tutorial.
@jotline 两个原因。你看下data下的数据,第一行其实是噪音建议删去,稍微修改下_create_examples
函数。因为如果先shuffle的话,第一行会被当成训练数据进去,更糟糕的是会多了个label变成11分类。第二个就加大步长,原文中写的是3000多步,也就是100epochs;我跑到1000步最高达到0.71,之后就没试过了。
from bert-classification-tutorial.
@hxs91 这个10分类的数据集跑了吗;我觉着上面谁跑到0.8的都是自己的数据集,不是这个1000行10分类数据集的结果。。。
我跑到了,不知道跑的对不对,但肯定没有用自己的数据集。
命令是
python3 run_classifier.py --data_dir=./data --vocab_file=./uncased_L-12_H-768_A-12/vocab.txt --bert_config_file=./uncased_L-12_H-768_A-12/bert_config.json --init_checkpoint=./uncased_L-12_H-768_A-12/bert_model.ckpt --output_dir=./output
from bert-classification-tutorial.
我也是,按照这个思路跑出来感觉不对劲。。
from bert-classification-tutorial.
然而shuf之后也只有0.58的eval_accuracy.
from bert-classification-tutorial.
@supergyz 好的,十分感谢🙏。我再试试看
from bert-classification-tutorial.
@supergyz 我跑了30000步,仍然是0.66左右。我估摸着数据有点少,导致测试集准确度太低。我换了一个6分类的场景,可以达到0.84的acc
from bert-classification-tutorial.
我开始也是0.1,看到上面的讨论才反应过来,只是对数据去掉第一行并shuffle后变为79%,可能会有浮动.
from bert-classification-tutorial.
@supergyz 非常感谢!
from bert-classification-tutorial.
@supergyz 可以直接跑一下官方的run_classifier.py,多加一些trainset的规模80%不难,我用我自己的数据集可以跑到挺高。
from bert-classification-tutorial.
@jotline 你用的英文还是中文?
from bert-classification-tutorial.
@h123c 你好,run_classifier的代码能发给我下吗。。刚才试了下还是0.66。。有点绝望。。
就是这里的原码,没有动,但是数据集处理了一下
from bert-classification-tutorial.
shuffle之后,跑到0.81是没什么问题的。
from bert-classification-tutorial.
@jotline 你用的英文还是中文?
我的数据集还比较复杂,有英文有中文,还有其他语言。
from bert-classification-tutorial.
@supergyz 我感觉是数据不太够?我跑的自己的多语种数据集,代码没有变,可以跑很高。后来没用tf版的bert了,pytorch版非常好用,速度也快。
from bert-classification-tutorial.
@supergyz 我是shuffle了一个与数据等长的list,然后分别对每个字段按照shuffle后的listc重排,参数没有改动。
from bert-classification-tutorial.
的确需要做shuffle,我之前以为代码中是有做shuffle的…在processor的_create_esamples中对examples做一下shuffle即可。我的实验(200+个类别文本分类)上结果从14%提升到91.7%
from bert-classification-tutorial.
@supergyz 没有,我只是跑的我自己的数据集…
from bert-classification-tutorial.
@hxs91 这个10分类的数据集跑了吗;我觉着上面谁跑到0.8的都是自己的数据集,不是这个1000行10分类数据集的结果。。。
我跑到了,不知道跑的对不对,但肯定没有用自己的数据集。
命令是
python3 run_classifier.py --data_dir=./data --vocab_file=./uncased_L-12_H-768_A-12/vocab.txt --bert_config_file=./uncased_L-12_H-768_A-12/bert_config.json --init_checkpoint=./uncased_L-12_H-768_A-12/bert_model.ckpt --output_dir=./output
可以请问一下你是怎么处理的呢?只是删除了第一行shuffle了数据吗?
方便的话可以发一下你的shuffle代码吗?谢谢!!
from bert-classification-tutorial.
@RebeccaRrr _create_examples中在return之前random.shuffle(examples)
from bert-classification-tutorial.
@hxs91 这个10分类的数据集跑了吗;我觉着上面谁跑到0.8的都是自己的数据集,不是这个1000行10分类数据集的结果。。。
我跑到了,不知道跑的对不对,但肯定没有用自己的数据集。
命令是
python3 run_classifier.py --data_dir=./data --vocab_file=./uncased_L-12_H-768_A-12/vocab.txt --bert_config_file=./uncased_L-12_H-768_A-12/bert_config.json --init_checkpoint=./uncased_L-12_H-768_A-12/bert_model.ckpt --output_dir=./output可以请问一下你是怎么处理的呢?只是删除了第一行shuffle了数据吗?
方便的话可以发一下你的shuffle代码吗?谢谢!!
_create_examples函数返回数据之前random.shuffle(examples)。没有删除第一行呀,原代码中删了吧,我看作者循环中在读取的时候if i==0 已经进行continue操作了。
from bert-classification-tutorial.
@JepsonWong 我也跑到啦~
from bert-classification-tutorial.
@hxs91 的确需要做shuffle,我之前以为代码中是有做shuffle的…在processor的_create_esamples中对examples做一下shuffle即可。我的实验(200+个类别文本分类)上结果从14%提升到91.7%
你好,请问下你200+类别的数据集有多大?用到多少个句子,我现在想做个大概90个类别的任务,想评估下自己的数据集大概有多少就够了。
from bert-classification-tutorial.
我问一下num_train_epochs=100.0的情况下,checkpoints的数量大概有多少?我跑了好长时间了还没跑完。
from bert-classification-tutorial.
from bert-classification-tutorial.
@jotline 两个原因。你看下data下的数据,第一行其实是噪音建议删去,稍微修改下
_create_examples
函数。因为如果先shuffle的话,第一行会被当成训练数据进去,更糟糕的是会多了个label变成11分类。第二个就加大步长,原文中写的是3000多步,也就是100epochs;我跑到1000步最高达到0.71,之后就没试过了。
请问是每个_create_examples都需要加random.shuffle(examples)吗?
from bert-classification-tutorial.
from bert-classification-tutorial.
@jotline
我有个问题,对于测试集一定要赋标签吗。
若不给test加标签,file_based_convert_examples_to_features就会报错,提示label是none。
若加了一个常量标签(即所有测试数据固定一个标签),那么预测结果就变成了之前设定好的标签。
这个问题,要怎么解决呢?
from bert-classification-tutorial.
我用您的代码跑了一下数据,eval accuracy 只有0.1,predict 的结果并没有图片中的80%那么高?
您好,为什么要将数据打乱
from bert-classification-tutorial.
Related Issues (20)
- 关于预处理的问题 HOT 3
- issues about new data which 7 classification HOT 8
- 怎么使用GPU模式的 HOT 7
- 保存训练过程dev set准确率
- do_eval的问题 HOT 1
- 中文乱码 HOT 1
- 请问, 哪里可以看到损失函数?
- max_seq_length的最大值不超过512
- 验证的精度,只有0.1,为什么? HOT 4
- 用模型预测最终生成的文件问题 HOT 4
- mrpc的训练数据在哪里下载
- emmm 这里的classification 好像不止改了一点点
- 能导出环境配置文件?跑了你的项目报错了
- eval_drop_remainder = True if FLAGS.use_tpu else Falsed HOT 2
- 关于多文本分类任务 HOT 1
- Tokens difference between bert project and yours. Is run_classifier.py the only changed file? HOT 2
- 问题 HOT 5
- 关于中文二分类问题 HOT 5
- 关于显卡显存 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 bert-classification-tutorial.