Closed rahulg963 closed 4 years ago
Maybe this is a little late but you could take a look in both examples/run_tf_glue.py
and this function fromsrc/transformers/data/processors/glue.py
and write a custom training script based from those.
To make things a little more concrete, I've written and annotated an end-to-end example of how to fine-tune a bert-base-cased
model from your DataFrame
's spec. Do comment if it helps you out!
@papapabi Thank you for your inputs. I will check this out.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I am working on a TextClassification problem, for which I am trying to traing my model on TFBertForSequenceClassification given in huggingface-transformers library.
I followed the example given on their github page, I am able to run the sample code with given sample data using tensorflow_datasets.load('glue/mrpc'). However, I am unable to find an example on how to load my own custom data and pass it in model.fit(train_dataset, epochs=2, steps_per_epoch=115, validation_data=valid_dataset, validation_steps=7).
How can I define my own X, do tokenization of my X and prepare train_dataset with my X and Y. Where X represents my input text and Y represents classification category of given X.
Sample Training dataframe :