xujinheng666 commited on
Commit
40a88f6
·
verified ·
1 Parent(s): 95e8e86

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -54,7 +54,7 @@ rating_pipe = pipeline("text-classification", model="Leo0129/CustomModel_dianpin
54
  def rate_quality(text):
55
  result = rating_pipe(text)[0]
56
  label = result["label"].split("(")[0].strip().lower()
57
- label_map = {"negative": "Poor", "positive": "Good"}
58
  return label_map.get(label, "Unknown")
59
 
60
  # Streamlit UI
 
54
  def rate_quality(text):
55
  result = rating_pipe(text)[0]
56
  label = result["label"].split("(")[0].strip().lower()
57
+ label_map = {"LABEL_0": "Poor", "LABEL_1": "Neutral", "LABEL_2": "Good"}
58
  return label_map.get(label, "Unknown")
59
 
60
  # Streamlit UI