Edit model card

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
5
Inference Examples
Inference API (serverless) does not yet support tf-keras models for this pipeline type.

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