Skip to content

Regarding training data format for gliner-bi-large-v2 #291

Description

@I-Am-Alam

I have been trying to fine tune the knowledgator/gliner-bi-large-v2.0. I was following the urchade/GLiNER/examples/finetune.ipynb.

Below is the cleaned data for training:

Image

This my count of data:

Image

After finetuning under following configuration:

num_steps = 600
batch_size = 8
data_size = len(train_dataset)
num_batches = data_size // batch_size
num_epochs = max(1, num_steps // num_batches)

training_args = TrainingArguments(
    output_dir="/content/drive/MyDrive/model_gliners",
    learning_rate=2e-5,
    weight_decay=0.01,
    others_lr=1e-5,
    others_weight_decay=0.01,
    lr_scheduler_type="linear", #cosine
    warmup_ratio=0.1,
    per_device_train_batch_size=batch_size,
    per_device_eval_batch_size=batch_size,
    focal_loss_alpha=0.75,
    focal_loss_gamma=2,
    num_train_epochs=num_epoch,
    save_steps = 50,
    save_total_limit=10,
    dataloader_num_workers = 0,
    use_cpu = False,
    report_to="none",
    )

trainer = Trainer(
    model=model,
    args=training_args,
    train_dataset=train_dataset,
    eval_dataset=test_dataset,
    tokenizer=model.data_processor.transformer_tokenizer,
    data_collator=data_collator,
)

trainer.train()

Result

All the predictions are same label, with nearby score of 0.5

[{'start': 1, 'end': 18, 'text': 'Cristiano Ronaldo', 'label': 'PERSON', 'score': 0.5005358457565308}, {'start': 19, 'end': 22, 'text': 'dos', 'label': 'PERSON', 'score': 0.5004287362098694}]

If anyone can resolve, It will be great help to new enthusiasts.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions