Pipeline text classification with two sequences for each example

Hello, I am trying to figure out how to use pipelines for inference when I have two input sequences per example for tasks like entailment.

I’m training a binary sequence classifier that takes two input sequences. Example:

{
    "sequence_a": "There are no giraffes in Canada.",
    "sequence_b": "Giraffes are only native to a handful of countries in Africa."
}

Is this possible?

Thanks for your help!

I’ve resolved this by creating my own Pipeline class. Curious to know if there is another way to do this though.

Hello and welcome to the forum :hugs:
You can just pass two sentences like this in the input:
“There are no giraffes in Canada. There are no giraffes in Canada are only native to a handful of countries in Africa.” like in the inference API widget. I know it’s will not work for when you want to do this beyond the sentences (e.g. two paragraphs) so I raised it.