File size: 6,637 Bytes
6077218 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | [
{
"function_name": "__init__",
"file_path": "data_augmentation.py::Random",
"function_calls": [
{
"function_call_name": "Reorder",
"functionality": "Creates a Reorder augmentation operator instance",
"input": "rate_min, rate_max",
"output": "Reorder instance",
"location_or_namespace": "data_augmentation.py"
},
{
"function_call_name": "Substitute",
"functionality": "Creates a Substitute augmentation operator instance",
"input": "item_similarity_model, rate_min, rate_max",
"output": "Substitute instance",
"location_or_namespace": "data_augmentation.py"
},
{
"function_call_name": "print",
"functionality": "Prints the number of augmentation methods",
"input": "\"Total augmentation numbers: \", len(self.data_augmentation_methods)",
"output": "None",
"location_or_namespace": "builtins"
}
]
},
{
"function_name": "__call__",
"file_path": "data_augmentation.py::Random",
"function_calls": [
{
"function_call_name": "random.randint",
"functionality": "Randomly selects an index for augmentation method",
"input": "0, len(self.data_augmentation_methods) - 1",
"output": "int",
"location_or_namespace": "random"
},
{
"function_call_name": "__call__",
"functionality": "Applies the selected augmentation operator",
"input": "sequence",
"output": "augmented sequence, rate",
"location_or_namespace": "data_augmentation.py (Reorder or Substitute)"
}
]
},
{
"function_name": "_ensmeble_sim_models",
"file_path": "data_augmentation.py",
"function_calls": []
},
{
"function_name": "__init__",
"file_path": "data_augmentation.py::Substitute",
"function_calls": []
},
{
"function_name": "__call__",
"file_path": "data_augmentation.py::Substitute",
"function_calls": [
{
"function_call_name": "copy.deepcopy",
"functionality": "Creates a deep copy of the input sequence",
"input": "sequence",
"output": "copied_sequence",
"location_or_namespace": "copy"
},
{
"function_call_name": "np.random.uniform",
"functionality": "Samples the substitute rate from a uniform distribution",
"input": "low=self.rate_min, high=self.rate_max",
"output": "float",
"location_or_namespace": "numpy"
},
{
"function_call_name": "int",
"functionality": "Converts substitute rate times sequence length to int",
"input": "substitute_rate * len(copied_sequence)",
"output": "int",
"location_or_namespace": "builtins"
},
{
"function_call_name": "max",
"functionality": "Ensures at least one item is substituted",
"input": "int(substitute_rate * len(copied_sequence)), 1",
"output": "int",
"location_or_namespace": "builtins"
},
{
"function_call_name": "range",
"functionality": "Generates list of possible indices for substitution",
"input": "len(copied_sequence)",
"output": "range object",
"location_or_namespace": "builtins"
},
{
"function_call_name": "random.sample",
"functionality": "Randomly selects indices to substitute",
"input": "list of indices, k=substitute_nums",
"output": "list of int",
"location_or_namespace": "random"
},
{
"function_call_name": "self.item_sim_model_1.most_similar",
"functionality": "",
"input": "copied_sequence[index], with_score=True",
"output": "list of (item, score) tuples",
"location_or_namespace": ""
},
{
"function_call_name": "self.item_sim_model_2.most_similar",
"functionality": "",
"input": "copied_sequence[index], with_score=True",
"output": "list of (item, score) tuples",
"location_or_namespace": ""
},
{
"function_call_name": "_ensmeble_sim_models",
"functionality": "Selects the best substitute item from two similarity models",
"input": "top_k_one, top_k_two",
"output": "list of top item(s)",
"location_or_namespace": "data_augmentation.py"
},
{
"function_call_name": "self.item_similarity_model.most_similar",
"functionality": "",
"input": "copied_sequence[index]",
"output": "list of similar items",
"location_or_namespace": ""
}
]
},
{
"function_name": "__init__",
"file_path": "data_augmentation.py::Reorder",
"function_calls": []
},
{
"function_name": "__call__",
"file_path": "data_augmentation.py::Reorder",
"function_calls": [
{
"function_call_name": "copy.deepcopy",
"functionality": "Creates a deep copy of the input sequence",
"input": "sequence",
"output": "copied_sequence",
"location_or_namespace": "copy"
},
{
"function_call_name": "np.random.uniform",
"functionality": "Samples the reorder rate from a uniform distribution",
"input": "low=self.rate_min, high=self.rate_max",
"output": "float",
"location_or_namespace": "numpy"
},
{
"function_call_name": "int",
"functionality": "Converts reorder rate times sequence length to int",
"input": "reorder_rate * len(copied_sequence)",
"output": "int",
"location_or_namespace": "builtins"
},
{
"function_call_name": "random.randint",
"functionality": "Randomly selects the start index for the sub-sequence",
"input": "0, len(copied_sequence) - sub_seq_length - 1",
"output": "int",
"location_or_namespace": "random"
},
{
"function_call_name": "random.shuffle",
"functionality": "Shuffles the sub-sequence in place",
"input": "sub_seq",
"output": "None",
"location_or_namespace": "random"
},
{
"function_call_name": "assert",
"functionality": "Ensures that the length of the output sequence matches the input",
"input": "len(copied_sequence) == len(reordered_seq)",
"output": "None or AssertionError",
"location_or_namespace": "builtins"
}
]
}
]
|