Testys commited on
Commit
6303acb
1 Parent(s): db225d0
Files changed (1) hide show
  1. main.py +2 -3
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 = [ner_config["id2label"][label] for label in ner_predictions[0].tolist()]
48
-
49
 
50
  # Tokenize input text for sentiment analysis
51
- sentiment_inputs = sentiment_tokenizer.encode_plus(text, return_tensors="pt")
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():