Spaces:
Runtime error
Runtime error
arianna-bis
commited on
Commit
β’
deb8c69
1
Parent(s):
beea541
Update app.py
Browse files
app.py
CHANGED
@@ -51,10 +51,9 @@ with gr.Blocks(theme=gr.themes.Default(text_size=gr.themes.sizes.text_md)) as de
|
|
51 |
Language Models (LMs) are powerful AI tools to understand and generate human language.<br />
|
52 |
However, they sometimes make mistakes... and it's hard to know why!<br /><br />
|
53 |
Are *humans* or *machines* better at understanding language?<br />
|
54 |
-
→ Play a game against AI to find out!<br
|
55 |
Does AI think like you or not at all?<br />
|
56 |
-
→ Check out the color highlighting to see which parts of the sentence are more important for the machine.<br
|
57 |
-
|
58 |
Can you outsmart the AI?<br />
|
59 |
→ Try to write a text that will trick it into the wrong decision<br /><br />
|
60 |
|
@@ -99,8 +98,8 @@ with gr.Blocks(theme=gr.themes.Default(text_size=gr.themes.sizes.text_md)) as de
|
|
99 |
input_text = gr.Textbox(label="Review:", value="HELLO! Hallo!", visible=False, container=False)
|
100 |
interpretation1 = gr.components.Interpretation(input_text)
|
101 |
|
102 |
-
slider_1_1 = gr.Slider(label="
|
103 |
-
user_important = gr.Textbox(label="Which words are
|
104 |
|
105 |
with gr.Column(scale=1):
|
106 |
gr.Markdown(
|
@@ -118,9 +117,9 @@ with gr.Blocks(theme=gr.themes.Default(text_size=gr.themes.sizes.text_md)) as de
|
|
118 |
|
119 |
with gr.Row():
|
120 |
with gr.Column(scale=2):
|
121 |
-
chat_button_1 = gr.Button("Click to see AI's
|
122 |
-
slider_1_2 = gr.Slider(label="AI: Dislike
|
123 |
-
interpre_button = gr.Button("See how AI
|
124 |
placeholder_text = gr.Textbox(label="Review:", value="HELLO! Hallo!", visible=False)
|
125 |
interpretation2 = gr.components.Interpretation(placeholder_text)
|
126 |
with gr.Column(scale=1):
|
@@ -129,7 +128,7 @@ with gr.Blocks(theme=gr.themes.Default(text_size=gr.themes.sizes.text_md)) as de
|
|
129 |
gr.Markdown(''' *** ''')
|
130 |
|
131 |
gr.Markdown(
|
132 |
-
''' # Now try your own
|
133 |
'''
|
134 |
)
|
135 |
|
@@ -137,12 +136,12 @@ with gr.Blocks(theme=gr.themes.Default(text_size=gr.themes.sizes.text_md)) as de
|
|
137 |
with gr.Column(scale=2):
|
138 |
text_written = gr.Textbox(label="Review: ", placeholder="Enter your own review about a movie/restaurant/book.", visible=True)
|
139 |
# image_1_3 = gr.Image('icon_user.png', height=80, width=80, min_width=80, show_label=False, show_share_button=False, interactive=False)
|
140 |
-
slider_1_3 = gr.Slider(label="
|
141 |
lang_written = gr.Radio(["English", "Dutch"], label="Language:", info="In which language is the review written?")
|
142 |
-
chat_button_2 = gr.Button("Click to see AI's
|
143 |
placeholder_written_text = gr.Textbox(label="Review: ", value="HELLO! Hallo!", visible=False)
|
144 |
interpretation4 = gr.components.Interpretation(placeholder_written_text)
|
145 |
-
slider_1_4 = gr.Slider(label="AI: Dislike
|
146 |
with gr.Column(scale=1):
|
147 |
chatbot2 = gr.Chatbot(height=350, min_width=50, container=False) # height=300
|
148 |
|
@@ -168,11 +167,11 @@ with gr.Blocks(theme=gr.themes.Default(text_size=gr.themes.sizes.text_md)) as de
|
|
168 |
with gr.Column(scale=2):
|
169 |
with gr.Row():
|
170 |
# gr.Markdown(''' <p style="text-align: center;"> or </p> ''')
|
171 |
-
sample_button_en_3 = gr.Button("Click to get a sentence
|
172 |
input_text_mf = gr.Textbox(label="Sentence:", value="HELLO! Hallo!", visible=False, container=False)
|
173 |
interpretation_mf_1 = gr.components.Interpretation(input_text_mf)
|
174 |
slider_3_1 = gr.Slider(label="Human: Male ββ> Female", container=True, min_width=200, height=80, show_label=True, interactive=True)
|
175 |
-
user_important_mf = gr.Textbox(label="Which words are
|
176 |
with gr.Column(scale=1):
|
177 |
gr.Markdown(
|
178 |
''' ## Male or Female
|
|
|
51 |
Language Models (LMs) are powerful AI tools to understand and generate human language.<br />
|
52 |
However, they sometimes make mistakes... and it's hard to know why!<br /><br />
|
53 |
Are *humans* or *machines* better at understanding language?<br />
|
54 |
+
→ Play a game against AI to find out!<br />
|
55 |
Does AI think like you or not at all?<br />
|
56 |
+
→ Check out the color highlighting to see which parts of the sentence are more important for the machine.<br />
|
|
|
57 |
Can you outsmart the AI?<br />
|
58 |
→ Try to write a text that will trick it into the wrong decision<br /><br />
|
59 |
|
|
|
98 |
input_text = gr.Textbox(label="Review:", value="HELLO! Hallo!", visible=False, container=False)
|
99 |
interpretation1 = gr.components.Interpretation(input_text)
|
100 |
|
101 |
+
slider_1_1 = gr.Slider(label="Your rating: Dislike(0) β> Like(100)", container=True, min_width=200, height=80, show_label=True, interactive=True)
|
102 |
+
user_important = gr.Textbox(label="Which words are your guesses based on?", placeholder="Enter words that you think are important for the task")
|
103 |
|
104 |
with gr.Column(scale=1):
|
105 |
gr.Markdown(
|
|
|
117 |
|
118 |
with gr.Row():
|
119 |
with gr.Column(scale=2):
|
120 |
+
chat_button_1 = gr.Button("Click to see AI's rating", size='sm')
|
121 |
+
slider_1_2 = gr.Slider(label="AI rating: Dislike(0) β> Like(100)", container=True, min_width=200, height=80, show_label=True, interactive=True)
|
122 |
+
interpre_button = gr.Button("See how AI got its rating", size='sm')
|
123 |
placeholder_text = gr.Textbox(label="Review:", value="HELLO! Hallo!", visible=False)
|
124 |
interpretation2 = gr.components.Interpretation(placeholder_text)
|
125 |
with gr.Column(scale=1):
|
|
|
128 |
gr.Markdown(''' *** ''')
|
129 |
|
130 |
gr.Markdown(
|
131 |
+
''' # Now try with your own review!
|
132 |
'''
|
133 |
)
|
134 |
|
|
|
136 |
with gr.Column(scale=2):
|
137 |
text_written = gr.Textbox(label="Review: ", placeholder="Enter your own review about a movie/restaurant/book.", visible=True)
|
138 |
# image_1_3 = gr.Image('icon_user.png', height=80, width=80, min_width=80, show_label=False, show_share_button=False, interactive=False)
|
139 |
+
slider_1_3 = gr.Slider(label="Your rating: Dislike(0) β> Like(100)", container=True, min_width=200, height=80, show_label=True, interactive=True)
|
140 |
lang_written = gr.Radio(["English", "Dutch"], label="Language:", info="In which language is the review written?")
|
141 |
+
chat_button_2 = gr.Button("Click to see AI's rating", size='sm')
|
142 |
placeholder_written_text = gr.Textbox(label="Review: ", value="HELLO! Hallo!", visible=False)
|
143 |
interpretation4 = gr.components.Interpretation(placeholder_written_text)
|
144 |
+
slider_1_4 = gr.Slider(label="AI rating: Dislike(0) β> Like(100)", container=True, min_width=200, height=80, show_label=True, interactive=True)
|
145 |
with gr.Column(scale=1):
|
146 |
chatbot2 = gr.Chatbot(height=350, min_width=50, container=False) # height=300
|
147 |
|
|
|
167 |
with gr.Column(scale=2):
|
168 |
with gr.Row():
|
169 |
# gr.Markdown(''' <p style="text-align: center;"> or </p> ''')
|
170 |
+
sample_button_en_3 = gr.Button("Click to get a sentence", size='sm')
|
171 |
input_text_mf = gr.Textbox(label="Sentence:", value="HELLO! Hallo!", visible=False, container=False)
|
172 |
interpretation_mf_1 = gr.components.Interpretation(input_text_mf)
|
173 |
slider_3_1 = gr.Slider(label="Human: Male ββ> Female", container=True, min_width=200, height=80, show_label=True, interactive=True)
|
174 |
+
user_important_mf = gr.Textbox(label="Which words are your guesses based on?", placeholder="Enter words that you think are important for the task")
|
175 |
with gr.Column(scale=1):
|
176 |
gr.Markdown(
|
177 |
''' ## Male or Female
|