I have dataset with two column: one with faulty addresses, and other with correct addresses. I want to train a model such that, I can use it later for correcting all the incoming faulty addresses. I have done tokenization, data splitting task for the same, but I can't make my model to start training.

I get GraphExecution error, which points towrads mismatch of dimension.

Exact error: logits and labels must have the same first dimension, got logits shape [16,55] and labels shape [880]

I don't know from where these values are coming from, as my X_Train consists of list with each list being length of 45, and y_train is a list of length 55. (All are integer values)

As, I am new to this task, any suggestions, comments, concerns, questions are welcome.

Also, I have tried basic ML approach, but the results were quite poor. Hence, please suggest me on the line of this approach only.

Here are some specifications to my approach:

Tokenization: RobertaTokenizer.from_pretrained("roberta-base")
Model: TFRobertaForSequenceClassification.from_pretrained("roberta-base")
optimizer: Adam
learning_rate = 1e-5
loss: SparseCategoricalCrossentropy
epochs: 10
batch_size: 16

I think following are the list of models which we can use:

enter image description here

github link used: https://github.com/huggingface/transformers/blob/main/src/transformers/models/roberta/__init__.py


  • $\begingroup$ Hi @learner_account, welcome to the site. RoBERTa is not a text generation model. Can you clarify how you intend it to generate the amended addresses? $\endgroup$
    – noe
    Oct 26, 2023 at 12:13
  • $\begingroup$ Hi, Thanks for the reply, I was trying to follow this model mentioned in this research paper hal.science/hal-03979858 Although I skipped the parsing step mentioned here $\endgroup$ Oct 26, 2023 at 12:52


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.