Instructions to use google-bert/bert-base-uncased with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google-bert/bert-base-uncased with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="google-bert/bert-base-uncased")# Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("google-bert/bert-base-uncased") model = AutoModelForMaskedLM.from_pretrained("google-bert/bert-base-uncased", device_map="auto") - Inference
- Notebooks
- Google Colab
- Kaggle
Trying to understand the output of bert-base-uncased for sentiment classification task
#14
by naina79000tyagi - opened
I am trying to implement bert-base-uncased for my sentiment classification task. Following are the 2 lines of code I wrote to do the same:
bert_base = pipeline('sentiment-analysis', model="bert-base-uncased")
bert_base("I am happy")
This is the output I received:
[{'label': 'LABEL_0', 'score': 0.5048592686653137}]
However, I am trying to understand what does the label key represents? Does it mean a positive or a negative sentiment ?