21678f424e8a7b0734e2dcc31d0a2ee2e10af097,snorkel/annotations.py,AnnotationManager,load,#AnnotationManager#Any#Any#Any#,152
Before Change
for cid, kid, val in q.all():
if cid not in row_index:
row_index[cid] = len(row_index)
if kid not in col_index:
col_index[kid] = len(col_index)
X[row_index[cid], col_index[kid]] = val
// Return as an AnnotationMatrix
return self.matrix_cls(X, candidate_set=candidate_set, key_set=key_set)
After Change
// First, we query to construct the column index map
kid_to_col = {}
col_to_kid = {}
q = session.query(AnnotationKey.id).filter(AnnotationKey.sets.contains(key_set)).order_by(AnnotationKey.id)
for kid, in q.all():
if kid not in kid_to_col:
j = len(kid_to_col)
// Create both mappings
kid_to_col[kid] = j
col_to_kid[j] = kid
// Construct the query
q = session.query(self.annotation_cls.candidate_id, self.annotation_cls.key_id, self.annotation_cls.value)
q = q.join(Candidate, AnnotationKey)
q = q.filter(Candidate.sets.contains(candidate_set)).filter(AnnotationKey.sets.contains(key_set))
q = q.order_by(self.annotation_cls.candidate_id).yield_per(1000)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 10
Instances Project Name: snorkel-team/snorkel
Commit Name: 21678f424e8a7b0734e2dcc31d0a2ee2e10af097
Time: 2016-09-04
Author: ajratner@gmail.com
File Name: snorkel/annotations.py
Class Name: AnnotationManager
Method Name: load
Project Name: snorkel-team/snorkel
Commit Name: 21678f424e8a7b0734e2dcc31d0a2ee2e10af097
Time: 2016-09-04
Author: ajratner@gmail.com
File Name: snorkel/annotations.py
Class Name: AnnotationManager
Method Name: load
Project Name: neuroailab/tnn
Commit Name: fde7cc023ea226bf01563d0cbce919e85f8701fd
Time: 2016-10-02
Author: qbilius@gmail.com
File Name: model.py
Class Name:
Method Name: _last
Project Name: dpressel/mead-baseline
Commit Name: 4edc5dd05bb737dcba543b12c8943ffbae6c9c92
Time: 2018-09-26
Author: blester125@users.noreply.github.com
File Name: python/mead/tasks.py
Class Name: Task
Method Name: _configure_reporting