def exc(file='testdata.txt', label_file=folder_datasource + '/' + 'fa_labels'):
    # 5. Test & Labels
    textList = store.loadTextData(file=file)
    labels = store.loadCSV(label_file)

    if (file_model):
        _time, templateList = sg.parseAddress(textList, file_model)
    else:
        _time, templateList = sg.parseAddress(textList)

    acc, dist = checkAddressSegmentAccuracy(labels, templateList)

    titles = [['#', 'Text', 'Runtime'],
              ['TestCase', 'Top', 'Name', 'Address', 'Phone', 'NameScore', 'AddressScore', 'PhoneScore', 'Score',
               'PrepName'] + ['Name_' + ft for ft in getFeatureNames()] + \
               ['PrepAddress'] + ['Address_' + ft for ft in getFeatureNames()] + \
               ['PrepPhone'] + ['Phone_' + ft for ft in getFeatureNames()]]

    if (file_model):
        store.saveResults(titles, (textList, _time),
                          templateList,
                          file=file_model + '_' + file_segment_address_result,
                          acc=acc)
    else:
        store.saveResults(titles, (textList, _time),
                          templateList,
                          file=timeManage.getTime() + '_' +
                          file_segment_address_result,
                          acc=acc)

    return acc
def exc(file='testdata.txt', label_file=folder_datasource + '/' + 'fa_labels'):
    # 5. Test & Labels
    textList = store.loadTextData(file=file)
    labels = store.loadCSV(label_file)

    if (file_model):
        _time, templateList = sg.parseAddress(textList, file_model)
    else:
        _time, templateList = sg.parseAddress(textList)

    if (sum([len(itmp) for itmp in templateList]) > 0):
        acc, dist = checkAddressSegmentAccuracy(labels, templateList)
    else:
        acc = 0


    titles = [['#', 'Text', 'Runtime'],
              ['TestCase', 'Top', 'Name', 'Address', 'Phone', 'NameScore', 'AddressScore', 'PhoneScore', 'Score',
               'PrepName'] + ['Name_' + ft for ft in getFeatureNames()] + \
               ['PrepAddress'] + ['Address_' + ft for ft in getFeatureNames()] + \
               ['PrepPhone'] + ['Phone_' + ft for ft in getFeatureNames()]]

    if (file_model):
        store.saveResults(titles, (textList, _time), templateList, file=file_model + '_' + file_segment_address_result,
                            acc=acc)
    else:
        store.saveResults(titles, (textList, _time), templateList, file=timeManage.getTime() + '_' + file_segment_address_result,
                            acc=acc)

    return acc
def exc(file='testdata.txt'):
    # 5. Test
    textList = store.loadTextData(file=file)
    _time, templateList = sg.parseAddress(textList)

    titles = [['#', 'Text', 'Runtime'],
              ['TestCase', 'Top', 'Name', 'Address', 'Phone', 'NameScore', 'AddressScore', 'PhoneScore', 'Score']]

    store.saveResults(titles, (textList, _time), templateList, file=timeManage.getTime() + '_' + file_segment_address_result)
def test(feature_func, preprocessing_func, file='testdata.txt'):
    # 4. Test
    textList = store.loadTextData(file=file)
    _time, templateList = sg.parseAddress(textList, feature_func, preprocessing_func)

    titles = [['#', 'Text', 'Runtime'],
              ['TestCase', 'Top', 'Name', 'Address', 'Phone', 'NameScore', 'AddressScore', 'PhoneScore', 'Score']]

    store.saveResults(titles, (textList, _time), templateList)
Exemplo n.º 5
0
def test(feature_func, preprocessing_func, file='testdata.txt'):
    # 4. Test
    textList = store.loadTextData(file=file)
    _time, templateList = sg.parseAddress(textList, feature_func, preprocessing_func)
    # _time, templateList = templateFilter(_time, templateList)

    titles = [['#', 'Text', 'Runtime'],
              ['TestCase', 'Top', 'Name', 'Address', 'Phone', 'NameScore', 'AddressScore', 'PhoneScore', 'Score']]

    store.saveResults(titles, (textList, _time), templateList)
def test(feature_func, preprocessing_func):
    # 4. Test
    textList = store.loadTextData()
    print('=======================================================')
    print('=> Address Parsing...')
    _time, templateList = sg.parseAddress(textList, feature_func, preprocessing_func)

    titles = [['#', 'Text', 'Runtime'],
              ['TestCase', 'Top', 'Name', 'Address', 'Phone', 'NameScore', 'AddressScore', 'PhoneScore', 'Score']]

    store.saveResults(titles, (textList, _time), templateList)
    print('<= Address Parsed.')
Exemplo n.º 7
0
def exc(file='testdata.txt'):
    # 5. Test
    textList = store.loadTextData(file=file)
    _time, templateList = sg.parseAddress(textList)

    titles = [['#', 'Text', 'Runtime'],
              [
                  'TestCase', 'Top', 'Name', 'Address', 'Phone', 'NameScore',
                  'AddressScore', 'PhoneScore', 'Score'
              ]]

    store.saveResults(titles, (textList, _time),
                      templateList,
                      file=timeManage.getTime() + '_' +
                      file_segment_address_result)
def exc(file='testdata.txt'):
    # 5. Test
    textList = store.loadTextData(file=file)
    if (file_model):
        _time, templateList = sg.parseAddress(textList, file_model)
    else:
        _time, templateList = sg.parseAddress(textList)

    titles = [['#', 'Text', 'Runtime'],
              ['TestCase', 'Top', 'Name', 'Address', 'Phone', 'NameScore', 'AddressScore', 'PhoneScore', 'Score',
               'PrepName', 'PrepAddress', 'PrepPhone'] + getFeatureNames()]

    if (file_model):
        store.saveResults(titles, (textList, _time), templateList, file=file_model + '_' + file_segment_address_result)
    else:
        store.saveResults(titles, (textList, _time), templateList, file=timeManage.getTime() + '_' + file_segment_address_result)
def test(feature_func, preprocessing_func):
    # 4. Test
    textList = store.loadTextData()
    print('=======================================================')
    print('=> Address Parsing...')
    _time, templateList = sg.parseAddress(textList, feature_func,
                                          preprocessing_func)

    titles = [['#', 'Text', 'Runtime'],
              [
                  'TestCase', 'Top', 'Name', 'Address', 'Phone', 'NameScore',
                  'AddressScore', 'PhoneScore', 'Score'
              ]]

    store.saveResults(titles, (textList, _time), templateList)
    print('<= Address Parsed.')
Exemplo n.º 10
0
def exc(file='testdata.txt'):
    # 5. Test
    textList = store.loadTextData(file=file)
    if (file_model):
        _time, templateList = sg.parseAddress(textList, file_model)
    else:
        _time, templateList = sg.parseAddress(textList)

    titles = [['#', 'Text', 'Runtime'],
              ['TestCase', 'Top', 'Name', 'Address', 'Phone', 'NameScore', 'AddressScore', 'PhoneScore', 'Score',
               'PrepName'] + ['Name_' + ft for ft in getFeatureNames()] + \
               ['PrepAddress'] + ['Address_' + ft for ft in getFeatureNames()] + \
               ['PrepPhone'] + ['Phone_' + ft for ft in getFeatureNames()]]

    if (file_model):
        store.saveResults(titles, (textList, _time),
                          templateList,
                          file=file_model + '_' + file_segment_address_result)
    else:
        store.saveResults(titles, (textList, _time),
                          templateList,
                          file=timeManage.getTime() + '_' +
                          file_segment_address_result)