-
Notifications
You must be signed in to change notification settings - Fork 0
/
analysis.py
64 lines (46 loc) · 1.53 KB
/
analysis.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import numpy as np
print("TRUE POSITIVES -----------------")
f1 = open("/home/asmita/CliNER/truepositives_myner.txt")
f2 = open("/home/asmita/CliNER/truepositives_cliner")
f1 = f1.read().split()
f2 = f2.read().split()
print("MyNER:", len(f1))
print("CliNER:", len(f2))
f3 = set(f1)&set(f2)
f11 = [item for item in f1 if item not in f3]
f22 = np.setdiff1d(f2,f3)
f22 = [item for item in f2 if item not in f3]
print(f3)
print("Common:", len(f3))
print("Extra in myNER: ", len(f11), f11)
print("Extra in CliNER: ", len(f22), f22)
print("\nFALSE POSITIVES -----------------")
f1 = open("/home/asmita/CliNER/falsenpositives_myner")
f2 = open("/home/asmita/CliNER/falsenpositives_cliner")
f1 = f1.read().split()
f2 = f2.read().split()
print("MyNER:", len(f1))
print("CliNER:", len(f2))
f3 = set(f1)&set(f2)
f11 = [item for item in f1 if item not in f3]
f22 = np.setdiff1d(f2,f3)
f22 = [item for item in f2 if item not in f3]
print(f3)
print("Common:", len(f3))
print("Extra in myNER: ", len(f11), f11)
print("Extra in CliNER: ", len(f22), f22)
print("\nFALSE NEGATIVES -----------------")
f1 = open("/home/asmita/CliNER/falsenegatives_myner")
f2 = open("/home/asmita/CliNER/falsenegatives_cliner")
f1 = f1.read().split()
f2 = f2.read().split()
print("MyNER:", len(f1))
print("CliNER:", len(f2))
f3 = set(f1)&set(f2)
f11 = [item for item in f1 if item not in f3]
f22 = np.setdiff1d(f2,f3)
f22 = [item for item in f2 if item not in f3]
print(f3)
print("Common:", len(f3))
print("Extra in myNER: ", len(f11), f11)
print("Extra in CliNER: ", len(f22), f22)