The results are random
I downloaded the pretrained model you provided and loaded it.(https : //drive.google.com/drive/folders/1iEEMr2DYofulK2F5pSErOPf5ggrEqtJt?usp=sharing) Why is the result random?
import torch
from transformers import AutoModelForTokenClassification, AutoTokenizer
pretrained_model ='./utils_fine_tune/word_piece_ner/'
tokenizer = AutoTokenizer.from_pretrained(pretrained_model)
model = AutoModelForTokenClassification.from_pretrained(pretrained_model)
sequence=" Is there any mechanism to enforce a singleton policy without having to make the derived class' constructors private manually?"
print(tokenizer.decode(tokenizer.encode(sequence)))
tokens = tokenizer.tokenize(tokenizer.decode(tokenizer.encode(sequence)))
inputs = tokenizer.encode(sequence, return_tensors="pt")
outputs = model(inputs)
outputs= outputs.logits
predictions = torch.argmax(outputs, dim=2)
for token, prediction in zip(tokens, predictions[0].numpy()):
print((token, model.config.id2label[prediction]))

@namelucky Hi! I've tried to get the utils_fine_tune.zip and the data_ctc.zip from the link: https://drive.google.com/drive/folders/1iEEMr2DYofulK2F5pSErOPf5ggrEqtJt?usp=sharing.
But I didn't find any other file in this website except for word_piece_ner and word_piece_seg. Maybe I didn't figured out the usage of the files in this link.Could you share a copy of these files with me?My email adress is [email protected];
Thank you very much!
@namelucky @KhaZix7 hello,namelucky,KhaZix7.I am trying to get the utils_fine_tune.zip and the data_ctc.zip too, and it seems that all the link is not avaliable,can anyone share a copy?thank you so much. My email address is [email protected]
@KhaZix7 @zhangdanni1129 I have uploaded a copy of the files to https://huggingface.co/itisphilippe/StackOverflowNER
@KhaZix7 @zhangdanni1129 I have uploaded a copy of the files to https://huggingface.co/itisphilippe/StackOverflowNER
Thank you soooooo much!
Hi, @namelucky it looks like you downloaded pre-trained model, but without classifier's weights. I have the same problem, when I run code. The website HuggingFace displays, that this model belongs to the category "Feature Extraction". @jeniyat could you please share weights for classifier head too?