Closed rezatakhshid closed 3 years ago
Hi @rezatakhshid ,
The model_max_length
hasn't been set in the tokenizer configuration for that version (v2
); the easiest and better solution is to use the fresh one (v3
).
bert_embedding = TransformerWordEmbeddings('HooshvareLab/bert-fa-zwnj-base')
sentence = Sentence('علی اکبر به شهر تهران رفت')
bert_embedding.embed(sentence)
Some weights of the model checkpoint at HooshvareLab/bert-fa-zwnj-base were not used when initializing BertModel: ['cls.predictions.decoder.weight', 'cls.predictions.transform.LayerNorm.weight', 'cls.predictions.bias', 'cls.predictions.transform.dense.bias', 'cls.predictions.transform.LayerNorm.bias', 'cls.predictions.decoder.bias', 'cls.predictions.transform.dense.weight']
- This IS expected if you are initializing BertModel from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).
- This IS NOT expected if you are initializing BertModel from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).
Some weights of BertModel were not initialized from the model checkpoint at HooshvareLab/bert-fa-zwnj-base and are newly initialized: ['bert.pooler.dense.weight', 'bert.pooler.dense.bias']
You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.
[Sentence: "علی اکبر به شهر تهران رفت" [− Tokens: 6]]
Thanks @m3hrdadfi Jan.
Hi, I'm getting this error when trying to load embedding using flair. Any idea what's going on? Am I using the right model? I just need to use the embedding vectors.
The code:
The error: