File size: 723 Bytes
bb21314
f4d6740
cca1792
bb21314
cca1792
 
c500598
 
bb21314
2adfb1c
 
 
 
 
 
 
c500598
2adfb1c
 
 
08e357c
 
2adfb1c
 
98d296a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import gradio as gr
import bap_preprocessing
import json

def tokenize(Sentence):
    response = bap_preprocessing.tokenize(Sentence)
    result = json.dumps(response)
    return result

with gr.Blocks() as demo:
    gr.Markdown(
        """
        # Tokenizer
        """
    )
    input_s = gr.Textbox(placeholder="Sentence to be tokenized.", label="Sentence")
    output = gr.JSON(label="Tokens")
    submit = gr.Button(text="Tokenize")
    submit.click(fn=tokenize, inputs=input_s, outputs=output)
    examples = gr.Examples([
        "Merhaba, ben okula gidiyorum.",
        "Rodin, Türkiye’de Düşünen Adam heykeliyle tanınır. Bir yandan da tartışmalı bir sanatçı."
    ], inputs=input_s)

demo.launch()