Execution environment for labeling functions in refinery. Containerized function as a service to execute user-defined Python scripts.
For classification tasks, the schema is:
from typing import Dict, Any
def my_labeling_function(record: Dict[str: Any]) -> str:
return "my_label"
For extraction tasks, the schema is:
from typing import Dict, Any, Tuple
def my_labeling_function(record: Dict[str: Any]) -> Tuple[str, int, int]:
start_idx = ...
end_idx = ... # excluding format
return "my_label", start_idx, end_idx
If you like what we're working on, please leave a ⭐ for refinery!