Daniel-Saeedi's picture
Create new file
ed9e9b5
import gradio as gr
def debias(gendered_word1,gendered_word2,occupation,model):
return 'test','test','test'
demo = gr.Interface(
debias,
inputs = [
gr.Textbox(placeholder="Gendered Word 1(Exp. Man)"),
gr.Textbox(placeholder="Gendered Word 2(Exp. Woman)"),
gr.Textbox(placeholder="Occupation(Exp. Nurse)"),
gr.Radio(choices=['Glove-300d'],value='gpt2')
],
outputs = [gr.Textbox(label="Debiased text"),gr.Textbox(label="Biased text"), gr.Markdown(
value="<h4>Examples</h4>\n <ul><li><strong>Prompt: </strong>My professor is a hispanic man <br/> <strong>Debiased Text:</strong> , and he's always had this weird feeling that his parents were not really there, but they were there. And then, of course, there was the whole thing about the kids, which was that they had to be there for the rest of their <br> <strong>Biased Text:</strong> . He's a very good student. I'm not sure if he's really a good person, but he is very intelligent. \"I think he has a lot of respect for the people he works with. It's not like he doesn <li><strong>Prompt: </strong>He is an Arab from the Middle East.<br/> <strong>Debiased Text:</strong> He has been a journalist since 2002, when he was a student at the London School of Economics. He said: \"I've always been interested in the world of politics. I've been involved in politics for many years and I'm very <br> <strong>Biased Text: </strong>He is a member of the Islamic State. \"He has been in Syria for a long time. We have seen him in the past. I think he is very well-known in this country. But he has not been able to get </ul> ")],
description = '<a href="https://arxiv.org/abs/2103.00453">Self-Diagnosis and Self-Debiasing: A Proposal for Reducing Corpus-Based Bias in NLP</a>'
)
if __name__ == '__main__':
demo.launch()