234698b07ab372738686e3d3de6ab8f08b1a7057,nala/learning/taggers.py,RelationshipExtractionGeneMutation,tag,#RelationshipExtractionGeneMutation#Any#,135

Before Change


    def tag(self, dataset):
        for docid, doc in dataset.documents.items():
            for partid, part in doc.parts.items():
                for ann in part.annotations:
                    if ann.class_id == MUT_CLASS_ID:
                        for ann2 in part.annotations:
                            if ann2.class_id == PRO_CLASS_ID:
                                try:
                                    // here happens the magic
                                    // atm: if in same sentence is the only condition
                                    if part.return_sentence_nr(ann.offset) == part.return_sentence_nr(ann2.offset):
                                        part.relations.append(
                                            Relation(ann.offset, ann2.offset, ann.text, ann2.text, PRO_REL_MUT_CLASS_ID))
                                except IndexError:
                                    pass

    def tag_2(self, dataset):
        from itertools import product
        for part in dataset.parts():
            for ann_1, ann_2 in product(

After Change



    def tag(self, dataset):
        from itertools import product
        for part in dataset.parts():
            for ann_1, ann_2 in product(
                    (ann for ann in part.annotations if ann.class_id == MUT_CLASS_ID),
                    (ann for ann in part.annotations if ann.class_id == PRO_CLASS_ID)):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: Rostlab/nalaf
Commit Name: 234698b07ab372738686e3d3de6ab8f08b1a7057
Time: 2015-10-06
Author: carsten.uhlig@gmail.com
File Name: nala/learning/taggers.py
Class Name: RelationshipExtractionGeneMutation
Method Name: tag


Project Name: Rostlab/nalaf
Commit Name: 2bfe43baf6d546b546184abc9d1a1d0a1238db0c
Time: 2015-05-23
Author: aleksandar.bojchevski@gmail.com
File Name: source/preprocessing/tokenizers.py
Class Name: NLTKTokenizer
Method Name: tokenize


Project Name: Rostlab/nalaf
Commit Name: 2bfe43baf6d546b546184abc9d1a1d0a1238db0c
Time: 2015-05-23
Author: aleksandar.bojchevski@gmail.com
File Name: source/preprocessing/spliters.py
Class Name: NTLKSplitter
Method Name: split