Downloads · 30 days
26
11% of all-time downloads
Ysfii-Dev/indobert-ner-citizen-reports
indobert-ner-citizen-reports is a token classification model from Ysfii-Dev. Use it when you need labels on individual words, such as names. It is set up for transformers. The card lists the license as mit.
This project aims to build a Named Entity Recognition (NER) system to automatically extract key information from citizen reports related to public infrastructure issues in Indonesia. The trained NER model is designed…
Downloads · 30 days
26
11% of all-time downloads
All-time downloads
245
Public
Parameters
110M
880 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors440 MB · 100%
From the Hugging Face model README
This project aims to build a Named Entity Recognition (NER) system to automatically extract key information from citizen reports related to public infrastructure issues in Indonesia.
The trained NER model is designed to be integrated into a web-based reporting application, enabling automatic classification of user reports into multiple entity categories.
LOC → LocationINFRA → Infrastructure typePROB → Problem typeTIME → TimeDESC → Additional descriptionSEV → Severity leveltaufiqdp/indonesian-sentiment)taufiqdp/indonesian-sentiment)from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline
# Model repo on Hugging Face
model_name = "Ysfii-Dev/indobert-ner-citizen-reports"
# Load tokenizer and model
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForTokenClassification.from_pretrained(model_name)
# Create NER pipeline (using aggregation to merge tokens into entities)
ner_pipeline = pipeline(
task="ner",
model=model,
tokenizer=tokenizer,
aggregation_strategy="simple" # "simple" merges tokens into full entities
)
# Example input text
text = "Lampu jalan di Jl. Sudirman mati sejak malam kemarin."
# Run prediction
entities = ner_pipeline(text)
# Print results
for entity in entities:
print(entity)
Secara default, pipeline ner di Hugging Face akan mengembalikan hasil prediksi per-token. Jadi kalau teksmu panjang, misalnya:
"Lampu jalan di Jl. Sudirman mati sejak malam kemarin."
tanpa aggregation_strategy, hasilnya bisa seperti ini (per kata/token):
[
{'entity': 'B-INFRA', 'word': 'Lampu', 'score': 0.98},
{'entity': 'I-INFRA', 'word': 'jalan', 'score': 0.97},
{'entity': 'B-LOC', 'word': 'Jl.', 'score': 0.95},
{'entity': 'I-LOC', 'word': 'Sudirman', 'score': 0.96},
{'entity': 'B-PROB', 'word': 'mati', 'score': 0.92},
{'entity': 'B-TIME', 'word': 'sejak', 'score': 0.91},
{'entity': 'I-TIME', 'word': 'malam', 'score': 0.90},
{'entity': 'I-TIME', 'word': 'kemarin', 'score': 0.89},
]
Jadi potongan entitas masih terpisah-pisah per kata.
Nah, kalau kamu tambahkan parameter:
pipeline(..., aggregation_strategy="simple")
Maka hasilnya akan digabung jadi satu entitas utuh, misalnya:
[
{'entity_group': 'INFRA', 'word': 'Lampu jalan', 'score': 0.975},
{'entity_group': 'LOC', 'word': 'Jl. Sudirman', 'score': 0.955},
{'entity_group': 'PROB', 'word': 'mati', 'score': 0.920},
{'entity_group': 'TIME', 'word': 'sejak malam kemarin', 'score': 0.900},
]
This model is released under the MIT License.