| # Example usage of id_nergrit_indonesian_spacy | |
| import spacy | |
| # Load the model | |
| nlp = spacy.load("id_nergrit_indonesian_spacy") | |
| # Example texts | |
| texts = [ | |
| "Presiden Joko Widodo mengunjungi Jakarta pada tanggal 17 Agustus 2023.", | |
| "Bank Indonesia mengumumkan suku bunga sebesar 5.75 persen.", | |
| "Menteri Keuangan Sri Mulyani menyatakan APBN 2023 mencapai Rp 3000 triliun.", | |
| "Universitas Indonesia terletak di Depok, Jawa Barat.", | |
| ] | |
| # Process texts | |
| for text in texts: | |
| doc = nlp(text) | |
| print(f"\nText: {text}") | |
| print("Entities:") | |
| for ent in doc.ents: | |
| print(f" - {ent.text:30} -> {ent.label_}") | |