Update metrics.py
Browse files- metrics.py +6 -0
metrics.py
CHANGED
|
@@ -1,5 +1,11 @@
|
|
| 1 |
import re
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
def humility_score(text):
|
| 4 |
humility_keywords = ["I may be wrong", "I don't know", "uncertain", "open to correction", "not sure"]
|
| 5 |
score = sum(1 for phrase in humility_keywords if phrase in text.lower())
|
|
|
|
| 1 |
import re
|
| 2 |
|
| 3 |
+
def get_metrics(text):
|
| 4 |
+
return {
|
| 5 |
+
"humility_score": humility_score(text),
|
| 6 |
+
"bias_confession_rate": bias_confession_rate(text)
|
| 7 |
+
}
|
| 8 |
+
|
| 9 |
def humility_score(text):
|
| 10 |
humility_keywords = ["I may be wrong", "I don't know", "uncertain", "open to correction", "not sure"]
|
| 11 |
score = sum(1 for phrase in humility_keywords if phrase in text.lower())
|