Spaces:
Sleeping
Sleeping
| title: "Multipurpose NLP: Translation and Summarization" | |
| emoji: "🧠" | |
| colorFrom: "blue" | |
| colorTo: "green" | |
| sdk: "gradio" | |
| sdk_version: "4.44.0" | |
| app_file: "app.py" | |
| pinned: false | |
| # Multipurpose NLP Web App (Gradio on Hugging Face Spaces) | |
| An interactive Gradio app offering: | |
| - Multi-language text translation (M2M100: 100+ languages) | |
| - Abstractive summarization in English (DistilBART CNN) | |
| ## Demo | |
| Once deployed, your Space will be live at: | |
| https://huggingface.co/spaces/<your-hf-username>/<your-space-name> | |
| ## Features | |
| - Translation: Choose source and target languages from 60+ common languages (backed by M2M100’s 100+ support). | |
| - Summarization: Abstractive summaries of long text (best for English news/articles). | |
| ## Models | |
| - Translation: `facebook/m2m100_418M` | |
| - Summarization: `sshleifer/distilbart-cnn-12-6` | |
| ## Quick Start (Hugging Face Spaces) | |
| 1. Log in at https://huggingface.co | |
| 2. Create a new Space: | |
| - Space SDK: Gradio | |
| - Template: Blank (Gradio) | |
| - Choose a name (e.g., `nlp-translate-summarize`) | |
| - Hardware: CPU Basic (works; translation may be slower for long inputs) | |
| 3. Upload these files: | |
| - `app.py` | |
| - `requirements.txt` | |
| - `README.md` | |
| 4. Wait for the build to finish. The Space will auto-start. | |
| ## Local Development (Optional) | |
| ```bash | |
| python -m venv .venv && source .venv/bin/activate # or .venv\Scripts\activate on Windows | |
| pip install -r requirements.txt | |
| python app.py | |
| # Visit http://127.0.0.1:7860 | |
| ``` | |
| ## Notes & Limitations | |
| - Translation: For very long inputs, the model truncates to fit context (about ~1k tokens). Consider shorter paragraphs for best quality. | |
| - Summarization: The chosen model is optimized for English. Non-English texts may yield weaker results. | |
| - CPU-only inference is supported but slower; upgrading hardware on Spaces can improve latency. | |
| ## License | |
| MIT (adjust as needed) |