You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been working with the FLANG-BERT model and have encountered an issue with understanding the labels returned by the model. Here is the code I am using:
fromtransformersimportBertTokenizer, BertForSequenceClassification, pipelinemodel_path="FLANG-BERT"# model_path = "FLANG-ELECTRA"flang_bert=BertForSequenceClassification.from_pretrained(model_path, num_labels=3) # Adjust num_labels as neededtokenizer=BertTokenizer.from_pretrained(model_path)
nlp=pipeline('text-classification', model=flang_bert, tokenizer=tokenizer)
results1=nlp("I am happy")
results2=nlp("I am angry")
results3=nlp("I am sleepy")
print(results1)
print(results2)
print(results3)
I am unsure what the labels (e.g., 'LABEL_1') represent in the FLANG-BERT model. I have looked at the documentation for the model, such as the Hugging Face documentation, but I could not find any notes about the meaning of the labels.
As there are only 3 labels in this case (maybe due to the num_labels=3 parameter), I suspect these 3 correspond to 'Positive', 'Negative', and 'Neutral' sentiments. However, I am still uncertain about if "LABEL_1" corresponds to 'Positive' or 'Negative' sentiment.
Could you please provide information on what the labels correspond to or direct me to where I can find this information in the documentation?
Thank you for your assistance.
The text was updated successfully, but these errors were encountered:
Code:
I have been working with the FLANG-BERT model and have encountered an issue with understanding the labels returned by the model. Here is the code I am using:
Output:
The output I receive is as follows:
When I run the same code again multiple times, I obtain different outputs:
Issue:
I am unsure what the labels (e.g., 'LABEL_1') represent in the FLANG-BERT model. I have looked at the documentation for the model, such as the Hugging Face documentation, but I could not find any notes about the meaning of the labels.
As there are only 3 labels in this case (maybe due to the
num_labels=3
parameter), I suspect these 3 correspond to 'Positive', 'Negative', and 'Neutral' sentiments. However, I am still uncertain about if "LABEL_1" corresponds to 'Positive' or 'Negative' sentiment.Could you please provide information on what the labels correspond to or direct me to where I can find this information in the documentation?
Thank you for your assistance.
The text was updated successfully, but these errors were encountered: