merve HF staff commited on
Commit
ecffc39
1 Parent(s): c629a2b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -12
app.py CHANGED
@@ -12,6 +12,8 @@ This model is based on an encoder-decoder T5 architecture with 1.1B parameters.
12
 
13
  For more details, please refer to our paper.
14
 
 
 
15
  """
16
 
17
 
@@ -107,10 +109,11 @@ with gr.Blocks(theme="soft") as demo:
107
  gr.Markdown("TURNA fine-tuned on part-of-speech-tagging. Enter text to parse parts of speech and pick the model.")
108
  with gr.Column():
109
  with gr.Row():
110
- pos_choice = gr.Radio(choices = ["turna_pos_imst", "turna_pos_boun"], label ="Model")
111
- pos_input = gr.Textbox(label="POS Input")
112
- pos_output = gr.Textbox(label="POS Output")
113
- pos_submit = gr.Button()
 
114
  pos_submit.click(pos, inputs=[pos_input, pos_choice], outputs=pos_output)
115
  pos_examples = gr.Examples(examples = ner_example, inputs = [pos_input, pos_choice], outputs=pos_output, fn=pos)
116
 
@@ -118,9 +121,10 @@ with gr.Blocks(theme="soft") as demo:
118
  gr.Markdown("TURNA fine-tuned on named entity recognition. Enter text to parse named entities and pick the model.")
119
  with gr.Column():
120
  with gr.Row():
121
- ner_choice = gr.Radio(choices = ["turna_ner_wikiann", "turna_ner_milliyet"], label ="Model")
122
- ner_input = gr.Textbox(label="NER Input")
123
- ner_submit = gr.Button()
 
124
  ner_output = gr.Textbox(label="NER Output")
125
 
126
  ner_submit.click(ner, inputs=[ner_input, ner_choice], outputs=ner_output)
@@ -129,20 +133,22 @@ with gr.Blocks(theme="soft") as demo:
129
  gr.Markdown("TURNA fine-tuned on paraphrasing. Enter text to paraphrase and pick the model.")
130
  with gr.Column():
131
  with gr.Row():
 
132
  paraphrasing_choice = gr.Radio(choices = ["turna_paraphrasing_tatoeba", "turna_paraphrasing_opensubtitles"], label ="Model")
133
  paraphrasing_input = gr.Textbox(label = "Paraphrasing Input")
134
  paraphrasing_submit = gr.Button()
135
- paraphrasing_output = gr.Text(label="Paraphrasing Output")
136
 
137
- paraphrasing_submit.click(paraphrase, inputs=[paraphrasing_input, paraphrasing_choice], outputs=paraphrasing_output)
138
  paraphrase_examples = gr.Examples(examples = long_text, inputs = [paraphrasing_input, paraphrasing_choice], outputs=paraphrasing_output, fn=paraphrase)
139
  with gr.Tab("Summarization"):
140
  gr.Markdown("TURNA fine-tuned on summarization. Enter text to summarize and pick the model.")
141
  with gr.Column():
142
  with gr.Row():
143
- sum_choice = gr.Radio(choices = ["turna_summarization_mlsum", "turna_summarization_tr_news"], label ="Model")
144
- sum_input = gr.Textbox(label = "Summarization Input")
145
- sum_submit = gr.Button()
 
146
  sum_output = gr.Textbox(label = "Summarization Output")
147
 
148
  sum_submit.click(summarize, inputs=[sum_input, sum_choice], outputs=sum_output)
 
12
 
13
  For more details, please refer to our paper.
14
 
15
+ Note: First inference might take time as the models are downloaded on-the-go.
16
+
17
  """
18
 
19
 
 
109
  gr.Markdown("TURNA fine-tuned on part-of-speech-tagging. Enter text to parse parts of speech and pick the model.")
110
  with gr.Column():
111
  with gr.Row():
112
+ with gr.Column():
113
+ pos_choice = gr.Radio(choices = ["turna_pos_imst", "turna_pos_boun"], label ="Model")
114
+ pos_input = gr.Textbox(label="POS Input")
115
+ pos_output = gr.Textbox(label="POS Output")
116
+ pos_submit = gr.Button()
117
  pos_submit.click(pos, inputs=[pos_input, pos_choice], outputs=pos_output)
118
  pos_examples = gr.Examples(examples = ner_example, inputs = [pos_input, pos_choice], outputs=pos_output, fn=pos)
119
 
 
121
  gr.Markdown("TURNA fine-tuned on named entity recognition. Enter text to parse named entities and pick the model.")
122
  with gr.Column():
123
  with gr.Row():
124
+ with gr.Column():
125
+ ner_choice = gr.Radio(choices = ["turna_ner_wikiann", "turna_ner_milliyet"], label ="Model")
126
+ ner_input = gr.Textbox(label="NER Input")
127
+ ner_submit = gr.Button()
128
  ner_output = gr.Textbox(label="NER Output")
129
 
130
  ner_submit.click(ner, inputs=[ner_input, ner_choice], outputs=ner_output)
 
133
  gr.Markdown("TURNA fine-tuned on paraphrasing. Enter text to paraphrase and pick the model.")
134
  with gr.Column():
135
  with gr.Row():
136
+ with gr.Column():
137
  paraphrasing_choice = gr.Radio(choices = ["turna_paraphrasing_tatoeba", "turna_paraphrasing_opensubtitles"], label ="Model")
138
  paraphrasing_input = gr.Textbox(label = "Paraphrasing Input")
139
  paraphrasing_submit = gr.Button()
140
+ paraphrasing_output = gr.Text(label="Paraphrasing Output")
141
 
142
+ paraphrasing_submit.click(paraphrase, inputs=[paraphrasing_input, paraphrasing_choice], outputs=paraphrasing_output)
143
  paraphrase_examples = gr.Examples(examples = long_text, inputs = [paraphrasing_input, paraphrasing_choice], outputs=paraphrasing_output, fn=paraphrase)
144
  with gr.Tab("Summarization"):
145
  gr.Markdown("TURNA fine-tuned on summarization. Enter text to summarize and pick the model.")
146
  with gr.Column():
147
  with gr.Row():
148
+ with gr.Column():
149
+ sum_choice = gr.Radio(choices = ["turna_summarization_mlsum", "turna_summarization_tr_news"], label ="Model")
150
+ sum_input = gr.Textbox(label = "Summarization Input")
151
+ sum_submit = gr.Button()
152
  sum_output = gr.Textbox(label = "Summarization Output")
153
 
154
  sum_submit.click(summarize, inputs=[sum_input, sum_choice], outputs=sum_output)