8000 Use models with zero-shot classification · Issue #3 · cardiffnlp/xlm-t · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Use models with zero-shot classification #3
Open
@kinoute

Description

@kinoute

Hello,

First, thanks for these great models! I was wondering if I could use these models for zero-shots classification, especially for emotion detection (Ekman). While doing so, I encountered this error regarding the config of the models and the missing entailment parameter which seems mandatory for zero-shot classification:

Failed to determine 'entailment' label id from the label2id mapping in the model config. Setting to -1. Define a descriptive label2id mapping in the model config to ensure correct outputs.

Basic code to reproduce:

model_path = "cardiffnlp/twitter-xlm-roberta-base"
zero_shot = pipeline("zero-shot-classification", model=model_path, tokenizer=model_path,)
zero_shot("You are an awful man,", candidate_labels=["anger", "disgust", "fear", "joy", "sadness", "surprise"], multi_label=True,)

It seems to lead indeed to weird outputs compared to the XLM-Roberta XNLI model that can be tested here: https://huggingface.co/zero-shot/.

Is there something missing in head_config.json?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0