Downloads · 30 days
8
0% of all-time downloads
KernAI/community-sentiment-bert
community-sentiment-bert is a text classification model from KernAI. Use it when you need a label for a piece of text. It is set up for transformers.
This distilbert model was fine-tuned on ~20.000 community postings using the HuggingFace adapter from Kern AI refinery. The postings consist of comments from various forums and social media sites. For the finetuning,…
Downloads · 30 days
8
0% of all-time downloads
All-time downloads
2.2K
Public
Repo size
867 MB
Likes
1
Public
Click a slice to open those files.
.bin433 MB · 100%
From the Hugging Face model README
This distilbert model was fine-tuned on ~20.000 community postings using the HuggingFace adapter from Kern AI refinery. The postings consist of comments from various forums and social media sites. For the finetuning, a single NVidia K80 was used for about two hours.
Join our Discord if you have questions about this model: https://discord.gg/MdZyqSxKbe
BERT, which stands for Bidirectional Encoder Representations from Transformers, is a language model introduced by Google researchers in 2018. It’s designed to pre-train deep bidirectional representations from unlabeled text by jointly conditioning on both left and right context in all layers2.
BERT is based on the transformer architecture and uses WordPiece to convert each English word into an integer code. This model has a classification head on top of it, which means that this BERT model is specifically made for text classification.
DISCLAIMER: Currently, the model has a slight bias towards neutral and positive predictions.
To use the model, you need to install the HuggingFace Transformers library:
pip install transformers
Then you can load the model and the tokenizer from the HuggingFace Hub:
from transformers import AutoModelForSequenceClassification, AutoTokenizer
model = AutoModelForSequenceClassification.from_pretrained("KernAI/community-sentiment-bert")
tokenizer = AutoTokenizer.from_pretrained("KernAI/community-sentiment-bert")
To classify a single sentence or a sentence pair, you can use the HuggingFace Pipeline API:
from transformers import pipeline
classifier = pipeline("text-classification", model=model, tokenizer=tokenizer)
result = classifier("This is a positive sentence.")
print(result)
# [{'label': 'Positive', 'score': 0.9998656511306763}]