bdf66f4cc11c083b48e74efa4df874668ef74805,pliers/extractors/text.py,WordCounterExtractor,_extract,#WordCounterExtractor#Any#,423

Before Change


        word_counter = pd.Series(tokens).groupby(tokens).cumcount() + 1
        if self.log_scale:
            word_counter = np.log(word_counter)
        results = []
        for i, count in enumerate(word_counter):
            results.append(ExtractorResult([count], list(stims)[i],
                           self, features=self.features))
        return results
        

After Change



    def _extract(self, stims):
        
        onsets = [s.onset for s in stims]
        durations = [s.duration for s in stims]
        tokens = [s.text for s in stims]
        tokens = [t if self.case_sensitive else t.lower() for t in tokens]
        word_counter = pd.Series(tokens).groupby(tokens).cumcount() + 1
        if self.log_scale:
            word_counter = np.log(word_counter)

        return ExtractorResult([word_counter], stims, self,
                               features=self.features,
                               onsets=onsets, durations=durations)

        
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 13

Instances


Project Name: tyarkoni/pliers
Commit Name: bdf66f4cc11c083b48e74efa4df874668ef74805
Time: 2020-02-14
Author: rbrrcc@gmail.com
File Name: pliers/extractors/text.py
Class Name: WordCounterExtractor
Method Name: _extract


Project Name: Qiskit/qiskit-aqua
Commit Name: a15a0a2165de02e2e3718e79f961eb200390ee04
Time: 2019-07-31
Author: chenrich@us.ibm.com
File Name: qiskit/aqua/operators/base_operator.py
Class Name: BaseOperator
Method Name: qubit_tapering


Project Name: IndicoDataSolutions/Enso
Commit Name: ae5602d3d008cc8b290b32e380fb72ae8fb53bd7
Time: 2018-04-18
Author: madison@indico.io
File Name: enso/metrics/basic_classification.py
Class Name: RocAuc
Method Name: evaluate


Project Name: janfreyberg/superintendent
Commit Name: dfd8e674ed63b4d258de4f484b7bac274c460d3e
Time: 2018-10-17
Author: janfreyberg@users.noreply.github.com
File Name: superintendent/distributed/dbqueue.py
Class Name: DatabaseQueue
Method Name: list_all