flairNLP / flair

A very simple framework for state-of-the-art Natural Language Processing (NLP)
https://flairnlp.github.io/flair/
Other
13.7k stars 2.08k forks source link

How to Rename Labels in a Flair Dataset?[Question]: #3472

Open DonaldFeuz opened 2 weeks ago

DonaldFeuz commented 2 weeks ago

Question

Hello,

I want to fine-tune HunFlair-Gene on the JNLPBA dataset, but I am getting mostly null scores during training.

I believe this is because the dataset does not contain gene mentions but rather mentions of proteins and other labels. I tested my code on a dataset that contains only gene labels (BC2GM) and obtained good results.

To solve my problem, I tried loading the JNLPBA dataset from flair.datasets using:

from flair.datasets import JNLPBA

Load the JNLPBA dataset

jnlpba_dataset = JNLPBA()

Then, I attempted to rename the protein labels to "Gene" and remove the other labels, but it appears that Flair does not provide the ability to rename labels in a dataset.

How can I work with JNLPBA to compare my scores with those of HunFlair?