Skip to content

Commit 2548c24

Browse files
committed
Minor modifications
1 parent d7b6ae5 commit 2548c24

File tree

6 files changed

+8
-3
lines changed

6 files changed

+8
-3
lines changed

supar/cmds/biaffine_dependency.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ def main():
1313
parser.add_argument('--partial', action='store_true', help='whether partial annotation is included')
1414
parser.set_defaults(Parser=BiaffineDependencyParser)
1515
subparsers = parser.add_subparsers(title='Commands', dest='mode')
16+
# train
1617
subparser = subparsers.add_parser('train', help='Train a parser.')
1718
subparser.add_argument('--feat', '-f', choices=['tag', 'char', 'bert'], help='choices of additional features')
1819
subparser.add_argument('--build', '-b', action='store_true', help='whether to build the model first')

supar/cmds/crf2o_dependency.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ def main():
1414
parser.add_argument('--proj', action='store_true', help='whether to projectivize the data')
1515
parser.add_argument('--partial', action='store_true', help='whether partial annotation is included')
1616
subparsers = parser.add_subparsers(title='Commands', dest='mode')
17+
# train
1718
subparser = subparsers.add_parser('train', help='Train a parser.')
1819
subparser.add_argument('--feat', '-f', choices=['tag', 'char', 'bert'], help='choices of additional features')
1920
subparser.add_argument('--build', '-b', action='store_true', help='whether to build the model first')

supar/cmds/crf_constituency.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ def main():
1111
parser.set_defaults(Parser=CRFConstituencyParser)
1212
parser.add_argument('--mbr', action='store_true', help='whether to use MBR decoding')
1313
subparsers = parser.add_subparsers(title='Commands', dest='mode')
14+
# train
1415
subparser = subparsers.add_parser('train', help='Train a parser.')
1516
subparser.add_argument('--feat', '-f', choices=['tag', 'char', 'bert'], help='choices of additional features')
1617
subparser.add_argument('--build', '-b', action='store_true', help='whether to build the model first')

supar/cmds/crf_dependency.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ def main():
1414
parser.add_argument('--proj', action='store_true', help='whether to projectivize the data')
1515
parser.add_argument('--partial', action='store_true', help='whether partial annotation is included')
1616
subparsers = parser.add_subparsers(title='Commands', dest='mode')
17+
# train
1718
subparser = subparsers.add_parser('train', help='Train a parser.')
1819
subparser.add_argument('--feat', '-f', choices=['tag', 'char', 'bert'], help='choices of additional features')
1920
subparser.add_argument('--build', '-b', action='store_true', help='whether to build the model first')

supar/cmds/crfnp_dependency.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ def main():
1111
parser.set_defaults(Parser=CRFNPDependencyParser)
1212
parser.add_argument('--mbr', action='store_true', help='whether to use MBR decoding')
1313
subparsers = parser.add_subparsers(title='Commands', dest='mode')
14+
# train
1415
subparser = subparsers.add_parser('train', help='Train a parser.')
1516
subparser.add_argument('--feat', '-f', choices=['tag', 'char', 'bert'], help='choices of additional features')
1617
subparser.add_argument('--build', '-b', action='store_true', help='whether to build the model first')

supar/utils/metric.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def score(self):
2424

2525
class AttachmentMetric(Metric):
2626

27-
def __init__(self, eps=1e-8):
27+
def __init__(self, eps=1e-12):
2828
super().__init__()
2929

3030
self.eps = eps
@@ -79,7 +79,7 @@ def las(self):
7979

8080
class SpanMetric(Metric):
8181

82-
def __init__(self, eps=1e-8):
82+
def __init__(self, eps=1e-12):
8383
super().__init__()
8484

8585
self.n = 0.0
@@ -154,7 +154,7 @@ def lf(self):
154154

155155
class ChartMetric(Metric):
156156

157-
def __init__(self, eps=1e-5):
157+
def __init__(self, eps=1e-12):
158158
super(ChartMetric, self).__init__()
159159

160160
self.tp = 0.0

0 commit comments

Comments
 (0)