Base API Postprocesing class :param start_tokens: token representation for [ or other tokens :param end_tokens: token representation for ] or other tokens :param minimum_percentage: pass percentage for candidate generation, less than this are ignored.
(
self,
start_tokens: List[int],
end_tokens: List[int],
minimum_percentage: float = 0.1,
)
| 16 | |
| 17 | class APICallPostprocessing: |
| 18 | def __init__( |
| 19 | self, |
| 20 | start_tokens: List[int], |
| 21 | end_tokens: List[int], |
| 22 | minimum_percentage: float = 0.1, |
| 23 | ): |
| 24 | """ |
| 25 | Base API Postprocesing class |
| 26 | |
| 27 | :param start_tokens: token representation for [ or other tokens |
| 28 | :param end_tokens: token representation for ] or other tokens |
| 29 | :param minimum_percentage: pass percentage for candidate generation, less than this are ignored. |
| 30 | """ |
| 31 | self.start_tokens = start_tokens |
| 32 | self.end_tokens = end_tokens |
| 33 | self.minimum_percentage = minimum_percentage |
| 34 | self.api_text = "" # API text, might be better to pass it in |
| 35 | self.k_values = 5 # Default topk generation, might be better to pass it in |
| 36 | |
| 37 | def filter_continuations( |
| 38 | self, |
nothing calls this directly
no outgoing calls
no test coverage detected