passing pandas data frame column to a classifier function

Viewed 45

I need to run ZeroShotClassificationPipeline on a column of my data frame named 'TEXT'.When I try to pass the column as my input I dace below error. I tried different alternatives like .apply or .pipe() bot it did not some my problem.

from transformers import pipeline
import pandas as pd
classifier = pipeline("zero-shot-classification", model="facebook/bart-large-mnli", device=0)
classifier(df['TEXT'], candidate_labels=label, multi_class=True)

the error is:

The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().```
0 Answers
Related