Esempio n. 1
0
    def set_all_auxs(self, features=vc.get_all_features(), reset=False):
        if reset:
            self.X = []
            self.Y = []

        if not self.X:
            self.X += self.all_auxs_to_features(features)
            self.Y += self.get_aux_classifications()
Esempio n. 2
0
    def set_all_auxs(self, features=vc.get_all_features(), reset=False):
        if reset:
            self.X = []
            self.Y = []

        if not self.X:
            self.X += self.all_auxs_to_features(features)
            self.Y += self.get_aux_classifications()
Esempio n. 3
0
                    f.write("%s\n%s: %s\n\n" % (str(aux), pair[0].upper(), sentdict.words_to_string()))
                else:
                    f.write("\n%s: %0.3f\n" % (pair[0], pair[1]))

    def initialize2(self, aux_type=None, rules_test=False, oversample=5):
        if aux_type:
            self.set_aux_type(aux_type)

        if not rules_test:
            self.oversample(multiplier=oversample)


if __name__ == "__main__":
    start_time = time.clock()

    features = vc.get_all_features(old_rules=True)
    print "Features:",
    print features

    if len(argv) == 5:
        classifier = VPEDetectionClassifier(int(argv[1]), int(argv[2]), int(argv[3]), int(argv[4]))

    # c.all_auxiliaries.print_gold_auxiliaries()

    # for a in c.gold_standard_auxs:
    #     try:
    #         sent = c.sentences.get_sentence(a.sentnum)
    #         sent.print_sentence()
    #         if 'his' in sent.words and 'wife' in sent.words:
    #             print sent.get_nltk_tree()
    #         # print c.sentences.get_sentence(a.sentnum).words[a.wordnum],
Esempio n. 4
0
                                                sentdict.words_to_string()))
                else:
                    f.write('\n%s: %0.3f\n' % (pair[0], pair[1]))

    def initialize2(self, aux_type=None, rules_test=False, oversample=5):
        if aux_type:
            self.set_aux_type(aux_type)

        if not rules_test:
            self.oversample(multiplier=oversample)


if __name__ == '__main__':
    start_time = time.clock()

    features = vc.get_all_features(old_rules=True)
    print 'Features:',
    print features

    if len(argv) == 5:
        classifier = VPEDetectionClassifier(int(argv[1]), int(argv[2]),
                                            int(argv[3]), int(argv[4]))

    # c.all_auxiliaries.print_gold_auxiliaries()

    # for a in c.gold_standard_auxs:
    #     try:
    #         sent = c.sentences.get_sentence(a.sentnum)
    #         sent.print_sentence()
    #         if 'his' in sent.words and 'wife' in sent.words:
    #             print sent.get_nltk_tree()