Spaces:
Sleeping
Sleeping
| from transformers import pipeline | |
| # Traducci贸n ingl茅s a espa帽ol | |
| translator = pipeline("translation_en_to_es", model="Helsinki-NLP/opus-mt-en-es") | |
| # Simplificaci贸n con modelo tipo LLM | |
| simplifier = pipeline("text2text-generation", model="google/flan-t5-large") | |
| def translate_text(text): | |
| result = translator(text, max_length=512) | |
| return result[0]['translation_text'] | |
| def simplify_text(text): | |
| prompt = f"Explica este texto en lenguaje sencillo para estudiantes de secundaria:\n\n{text}" | |
| result = simplifier(prompt, max_length=512) | |
| return result[0]['generated_text'] | |