Open pratikchhapolika opened 1 year ago
Hi,
Please use the forum for these kind of questions. We'd like to keep Github issues for bugs and feature requests.
Thanks!
Hi,
Please use the forum for these kind of questions. We'd like to keep Github issues for bugs and feature requests.
Thanks!
This is kind of feature request only. @NielsRogge
Models are fully defined in each modeling file in an independent fashion so you can easily copy/paste them and then customize them to your need :-)
Model description
Is it possible to add simple custom
pytorch-crf
layer on top ofTokenClassification model
. It will make the model more robust. There should be simpleNotebook tutorial
which teaches us to add our owncustom layer
on top ofHugging face models
forBy taking an example from
dslim/bert-base-NER
. Then addfrom torchcrf import CRF
on top of it.I am planning to do this, but I don't know how to get this feature coded. Any leads or Notebook example would be helpful.
I get error on line
**sequence_output = torch.cat((outputs[1][-1], outputs[1][-2], outputs[1][-3], outputs[1][-4]),-1)**
As
outputs = self.bert(input_ids, attention_mask=attention_mask)
gives the logits for tokenclassification. How can we get hidden states so that I can concate last 4 hidden states. so that I can do
outputs[1][-1]`?Open source status
Provide useful links for the implementation
No response