ltgoslo / NorBERT

Large-scale language models for Norwegian
Creative Commons Zero v1.0 Universal
37 stars 3 forks source link

Norwegian Sentiment analysis #3

Open fatimaaaaaaa opened 1 year ago

fatimaaaaaaa commented 1 year ago

Hi,

How can I use NorBERT for sentiment analysis in Norwegian? Is there a pre-trained model out there or do I have to train it myself using the Norwegian review corpus?

akutuzov commented 1 year ago

Hi, Some models are available here @liljao and @erikve might know more.

fatimaaaaaaa commented 1 year ago

Hi @akutuzov, thanks for replying.

I tried to run the example in the readme of the ltgoslo/ssa-perin model and get an unexpected output:

['Negative', 'Source', 'Target', 'Positive']
Some weights of the model checkpoint at models\encoder were not used when initializing BertModel: ['cls.seq_relationship.bias', 'cls.seq_relationship.weight', 'cls.predictions.transform.dense.weight', 'cls.predictions.transform.dense.bias', 'cls.predictions.decoder.weight', 'bert.pooler.dense.bias', 'cls.predictions.transform.LayerNorm.bias', 'cls.predictions.decoder.bias', 'bert.pooler.dense.weight', 'cls.predictions.bias', 'cls.predictions.transform.LayerNorm.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).
C:\Users\ssa-perin\data\field\basic_field.py:10: UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor).
  tensor = torch.tensor(example, dtype=torch.long, device=device)