Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| def segment(text): | |
| return " / ".join(list(text)) | |
| demo = gr.Interface( | |
| fn=segment, | |
| inputs=gr.Textbox(lines=2, placeholder="輸入一段中文..."), | |
| outputs="text", | |
| title="中文斷詞模擬器", | |
| description="這是一個簡易的中文斷詞工具,未來將整合 CKIP 模型。" | |
| # 移除 api_name,使用 Gradio 預設 endpoint | |
| ) | |
| demo.launch() |