Skip to content

Conversation

@stefan-it
Copy link
Collaborator

Hi,

this PR adds a DistilBertForTokenClassification implementation (mainly inspired by the BERT implementation) that allows to perform sequence labeling tasks like NER or PoS tagging.

Additionally, the run_ner.py example script was modified to fully support DistilBERT for NER tasks.

I did a small comparison between BERT (large, cased), RoBERTa (large, cased) and DistilBERT (base, uncased) with the same hyperparameters as specified in the example documentation (one run):

Model F-Score Dev F-Score Test
bert-large-cased 95.59 91.70
roberta-large 95.96 91.87
distilbert-base-uncased 94.34 90.32

Unit test for the DistilBertForTokenClassification implementation is also added.

@LysandreJik
Copy link
Member

This is great, thanks @stefan-it!

@thomwolf
Copy link
Member

This is great, thanks a lot @stefan-it.
I've added your quick benchmark in the readme.

@thomwolf thomwolf merged commit 74ce8de into huggingface:master Nov 14, 2019
@codecov-io
Copy link

codecov-io commented Nov 14, 2019

Codecov Report

Merging #1792 into master will increase coverage by 0.03%.
The diff coverage is 97.29%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1792      +/-   ##
==========================================
+ Coverage   84.03%   84.07%   +0.03%     
==========================================
  Files          94       94              
  Lines       14032    14069      +37     
==========================================
+ Hits        11792    11828      +36     
- Misses       2240     2241       +1
Impacted Files Coverage Δ
transformers/tests/modeling_distilbert_test.py 99.18% <100%> (+0.08%) ⬆️
transformers/modeling_distilbert.py 95.87% <96.15%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b5d330d...05db5bc. Read the comment docs.

@tedgoddard
Copy link

I just wanted to say thanks for this PR, it was just what I was looking for at the time.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants