ed213612f72a23c3a87bf8d8cbae858c41c26e10,nalaf/features/relations/new/sentence.py,SentenceFeatureGenerator,generate,#SentenceFeatureGenerator#,40

Before Change



            for e_class_id, entities in edge.get_any_entities_in_sentences(predicted=False).items():
                count = len(entities)
                if e_class_id in [edge.entity1.class_id, edge.entity2.class_id]:
                    // Rest -1 thus removing each consider pair of entities
                    count -= 1

                // TODO feature select with integer value or binary representation ?
                // self.add(f_set, is_train, edge, "f_counts", "binary", e_class_id, "is", count)
                self.add_with_value(f_set, is_train, edge, "f_counts", count, "int", e_class_id)

            for e_class_id, entities in edge.get_any_entities_between_entities(predicted=False).items():
                count = str(len(entities))

After Change


            for e_class_id, entities in edge.get_any_entities_in_sentences(predicted=False).items():
                count = -1  // start from -1, as one is already one of the edge"s entities
                count += len(entities)
                assert count >= 0
                self.add_with_value(f_set, is_train, edge, "f_counts", count, "int", e_class_id)

            count = 0
            for e_class_id, entities in edge.get_any_entities_between_entities(predicted=False).items():
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 6

Non-data size: 3

Instances


Project Name: Rostlab/nalaf
Commit Name: ed213612f72a23c3a87bf8d8cbae858c41c26e10
Time: 2017-01-12
Author: i@juanmi.rocks
File Name: nalaf/features/relations/new/sentence.py
Class Name: SentenceFeatureGenerator
Method Name: generate


Project Name: tech-srl/code2vec
Commit Name: 98a0b1b840a75f4cef7a4c3a0fefe354df4a1595
Time: 2019-04-03
Author: eladnah@gmail.com
File Name: common.py
Class Name: common
Method Name: save_word2vec_file


Project Name: recipy/recipy
Commit Name: 7b41deb87d3f6b3a8adf7ec94e6fd7b21e409299
Time: 2016-10-21
Author: michaelj@epcc.ed.ac.uk
File Name: integration_test/testcases/test_case_runner.py
Class Name: TestCaseRunner
Method Name: run_test_case


Project Name: open-mmlab/mmdetection
Commit Name: 2d2e5c6f42b6f4b8ab4f68985b1fd7823e3be505
Time: 2021-01-13
Author: 35596075+congee524@users.noreply.github.com
File Name: docs/stat.py
Class Name:
Method Name:


Project Name: tensorflow/minigo
Commit Name: e2d6d2109f5fda3b49959cfd1b26f6aca1656268
Time: 2019-03-15
Author: tmadams@google.com
File Name: rl_loop/selfplay.py
Class Name:
Method Name: run_tpu


Project Name: oddt/oddt
Commit Name: 178b1bc846ab4546c809771ae5fc2484790fd702
Time: 2018-05-17
Author: martasd@ibb.waw.pl
File Name: rdkit_fixer.py
Class Name:
Method Name: IsResidueConnected