Exemplo n.º 1
0
def AnalysisComparison(text, record, expectList=[], noneList=[]):
    funcList = [mmseg_segfun, ICTCLAS_segfun]
    we = WeightEngine(mmseg_segfun)
    we.load_record(record)
    # compareStatus(list_basic)
    stop_list = [u"的", u"。", u",", u"是"] + STOPLIST

    result = export_mmseg(we, text, funcList, stop_list, expectList, noneList)
    compareStatus(result)
Exemplo n.º 2
0
def report_all(n=50):
    result = [["mmseg", "ICTCLAS", "mmseg(with STOPWORDS)", "ICTCLAS(with STOPWORDS)"]]
    for item in build_dict(mmseg_segfun, n, filename = "mmseg_save.bak"):
        element = [item[0] + str(item[1]), ]
        result.append(element)

    index = 1
    for item in build_dict(ICTCLAS_segfun, n, filename = "ICTCLAS_save.bak"):
        result[index].append(item[0] + str(item[1]))
        index += 1

    stop_list = [u"的", u"。", u",", u"是"] + STOPLIST
    index = 1
    for item in build_dict(mmseg_segfun, n, stopword_list = stop_list, filename = "mmseg_save_with_stopwords.bak"):
        result[index].append(item[0] + str(item[1]))
        index += 1
    index = 1
    for item in build_dict(ICTCLAS_segfun, n, stopword_list = stop_list, filename = "ICTCLAS_save_with_stopwords.bak"):
        result[index].append(item[0] + str(item[1]))
        index += 1
    compareStatus(result)
Exemplo n.º 3
0
def report_using_save(count=50):
    result = [["mmseg", "ICTCLAS", "mmseg(with STOPWORDS)", "ICTCLAS(with STOPWORDS)"]]

    for item in load_dict_from_save(filename = "mmseg_save.bak", n = count):
        element = [item[0] + str(item[1]), ]
        result.append(element)

    index = 1
    for item in load_dict_from_save(filename = "ICTCLAS_save.bak", n = count):
        result[index].append(item[0] + str(item[1]))
        index += 1

    index = 1
    for item in load_dict_from_save(filename = "mmseg_save_with_stopwords.bak", n = count):
        result[index].append(item[0] + str(item[1]))
        index += 1
    index = 1
    for item in load_dict_from_save(filename = "ICTCLAS_save_with_stopwords.bak", n = count):
        result[index].append(item[0] + str(item[1]))
        index += 1
    compareStatus(result)
Exemplo n.º 4
0
 def test_compareStatus(self):
     l = [["", "mmseg", "ICTCLAS", "online(hehe)"], ["tf-idf", "tete", "dd<", "dd"]]
     compareStatus(l)
     pass