Initial commit
Browse files
app.py
CHANGED
@@ -50,6 +50,7 @@ def trait_classifier(text: str) -> Dict[str, float]:
|
|
50 |
|
51 |
# Format output for Gradio (e.g. {"label_1": probability_1, "label_2": probability_2})
|
52 |
output_dict = {}
|
|
|
53 |
#agr
|
54 |
if outputs_agr[0]['label'] == 'POSITIVE':
|
55 |
output_dict['Agreeablenes'] = outputs_agr[0]["score"]
|
@@ -96,13 +97,14 @@ Fine-tuned from [xlm-roberta-base](https://huggingface.co/FacebookAI/xlm-roberta
|
|
96 |
|
97 |
demo = gr.Interface(fn=trait_classifier,
|
98 |
inputs="text",
|
99 |
-
outputs=gr.Label(num_top_classes=5, label='
|
100 |
title="🤯 Petarda",
|
101 |
-
theme=
|
102 |
description=description,
|
103 |
examples=[["I have a real problem right now... I am struggling a lot :("],
|
104 |
-
["He's such a nice, gentle man and it was great"]
|
|
|
105 |
|
106 |
# 4. Launch the interface
|
107 |
if __name__ == "__main__":
|
108 |
-
demo.launch()
|
|
|
50 |
|
51 |
# Format output for Gradio (e.g. {"label_1": probability_1, "label_2": probability_2})
|
52 |
output_dict = {}
|
53 |
+
output_dict['Personality traits'] = 1
|
54 |
#agr
|
55 |
if outputs_agr[0]['label'] == 'POSITIVE':
|
56 |
output_dict['Agreeablenes'] = outputs_agr[0]["score"]
|
|
|
97 |
|
98 |
demo = gr.Interface(fn=trait_classifier,
|
99 |
inputs="text",
|
100 |
+
outputs=gr.Label(num_top_classes=5, label='output'),
|
101 |
title="🤯 Petarda",
|
102 |
+
theme=gr.themes.Ocean(primary_hue="amber", secondary_hue="cyan"),
|
103 |
description=description,
|
104 |
examples=[["I have a real problem right now... I am struggling a lot :("],
|
105 |
+
["He's such a nice, gentle man and it was great"],
|
106 |
+
"And now you\'re asking very hard questions that I\'ve struggled with quite a bit… Both of those can be a struggle. My memory is very hard to access because I just can\'t remember things in any level of detail... faces, conversations, events, my own actions, or unstructured facts. My senses can be hard to access as well because I keep pulling back into my own head. I don\t feel like I\'m grounded in myself or that I have a consistent behavior. I\'m stateless. It\'s as if everything is new to me all the time. I can barely maintain a routine. At the same time, empathizing and really knowing what to do naturally in social situations is really a problem for me as well. I seem to get by and people generally like me, but I\'m very careful and I can\'t always relate to how other people are acting. Sometimes it seems animalistic, simple-minded, and petty. Depends... if there\'s something that I\'m interested in being discussed or done, then I am very, very energetic, passionate, and reactive. My energy levels can swing from one extreme to another depending on my level of interest. If not, then I\'m extremely withdrawn and in my own head."])
|
107 |
|
108 |
# 4. Launch the interface
|
109 |
if __name__ == "__main__":
|
110 |
+
demo.launch(share=True)
|