LLMProject / README.md
Pratham06's picture
Update README.md
dc29568 verified

A newer version of the Gradio SDK is available: 6.1.0

Upgrade
metadata
title: Multipurpose NLP Web App
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 all‑in‑one Translation + Summarization app:

Deploy in 3 minutes

  1. Create a Space: https://huggingface.co/new-space
    • Space SDK: Gradio
    • Hardware: CPU Basic is fine (bigger models may load slower).
  2. Upload these three files: app.py, requirements.txt, languages.json.
  3. Commit → The Space will build and start. No secrets needed.

Features

  • Two tabs: Translate and Summarize
  • Dropdowns for source/target languages (common ~45 languages pre‑mapped)
  • Adjustable generation lengths
  • Example inputs to test quickly

Notes

  • M2M100 requires setting src_lang and a forced_bos_token_id for the target language; handled for you in app.py.
  • Summarization is English‑focused for speed. If you need multilingual summaries, swap the model in app.py for an mT5‑based XLSum model (e.g., csebuetnlp/mT5_multilingual_XLSum) and add sentencepiece (already included).

Optional: Multilingual Summarization

Replace the summarizer lines in app.py with:

SUM_MODEL_NAME = "csebuetnlp/mT5_multilingual_XLSum"
summarizer = pipeline("summarization", model=SUM_MODEL_NAME, tokenizer=SUM_MODEL_NAME)

Built for assignments and demos. Enjoy!