Spaces:
Runtime error
Runtime error
ajitrajasekharan
commited on
Commit
•
61f1a9c
1
Parent(s):
7b42b56
Updates
Browse files- batched_main_NER.py +6 -1
- ensemble_config.json +4 -1
- entity_types_consolidated.txt +5 -2
batched_main_NER.py
CHANGED
@@ -26,7 +26,12 @@ SPECIFIC_TAG=":__entity__"
|
|
26 |
|
27 |
def softmax(x):
|
28 |
"""Compute softmax values for each sets of scores in x."""
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
|
32 |
#noun_tags = ['NFP','JJ','NN','FW','NNS','NNPS','JJS','JJR','NNP','POS','CD']
|
|
|
26 |
|
27 |
def softmax(x):
|
28 |
"""Compute softmax values for each sets of scores in x."""
|
29 |
+
e_x = np.exp(x - np.max(x))
|
30 |
+
return e_x / e_x.sum(axis=0) # only difference
|
31 |
+
|
32 |
+
#def softmax(x):
|
33 |
+
# """Compute softmax values for each sets of scores in x."""
|
34 |
+
# return np.exp(x) / np.sum(np.exp(x), axis=0)
|
35 |
|
36 |
|
37 |
#noun_tags = ['NFP','JJ','NN','FW','NNS','NNPS','JJS','JJR','NNP','POS','CD']
|
ensemble_config.json
CHANGED
@@ -17,7 +17,10 @@
|
|
17 |
"LANGUAGE",
|
18 |
"GRAMMAR_CONSTRUCT",
|
19 |
"LOCATION",
|
20 |
-
"SOCIAL_CIRCUMSTANCES"
|
|
|
|
|
|
|
21 |
],
|
22 |
|
23 |
"common_entities_arr":
|
|
|
17 |
"LANGUAGE",
|
18 |
"GRAMMAR_CONSTRUCT",
|
19 |
"LOCATION",
|
20 |
+
"SOCIAL_CIRCUMSTANCES",
|
21 |
+
"LEGAL",
|
22 |
+
"POLITICS",
|
23 |
+
"SOFTWARE"
|
24 |
],
|
25 |
|
26 |
"common_entities_arr":
|
entity_types_consolidated.txt
CHANGED
@@ -4,7 +4,7 @@ GENE PROTEIN/ENZYME/VIRAL_PROTEIN/RECEPTOR/PROTEIN_FAMILY/MOUSE_PROTEIN_FAMILY/M
|
|
4 |
BODY_PART_OR_ORGAN_COMPONENT BODY_LOCATION_OR_REGION/BODY_SUBSTANCE/CELL/CELL_LINE/CELL_COMPONENT/BIO_MOLECULE/METABOLITE/HORMONE/BODY_ADJECTIVE
|
5 |
ORGANISM_FUNCTION ORGAN_OR_TISSUE_FUNCTION/PHYSIOLOGIC_FUNCTION/CELL_FUNCTION/FUNCTION_ADJECTIVE
|
6 |
BIO SPECIES/BACTERIUM/VIRUS/BIO_ADJECTIVE
|
7 |
-
OBJECT PRODUCT/MEDICAL_DEVICE/DEVICE/
|
8 |
MEASURE NUMBER/TIME/SEQUENCE/MEASURE_ADJECTIVE
|
9 |
PERSON PERSON_ADJECTIVE
|
10 |
ORGANIZATION UNIV/GOV/EDU/ORGANIZATION_ADJECTIVE
|
@@ -14,5 +14,8 @@ SOCIAL_CIRCUMSTANCES RELIGION/SOCIAL_CIRCUMSTANCES_ADJECTIVE
|
|
14 |
COLOR COLOR_ADJECTIVE
|
15 |
LANGUAGE LANGUAGE_ADJECTIVE
|
16 |
GRAMMAR_CONSTRUCT
|
17 |
-
|
|
|
|
|
|
|
18 |
UNTAGGED_ENTITY
|
|
|
4 |
BODY_PART_OR_ORGAN_COMPONENT BODY_LOCATION_OR_REGION/BODY_SUBSTANCE/CELL/CELL_LINE/CELL_COMPONENT/BIO_MOLECULE/METABOLITE/HORMONE/BODY_ADJECTIVE
|
5 |
ORGANISM_FUNCTION ORGAN_OR_TISSUE_FUNCTION/PHYSIOLOGIC_FUNCTION/CELL_FUNCTION/FUNCTION_ADJECTIVE
|
6 |
BIO SPECIES/BACTERIUM/VIRUS/BIO_ADJECTIVE
|
7 |
+
OBJECT PRODUCT/MEDICAL_DEVICE/DEVICE/PRODUCT_ADJECTIVE
|
8 |
MEASURE NUMBER/TIME/SEQUENCE/MEASURE_ADJECTIVE
|
9 |
PERSON PERSON_ADJECTIVE
|
10 |
ORGANIZATION UNIV/GOV/EDU/ORGANIZATION_ADJECTIVE
|
|
|
14 |
COLOR COLOR_ADJECTIVE
|
15 |
LANGUAGE LANGUAGE_ADJECTIVE
|
16 |
GRAMMAR_CONSTRUCT
|
17 |
+
LEGAL LEGAL_ADJECTIVE
|
18 |
+
POLITICS POLITICS_ADJECTIVE
|
19 |
+
SOFTWARE SOFTWARE_ADJECTIVE
|
20 |
+
OTHER
|
21 |
UNTAGGED_ENTITY
|