ebe4256914107273feb1da940fc3e4237731365e,nalaf/preprocessing/edges.py,SimpleEdgeGenerator,generate,#SimpleEdgeGenerator#,37

Before Change


        for part in dataset.parts():
            part.edges = []

            for ann_1, ann_2 in product(
                    (ann for ann in chain(part.annotations, part.predicted_annotations) if ann.class_id == self.entity1_class),
                    (ann for ann in chain(part.annotations, part.predicted_annotations) if ann.class_id == self.entity2_class)):

                index_1 = part.get_sentence_index_for_annotation(ann_1)
                index_2 = part.get_sentence_index_for_annotation(ann_2)

                if index_1 == index_2 and index_1 is not None:
                    part.edges.append(
                        Edge(ann_1, ann_2, self.relation_type, index_1, part))


class WordFilterEdgeGenerator(EdgeGenerator):
    
    Simple implementation of generating edges between the two entities
    if they are contained in the same sentence AND the sentence

After Change


        import warnings
        warnings.warn("Use `SentenceDistanceEdgeGenerator` directly. This will be deleted", DeprecationWarning)

        super().generate(dataset)


class WordFilterEdgeGenerator(EdgeGenerator):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: Rostlab/nalaf
Commit Name: ebe4256914107273feb1da940fc3e4237731365e
Time: 2016-11-11
Author: i@juanmi.rocks
File Name: nalaf/preprocessing/edges.py
Class Name: SimpleEdgeGenerator
Method Name: generate


Project Name: Rostlab/nalaf
Commit Name: 8a2e857746dbab697b0045aa6c38133f3de71250
Time: 2016-11-14
Author: i@juanmi.rocks
File Name: nalaf/learning/taggers.py
Class Name: StubSameSentenceRelationExtractor
Method Name: annotate


Project Name: dnouri/skorch
Commit Name: 892065c8339f9c20d36127645ba3ae169577f47b
Time: 2020-06-27
Author: b.bossan@gmail.com
File Name: skorch/classifier.py
Class Name: NeuralNetClassifier
Method Name: predict