ALISY/sampurner-bengali-muril-npu
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

SampurNER Bengali MuRIL (Ascend NPU)

Fine-grained Named Entity Recognition (NER) for Bengali, using google/muril-large-cased fine-tuned on the SampurNER dataset (Few-NERD fine-grained tagset, 133 labels).

This repository is the Ascend NPU (torch-npu) adaptation of prachuryyaIITG/SampurNER_Bengali_MuRIL by luna_worker. All CUDA code is removed; the model and input tensors run on npu:0 (falls back to npu:1), float32 inference.

  • Model weights: cached locally under model_weights/prachuryyaIITG/SampurNER_Bengali_MuRIL/ (not committed; download via https://hf-mirror.com/prachuryyaIITG/SampurNER_Bengali_MuRIL).
  • F1 (paper): 68.26 · Precision 66.54 · Recall 70.08

Requirements (NPU runtime)

torch + torch_npu (CANN), transformers, safetensors, fastapi, uvicorn, python-multipart

CLI inference

python inference.py --img test_sentence.txt

--img takes a UTF-8 text file containing a Bengali sentence. Prints JSON: {"model": ..., "result": {"tokens": [], "predicted_labels": [], "entities": [{text,label,start,end}]}}.

FastAPI inference

uvicorn inference:app --host 0.0.0.0 --port 8000
curl -s -F "file=@test_sentence.txt" http://127.0.0.1:8000/predict

Returns the same JSON. POST /predict, multipart field name file.

Example

Input (test_sentence.txt):

নরেন্দ্র মোদী ২০২৩ সালে দিল্লিতে ভারতীয় জনতা পার্টির এক সভায় ভাষণ দেন।

The fine-grained tags follow the Few-NERD taxonomy, e.g. B-person-politician, B-location-GPE, B-organization-politicalparty, etc.

Original model

  • Hugging Face: https://huggingface.co/prachuryyaIITG/SampurNER_Bengali_MuRIL
  • Paper: SampurNER, AAAI-2026 (https://ojs.aaai.org/index.php/AAAI/article/view/40405)
  • License: MIT