diff --git a/pages/students/2016/jakub_maruniak/dp2021/annotation/count.py b/pages/students/2016/jakub_maruniak/dp2021/annotation/count.py new file mode 100644 index 00000000..c4f7fe0d --- /dev/null +++ b/pages/students/2016/jakub_maruniak/dp2021/annotation/count.py @@ -0,0 +1,14 @@ +# load data +filename = 'ner/annotations.jsonl' +file = open(filename, 'rt', encoding='utf-8') +text = file.read() + +# count entity PER +countPER = text.count('PER') +countLOC = text.count('LOC') +countORG = text.count('ORG') +countMISC = text.count('MISC') +print('Počet anotovaných entít typu PER:', countPER,'\n', + 'Počet anotovaných entít typu LOC:', countLOC,'\n', + 'Počet anotovaných entít typu ORG:', countORG,'\n', + 'Počet anotovaných entít typu MISC:', countMISC,'\n') \ No newline at end of file