~/bert_model/Chinese-Text-Classification-Pytorch#python run.py --model TextCNN
Loading data…
Vocab size: 4762
180000it [00:01, 116661.02it/s]
10000it [00:00, 122813.92it/s]
10000it [00:00, 122515.09it/s]
Time usage: 0:00:02
<bound method Module.parameters of Model(
(embedding): Embedding(4762, 300)
(convs): ModuleList(
(0): Conv2d(1, 256, kernel_size=(2, 300), stride=(1, 1))
(1): Conv2d(1, 256, kernel_size=(3, 300), stride=(1, 1))
(2): Conv2d(1, 256, kernel_size=(4, 300), stride=(1, 1))
)
(dropout): Dropout(p=0.5, inplace=False)
(fc): Linear(in_features=768, out_features=10, bias=True)
)>
Epoch [1/20]
Iter: 0, Train Loss: 2.3, Train Acc: 11.72%, Val Loss: 2.8, Val Acc: 11.42%, Time: 0:00:06 *
Iter: 100, Train Loss: 0.73, Train Acc: 73.44%, Val Loss: 0.69, Val Acc: 78.58%, Time: 0:04:59 *
Iter: 200, Train Loss: 0.73,
暂存模型结果
最新推荐文章于 2022-04-20 10:19:16 发布
本文档记录了使用TextCNN模型进行文本分类的过程,包括加载数据、模型构建、训练过程及性能指标。经过训练,模型在验证集上取得了89.98%的准确率,并在测试集上达到了90.35%的准确率。
摘要由CSDN通过智能技术生成