Menambahkan kode PoS Tagging Bahasa Indonesia
This commit is contained in:
commit
90a53d20ef
8
pos_tagging.py
Normal file
8
pos_tagging.py
Normal file
@ -0,0 +1,8 @@
|
||||
|
||||
import stanza
|
||||
stanza.download('id')
|
||||
nlp = stanza.Pipeline('id', processors='tokenize,pos')
|
||||
doc = nlp("Budi sedang membaca buku sejarah di perpustakaan nasional.")
|
||||
for sentence in doc.sentences:
|
||||
for word in sentence.words:
|
||||
print(f"{word.text:<15} | {word.upos:<15}")
|
||||
Loading…
x
Reference in New Issue
Block a user