Skip to content

Commit fd0466f

Browse files
add utility functions package
1 parent e146761 commit fd0466f

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

python/dnlp/utils/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#-*- coding: UTF-8 -*-

python/dnlp/utils/constant.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# -*- coding: UTF-8 -*-
2+
3+
# 字典
4+
BATCH_PAD = 'BATCH_PAD'
5+
BATCH_PAD_VAL = 0
6+
UNK = 'UNK'
7+
UNK_VAL = 1
8+
STRT = 'STRT'
9+
STRT_VAL = 2
10+
END = 'END'
11+
END_VAL = 3
12+
13+
# 标注标签
14+
TAG_PAD = 'P'
15+
TAG_BEGIN = 'B'
16+
TAG_INSIDE = 'I'
17+
TAG_END = 'E'
18+
TAG_SINGLE = 'S'
19+
TAG_OTHER = 'O'
20+
21+
# 映射表
22+
CWS_TAGS = (TAG_BEGIN, TAG_INSIDE, TAG_END, TAG_SINGLE,TAG_PAD)

0 commit comments

Comments
 (0)