def get_features(self, context_obj):
        if 'source_token' not in context_obj or len(context_obj['source_token']) == 0:
            return [0.0 for i in range(len(self.thresholds)*2)]

        translations, translations_weighted = [], []
        for thr in self.thresholds:
            all_words, all_words_weighted = [], []
            for word in context_obj['source_token']:
                trans = [fl for fl in self.lex_prob[word] if fl >= thr]
                all_words.append(len(trans))
                all_words_weighted.append(len(trans)*self.corpus_freq.freq(word))
            translations.append(np.average(all_words))
            translations_weighted.append(np.average(all_words_weighted))
        return translations + translations_weighted
dataset/ETHPy150Open qe-team/marmot/marmot/features/phrase/num_translations_feature_extractor.py/NumTranslationsFeatureExtractor.get_features/original