Streamlit app for intent classification and slot filling across 51 languages, built with XLM-RoBERTa and trained on the MASSIVE dataset.
- Intent classification: 60+ intents (alarm_set, play_music, weather_query, etc.)
- Slot filling: 40+ slot types (time, place_name, song_name, etc.)
- 51 languages via zero-shot cross-lingual transfer
- Streamlit UI: Enter an utterance and see intent + extracted slots
-
Clone and enter the repo
git clone https://github.com/AdithyaReddyGeeda/Intent-classification-and-slot-filling.git cd Intent-classification-and-slot-filling -
Create a virtual environment and install dependencies
python -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate pip install -r requirements.txt
-
Add the trained models (not in the repo due to size):
- Intent model: Place your saved checkpoint in
results_intent_classification/checkpoint-71965/(orcheckpoint-57572/). The app expects a Hugging FaceAutoModelForSequenceClassificationcheckpoint (e.g. XLM-RoBERTa) withconfig.jsoncontainingid2label. - Slot model: Place your saved model in
slot_filling_model_crf/final_model/with tokenizer files andid2label.json.
- Intent model: Place your saved checkpoint in
-
Run the app
streamlit run app.py
Open http://localhost:8501.
-
Push this repo to GitHub (code only; models are in
.gitignore). -
Host the models (required for the app to run):
- Option A: Upload the model folders to Hugging Face Hub (as a private or public model repo), then in
app.pyreplace the local paths withfrom_pretrained("your-username/your-intent-model")andfrom_pretrained("your-username/your-slot-model"). - Option B: Use Streamlit’s “Secrets” to point to a URL or path where the app can download the model files at startup (you’d add a small download step in
app.py).
- Option A: Upload the model folders to Hugging Face Hub (as a private or public model repo), then in
-
Deploy:
- Go to share.streamlit.io, sign in with GitHub, and select this repo.
- Set Main file path to
app.py. - Add any secrets (e.g. HF token) if you use private models.
- Deploy. The first run may be slow while dependencies and models load.
app.py— Streamlit UI and inference (intent + slot filling)requirements.txt— Python dependenciesresults_intent_classification/— Intent model checkpoints (add locally; gitignored)slot_filling_model_crf/final_model/— Slot filling model (add locally; gitignored)*.ipynb— Notebooks for training and evaluation
- Python 3.8+
- PyTorch, Transformers, Streamlit (see
requirements.txt)