from transformers import pipeline import requests import json import gradio as gr js = """ async () => { function showCard(event, title, content) { document.getElementById('hovercard').style.visibility = 'visible'; document.getElementById('card_title').innerText = title; document.getElementById('card_content').innerText = content; } function hideCard(event) { document.getElementById('hovercard').style.visibility = 'hidden'; } globalThis.showCard = showCard; globalThis.hideCard = hideCard; } """ pipe = pipeline("translation", "guymorlan/TokenizerLabeller") r = requests.get("https://huggingface.co/guymorlan/TokenizerLabeller/raw/main/playaling_words.json") data = json.loads(r.text) def predict(input): out = pipe(input)[0]['translation_text'] raw = out out = [x.strip() for x in out.split(" + ")] output = f"""