Update app.py
Browse files
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 |
-
|
69 |
-
|
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")
|