File size: 1,701 Bytes
a032364
 
b333e2e
 
 
 
 
 
 
255684b
 
a032364
2e1c9f0
b333e2e
 
 
 
 
 
 
 
 
 
2c08fa3
b333e2e
 
2c08fa3
b333e2e
 
 
2c08fa3
b333e2e
 
 
2c08fa3
 
b333e2e
 
 
15c26e9
b333e2e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15c26e9
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
license: apache-2.0
language:
- en
metrics:
- accuracy
pipeline_tag: text-classification
tags:
- news
widget:
- text: "Researchers have made significant progress in the development of a new treatment for a rare genetic disorder. Early trials of the treatment have shown promising results, with patients experiencing improvements in their symptoms and quality of life. This breakthrough offers hope to individuals and families affected by the condition, bringing them closer to a potential cure"
---

# 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

```python
import tensorflow_text as text
import tensorflow as tf
```

### Load The Model

```python
from huggingface_hub import from_pretrained_keras

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


### Make Predictions

```python
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)
```