From 40ed01c744a918edc23633f5e5fda308a2b16d87 Mon Sep 17 00:00:00 2001 From: Jakub Maruniak Date: Sun, 21 Mar 2021 20:12:06 +0000 Subject: [PATCH] =?UTF-8?q?Smazat=20=E2=80=9Epages/students/2016/jakub=5Fm?= =?UTF-8?q?aruniak/dp2021/annotation/count.py=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jakub_maruniak/dp2021/annotation/count.py | 60 ------------------- 1 file changed, 60 deletions(-) delete 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 deleted file mode 100644 index 0178df39d9..0000000000 --- a/pages/students/2016/jakub_maruniak/dp2021/annotation/count.py +++ /dev/null @@ -1,60 +0,0 @@ -# load data - -filename = 'ner/skner/skner.jsonl' -file = open(filename, 'rt', encoding='utf-8') -text = file.read() - -# count articles -countAccept = text.count('accept') -countReject = text.count('reject') -countSkip = text.count('ignore') -countSpans = text.count('tokens') -# count entities -countPER = text.count('PER') -countLOC = text.count('LOC') -countORG = text.count('ORG') -countMISC = text.count('MISC') - -underline = '\033[04m' -reset = '\033[0m' -red = '\033[31m' -green='\033[32m' -gray='\033[37m' - -# table v1 -#from lib import TableIt -#table1 = [ -# ['Prijatých', countAccept], -# ['Zamietnutých', countReject], -# ['Preskočených', countSkip], -# ['------------', '------------'], -# ['Spolu', countSpans] -#] -# -#table = [ -# ['Entita', 'Počet'], -# ['PER', countPER], -# ['LOC', countLOC], -# ['ORG', countORG], -# ['MISC', countMISC] -#] -#print('\nPočet anotovaných článkov:') -#TableIt.printTable(table1) -#print('\nPočet jednotlivých entít:') -#TableIt.printTable(table, useFieldNames=True, color=(26, 156, 171)) - -# table v2 -print(underline + '\nPočet anotovaných článkov:' + reset) -print(green + "%-15s %-20s" %("Prijatých", countAccept) + reset) -print(red + "%-15s %-15s" %("Zamietnutých", countReject) + reset) -print(gray + "%-15s %-15s" %("Preskočených", countSkip) + reset) -print("%-15s" %("---------------------")) -print("%-15s %-15s" %("Spolu", countSpans)) - -print(underline + '\nPočet jednotlivých entít:' + reset) -print("%-10s %-10s" %("Entita:", "Počet:")) -print("%-10s" %("----------------")) -print("%-10s %-10s" %("PER", countPER)) -print("%-10s %-10s" %("LOC", countLOC)) -print("%-10s %-10s" %("ORG", countORG)) -print("%-10s %-10s" %("MISC", countMISC)) \ No newline at end of file