78962a65d919e3f21ecdf1d58155efd0c4c3f815,finetune/base_models/bert/encoder.py,BERTEncoder,_encode,#BERTEncoder#Any#Any#,44

Before Change


            subtokens = self.tokenizer.tokenize(text)
            subtoken_locs = [0]
            for tok in subtokens:
                if tok.startswith("////"):
                    subtoken_locs.append(subtoken_locs[-1] + len(tok) - 2)
                else:
                    subtoken_locs.append(subtoken_locs[-1] + len(tok) + 1)
            subtoken_locs = subtoken_locs[1:]

            batch_tokens.append(subtokens)
            batch_token_idxs.append(self.tokenizer.convert_tokens_to_ids(subtokens))

After Change


                label = labels[i]

            subtokens, token_idxs = self.tokenizer.tokenize(text)
            subtoken_locs = [l[1] for l in token_idxs]

            batch_tokens.append(subtokens)
            batch_token_idxs.append(self.tokenizer.convert_tokens_to_ids(subtokens))
            batch_character_locs.append(subtoken_locs)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 6

Instances


Project Name: IndicoDataSolutions/finetune
Commit Name: 78962a65d919e3f21ecdf1d58155efd0c4c3f815
Time: 2019-05-14
Author: benlt@hotmail.co.uk
File Name: finetune/base_models/bert/encoder.py
Class Name: BERTEncoder
Method Name: _encode


Project Name: idealo/image-super-resolution
Commit Name: 677467e2ae6a25911428540620b5e992cd64f482
Time: 2018-12-20
Author: testadicardi@gmail.com
File Name: src/predict/predict.py
Class Name: Predictor
Method Name: get_predictions


Project Name: coala/coala-bears
Commit Name: 7000896391a82ddf8def28c55fd2ce1066a097cd
Time: 2016-03-11
Author: uran198@gmail.com
File Name: bears/c_languages/codeclone_detection/CloneDetectionRoutines.py
Class Name:
Method Name: exclude_function


Project Name: OpenNMT/OpenNMT-tf
Commit Name: c141e570011e7adf3634bd65a3e7de30d8fbdca2
Time: 2018-10-18
Author: guillaumekln@users.noreply.github.com
File Name: opennmt/utils/checkpoint.py
Class Name:
Method Name: _create_checkpoint_from_variables