Spaces:
Paused
Paused
import gradio as gr | |
import spaces | |
import transformers | |
import torch | |
DESCRIPTION=""" | |
This is the space for the Language Modeling Group at TABILAB in Computer Engineering of Bogazici University. | |
We released the first version of our Turkish language model TURNA. | |
This model is based on an encoder-decoder T5 architecture with 1.1B parameters. | |
For more details, please refer to our paper. | |
""" | |
sentiment_example = [["Bu üründen çok memnun kaldım."]] | |
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."]] | |
ner_example = [["Benim adım Turna."]] | |
t2t_example = [["Paraphrase: Bu üründen çok memnun kaldım."]] | |
nli_example = [["Bunu çok beğendim. Bunu çok sevdim."]] | |
t2t_gen = gr.load("huggingface/boun-tabi-LMG/TURNA", examples =t2t_example, title="Text-to-Text Generation", description="Please enter an instruction with a prefix to generate.") | |
summarization = gr.load("huggingface/boun-tabi-LMG/turna_summarization_mlsum",examples =long_text, title="Summarization", description="TURNA fine-tuned on MLSUM. Enter a text to summarize below.") | |
news_sum = gr.load("huggingface/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.") | |
paraphrase = gr.load("huggingface/boun-tabi-LMG/turna_paraphrasing_tatoeba", examples =long_text,title="Paraphrasing") | |
paraphrasing_sub = gr.load("huggingface/boun-tabi-LMG/turna_paraphrasing_opensubtitles",examples =long_text, title="Paraphrasing on Subtitles") | |
ttc = gr.load("huggingface/boun-tabi-LMG/turna_classification_ttc4900", examples =long_text, title="Text Categorization") | |
product_reviews = gr.load("huggingface/boun-tabi-LMG/turna_classification_tr_product_reviews", examples=sentiment_example, title="Product Reviews Categorization") | |
title_gen = gr.load("huggingface/boun-tabi-LMG/turna_title_generation_mlsum", examples =long_text, title="Title Generation", description="Enter a text to generate title to.") | |
sentiment = gr.load("huggingface/boun-tabi-LMG/turna_classification_17bintweet_sentiment",examples=sentiment_example, title="Sentiment Analysis", description="Enter a text to generate title to.") | |
pos = gr.load("huggingface/boun-tabi-LMG/turna_pos_imst", title="Part of Speech Tagging", examples=ner_example,description="Enter a text to generate title to.") | |
nli = gr.load("huggingface/boun-tabi-LMG/turna_nli_nli_tr", title="NLI",examples=nli_example, description="Enter two texts to infer entailment.") | |
pos_boun = gr.load("huggingface/boun-tabi-LMG/turna_pos_boun", examples = ner_example, title="Part of Speech Tagging", description="Enter a text to tag parts of speech (POS).") | |
stsb = gr.load("huggingface/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.") | |
ner = gr.load("huggingface/boun-tabi-LMG/turna_ner_milliyet", title="NER WikiANN", examples=ner_example, description="Enter a text for NER.") | |
ner_wikiann = gr.load("huggingface/boun-tabi-LMG/turna_ner_wikiann", title="NER",examples=ner_example, description="Enter a text for NER.") | |
interface_list = ["t2t_gen","summarization", "news_sum", "paraphrase", "paraphrasing_sub", "ttc", | |
"product_reviews", "title_gen", "sentiment", "pos", "nli", "pos_boun", | |
"stsb", "ner", "ner_wikiann"] | |
with gr.Blocks() as demo: | |
gr.Markdown("# TURNA 🐦") | |
gr.Markdown(DESCRIPTION) | |
gradio.TabbedInterface(interface_list) | |
demo.launch() |