def get_curr_first_lemma_verb(arg_clauses, clause_index, parse_dict): DocID = arg_clauses.DocID sent_index = arg_clauses.sent_index verb_pos = ["VB", "VBD", "VBG", "VBN", "VBP", "VBZ"] curr_clause = arg_clauses.clauses[clause_index] # ([1,2,3],yes) word_list = [] pos_list = [] for index in curr_clause[0]: word = parse_dict[DocID]["sentences"][sent_index]["words"][index][0] pos = parse_dict[DocID]["sentences"][sent_index]["words"][index][1][ "PartOfSpeech"] word_list.append(word) pos_list.append(pos) be_have_words = [ "have", "has", "had", "'ve", "'d", "is", "am", "are", "was", "were", "been", "be", "'s", "'re", "'m" ] # verb, but exclude: be have for word, pos in zip(word_list, pos_list): if pos in verb_pos and word not in be_have_words: word = util.lemma_word(word, pos) return word # only be have for word, pos in zip(word_list, pos_list): if word in be_have_words: word = util.lemma_word(word, pos) return word return "NULL"
def get_curr_first_lemma_verb(arg_clauses, clause_index, parse_dict): DocID = arg_clauses.DocID sent_index = arg_clauses.sent_index verb_pos = ["VB", "VBD", "VBG", "VBN", "VBP", "VBZ"] curr_clause = arg_clauses.clauses[clause_index] # ([1,2,3],yes) word_list = [] pos_list = [] for index in curr_clause[0]: word = parse_dict[DocID]["sentences"][sent_index]["words"][index][0] pos = parse_dict[DocID]["sentences"][sent_index]["words"][index][1]["PartOfSpeech"] word_list.append(word) pos_list.append(pos) be_have_words = [ "have", "has", "had", "'ve", "'d", "is", "am", "are", "was", "were", "been", "be", "'s", "'re", "'m", ] # verb, but exclude: be have for word, pos in zip(word_list, pos_list): if pos in verb_pos and word not in be_have_words: word = util.lemma_word(word, pos) return word # only be have for word, pos in zip(word_list, pos_list): if word in be_have_words: word = util.lemma_word(word, pos) return word return "NULL"
def _get_main_verb(relation, Arg, parse_dict): verb_pos = ["VBD", "VBN"] + ["VB", "VBP", "VBZ"] + ["VBG"] be_have_words = ["have", "has", "had", "'ve", "'d", "is", "am", "are", "was", "were", "been", "be", "'s", "'re", "'m"] word_list = get_Arg_Words_List(relation, Arg, parse_dict) pos_list = get_Arg_POS_List(relation, Arg, parse_dict) # verb, but not: be have for word, pos in zip(word_list, pos_list): if pos in verb_pos and word not in be_have_words: word = util.lemma_word(word, pos) return word # only: be have for word, pos in zip(word_list, pos_list): if word in be_have_words: word = util.lemma_word(word, pos) return word return "None"
def _get_main_verb(relation, Arg, parse_dict): verb_pos = ["VBD", "VBN"] + ["VB", "VBP", "VBZ"] + ["VBG"] be_have_words = [ "have", "has", "had", "'ve", "'d", "is", "am", "are", "was", "were", "been", "be", "'s", "'re", "'m" ] word_list = get_Arg_Words_List(relation, Arg, parse_dict) pos_list = get_Arg_POS_List(relation, Arg, parse_dict) # verb, but not: be have for word, pos in zip(word_list, pos_list): if pos in verb_pos and word not in be_have_words: word = util.lemma_word(word, pos) return word # only: be have for word, pos in zip(word_list, pos_list): if word in be_have_words: word = util.lemma_word(word, pos) return word return "None"