Browse Source

update segment

master
Yener 5 years ago
parent
commit
102a57fde6
2 changed files with 4 additions and 3 deletions
  1. +2
    -1
      jiagu/segment/dict/jiagu.dict
  2. +2
    -2
      jiagu/segment/nroute.py

+ 2
- 1
jiagu/segment/dict/jiagu.dict View File

@@ -205738,6 +205738,7 @@ win键 7
知识分子型 3
知识化 44
知识卷 3
知识图谱 7
知识圈 3
知识型 10
知识库 12
@@ -253877,7 +253878,7 @@ win键 7
谷梁传 10
谷梅 3
谷欣 4
谷歌 51
谷歌 56
谷正纲 6
谷气 3
谷氨酸 10


+ 2
- 2
jiagu/segment/nroute.py View File

@@ -17,7 +17,7 @@ class Segment:

def init(self, vocab_path='dict/jiagu.dict', user_vocab='dict/user.dict'):
self.load_vocab(os.path.join(os.path.dirname(__file__), vocab_path))
# self.load_vocab(os.path.join(os.path.dirname(__file__), user_vocab))
self.load_vocab(os.path.join(os.path.dirname(__file__), user_vocab))
self.initialized = True
def load_vocab(self, vocab_path):
@@ -182,7 +182,7 @@ if __name__=='__main__':
# sg.load_userdict('dict/user.dict')
# s.load_userdict(['知识图谱'])

text = '天猫啊'
text = '情感分析了解一下?一个比情感词典、机器学习更好的方法'
words = s.seg(text)
print(words)


Loading…
Cancel
Save