Spaces:
Running
on
Zero
Running
on
Zero
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import spaces
|
3 |
+
import transformers
|
4 |
+
import torch
|
5 |
+
|
6 |
+
DESCRIPTION=
|
7 |
+
"""
|
8 |
+
This is the space for the Language Modeling Group at TABILAB in Computer Engineering of Bogazici University.
|
9 |
+
|
10 |
+
We released the first version of our Turkish language model TURNA.
|
11 |
+
|
12 |
+
This model is based on an encoder-decoder T5 architecture with 1.1B parameters.
|
13 |
+
|
14 |
+
For more details, please refer to our paper.
|
15 |
+
|
16 |
+
"""
|
17 |
+
|
18 |
+
|
19 |
+
sentiment_example = [["Bu üründen çok memnun kaldım."]]
|
20 |
+
long_text = [["Eyfel Kulesi (Fransızca: La tour Eiffel [la tuʀ ɛˈfɛl]), Paris'teki demir kule. Kule, aynı zamanda tüm dünyada Fransa'nın sembolü halini almıştır. İsmini, inşa ettiren Fransız inşaat mühendisi Gustave Eiffel'den alır.[1] En büyük turizm cazibelerinden biri olan Eyfel Kulesi, yılda 6 milyon turist çeker. 2002 yılında toplam ziyaretçi sayısı 200 milyona ulaşmıştır."]]
|
21 |
+
ner_example = [["Benim adım Turna."]]
|
22 |
+
t2t_example = [["Paraphrase: Bu üründen çok memnun kaldım."]]
|
23 |
+
nli_example = [["Bunu çok beğendim. Bunu çok sevdim."]]
|
24 |
+
|
25 |
+
t2t_gen = gr.load("boun-tabi-LMG/TURNA", examples =t2t_example, title="Text-to-Text Generation", description="Please enter an instruction with a prefix to generate.")
|
26 |
+
summarization = gr.load("boun-tabi-LMG/turna_summarization_mlsum",examples =long_text, title="Summarization", description="TURNA fine-tuned on MLSUM. Enter a text to summarize below.")
|
27 |
+
news_sum = gr.load("boun-tabi-LMG/turna_summarization_tr_news",examples =long_text, title="News Summarization", description="TURNA fine-tuned on News summarization. Enter a news to summarize.")
|
28 |
+
paraphrase = gr.load("boun-tabi-LMG/turna_paraphrasing_tatoeba", examples =long_text,title="Paraphrasing")
|
29 |
+
paraphrasing_sub = gr.load("boun-tabi-LMG/turna_paraphrasing_opensubtitles",examples =long_text, title="Paraphrasing on Subtitles")
|
30 |
+
|
31 |
+
ttc = gr.load("boun-tabi-LMG/turna_classification_ttc4900", examples =long_text, title="Text Categorization")
|
32 |
+
product_reviews = gr.load("boun-tabi-LMG/turna_classification_tr_product_reviews", examples=sentiment_example, title="Product Reviews Categorization")
|
33 |
+
title_gen = gr.load("boun-tabi-LMG/turna_title_generation_mlsum", examples =long_text, title="Title Generation", description="Enter a text to generate title to.")
|
34 |
+
sentiment = gr.load("boun-tabi-LMG/turna_classification_17bintweet_sentiment",examples=sentiment_example, title="Sentiment Analysis", description="Enter a text to generate title to.")
|
35 |
+
|
36 |
+
pos = gr.load("boun-tabi-LMG/turna_pos_imst", title="Part of Speech Tagging", examples=ner_example,description="Enter a text to generate title to.")
|
37 |
+
nli = gr.load("boun-tabi-LMG/turna_nli_nli_tr", title="NLI",examples=nli_example, description="Enter two texts to infer entailment.")
|
38 |
+
pos_boun = gr.load("boun-tabi-LMG/turna_pos_boun", examples = ner_example, title="Part of Speech Tagging", description="Enter a text to tag parts of speech (POS).")
|
39 |
+
stsb = gr.load("boun-tabi-LMG/turna_semantic_similarity_stsb_tr", examples=nli_example, title="Semantic Similarity", description="Enter two texts in the input to assess semantic similarity.")
|
40 |
+
ner = gr.load("boun-tabi-LMG/turna_ner_milliyet", title="NER WikiANN", examples=ner_example, description="Enter a text for NER.")
|
41 |
+
ner_wikiann = gr.load("boun-tabi-LMG/turna_ner_wikiann", title="NER",examples=ner_example, description="Enter a text for NER.")
|
42 |
+
|
43 |
+
|
44 |
+
interface_list = ["t2t_gen","summarization", "news_sum", "paraphrase", "paraphrasing_sub", "ttc",
|
45 |
+
"product_reviews", "title_gen", "sentiment", "pos", "nli", "pos_boun",
|
46 |
+
"stsb", "ner", "ner_wikiann"]
|
47 |
+
|
48 |
+
with gr.Blocks() as demo:
|
49 |
+
gr.Markdown("# TURNA 🐦")
|
50 |
+
gr.Markdown(DESCRIPTION)
|
51 |
+
gradio.TabbedInterface(interface_list)
|
52 |
+
|
53 |
+
demo.launch()
|