Esempio n. 1
0
def getFileSentence():
    filepath = "../Data/corpus/"
    files = ['favor0721.xlsx', 'inter0721.xlsx', 'Sentence_QR_pair_0714.xlsx']
    sentences = []
    for file in files:
        Q, R = ReadFile.getFileSentence(filepath + file)
        sentences.extend(Q)
    return sentences
Esempio n. 2
0
def getFileSentence():
    filepath = "../Data/corpus/"
    files = ['favor0721.xlsx','inter0721.xlsx','Sentence_QR_pair_0714.xlsx']
    sentences = []
    for file in files:
        Q,R = ReadFile.getFileSentence(filepath + file)
        sentences.extend(Q)
    return sentences
Esempio n. 3
0
def ExtracKeyWordFromSentence(sentencefile =MyCode.config.SentenceKeyWordPath + "badcase.xlsx"):
    print "Extrc key words from sentence"
    sentences = ReadFile.getFileSentence(sentencefile)[0]
    sentences = list(set(sentences))
    tag_sentence = get_tagByjieba(sentences)
    writeToFile(sentences,tag_sentence)
    sentences_keywords = []
    for i in xrange(len(sentences)):
        sentences_keywords.append((sentences[i],tag_sentence[i]))
    return sentences_keywords
Esempio n. 4
0
def ExtracKeyWordFromSentence(sentencefile=MyCode.config.SentenceKeyWordPath +
                              "badcase.xlsx"):
    print "Extrc key words from sentence"
    sentences = ReadFile.getFileSentence(sentencefile)[0]
    sentences = list(set(sentences))
    tag_sentence = get_tagByjieba(sentences)
    writeToFile(sentences, tag_sentence)
    sentences_keywords = []
    for i in xrange(len(sentences)):
        sentences_keywords.append((sentences[i], tag_sentence[i]))
    return sentences_keywords
Esempio n. 5
0
def buildWordfromExcel():
    file = "../Data/Sentence_QR_pair_0714.xlsx"
    Q_s, R_s = ReadFile.getFileSentence(file)
    sentences = Participle.Participle(Q_s)
    Q_sentences = []
    for s in sentences:
        snetence = ''
        for word in s:
            snetence += word + ' '
        Q_sentences.append(snetence)
    return Q_sentences
Esempio n. 6
0
def buildWordfromExcel():
    file = "../Data/Sentence_QR_pair_0714.xlsx"
    Q_s,R_s = ReadFile.getFileSentence(file)
    sentences = Participle.Participle(Q_s)
    Q_sentences = []
    for s in sentences:
        snetence = ''
        for word in s:
            snetence += word + ' '
        Q_sentences.append(snetence)
    return Q_sentences