alibaba / alibaba/EasyNLP

使用K-bert做文本分类无法指定分类类别

Open
#318 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
2.2k
Forks
257
PR merge metrics
No merged PRs in 30d

Description

通过修改 examples/kbert/run_cls.sh 这个文件下的 label_enumerate_values 改变模型分类个数。
自己数据集一共是10种类别,值为0-9,但是运行会报错。
通过打印logits 的值发现,模型输出依然是二分类。logits形状为[batch_size,2]
如何改变分类类别?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with examples/kbert/run_cls.sh and trace how label_enumerate_values is used for the classification setup. Run the reported dataset with 10 labels and inspect the logits shape; done means the configuration is honored and the model produces 10 class outputs without the reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.