Update README.md
Browse files
README.md
CHANGED
|
@@ -35,7 +35,6 @@ Below is an example of how to load and use the model for sentiment classificatio
|
|
| 35 |
```python
|
| 36 |
from transformers import BertTokenizer, BertForSequenceClassification
|
| 37 |
import torch
|
| 38 |
-
import streamlit as st
|
| 39 |
|
| 40 |
# Load the tokenizer and model
|
| 41 |
tokenizer = BertTokenizer.from_pretrained(
|
|
@@ -50,7 +49,7 @@ outputs = model(**inputs)
|
|
| 50 |
logits = outputs.logits
|
| 51 |
sentiment = torch.argmax(logits, dim=1).item()
|
| 52 |
|
| 53 |
-
print(f"Predicted sentiment: {'Positive' if sentiment
|
| 54 |
|
| 55 |
|
| 56 |
|
|
|
|
| 35 |
```python
|
| 36 |
from transformers import BertTokenizer, BertForSequenceClassification
|
| 37 |
import torch
|
|
|
|
| 38 |
|
| 39 |
# Load the tokenizer and model
|
| 40 |
tokenizer = BertTokenizer.from_pretrained(
|
|
|
|
| 49 |
logits = outputs.logits
|
| 50 |
sentiment = torch.argmax(logits, dim=1).item()
|
| 51 |
|
| 52 |
+
print(f"Predicted sentiment: {'Positive' if sentiment else 'Negative'}")
|
| 53 |
|
| 54 |
|
| 55 |
|