I am trying to use the model robert-base-openai-detector from huggingface.
I get keyError csv when I try to use a csv file. Whenever I use a text file and change load_dataset and KeyDataset to text it works.
Do I need to do some preprocessing before or what am I doing wrong?
pipe = pipeline("text-classification", model="roberta-base-openai-detector")
dataset = load_dataset('csv', data_files=["/content/training testing split with college address.xlsx - Sheet1.csv"], split='train')
for out in tqdm(pipe(KeyDataset(dataset, "csv"))):
print (out)
The error stack doesn’t give me much information.
KeyError Traceback (most recent call last)
<ipython-input-5-98a64dbb56de> in <cell line: 10>()
8
9
---> 10 for out in tqdm(pipe(KeyDataset(dataset, "csv"))):
11 print (out)
12
8 frames
/usr/local/lib/python3.10/dist-packages/transformers/pipelines/pt_utils.py in __getitem__(self, i)
303
304 def __getitem__(self, i):
--> 305 return self.dataset[i][self.key]
306
307
KeyError: 'csv'