transformers icon indicating copy to clipboard operation
transformers copied to clipboard

Adding example with Finnish BERT fine-tuning for NER task

Open bmichele opened this issue 6 years ago • 3 comments

🚀 Feature request

Add an example in /examples/token-classification. The example consists in the fine-tuning of the Finnish BERT models (bert-base-finnish-cased-v1 and bert-base-finnish-uncased-v1) with the FiNER dataset (https://github.com/mpsilfve/finer-data).

The example is similar to the already existing GermEval and WNUT'17 examples, but for Finnish language.

Motivation

The fine-tuned model can be used to extract product, location, date, event, organization and person entities from Finnish sentences. The scripts necessary for the fine-tuning are already available here. I would like to contribute to the transformer projects and get feedback from the community on this. Note that I submitted a PR but this was never reviewed and finally closed by stale bot (see https://github.com/huggingface/transformers/pull/3474).

Your contribution

I can adapt the code in the closed PR in order to be merged in master.

bmichele avatar Aug 05 '20 15:08 bmichele

Hi @bmichele , The /examples/token-classification is pretty generic, you won't need to add new example. If you process the data in the format expected by the example the you can pass the bert-base-finnish-cased-v1 model using the model_name_or_path argument.

Hope this helps.

patil-suraj avatar Aug 06 '20 05:08 patil-suraj

Hi @patil-suraj , thank you for your input.

As I mentioned in the issue, the example for Finnish is already implemented in this branch: https://github.com/bmichele/transformers/tree/finnish-ner

The branch contains the scripts necessary to

  • download and preprocess the FiNER dataset
  • perform the fine-tuning

Moreover, I added the results in the readme file: https://github.com/bmichele/transformers/blob/finnish-ner/examples/ner/README.md

I see that few months ago the WNUT’17 example was added, my question is if there is interest in merging also the Finnish example. If this is the case, I will take care of updating it so that it can be merged without conflicts and create a PR.

bmichele avatar Aug 06 '20 06:08 bmichele

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.

stale[bot] avatar Oct 10 '20 08:10 stale[bot]