merve HF staff commited on
Commit
bcd8f3a
β€’
1 Parent(s): 09834f8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -13
app.py CHANGED
@@ -98,7 +98,7 @@ def summarize(input, model_choice="turna_summarization_tr_news"):
98
 
99
 
100
 
101
- with gr.Blocks(theme="shivi/calm_seafoam") as demo:
102
  gr.Markdown("# TURNA 🐦")
103
  gr.Markdown(DESCRIPTION)
104
  with gr.Tab("POS"):
@@ -106,40 +106,40 @@ with gr.Blocks(theme="shivi/calm_seafoam") as demo:
106
  with gr.Column():
107
  with gr.Row():
108
  pos_choice = gr.Radio(choices = ["turna_pos_imst", "turna_pos_boun"])
109
- pos_input = gr.Text()
110
- pos_output = gr.Text()
111
  pos_submit = gr.Button()
112
  pos_submit.click(pos, inputs=[pos_input, pos_choice], outputs=pos_output)
113
- pos_examples = gr.Examples(examples = ner_example, inputs = [pos_input, pos_choice], outputs=pos_output, fn=pos)
114
 
115
  with gr.Tab("NER"):
116
  gr.Markdown("TURNA fine-tuned on named entity recognition. Enter text to parse named entities and pick the model.")
117
  with gr.Column():
118
  with gr.Row():
119
  ner_choice = gr.Radio(choices = ["turna_ner_wikiann", "turna_ner_milliyet"])
120
- ner_input = gr.Text()
121
- ner_output = gr.Text()
122
  ner_submit = gr.Button()
123
  ner_submit.click(ner, inputs=[ner_input, ner_choice], outputs=ner_output)
124
- ner_examples = gr.Examples(examples = ner_example, inputs = [ner_input, ner_choice], outputs=ner_output, fn=ner)
125
  with gr.Tab("Paraphrase"):
126
  gr.Markdown("TURNA fine-tuned on paraphrasing. Enter text to paraphrase and pick the model.")
127
  with gr.Column():
128
  with gr.Row():
129
  paraphrasing_choice = gr.Radio(choices = ["turna_paraphrasing_tatoeba", "turna_paraphrasing_opensubtitles"])
130
- paraphrasing_input = gr.Text()
131
- paraphrasing_output = gr.Text()
132
  paraphrasing_submit = gr.Button()
133
  paraphrasing_submit.click(paraphrase, inputs=[paraphrasing_input, paraphrasing_choice], outputs=paraphrasing_output)
134
- paraphrase_examples = gr.Examples(examples = long_text, inputs = [paraphrasing_input, paraphrasing_choice], outputs=paraphrasing_output, fn=paraphrase)
135
  with gr.Tab("Summarization"):
136
  gr.Markdown("TURNA fine-tuned on summarization. Enter text to summarize and pick the model.")
137
  with gr.Column():
138
  with gr.Row():
139
  sum_choice = gr.Radio(choices = ["turna_summarization_mlsum", "turna_summarization_tr_news"])
140
- sum_input = gr.Text()
141
- sum_output = gr.Text()
142
  sum_submit = gr.Button()
143
  sum_submit.click(summarize, inputs=[sum_input, sum_choice], outputs=sum_output)
144
- sum_examples = gr.Examples(examples = long_text, inputs = [sum_input, sum_choice], outputs=sum_output, fn=summarize)
145
  demo.launch()
 
98
 
99
 
100
 
101
+ with gr.Blocks(theme="soft") as demo:
102
  gr.Markdown("# TURNA 🐦")
103
  gr.Markdown(DESCRIPTION)
104
  with gr.Tab("POS"):
 
106
  with gr.Column():
107
  with gr.Row():
108
  pos_choice = gr.Radio(choices = ["turna_pos_imst", "turna_pos_boun"])
109
+ pos_input = gr.Textbox(label="POS Input")
110
+ pos_output = gr.Textbox(label="POS Output")
111
  pos_submit = gr.Button()
112
  pos_submit.click(pos, inputs=[pos_input, pos_choice], outputs=pos_output)
113
+ pos_examples = gr.Examples(examples = ner_example, inputs = [pos_input, pos_choice], outputs=pos_output, fn=pos)
114
 
115
  with gr.Tab("NER"):
116
  gr.Markdown("TURNA fine-tuned on named entity recognition. Enter text to parse named entities and pick the model.")
117
  with gr.Column():
118
  with gr.Row():
119
  ner_choice = gr.Radio(choices = ["turna_ner_wikiann", "turna_ner_milliyet"])
120
+ ner_input = gr.Textbox(label="NER Input")
121
+ ner_output = gr.Textbox(label="NER Output")
122
  ner_submit = gr.Button()
123
  ner_submit.click(ner, inputs=[ner_input, ner_choice], outputs=ner_output)
124
+ ner_examples = gr.Examples(examples = ner_example, inputs = [ner_input, ner_choice], outputs=ner_output, fn=ner)
125
  with gr.Tab("Paraphrase"):
126
  gr.Markdown("TURNA fine-tuned on paraphrasing. Enter text to paraphrase and pick the model.")
127
  with gr.Column():
128
  with gr.Row():
129
  paraphrasing_choice = gr.Radio(choices = ["turna_paraphrasing_tatoeba", "turna_paraphrasing_opensubtitles"])
130
+ paraphrasing_input = gr.Textbox(label = "Paraphrasing Input")
131
+ paraphrasing_output = gr.Text(label="Paraphrasing Output")
132
  paraphrasing_submit = gr.Button()
133
  paraphrasing_submit.click(paraphrase, inputs=[paraphrasing_input, paraphrasing_choice], outputs=paraphrasing_output)
134
+ paraphrase_examples = gr.Examples(examples = long_text, inputs = [paraphrasing_input, paraphrasing_choice], outputs=paraphrasing_output, fn=paraphrase)
135
  with gr.Tab("Summarization"):
136
  gr.Markdown("TURNA fine-tuned on summarization. Enter text to summarize and pick the model.")
137
  with gr.Column():
138
  with gr.Row():
139
  sum_choice = gr.Radio(choices = ["turna_summarization_mlsum", "turna_summarization_tr_news"])
140
+ sum_input = gr.Textbox(label = "Summarization Input")
141
+ sum_output = gr.Textbox(label = "Summarization Output")
142
  sum_submit = gr.Button()
143
  sum_submit.click(summarize, inputs=[sum_input, sum_choice], outputs=sum_output)
144
+ sum_examples = gr.Examples(examples = long_text, inputs = [sum_input, sum_choice], outputs=sum_output, fn=summarize)
145
  demo.launch()