Spaces:
Runtime error
Runtime error
add `note` for storytelling mode
Browse files- src/play_storytelling.py +6 -0
- src/probability_emote.py +1 -1
src/play_storytelling.py
CHANGED
@@ -51,3 +51,9 @@ def run_play_storytelling(gen, container_guide, container_param, container_butto
|
|
51 |
st.session_state.sentence_list = [{'sentence': first_sentence,
|
52 |
'emotion': first_emotion['label'],
|
53 |
'score': first_emotion['score']}]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
st.session_state.sentence_list = [{'sentence': first_sentence,
|
52 |
'emotion': first_emotion['label'],
|
53 |
'score': first_emotion['score']}]
|
54 |
+
|
55 |
+
st.sidebar.markdown(
|
56 |
+
'''
|
57 |
+
* Click `Run` again to generate the next sentence.
|
58 |
+
* Click `Clear` twice to reset the story.
|
59 |
+
''')
|
src/probability_emote.py
CHANGED
@@ -73,7 +73,7 @@ def get_equation_text(w=0.5, ec=0.7, rand=None, emotion_frequency=None):
|
|
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 |
```
|
|
|
73 |
text = f'''
|
74 |
#### Equation
|
75 |
```
|
76 |
+
frequency_penalty = 1 - emotion_frequency = 1 - {proper_float(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 |
```
|