kambris commited on
Commit
af4b612
·
verified ·
1 Parent(s): a9e902c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -64,10 +64,9 @@ class SpeechAnalyzer:
64
  self.moral_model_path = "MMADS/MoralFoundationsClassifier"
65
  self.moral_tokenizer = RobertaTokenizer.from_pretrained(self.moral_model_path)
66
  self.moral_model = RobertaForSequenceClassification.from_pretrained(self.moral_model_path)
67
-
68
- # Load label names
69
- with open(f"{self.moral_model_path}/label_names.json", 'r') as f:
70
- self.label_names = json.load(f)
71
 
72
  # Other pipelines remain the same
73
  self.sentiment_pipeline = pipeline("sentiment-analysis")
 
64
  self.moral_model_path = "MMADS/MoralFoundationsClassifier"
65
  self.moral_tokenizer = RobertaTokenizer.from_pretrained(self.moral_model_path)
66
  self.moral_model = RobertaForSequenceClassification.from_pretrained(self.moral_model_path)
67
+
68
+ # Define label names directly
69
+ self.label_names = ['care', 'fairness', 'loyalty', 'authority', 'sanctity']
 
70
 
71
  # Other pipelines remain the same
72
  self.sentiment_pipeline = pipeline("sentiment-analysis")