ys7yoo / korner

KoBERT와 CRF로 만든 한국어 개체명인식기 (BERT+CRF based Named Entity Recognition model for Korean)
Apache License 2.0
0 stars 0 forks source link

Error using CRF #2

Open ys7yoo opened 1 year ago

ys7yoo commented 1 year ago
[/content/korner/model/net.py](https://h2vdoxku0l4-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab-20230109-060104-RC00_500662758#) in __init__(self, config, num_classes, vocab)
     34         self.dropout = nn.Dropout(config.dropout)
     35         self.position_wise_ff = nn.Linear(config.hidden_size, num_classes)
---> 36         self.crf = CRF(num_labels=num_classes)
     37 
     38     def forward(self, input_ids, token_type_ids=None, tags=None):

TypeError: __init__() got an unexpected keyword argument 'num_labels'
ys7yoo commented 1 year ago

https://pytorch-crf.readthedocs.io/en/stable/