Spaces:
Sleeping
Sleeping
Upload 4 files
Browse filesFiles changed (4)
- README.md+45-12
- app.pyAdded+19
- explain_utils.pyAdded+16
- requirements.txt+3-3
1223456789456789111011121413141615161819171819202122232425262728293031323334353637383940414243444546474849505152---title: NASASimplifiertitle: NASA Report Simplifieremoji: 🚀colorFrom: redcolorTo: redsdk: dockerapp_port: 8501tags:- streamlitcolorFrom: indigocolorTo: bluesdk: streamlitsdk_version: 1.32.0app_file: app.pypinned: falseshort_description: Streamlit template spacelicense: mit---
# Welcome to Streamlit!# NASA Report Simplifier
Edit `/src/streamlit_app.py` to customize this app to your heart's desire. :heart:Este Space convierte textos científicos complejos (como los de la NASA) en explicaciones claras y fáciles de entender en español.
If you have any questions, checkout our [documentation](https://docs.streamlit.io) and [communityforums](https://discuss.streamlit.io).## Demo
Ingresa un texto técnico (en inglés o español), y la aplicación:- Traducirá al español si es necesario.- Explicará el contenido en lenguaje sencillo (nivel secundario o básico).
## Cómo funciona
Este Space usa dos modelos de Hugging Face:
1. **Traducción (Inglés → Español):** - [`Helsinki-NLP/opus-mt-en-es`](https://huggingface.co/Helsinki-NLP/opus-mt-en-es)
2. **Simplificación del lenguaje:** - [`google/flan-t5-large`](https://huggingface.co/google/flan-t5-large)
## Tecnologías utilizadas
- [Streamlit](https://streamlit.io/)- [Transformers](https://huggingface.co/docs/transformers)- Modelos de Hugging Face
## Cómo usar localmente
```bashgit clone https://huggingface.co/spaces/<tu-usuario>/nasa-simplifiercd nasa-simplifierpip install -r requirements.txtstreamlit run app.py```
## Créditos
Desarrollado por [VicGerardoPR](https://huggingface.co/VicGerardoPR)
Inspirado en los modelos abiertos de la NASA y la misión de hacer accesible el conocimiento científico.12345678910111213141516171819import streamlit as stfrom explain_utils import translate_text, simplify_text
st.set_page_config(page_title="NASA Report Simplifier", layout="wide")
st.title("Simplificador de Reportes Científicos de NASA")st.markdown("Sube un texto técnico o artículo y conviértelo a lenguaje sencillo.")
input_text = st.text_area("Pega el contenido científico aquí:", height=300)
if st.button("Simplificar"): if input_text.strip(): with st.spinner("Procesando..."): translated = translate_text(input_text) simplified = simplify_text(translated) st.subheader("Texto simplificado:") st.write(simplified) else: st.warning("Por favor, ingresa algún texto.")12345678910111213141516from transformers import pipeline
# Traducción inglés a españoltranslator = pipeline("translation_en_to_es", model="Helsinki-NLP/opus-mt-en-es")
# Simplificación con modelo tipo LLMsimplifier = 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']123123altairpandasstreamlitstreamlittransformerstorchREADME.md+45-12
app.pyAdded+19
explain_utils.pyAdded+16
requirements.txt+3-3