1ddc26b3cfc16daae7cfdde9a730be33b8b690c0,pliers/extractors/text.py,PretrainedBertExtractor,_extract,#PretrainedBertExtractor#Any#,484
Before Change
def _extract(self, stims):
t_wds, t_ons, t_dur, t_tok, t_idx = self._preprocess(stims)
preds = self.model(t_idx)
preds = [p.detach().numpy() if self.framework == "pt" else
p.numpy() for p in preds]
out, t_tok, t_wds, t_ons, t_dur = self._postprocess(preds, t_tok, t_wds, t_ons, t_dur)
data = [out.tolist(), t_tok, t_wds]
features = self._get_feature_names()
return ExtractorResult(data, stims, self, features=features,
onsets=t_ons, durations=t_dur)
After Change
wds, ons, dur, tok, idx = self._preprocess(stims)
preds = self.model(idx)
preds = [p.detach() if self.framework == "pt" else p for p in preds]
preds = [p.numpy().squeeze() for p in preds]
data, ons, dur = self._postprocess(preds, tok, wds, ons, dur)
features = self._get_feature_names()
return ExtractorResult(data, stims, self,
features=features, onsets=ons, durations=dur)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances
Project Name: tyarkoni/pliers
Commit Name: 1ddc26b3cfc16daae7cfdde9a730be33b8b690c0
Time: 2020-03-02
Author: rbrrcc@gmail.com
File Name: pliers/extractors/text.py
Class Name: PretrainedBertExtractor
Method Name: _extract
Project Name: Pinafore/qb
Commit Name: e604607e0a26bd5ca244b60dba8769779f2f07a4
Time: 2018-04-19
Author: sjtufs@gmail.com
File Name: qanta/guesser/dan.py
Class Name: DanGuesser
Method Name: _guess_batch
Project Name: apple/coremltools
Commit Name: 523d5e03d86c26267ee6bdf17dd20f6ce6bdadd7
Time: 2020-10-10
Author: aseem.elec@gmail.com
File Name: coremltools/converters/mil/frontend/tensorflow2/test/testing_utils.py
Class Name:
Method Name: run_compare_tf_keras