Spaces:
Sleeping
Sleeping
Shane Weisz
commited on
Commit
·
5e6bf87
1
Parent(s):
3c06843
Add examples
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ The project is supervised by [Dr Marcus Tomalin](https://www.crassh.cam.ac.uk/ab
|
|
12 |
<br/>
|
13 |
The system is built by fine-tuning [DialoGPT](https://huggingface.co/microsoft/DialoGPT-medium#:~:text=DialoGPT%20is%20a%20SOTA%20large,single%2Dturn%20conversation%20Turing%20test) on the [MultiCONAN](https://github.com/marcoguerini/CONAN#Multitarget-CONAN) dataset, a dataset comprising a set of hate speech inputs and appropriate counterspeech responses produced under the supervision of trained NGO operators from [Stop Hate UK](https://www.stophateuk.org/).
|
14 |
<br/><br/>
|
15 |
-
**Try it out**: Enter some hate speech and see if the system generates an appropriate counterspeech response."""
|
16 |
ARTICLE = f"""
|
17 |
**Model:** {DEFAULT_MODEL}<br>
|
18 |
**Decoding parameters:** {DECODING_CONFIG}
|
@@ -23,5 +23,5 @@ model = ResponseGenerator(DEFAULT_MODEL, DECODING_CONFIG)
|
|
23 |
def respond(input):
|
24 |
return model.respond(input)
|
25 |
|
26 |
-
demo = gr.Interface(fn=respond, inputs="text", outputs="text", title = TITLE, description = DESCRIPTION, article = ARTICLE)
|
27 |
demo.launch()
|
|
|
12 |
<br/>
|
13 |
The system is built by fine-tuning [DialoGPT](https://huggingface.co/microsoft/DialoGPT-medium#:~:text=DialoGPT%20is%20a%20SOTA%20large,single%2Dturn%20conversation%20Turing%20test) on the [MultiCONAN](https://github.com/marcoguerini/CONAN#Multitarget-CONAN) dataset, a dataset comprising a set of hate speech inputs and appropriate counterspeech responses produced under the supervision of trained NGO operators from [Stop Hate UK](https://www.stophateuk.org/).
|
14 |
<br/><br/>
|
15 |
+
**Try it out**: Enter some hate speech (or select one of the provided examples) and see if the system generates an appropriate counterspeech response."""
|
16 |
ARTICLE = f"""
|
17 |
**Model:** {DEFAULT_MODEL}<br>
|
18 |
**Decoding parameters:** {DECODING_CONFIG}
|
|
|
23 |
def respond(input):
|
24 |
return model.respond(input)
|
25 |
|
26 |
+
demo = gr.Interface(fn=respond, inputs="text", outputs="text", examples=["Muslims are all terrorists", "Jews are selfish and greedy", "Why waste time listening to black women?"], title = TITLE, description = DESCRIPTION, article = ARTICLE)
|
27 |
demo.launch()
|