Spaces:
Runtime error
Runtime error
improves text visuals
Browse files- src/probability_emote.py +17 -11
src/probability_emote.py
CHANGED
@@ -60,9 +60,11 @@ def get_text():
|
|
60 |
def get_equation_text(w=0.5, ec=0.7, rand=None, emotion_frequency=None):
|
61 |
text = f'''
|
62 |
#### Equation
|
63 |
-
|
64 |
-
|
65 |
-
|
|
|
|
|
66 |
|
67 |
'''
|
68 |
if rand is not None:
|
@@ -70,15 +72,19 @@ def get_equation_text(w=0.5, ec=0.7, rand=None, emotion_frequency=None):
|
|
70 |
probability_emote = proper_float((w)*(ec)+(1-w)*frequency_penalty)
|
71 |
text = f'''
|
72 |
#### Equation
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
|
|
|
|
|
|
78 |
= probability_emote > (Random value between 0 and 1)
|
79 |
-
|
80 |
-
|
81 |
-
|
|
|
82 |
'''
|
83 |
return text
|
84 |
|
|
|
60 |
def get_equation_text(w=0.5, ec=0.7, rand=None, emotion_frequency=None):
|
61 |
text = f'''
|
62 |
#### Equation
|
63 |
+
```
|
64 |
+
frequency_penalty = 1 - emotion_frequency
|
65 |
+
probability_emote = w * emotion_confidence + (1 - w) * frequency_penalty
|
66 |
+
```
|
67 |
+
**probability_emote** = {proper_float(w)} * {proper_float(ec)} + {proper_float(1-w)} * frequency_penalty
|
68 |
|
69 |
'''
|
70 |
if rand is not None:
|
|
|
72 |
probability_emote = proper_float((w)*(ec)+(1-w)*frequency_penalty)
|
73 |
text = f'''
|
74 |
#### Equation
|
75 |
+
```
|
76 |
+
frequency_penalty = 1 - emotion_frequency = 1 - {emotion_frequency} = {frequency_penalty}
|
77 |
+
probability_emote = w * emotion_confidence + (1 - w) * frequency_penalty
|
78 |
+
probability_emote = {proper_float(w)} * {proper_float(ec)} + {proper_float(1-w)} * {frequency_penalty}
|
79 |
+
```
|
80 |
+
**probability_emote** = {probability_emote}
|
81 |
+
```
|
82 |
+
Show_Emotion
|
83 |
= probability_emote > (Random value between 0 and 1)
|
84 |
+
Random value = {rand}
|
85 |
+
Show_Emotion = {probability_emote} > {rand}
|
86 |
+
```
|
87 |
+
**Show_Emotion** = {probability_emote > rand}
|
88 |
'''
|
89 |
return text
|
90 |
|