Text-Classification-with-BERT-PyTorch icon indicating copy to clipboard operation
Text-Classification-with-BERT-PyTorch copied to clipboard

Classifier.py

Open Sankalp1233 opened this issue 3 years ago • 0 comments

For Classifier .py in the section it says: train_iterator = tqdm(train_loader, desc="Train Iteration") for step, batch in enumerate(train_iterator): When I run this part of the code I get an error: ValueError Traceback (most recent call last) in () 68 # Training Loop 69 train_iterator = tqdm(train_loader, desc="Train Iteration") ---> 70 for step, batch in enumerate(train_iterator): 71 model.train(True) 72 # Here each element of batch list refers to one of [input_ids, segment_ids, attention_mask, labels]

5 frames in getitem(self, index) 24 25 def getitem(self, index): ---> 26 is_sarcastic, headline = self.headlines[index] 27 for regex, value_to_replace_with in self.regex_transformations.items(): 28 headline = re.sub(regex, value_to_replace_with, headline)

ValueError: too many values to unpack (expected 2) I am not sure why this error is popping up and how to fix it?

Sankalp1233 avatar Mar 31 '21 19:03 Sankalp1233