Spaces:
Runtime error
Runtime error
Commit
·
336452b
1
Parent(s):
bae9c12
Update batched_main_NER.py
Browse files- batched_main_NER.py +2 -1
batched_main_NER.py
CHANGED
|
@@ -26,7 +26,8 @@ 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 |
|
| 33 |
#noun_tags = ['NFP','JJ','NN','FW','NNS','NNPS','JJS','JJR','NNP','POS','CD']
|