Push
Browse files
main.py
CHANGED
|
@@ -44,11 +44,10 @@ def analyze_text(text):
|
|
| 44 |
ner_outputs = ner_model(**ner_inputs)
|
| 45 |
|
| 46 |
ner_predictions = torch.argmax(ner_outputs, dim=-1)
|
| 47 |
-
ner_labels =
|
| 48 |
-
|
| 49 |
|
| 50 |
# Tokenize input text for sentiment analysis
|
| 51 |
-
sentiment_inputs = sentiment_tokenizer
|
| 52 |
|
| 53 |
# Perform sentiment analysis
|
| 54 |
with torch.no_grad():
|
|
|
|
| 44 |
ner_outputs = ner_model(**ner_inputs)
|
| 45 |
|
| 46 |
ner_predictions = torch.argmax(ner_outputs, dim=-1)
|
| 47 |
+
ner_labels = ner_predictions.tolist()
|
|
|
|
| 48 |
|
| 49 |
# Tokenize input text for sentiment analysis
|
| 50 |
+
sentiment_inputs = sentiment_tokenizer(text, return_tensors="pt")
|
| 51 |
|
| 52 |
# Perform sentiment analysis
|
| 53 |
with torch.no_grad():
|