Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

第7章のマルチラベル分類のBERTモデルについて #56

Open
kassy11 opened this issue Jul 24, 2023 · 1 comment
Open

第7章のマルチラベル分類のBERTモデルについて #56

kassy11 opened this issue Jul 24, 2023 · 1 comment

Comments

@kassy11
Copy link

kassy11 commented Jul 24, 2023

書籍ではBertModelを利用した自作モデルを実装していますが、2023年現在ではBertForSequenceClassificationにてproblem_type="multi_label_classification"を指定するとマルチラベル分類ができるようです。

self.bert_scml = BertForSequenceClassification.from_pretrained(
    model_name, num_labels=num_labels, problem_type="multi_label_classification"
)
@omitakahiro
Copy link
Collaborator

ありがとうございます!こちら参考にさせていただきます。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants