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

multilabel support for data_silo.calculate_class_weights #389

Merged
merged 3 commits into from
May 31, 2020

Conversation

Timoeller
Copy link
Contributor

adds a check to #356 so class weight computations for multi class aren't broken.

renaud and others added 3 commits May 8, 2020 15:26
I was having an issue with using `TextClassificationProcessor(multilabel=True)` together with `data_silo.calculate_class_weights`

I belive this commit solves the issue, please let me know if it's the way to go.

    processor = TextClassificationProcessor(
                                            multilabel=True,
                                            )

    data_silo = DataSilo(
        processor=processor,
        batch_size=batch_size)

    language_model = LanguageModel.load(lang_model)
    prediction_head = MultiLabelTextClassificationHead(
        class_weights=data_silo.calculate_class_weights(task_name="text_classification"),
        num_labels=len(label_list))
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

Successfully merging this pull request may close these issues.

None yet

2 participants