From 037c3bfaa5cfced4b76a59584b2e9821049ff05a Mon Sep 17 00:00:00 2001 From: Jakub Maruniak Date: Mon, 9 Nov 2020 21:51:51 +0000 Subject: [PATCH] =?UTF-8?q?Nahr=C3=A1t=20soubory=20do=20=E2=80=9Epages/stu?= =?UTF-8?q?dents/2016/jakub=5Fmaruniak/dp2021/annotation=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2016/jakub_maruniak/dp2021/annotation/count.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 pages/students/2016/jakub_maruniak/dp2021/annotation/count.py 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