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/prachuryyaIITG/SampurNER_Bengali_MuRIL/
(not committed; download via https://hf-mirror.com/prachuryyaIITG/SampurNER_Bengali_MuRIL).torch + torch_npu (CANN), transformers, safetensors, fastapi, uvicorn, python-multipartpython 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}]}}.
uvicorn inference:app --host 0.0.0.0 --port 8000curl -s -F "file=@test_sentence.txt" http://127.0.0.1:8000/predictReturns the same JSON. POST /predict, multipart field name file.
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.