Fine-Tuned BERT News Classifier

Overview

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.

Usage Instructions

Import Necessary Libraries

import tensorflow_text as text
import tensorflow as tf

Load The Model

from huggingface_hub import from_pretrained_keras

model = from_pretrained_keras("weightedhuman/fine-tuned-bert-news-classifier")

Make Predictions

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)
Downloads last month
1
Inference Providers NEW
This model is not currently available via any of the supported third-party Inference Providers, and the HF Inference API does not support tf-keras models with pipeline type text-classification

Space using weightedhuman/fine-tuned-bert-news-classifier 1