001010c152897b4f476ca5e435f86c9b75b17078,padatious/train_data.py,TrainData,add_lines,#TrainData#Any#Any#,27
Before Change
sents = []
for line in lines:
if not line.isspace():
tokens = tokenize(line)
sents += expand_parentheses(tokens)
self.sent_lists[name] = sents
def add_file(self, name, file_name):
with open(file_name, "r") as f:
After Change
self.sent_lists = {}
def add_lines(self, name, lines):
self.sent_lists[name] = sum([expand_parentheses(tokenize(line))
for line in lines if not line.isspace()], [])
def add_file(self, name, file_name):
with open(file_name, "r") as f:
self.add_lines(name, f.readlines())
In pattern: SUPERPATTERN
Frequency: 5
Non-data size: 4
Instances Project Name: MycroftAI/padatious
Commit Name: 001010c152897b4f476ca5e435f86c9b75b17078
Time: 2017-10-11
Author: matthew3311999@gmail.com
File Name: padatious/train_data.py
Class Name: TrainData
Method Name: add_lines
Project Name: kermitt2/delft
Commit Name: b445c177a4543617c843f24943bb00e69ab24b36
Time: 2018-05-02
Author: patrice.lopez@science-miner.com
File Name: sequenceLabelling/tokenizer.py
Class Name:
Method Name: tokenizeAndFilter
Project Name: RasaHQ/rasa
Commit Name: 9270738bbd828b69d7c42693c4cf4c35c23f9c6a
Time: 2020-05-04
Author: tabergma@gmail.com
File Name: tests/utils/test_train_utils.py
Class Name:
Method Name: test_align_token_features_convert
Project Name: RasaHQ/rasa
Commit Name: a7fcffb524edc5d44ecf1e6b56cc517f0073b23f
Time: 2020-10-15
Author: f.koerner@rasa.com
File Name: tests/nlu/featurizers/test_convert_featurizer.py
Class Name:
Method Name: test_convert_featurizer_tokens_to_text
Project Name: PyThaiNLP/pythainlp
Commit Name: 7adc2ea7ec11cf4376551a9395bccf20d9013f20
Time: 2019-09-01
Author: supaseth@gmail.com
File Name: pythainlp/tokenize/__init__.py
Class Name:
Method Name: sent_tokenize