BrikerMan / Kashgari

Kashgari is a production-level NLP Transfer learning framework built on top of tf.keras for text-labeling and text-classification, includes Word2Vec, BERT, and GPT2 Language Embedding.
http://kashgari.readthedocs.io/
Apache License 2.0
2.39k stars 441 forks source link

[Question] why is dense size = Classification category +1? (in classification task) #21

Closed melansediao closed 5 years ago

melansediao commented 5 years ago

why is dense size = Classification category +1? (in classification task) These two pictures below are from your blog: https://eliyar.biz/nlp_chinese_text_classification_in_15mins/?nsukey=O%2BczPW172RmhIMqZT%2BfUlcATr6%2Ba8SX%2BJOwFmeqO7sK%2FDXKSkt%2BembEWvsivT76TbO5z7Dh02n%2BDux3v7PQgBZJl9fdsUl7aFAeUOQis%2BI0D6lpYW%2B9nAVUiSaAvf6mCvwDLx2a6%2Be5p4Up5QuSJ9UiCKek51b5HXyjbOPnZJMM%3D

image image

BrikerMan commented 5 years ago

Because I added "PAD": 0 to label2idx dict by default on both classification and labeling tasks, I think I should remove this feature from classification task. Then dense size will equel to classification category.

melansediao commented 5 years ago

这个不影响训练吗?

BrikerMan commented 5 years ago

不影响,只是多了一个没有数据对应的分类。