eaaf2bad32af4bda1a98d434530926bb6a001230,textacy/augmentation/transformations.py,,replace_with_synonyms,#Any#Any#Any#,66
Before Change
Returns:
List[Item]
replacements = random.sample(
[
(idx, synonyms[(item.text, item.pos)])
for idx, item in enumerate(items)
if item.is_word
],
n,
)
for idx, syns in replacements:
if syns:
curr_item = items[idx]
items[idx] = Item(
After Change
if not candidate_idx_syns:
return items
random_idx_syns = random.sample(candidate_idx_syns, min(n, len(candidate_idx_syns)))
for idx, syns in random_idx_syns:
curr_item = items[idx]
items[idx] = Item(
tok=None,
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 3
Instances
Project Name: chartbeat-labs/textacy
Commit Name: eaaf2bad32af4bda1a98d434530926bb6a001230
Time: 2019-08-23
Author: burtdewilde@gmail.com
File Name: textacy/augmentation/transformations.py
Class Name:
Method Name: replace_with_synonyms
Project Name: cornellius-gp/gpytorch
Commit Name: 5ea152e9f0d71e1dfdefac81cf7d60238e130c60
Time: 2020-08-04
Author: gpleiss@gmail.com
File Name: gpytorch/models/pyro/_pyro_mixin.py
Class Name: _PyroMixin
Method Name: pyro_model
Project Name: PIQuIL/QuCumber
Commit Name: 268e3e3fb41907f439cf06d3ffb391d77f049078
Time: 2018-07-26
Author: gtorlai@uwaterloo.ca
File Name: qucumber/quantum_reconstruction.py
Class Name: QuantumReconstruction
Method Name: compute_batch_gradients
Project Name: cornellius-gp/gpytorch
Commit Name: 2ae4f8999145c3d7a7a897dff4258a625a69076b
Time: 2019-11-10
Author: gpleiss@gmail.com
File Name: gpytorch/models/pyro/_pyro_mixin.py
Class Name: _PyroMixin
Method Name: pyro_guide