Spaces:
Sleeping
Sleeping
Commit
Β·
49b3735
1
Parent(s):
45cf8e6
Update app.py
Browse files
app.py
CHANGED
|
@@ -50,11 +50,13 @@ with gr.Blocks(theme=gr.themes.Default(text_size=gr.themes.sizes.text_md)) as de
|
|
| 50 |
#with gr.Column():
|
| 51 |
placeholder = gr.Markdown(
|
| 52 |
''' ## Welcome to the Language Model Explanation Challenge!
|
|
|
|
| 53 |
Language Models (LMs) are powerful AI tools to understand and generate human language.<br />
|
| 54 |
However, they sometimes make mistakes... and it's hard to know why!<br /><br />
|
| 55 |
-
|
| 56 |
|
| 57 |
Choose one of the tasks below ... and start to play!
|
|
|
|
|
|
|
| 58 |
'''
|
| 59 |
|
| 60 |
#* **Like or Dislike** provides a movie/food/book review. You (and AI) are required to guess its score.
|
|
@@ -71,12 +73,14 @@ with gr.Blocks(theme=gr.themes.Default(text_size=gr.themes.sizes.text_md)) as de
|
|
| 71 |
#logo = gr.Image('logo.png', height=230, width=600, min_width=80, show_label=False, show_share_button=False, interactive=False, container=False)
|
| 72 |
placeholder = gr.Markdown(
|
| 73 |
'''
|
|
|
|
| 74 |
Are *humans* or *machines* better at understanding language?<br />
|
| 75 |
→ Play a game against AI to find out!<br />
|
| 76 |
Does AI think like you or not at all?<br />
|
| 77 |
→ Check out the color highlighting to see which parts of the sentence are more important for the machine.<br />
|
| 78 |
Can you outsmart the AI?<br />
|
| 79 |
→ Try to write a text that will trick it into the wrong decision<br /><br />
|
|
|
|
| 80 |
'''
|
| 81 |
)
|
| 82 |
|
|
@@ -115,11 +119,9 @@ with gr.Blocks(theme=gr.themes.Default(text_size=gr.themes.sizes.text_md)) as de
|
|
| 115 |
You're given a short review of a movie, book or restaurant.
|
| 116 |
The goal of this game is to guess how *positive* the review is, from 0 (=extremely bad) to 100 (=fantastic).
|
| 117 |
|
| 118 |
-
* Step 1
|
| 119 |
-
|
| 120 |
-
* Step
|
| 121 |
-
|
| 122 |
-
* Step 3. Check the word highlighting to understand how AI made its decision.
|
| 123 |
'''
|
| 124 |
)
|
| 125 |
|
|
@@ -178,7 +180,7 @@ with gr.Blocks(theme=gr.themes.Default(text_size=gr.themes.sizes.text_md)) as de
|
|
| 178 |
sample_button_en_3 = gr.Button("Click to get a sentence", size='sm')
|
| 179 |
input_text_mf = gr.Textbox(label="Sentence:", value="HELLO! Hallo!", visible=False, container=False)
|
| 180 |
interpretation_mf_1 = gr.components.Interpretation(input_text_mf)
|
| 181 |
-
slider_3_1 = gr.Slider(label="Your
|
| 182 |
user_important_mf = gr.Textbox(label="Which words are your guesses based on?", placeholder="Enter words that you think are important for the task")
|
| 183 |
with gr.Column(scale=1):
|
| 184 |
gr.Markdown(
|
|
@@ -191,21 +193,19 @@ with gr.Blocks(theme=gr.themes.Default(text_size=gr.themes.sizes.text_md)) as de
|
|
| 191 |
gr.Markdown(
|
| 192 |
''' ## Male or Female
|
| 193 |
|
| 194 |
-
You're given a sentence
|
| 195 |
-
The goal of
|
| 196 |
-
|
| 197 |
-
*Step 1. Get a sentence and guess the gender of the speaker.
|
| 198 |
-
|
| 199 |
-
*Step 2. Check the gender guessed by AI. Who gets the most correct answer wins.
|
| 200 |
|
| 201 |
-
|
|
|
|
|
|
|
| 202 |
'''
|
| 203 |
)
|
| 204 |
|
| 205 |
with gr.Row():
|
| 206 |
with gr.Column(scale=2):
|
| 207 |
chat_button_mf = gr.Button("Click to see AI's guess", size='sm')
|
| 208 |
-
slider_3_2 = gr.Slider(label="AI guess on author
|
| 209 |
interpre_button_mf = gr.Button("See how AI made its guess", size='sm')
|
| 210 |
placeholder_text_mf = gr.Textbox(label="Red higlights: Female / Blue higlights: Male", value="HELLO! Hallo!", visible=False)
|
| 211 |
interpretation_mf_2 = gr.components.Interpretation(placeholder_text_mf)
|
|
@@ -222,11 +222,11 @@ with gr.Blocks(theme=gr.themes.Default(text_size=gr.themes.sizes.text_md)) as de
|
|
| 222 |
with gr.Row():
|
| 223 |
with gr.Column(scale=2):
|
| 224 |
text_written_mf = gr.Textbox(label="Sentence: ", placeholder="Enter a sentence.", visible=True)
|
| 225 |
-
slider_3_3 = gr.Slider(label="Your
|
| 226 |
chat_button_mf_2 = gr.Button("Click to see AI's guess", size='sm')
|
| 227 |
placeholder_written_text_mf = gr.Textbox(label="Red higlights: Female / Blue higlights: Male", value="HELLO! Hallo!", visible=False)
|
| 228 |
interpretation_mf_4 = gr.components.Interpretation(placeholder_written_text_mf)
|
| 229 |
-
slider_3_4 = gr.Slider(label="AI guess on author
|
| 230 |
with gr.Column(scale=1):
|
| 231 |
chatbot_mf_2 = gr.Chatbot(height=350, min_width=50, container=False) # height=300
|
| 232 |
|
|
|
|
| 50 |
#with gr.Column():
|
| 51 |
placeholder = gr.Markdown(
|
| 52 |
''' ## Welcome to the Language Model Explanation Challenge!
|
| 53 |
+
<font size="2">
|
| 54 |
Language Models (LMs) are powerful AI tools to understand and generate human language.<br />
|
| 55 |
However, they sometimes make mistakes... and it's hard to know why!<br /><br />
|
|
|
|
| 56 |
|
| 57 |
Choose one of the tasks below ... and start to play!
|
| 58 |
+
</font>
|
| 59 |
+
|
| 60 |
'''
|
| 61 |
|
| 62 |
#* **Like or Dislike** provides a movie/food/book review. You (and AI) are required to guess its score.
|
|
|
|
| 73 |
#logo = gr.Image('logo.png', height=230, width=600, min_width=80, show_label=False, show_share_button=False, interactive=False, container=False)
|
| 74 |
placeholder = gr.Markdown(
|
| 75 |
'''
|
| 76 |
+
<font size="2">
|
| 77 |
Are *humans* or *machines* better at understanding language?<br />
|
| 78 |
→ Play a game against AI to find out!<br />
|
| 79 |
Does AI think like you or not at all?<br />
|
| 80 |
→ Check out the color highlighting to see which parts of the sentence are more important for the machine.<br />
|
| 81 |
Can you outsmart the AI?<br />
|
| 82 |
→ Try to write a text that will trick it into the wrong decision<br /><br />
|
| 83 |
+
</font>
|
| 84 |
'''
|
| 85 |
)
|
| 86 |
|
|
|
|
| 119 |
You're given a short review of a movie, book or restaurant.
|
| 120 |
The goal of this game is to guess how *positive* the review is, from 0 (=extremely bad) to 100 (=fantastic).
|
| 121 |
|
| 122 |
+
* Step 1: Get an English or Dutch review and guess the corresponding score.
|
| 123 |
+
* Step 2: Check the score guessed by AI. Who gets the most correct answer wins.
|
| 124 |
+
* Step 3: Check the word highlighting to understand how AI made its decision.
|
|
|
|
|
|
|
| 125 |
'''
|
| 126 |
)
|
| 127 |
|
|
|
|
| 180 |
sample_button_en_3 = gr.Button("Click to get a sentence", size='sm')
|
| 181 |
input_text_mf = gr.Textbox(label="Sentence:", value="HELLO! Hallo!", visible=False, container=False)
|
| 182 |
interpretation_mf_1 = gr.components.Interpretation(input_text_mf)
|
| 183 |
+
slider_3_1 = gr.Slider(label="Your guess of author gender: Male(0) ββ> Female(100)", container=True, min_width=200, height=80, show_label=True, interactive=True)
|
| 184 |
user_important_mf = gr.Textbox(label="Which words are your guesses based on?", placeholder="Enter words that you think are important for the task")
|
| 185 |
with gr.Column(scale=1):
|
| 186 |
gr.Markdown(
|
|
|
|
| 193 |
gr.Markdown(
|
| 194 |
''' ## Male or Female
|
| 195 |
|
| 196 |
+
You're given a sentence written by a person.
|
| 197 |
+
The goal of the game is to guess the gender of that person, from 0 (=Male) to 100 (=Female).
|
|
|
|
|
|
|
|
|
|
|
|
|
| 198 |
|
| 199 |
+
- Step 1: Get a sentence and guess the gender of its author.
|
| 200 |
+
- Step 2: Check the gender guessed by AI. Who gets the most correct answer wins.
|
| 201 |
+
- Step 3: Check the word highlighting to understand how AI made its decision.
|
| 202 |
'''
|
| 203 |
)
|
| 204 |
|
| 205 |
with gr.Row():
|
| 206 |
with gr.Column(scale=2):
|
| 207 |
chat_button_mf = gr.Button("Click to see AI's guess", size='sm')
|
| 208 |
+
slider_3_2 = gr.Slider(label="AI guess on author gender: Male(0) ββ> Female(100)", container=True, min_width=200, height=80, show_label=True, interactive=True)
|
| 209 |
interpre_button_mf = gr.Button("See how AI made its guess", size='sm')
|
| 210 |
placeholder_text_mf = gr.Textbox(label="Red higlights: Female / Blue higlights: Male", value="HELLO! Hallo!", visible=False)
|
| 211 |
interpretation_mf_2 = gr.components.Interpretation(placeholder_text_mf)
|
|
|
|
| 222 |
with gr.Row():
|
| 223 |
with gr.Column(scale=2):
|
| 224 |
text_written_mf = gr.Textbox(label="Sentence: ", placeholder="Enter a sentence.", visible=True)
|
| 225 |
+
slider_3_3 = gr.Slider(label="Your guess of author gender: Male(0) ββ> Female(100)", container=True, min_width=200, height=80, show_label=True, interactive=True)
|
| 226 |
chat_button_mf_2 = gr.Button("Click to see AI's guess", size='sm')
|
| 227 |
placeholder_written_text_mf = gr.Textbox(label="Red higlights: Female / Blue higlights: Male", value="HELLO! Hallo!", visible=False)
|
| 228 |
interpretation_mf_4 = gr.components.Interpretation(placeholder_written_text_mf)
|
| 229 |
+
slider_3_4 = gr.Slider(label="AI guess on author gender: Male(0) ββ> Female(100)", container=True, min_width=200, height=80, show_label=True, interactive=True)
|
| 230 |
with gr.Column(scale=1):
|
| 231 |
chatbot_mf_2 = gr.Chatbot(height=350, min_width=50, container=False) # height=300
|
| 232 |
|