def sim_ox_wn_defi_WDS_via_defi_of_curr_main_syn(word): dict_vectors_wn = WordnetParseDefinition.get_dict_vectors_synsets_for_word(word) (keys_wn, vectors_wn) = Util.get_keys_values_of_dict(dict_vectors_wn) dict_vectors_wn_defi = WordnetParseDefinition.get_vectors_defi_for_word(word) (keys_wn_defi, vectors_wn_defi) = Util.get_keys_values_of_dict(dict_vectors_wn_defi) definitions = OxfordParser.get_definitions_of_word(word) m2d_sim = [[0 for x in range(len(definitions))] for x in range(len(vectors_wn))] for i in range(len(vectors_wn)): vector_wn = vectors_wn[i] vector_wn_defi = vectors_wn_defi[i] dict_vectors_ox = OxParseDefinition.get_dict_vectors_synsets_for_word(word, vector_wn_defi) (keys_ox, vectors_ox) = Util.get_keys_values_of_dict(dict_vectors_ox) for j in range(len(vectors_ox)): vector_ox = vectors_ox[j] m2d_sim[i][j] = sim_2_vector(vector_ox, vector_wn) cal_sim_ngrams(word) return m2d_sim
def create_input_for_train(): dict_vn = ReadVietNet.readVietNetFile() dict_ox = OxfordParser.get_dict_nouns() # create_input_sen_via_ox_vn(dict_vn, dict_ox) dict_gold = CompareWithGold.goldData create_input_sen_via_gold_data(dict_vn, dict_ox, dict_gold)
def parse_ox_wn_defi_to_input(word): defis_wn = WordnetHandler.get_definitions_for_word(word) defis_ox = OxfordParser.get_definitions_of_word_for_svm(word) for defi_wn in defis_wn: for defi_ox in defis_ox: value = defi_wn + "\t" + defi_ox FileProcess.append_value_to_file(value, __filename_input_sen__)
def get_dict_vectors_word_for_word(word): vectors = OrderedDict() definitions = OxfordParser.get_definitions_of_word(word) for definition in definitions: vector = PreprocessDefinition.preprocess_sentence(definition) key = definition vectors[key] = vector return vectors
def get_dict_vectors_synsets_for_word(word, synsets_wn): vectors = OrderedDict() definitions = OxfordParser.get_definitions_of_word(word) for definition in definitions: vector = get_definition_synset_with_synsetwn(definition, synsets_wn) key = definition vectors[key] = vector return vectors
def cal_sim_ngrams(word): dict_gloss_wn = WordnetParseDefinition.get_gloss_for_jacc(word) (key_wn, wn_gloss) = Util.get_keys_values_of_dict(dict_gloss_wn) ox_gloss = OxfordParser.get_definitions_of_word_for_jacc(word) cal_n_grams_sim(word, wn_gloss, ox_gloss, 2) cal_n_grams_sim(word, wn_gloss, ox_gloss, 3) cal_n_grams_sim(word, wn_gloss, ox_gloss, 4) for i in range(len(wn_gloss)): wn_gloss[i] = wn_gloss[i].replace(word, "") for i in range(len(ox_gloss)): ox_gloss[i] = ox_gloss[i].replace(word, "") cal_jacc_sim(word, wn_gloss, ox_gloss)
def get_m2d_sim_for_word_from_svm_result(word): defis_wn = WordnetHandler.get_definitions_for_word(word) defis_ox = OxfordParser.get_definitions_of_word_for_svm(word) if len(defis_wn) == 0 or len(defis_ox) == 0: return None m2d_sim = [[0 for x in range(len(defis_ox))] for x in range(len(defis_wn))] for i_wn in range(len(defis_wn)): defi_wn = str(defis_wn[i_wn]) for i_ox in range(len(defis_ox)): defi_ox = str(defis_ox[i_ox]) m2d_sim[i_wn][i_ox] = ReadSVMResult.get_sim_for_sens(defi_wn, defi_ox) return m2d_sim
def sim_ox_wn_via_definition_cal_word(): total_precision = 0; total_recall = 0; total_accuracy = 0; total_word = 0 dict_ox = OxfordParser.get_dict_nouns() for word in dict_ox: if word not in __m2d_sim__: m2d_sim = sim_ox_wn_definition(word) __m2d_sim__[word] = m2d_sim m2d_sim = copy.deepcopy(__m2d_sim__[word]) if m2d_sim == None or len(m2d_sim) == 0 or len(m2d_sim[0]) == 0: continue print word # # if len(m2d_sim) == 1 and len(m2d_sim[0]) == 1: # continue # m2d_sim = choose_pair_0_1(m2d_sim, len(m2d_sim), len(m2d_sim[0])) (precision, recall, accuracy) = CompareWithGold.compareGoldWithResult(m2d_sim,word) if precision != -1: total_precision += precision total_recall += recall total_accuracy += accuracy total_word += 1 precision = total_precision/total_word recall = total_recall/total_word f_score = 0 if precision != 0 or recall != 0: f_score = 2*(precision*recall)/(precision + recall) accuracy = total_accuracy/total_word print "total:" print total_word print precision print recall print f_score print accuracy Parameters.append_result_to_file( precision, recall, f_score, accuracy)
def create_input_sens_test(dict_ox): flag_can_go = False for word in dict_ox: if word == "blockage": flag_can_go = True if flag_can_go == False: continue if len(dict_ox[word]) == 0: continue defis_wn = WordnetHandler.get_definitions_for_word(word) defis_ox = OxfordParser.get_definitions_of_word_for_svm(word) if len(defis_ox) == 1 and len(defis_wn) == 1: continue if len(defis_ox) == 1 and len(defis_wn) > 1: all_defi_wn = "" for defi_wn in defis_wn: all_defi_wn += defi_wn + "\t" if all_defi_wn != "": all_defi_wn = all_defi_wn[:-1] for defi_wn in defis_wn: for defi_ox in defis_ox: value = defi_wn + "\t" + defi_ox + "\t" + all_defi_wn FileProcess.append_value_to_file(value, __filename_input_sen_test__) else: for defi_wn in defis_wn: all_defi_ox = "" for defi_ox in defis_ox: all_defi_ox += defi_ox + "\t" if all_defi_ox != "": all_defi_ox = all_defi_ox[:-1] for defi_ox in defis_ox: value = defi_wn + "\t" + defi_ox + "\t" + all_defi_ox FileProcess.append_value_to_file(value, __filename_input_sen_test__)
def create_input_for_test_svm(): dict_ox = OxfordParser.get_dict_nouns() flag_can_go = False for word in dict_ox: # if word == "brook": # flag_can_go = True # # if flag_can_go == False: # continue if len(dict_ox[word]) == 0: continue syns_wn = WordnetHandler.get_synsets_for_word(word, 'n') syns_ox = dict_ox[word] if len(syns_ox) == 1 and len(syns_wn) == 1: continue write_sens_for_reading(syns_wn, syns_ox, __filename_input_sen_test__) cal_features_and_write_to_file_for(syns_wn, syns_ox, __filename_input_test_feature_values__)
def create_input_for_train_svm(): dict_ox = OxfordParser.get_dict_nouns() dict_gold = CompareWithGold.goldData for word in dict_ox: if len(dict_ox[word]) == 0 or word not in dict_gold: continue if word == "brook": return # if word != "bank": # continue syns_wn = WordnetHandler.get_synsets_for_word(word, 'n') syns_ox = dict_ox[word] if len(syns_ox) == 1 and len(syns_wn) == 1: continue write_label_for_svm(syns_wn, syns_ox, dict_gold[word]) write_sens_for_reading(syns_wn, syns_ox, __filename_input_sen_train__) cal_features_and_write_to_file_for(syns_wn, syns_ox, __filename_input_train_feature_values__)
def sim_ox_wn_via_svm(): total_tp = 0.00001 total_tn = 0.00001 total_fn = 0.00001 total_fp = 0.00001 total_pair = 0 dict_ox = OxfordParser.get_dict_nouns() flag_can_go = False for word in dict_ox: # if word == "brook": # flag_can_go = True # # if flag_can_go == False: # continue word_syns_ox = dict_ox[word] wn_synsets = WordnetHandler.get_synsets_for_word(word, "n") m2d_sim = [[0 for x in range(len(word_syns_ox))] for x in range(len(wn_synsets))] if len(word_syns_ox) == 1 and len(wn_synsets) == 1: m2d_sim[0][0] = 1 else: m2d_sim = get_m2d_sim_for_word_from_svm_result(word) if m2d_sim == None: continue # DebugHandler.print_2d_matrix(m2d_sim) m2d_sim = choose_pair_0_1(m2d_sim, len(m2d_sim), len(m2d_sim[0])) # DebugHandler.print_2d_matrix(m2d_sim) pair = count_pair(m2d_sim) total_pair += pair (tp, tn, fn, fp) = CompareWithGold.compareGoldWithResult_without_cal_result(m2d_sim,word) if tp != -1: total_tp += tp total_tn += tn total_fn += fn total_fp += fp precision = total_tp / (total_tp + total_fp) recall = total_tp / (total_tp + total_fn) accuracy = (total_tp + total_tn) / (total_tp + total_tn + total_fp + total_fn) f_score = 0 if precision != 0 or recall != 0: f_score = 2*(precision*recall)/(precision + recall) print "total:" print total_pair print total_tp print total_tn print total_fn print total_fp print precision print recall print f_score print accuracy Parameters.append_result_to_file( precision, recall, f_score, accuracy) current_params = Parameters.get_current_params() current_params = copy.deepcopy(current_params) return f_score, current_params
def create_input_sens_for_test_svm(): dict_ox = OxfordParser.get_dict_nouns() for word in dict_ox: parse_ox_wn_defi_to_input(word)
# row for i in range(len(dict_words)): if not dict_words[str(i)].has_key('tv'): dict_words[str(i)]['tv'] = "--"; if dict_words[str(i)]['tv'] == None: dict_words[str(i)]['tv'] = "--" ox_word = dict_words[str(i)]["tv"].encode('utf8'); ox_words.append(ox_word) for i in range(len(wn_words)): wn_word = wn_words[i].name() dict_wn_ox[wn_word] = [] indexs_max = get_best_max_index(matrix_similarity[i]) for index in indexs_max: ox_word = ox_words[index] dict_wn_ox[wn_word].append(ox_word) return dict_wn_ox __dict_ox_nouns__ = OxfordParser.readOxfordNouns(); def cal_similarity_for_word(word): filted_dict = {} if __dict_ox_nouns__.has_key(word): if not (word is None or __dict_ox_nouns__[word] is None): filted_dict = similarity_without_choice(word,__dict_ox_nouns__[word]); return filted_dict #cal_similarity_for_word("bank")
def create_input_for_train_svm_via_vn(): dict_ox = OxfordParser.get_dict_csv_nouns() f = open(__filename_input_sen_train__,'r'); line = f.readline(); while (line): if len(line) > 0: sens = line.split("\t") syn_wn = wn._synset_from_pos_and_offset('n', long(sens[0])) for lemma in syn_wn.lemmas(): word = lemma.name().lower() if word in dict_ox: syns_ox = dict_ox[word] syns_values_in_row = [] ox_current = -1 for i_ox in range(len(syns_ox)): syn_ox = syns_ox[str(i_ox)] ox_defi = syn_ox['d'].replace("\n","") ox_defi = ox_defi.replace("\t","") ox_gold_defi = sens[1].replace("\n","") ox_gold_defi = ox_gold_defi.replace("\t","") ox_gold_defi = ox_gold_defi.replace(","," ") if check_tv_similar(ox_defi, ox_gold_defi): ox_current = i_ox if ox_current == -1: continue # cal all features between syns in ox with syn in wn syns_values_in_row = [] for i_ox in range(len(syns_ox)): syn_ox = syns_ox[str(i_ox)] feature_values = cal_feature_values_for(syn_wn, syn_ox) syns_values_in_row.append(feature_values) # cal max values of each feature arr_root_values_of_feature = [] for i_feature in range(len(syns_values_in_row[0])): root = root_values_of_a_feature_in_row(syns_values_in_row, i_feature) arr_root_values_of_feature.append(root) # cal value for svm feature_values_for_svm = "" feature_values_1_syn = syns_values_in_row[ox_current] for i_feature in range(len(feature_values_1_syn)): root_value = arr_root_values_of_feature[i_feature] feature_value = feature_values_1_syn[i_feature] feature_value_for_svm = feature_value/root_value feature_values_for_svm += str(feature_value_for_svm) + "\t" if feature_values_for_svm != "": feature_values_for_svm = feature_values_for_svm[:-1] append_value_to_file(feature_values_for_svm, __filename_input_train_feature_values__) break line = f.readline(); f.close()
def sim_ox_wn_via_definition_cal_syns(): total_tp = 0.; total_tn = 0.; total_fn = 0.0; total_fp = 0.0; total_pair = 0 dict_ox = OxfordParser.get_dict_nouns() for word in dict_ox: # if word != 'bank': # continue # if word not in __m2d_sim__: m2d_sim = sim_ox_wn_definition(word) __m2d_sim__[word] = m2d_sim m2d_sim = copy.deepcopy(__m2d_sim__[word]) if m2d_sim == None or len(m2d_sim) == 0 or len(m2d_sim[0]) == 0: continue # if len(m2d_sim) == 1 and len(m2d_sim[0]) == 1: # continue # m2d_sim = choose_pair_0_1(m2d_sim, len(m2d_sim), len(m2d_sim[0])) # m2d_sim = pair_0_1_reducing_m2d_sim(m2d_sim, len(m2d_sim), len(m2d_sim[0]), word) # print word pair = count_pair(m2d_sim) total_pair += pair (tp, tn, fn, fp) = CompareWithGold.compareGoldWithResult_without_cal_result(m2d_sim,word) if tp != -1: total_tp += tp total_tn += tn total_fn += fn total_fp += fp precision = total_tp / (total_tp + total_fp) recall = total_tp / (total_tp + total_fn) accuracy = (total_tp + total_tn) / (total_tp + total_tn + total_fp + total_fn) f_score = 0 if precision != 0 or recall != 0: f_score = 2*(precision*recall)/(precision + recall) print "total:" print total_pair print total_tp print total_tn print total_fn print total_fp print precision print recall print f_score print accuracy Parameters.append_result_to_file( precision, recall, f_score, accuracy) current_params = Parameters.get_current_params() current_params = copy.deepcopy(current_params) return f_score, current_params
def sim_ox_wn_via_definition_morpho_cal_syns(): total_tp = 0.00001 total_tn = 0.00001; total_fn = 0.00001; total_fp = 0.00001; total_pair = 0 dict_ox = OxfordParser.get_dict_nouns() for word in dict_ox: # if word != 'blaze': # continue # if word not in __m2d_sim__: m2d_sim = sim_ox_wn_definition(word) __m2d_sim__[word] = m2d_sim m2d_sim = copy.deepcopy(__m2d_sim__[word]) if m2d_sim == None or len(m2d_sim) == 0 or len(m2d_sim[0]) == 0: continue # if len(m2d_sim) == 1 or len(m2d_sim[0]) == 1: # continue if word not in __dict_ngrams__: m2d_jacc = __m2d_sim_jacc__[word] m2d_2grams = __m2d_sim_2grams__[word] m2d_3grams = __m2d_sim_3grams__[word] m2d_4grams = __m2d_sim_4grams__[word] # DebugHandler.print_2d_matrix(m2d_jacc) # DebugHandler.print_2d_matrix(m2d_2grams) # DebugHandler.print_2d_matrix(m2d_3grams) # DebugHandler.print_2d_matrix(m2d_4grams) # m2d_ngrams = [[0 for x in range(len(m2d_sim[0]))] for x in range(len(m2d_sim))] monogram_weight = 0.25 bigram_weight = 0.25 trigram_weight = 0.25 for i in range(len(m2d_sim)): for j in range(len(m2d_sim[0])): m2d_ngrams[i][j] = m2d_jacc[i][j]*monogram_weight \ + m2d_2grams[i][j]*bigram_weight \ + m2d_3grams[i][j]*(trigram_weight) \ + m2d_4grams[i][j]*(1- monogram_weight - bigram_weight - trigram_weight) __dict_ngrams__[word] = m2d_ngrams # print word m2d_ngrams = __dict_ngrams__[word] # DebugHandler.print_2d_matrix(m2d_ngrams) # DebugHandler.print_2d_matrix(m2d_sim) # ngram_weight = 0.075 # for iWnWord in range(len(m2d_sim)): # for iDictWord in range(len(m2d_sim[0])): # jacc = m2d_jacc[iWnWord][iDictWord] # ngrams = m2d_ngrams[iWnWord][iDictWord] # m2d_jacc[iWnWord][iDictWord] = jacc*(1-ngram_weight) + ngrams*ngram_weight # JACCARD_WEIGHT = Parameters.MORPHO.JACCARD for i in range(len(m2d_sim)): for j in range(len(m2d_sim[0])): m2d_sim[i][j] = m2d_sim[i][j]*(1-JACCARD_WEIGHT) + JACCARD_WEIGHT*(m2d_ngrams[i][j]); # DebugHandler.print_2d_matrix(m2d_sim) # if len(m2d_sim) == 1 and len(m2d_sim[0]) == 1: # continue # m2d_sim = choose_pair_0_1(m2d_sim, len(m2d_sim), len(m2d_sim[0])) # m2d_sim = pair_0_1_reducing_m2d_sim(m2d_sim, len(m2d_sim), len(m2d_sim[0]), word) # print word # DebugHandler.print_2d_matrix(m2d_sim) pair = count_pair(m2d_sim) total_pair += pair (tp, tn, fn, fp) = CompareWithGold.compareGoldWithResult_without_cal_result(m2d_sim,word) # precision = tp / (tp + fp + 0.0001) # recall = tp / (tp + fn + 0.0001) # accuracy = (tp + tn) / (tp + tn + fp + fn + 0.0001) # # f_score = 0 # if precision != 0 or recall != 0: # f_score = 2*(precision*recall)/(precision + recall) # if f_score < 0.5: # print word # print f_score # print tp # print tn # print fn # print fp # if tp != -1: total_tp += tp total_tn += tn total_fn += fn total_fp += fp precision = total_tp / (total_tp + total_fp) recall = total_tp / (total_tp + total_fn) accuracy = (total_tp + total_tn) / (total_tp + total_tn + total_fp + total_fn) f_score = 0 if precision != 0 or recall != 0: f_score = 2*(precision*recall)/(precision + recall) print "total:" print total_pair print total_tp print total_tn print total_fn print total_fp print precision print recall print f_score print accuracy Parameters.append_result_to_file( precision, recall, f_score, accuracy) current_params = Parameters.get_current_params() current_params = copy.deepcopy(current_params) return f_score, current_params
def create_input_for_test(): dict_ox = OxfordParser.get_dict_nouns() create_input_sens_test(dict_ox)
# row arrRowDict = []; arrRowDict.append("--"); for i in range(len(dict_words)): if not dict_words[str(i)].has_key('tv'): dict_words[str(i)]['tv'] = "--"; if dict_words[str(i)]['tv'] == None: dict_words[str(i)]['tv'] = "--" arrRowDict.append(dict_words[str(i)]["tv"].encode('utf8')); FileProcess.write_to_excel_file("Results/"+WORD+"_synsets_synsets_nbest_withword_average_vn.csv",arrRowDict,matrix_similarity) #################################################################################################### dictOxford = OxfordParser.readOxfordNouns(); print dictOxford def similarityWordB(): for word in dictOxford: print word print dictOxford[word] if word == 'bank': similarity_by_synsets_synsets_nbest_withword_average(word,dictOxford[word]); ######################################## ########################################
def cal_feature_values_for(syn_wn, syn_ox): feature_values = [] defi_wn = WordnetHandler.get_defi_for_syn(syn_wn) defi_ox = OxfordParser.get_defi_for_syn(syn_ox) gloss_wn = WordnetHandler.get_gloss_for_syn(syn_wn) gloss_ox = OxfordParser.get_gloss_for_syn(syn_ox) lemma_wn = WordnetHandler.get_lemma_for_synset(syn_wn) sd_ox = OxfordParser.get_short_defi_for_syn(syn_ox) ex_wn = WordnetHandler.get_ex_for_syn(syn_wn) ex_ox = OxfordParser.get_ex_for_syn(syn_ox) cl_ox = OxfordParser.get_collocation_for_syn(syn_ox) hyper_wn = WordnetHandler.get_hyper_defi_for_synset(syn_wn) mero_wn = WordnetHandler.get_mero_defi_for_synset(syn_wn) # # # # # # # # # # # # # # # # # # Literal literal_leven_value = 1-Literal.levenshtein(defi_wn, defi_ox) feature_values.append(literal_leven_value) literal_jacc_value = 1.00001-Literal.jaccard(defi_wn, defi_ox) feature_values.append(literal_jacc_value) # feature_values.append(literal_jacc_value+literal_leven_value) # # # # # # # # # # literal_leven_value = 1-Literal.levenshtein(gloss_wn, gloss_ox) feature_values.append(literal_leven_value) literal_jacc_value = 1.00001-Literal.jaccard(gloss_wn, gloss_ox) feature_values.append(literal_jacc_value) # feature_values.append(literal_jacc_value+literal_leven_value) # # # # # # # # # # literal_leven_ngram = literal_leven_value literal_jacc_ngram = literal_jacc_value ngrams_value = Ngrams.ngrams_word_for(gloss_wn, gloss_ox, 2) literal_jacc_ngram += ngrams_value literal_leven_ngram += ngrams_value ngrams_value = Ngrams.ngrams_word_for(gloss_wn, gloss_ox, 3) literal_jacc_ngram += ngrams_value literal_leven_ngram += ngrams_value ngrams_value = Ngrams.ngrams_word_for(gloss_wn, gloss_ox, 4) literal_jacc_ngram += ngrams_value literal_leven_ngram += ngrams_value ngrams_value = Ngrams.ngrams_word_for(gloss_wn, gloss_ox, 5) literal_jacc_ngram += ngrams_value literal_leven_ngram += ngrams_value feature_values.append(literal_jacc_ngram) # feature_values.append(literal_leven_ngram) # # # # # # # # # # # gloss_split_wn = Literal.split_and_stem(gloss_wn) # gloss_split_ox = Literal.split_and_stem(gloss_ox) # literal_jaro_winkler = Jelly.jaro_winkler(gloss_wn, gloss_ox) # feature_values.append(literal_jaro_winkler + literal_jacc_value) # # # # # # # # # # # literal_jacc_value = 1.00001-Literal.jaccard(ex_wn, ex_ox) # feature_values.append(literal_jacc_value) # # # # # # # # # # # # # # # # # # ShallowSyntactic # shallow_jaccard_POS = 0 # shallow_jaccard_POS += 1.0001 - ShallowSyntactic.jaccard_POS(gloss_wn, gloss_ox) # shallow_jaccard_POS += 1.0001 - ShallowSyntactic.jaccard_POS_ngrams(gloss_wn, gloss_ox, 2) # shallow_jaccard_POS += 1.0001 - ShallowSyntactic.jaccard_POS_ngrams(gloss_wn, gloss_ox, 3) # shallow_jaccard_POS += 1.0001 - ShallowSyntactic.jaccard_POS_ngrams(gloss_wn, gloss_ox, 4) # feature_values.append(shallow_jaccard_POS) # # # # # # # # # # # # # # # # # # wordnet-based, WSD wn_value = WordnetBased.wordnet_based(defi_wn, defi_ox, 0) feature_values.append(wn_value) # wn_value = WordnetBased.wordnet_based(hyper_wn, defi_ox, 0) # feature_values.append(wn_value) # hypo_value = 0 # if len(syn_wn.hyponyms()) > 0: # for hypo in syn_wn.hyponyms(): # hypo_value += WordnetBased.wordnet_based_synset(hypo, defi_ox) # hypo_value /= len(syn_wn.hyponyms()) # feature_values.append(hypo_value) # hyper_value = 0 # if len(syn_wn.hypernyms()) > 0: # for hyper in syn_wn.hypernyms(): # hyper_value += WordnetBased.wordnet_based_synset(hyper, defi_ox) # hyper_value /= len(syn_wn.hypernyms()) # feature_values.append(hyper_value) # # wn_value = WordnetBased.wordnet_based(ex_wn, ex_ox,0) # feature_values.append(wn_value) # # wn_value_1 = WordnetBased.wordnet_based(defi_wn, defi_ox, 1) # feature_values.append(wn_value + wn_value_1) # # wn_value = WordnetBased.wordnet_based(gloss_wn, gloss_ox, 0) # feature_values.append(wn_value) # # wn_value_1 = WordnetBased.wordnet_based(gloss_wn, gloss_ox, 1) # feature_values.append(wn_value + wn_value_1) # # # # # # # # # # # # # # # # # # lsa # lsa_tfidf = LSA.sim_tfidf(defi_wn, defi_ox) # feature_values.append(lsa_tfidf) ## # lsa_tfidf = LSA.sim_tfidf(hyper_wn, defi_ox) # feature_values.append(lsa_tfidf) # # lsa_tfidf = LSA.sim_tfidf(gloss_wn, gloss_ox) # feature_values.append(lsa_tfidf) # lsa_tfidf = LSA.sim_tfidf(lemma_wn, sd_ox) # feature_values.append(lsa_tfidf) # # lsa_tfidf = LSA.sim_tfidf(ex_wn, ex_ox) # feature_values.append(lsa_tfidf) return feature_values