Thanks for your reply. I am trying to use strong supervision. I have created a column with the “aggregation_label” indices. Now I am not sure how to pass the aggregation_labels to training. This is how I am trying to run it.
config = TapasConfig(num_aggregation_labels=3,
                  use_answer_as_supervision = True,
                  select_one_column = False,
                  cell_selection_preference = 0.1,
                  aggregation_labels = {0: "DIFF", 1: "PERCENT", 2: "SUM"},
                  )
model_training = TapasForQuestionAnswering.from_pretrained("google/tapas-base", config=config)

for epoch in range(3):  # loop over the dataset multiple times
 print("Epoch:",epoch)
for idx, batch in enumerate(train_dataloader):
    # get the inputs;
    input_ids = batch["input_ids"].to(device)
    attention_mask = batch["attention_mask"].to(device)
    token_type_ids = batch["token_type_ids"].to(device)
    labels = batch["labels"].to(device)
    # numeric_values = batch["numeric_values"].to(device)
    # numeric_values_scale = batch["numeric_values_scale"].to(device)
    # float_answer = batch["float_answer"].to(device)
    # aggregation_labels = Should I pass the aggregation_labels here, how then, batch[] won't work because the tokenizer doesn't return aggregation_labels ??
    # zero the parameter gradients
    optimizer.zero_grad()
    # forward + backward + optimize        
    outputs = model_training(input_ids=input_ids, attention_mask=attention_mask, token_type_ids=token_type_ids, labels = labels)
    loss = outputs.loss
    print("Loss:", loss.item())
    loss.backward()
    optimizer.step()

When I run the above code, i get the following error.
File "C:\Users\Kinjal\.conda\envs\nlp\lib\site-packages\transformers\models\tapas\modeling_tapas.py", line 1312, in forward
raise ValueError(

ValueError: You have to specify aggregation labels in order to calculate the aggregation loss