![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
nlp_lab
Tiny Tot
这个作者很懒,什么都没留下…
展开
-
3.4Optimize
# -*- coding: utf-8 -*- import time dictionaryfilename = "../data/dic.txt" inputfilename = "../data/199801_sent.txt" BMMfilename = "../data/seg_BMM.txt" FMMfilename = "../data/seg_FMM.txt" def readDic(dicpath=dictionaryfilename): tripleDic = []原创 2020-12-27 09:03:48 · 208 阅读 · 2 评论 -
3.3Evaluate
# -*- coding: utf-8 -*- import re correctfilename = "../data/199801_seg&pos.txt" segfilename = "../data/seg_BMM.txt" def evaluate(correct_path=correctfilename, seg_path=segfilename): correct_sum = 0 seg_sum = 0 correct = 0 allwrong原创 2020-12-27 09:24:35 · 115 阅读 · 0 评论 -
3.2FMM&GMM
# -*- coding: utf-8 -*- import time dictionaryfilename = "../data/dic.txt" inputfilename = "../data/199801_sent.txt" BMMfilename = "../data/seg_BMM2.txt" FMMfilename = "../data/seg_FMM.txt" def readDic(dicpath=dictionaryfilename): tripleDic = []原创 2020-12-27 09:22:23 · 127 阅读 · 0 评论 -
3.1Generate
# -*- coding: utf-8 -*- from collections import defaultdict Inputfilename = "../data/199801_seg&pos.txt" Outputfilename = "../data/dic.txt" def BuildDic(Ip=Inputfilename,Op=Outputfilename): fi = open(Ip,'r',encoding='gbk') fo = open(Op,'w',e原创 2020-11-23 12:15:01 · 91 阅读 · 0 评论