Skip to content

Conversation

@lifefeel
Copy link
Contributor

Update the example file by changing the name of AlbertForTokenClassification to AlbertForSequenceClassification.

@codecov-io
Copy link

codecov-io commented Mar 13, 2020

Codecov Report

Merging #3261 into master will increase coverage by 0.12%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3261      +/-   ##
==========================================
+ Coverage   77.82%   77.94%   +0.12%     
==========================================
  Files          98       98              
  Lines       16666    16666              
==========================================
+ Hits        12970    12990      +20     
+ Misses       3696     3676      -20     
Impacted Files Coverage Δ
src/transformers/modeling_utils.py 93.56% <0.00%> (-0.14%) ⬇️
src/transformers/modeling_tf_utils.py 86.22% <0.00%> (+3.75%) ⬆️

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 afea70c...547efb9. Read the comment docs.

@stefan-it
Copy link
Collaborator

Well, I don't think the `SequenceClassification" head is not the right one, as it is supposed for sequence classification/regression tasks (see https://huggingface.co/transformers/model_doc/albert.html#transformers.AlbertForSequenceClassification).

NER requires a per token classification implementation: https://github.com/huggingface/transformers/blob/master/src/transformers/modeling_albert.py#L791

@srush
Copy link
Contributor

srush commented Mar 16, 2020

Will this be fixed by switching to AutoModel? I think we are doing that here for run_pl_ner.py #3290

@lifefeel
Copy link
Contributor Author

lifefeel commented Mar 16, 2020

I knew what the problem was. In version 2.5.1, there is no definition for AlbertForTokenClassification in run_ner.py
However, it is included in the master branch. I'll close this request.

@lifefeel lifefeel closed this Mar 16, 2020
@lifefeel
Copy link
Contributor Author

@srush I think using AutoModelForTokenClassification is better than calling each model class. How about making a change to run_ner.py?

@srush
Copy link
Contributor

srush commented Mar 16, 2020

Yes, if you can send that PR and add me as a reviewers

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.

4 participants