lwdragon commited on
Commit
d613c9a
β€’
1 Parent(s): 33b9d48

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -6
app.py CHANGED
@@ -53,11 +53,6 @@ class RNN(nn.Cell):
53
  output = self.fc(hidden)
54
  return self.sigmoid(output)
55
 
56
- score_map = {
57
- 1: "Positive",
58
- 0: "Negative"
59
- }
60
-
61
  def predict_sentiment(model, vocab, sentence):
62
  model.set_train(False)
63
  tokenized = sentence.lower().split()
@@ -87,7 +82,7 @@ def prefict_emotion(sentence):
87
  load_param_into_net(net, param_dict)
88
 
89
  # ι’„ζ΅‹
90
- pred = predict_sentiment(net, vocab, sentence)
91
  result = {
92
  "Positive πŸ™‚": pred,
93
  "Negative πŸ™ƒ": 1-pred,
 
53
  output = self.fc(hidden)
54
  return self.sigmoid(output)
55
 
 
 
 
 
 
56
  def predict_sentiment(model, vocab, sentence):
57
  model.set_train(False)
58
  tokenized = sentence.lower().split()
 
82
  load_param_into_net(net, param_dict)
83
 
84
  # ι’„ζ΅‹
85
+ pred = predict_sentiment(net, vocab, sentence).item()
86
  result = {
87
  "Positive πŸ™‚": pred,
88
  "Negative πŸ™ƒ": 1-pred,