Example #1
0
    NE_S_chuck = story.chuck_NE()
    filter_NE_Chuck(NE_S_chuck)
    s_bags = story.remove_stopwords(story.bags)
    # s_bags = story.stem_words(s_bags)
    # print(s_bags)

    # Creat a question
    # question = Question(instance + ".questions")
    # question = Question("1999-W02-5.questions")
    # Do things to the question object
    # Q_chuck = question.chuck_NP()
    question = Question(path + '/' + foldname + '/' + foldname + ".questions")
    q_bags = question.pos_tag(question.questions)
    question.answer_NP_type()
    Q_chuck = question.chuck_NP()
    NE_Q_chuck = question.NER()
    q_bags = story.remove_stopwords(question.questions)
    # q_bags = story.stem_words(q_bags)
    # print(q_bags)

    # BASIC_RULE WordMatch
    score_table = []
    for x, q_sent in enumerate(NE_Q_chuck):
        score = []
        q_NE = list(list(zip(*q_sent))[0])
        q_NE_lower = [i.lower() for i in q_NE]
        q_words_lower = [i.lower() for i in q_bags[x]]
        for s_sent in NE_S_chuck:
            s_score = 0
            scored_Schunck = []
            scored_Qchuck = []