Downloads · 30 days
7
2% of all-time downloads
weightedhuman/fine-tuned-bert-news-classifier
fine-tuned-bert-news-classifier is a text classification model from weightedhuman. Use it when you need a label for a piece of text. It is set up for tf-keras. The card lists the license as apache-2.0.
The Fine-Tuned BERT News Classifier is a natural language processing (NLP) model built upon the BERT architecture. It is specifically designed for news classification, providing a softmax output where a value of 1 ind…
Downloads · 30 days
7
2% of all-time downloads
All-time downloads
355
Public
Repo size
123 MB
Likes
3
Public
Click a slice to open those files.
.data-00000-of-00001116 MB · 94%
From the Hugging Face model README
The Fine-Tuned BERT News Classifier is a natural language processing (NLP) model built upon the BERT architecture. It is specifically designed for news classification, providing a softmax output where a value of 1 indicates positive news and 0 indicates negative news sentiment. This model is trained to understand and categorize news articles, assisting in tasks such as sentiment analysis and news aggregation.
import tensorflow_text as text
import tensorflow as tf
from huggingface_hub import from_pretrained_keras
model = from_pretrained_keras("weightedhuman/fine-tuned-bert-news-classifier")
examples = "Community Gardens Flourish, Bringing Fresh Produce and Unity to Neighborhoods"
serving_results = model \
.signatures['serving_default'](tf.constant(examples))
serving_results = tf.sigmoid(serving_results['classifier'])
serving_results_np = serving_results.numpy()
for i in range(len(serving_results_np)):
output_value = serving_results_np[i][0]
print(output_value)