{"library":"snorkel","title":"Snorkel","type":"library","description":"A system for quickly generating training data with weak supervision. Uses labeling functions and probabilistic models to create noisy labels. Current version 0.10.0, supports Python >=3.11. Releases are infrequent; maintenance updates only.","language":"python","status":"active","last_verified":"Sat May 09","install":{"commands":["pip install snorkel"],"cli":null},"imports":["from snorkel.labeling.model import LabelModel","from snorkel.labeling import LFAnalysis","from snorkel.classification import SnorkelClassifier"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":"https://snorkel.org","github":"https://github.com/snorkel-team/snorkel","docs":null,"changelog":null,"pypi":"https://pypi.org/project/snorkel/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"from snorkel.labeling import labeling_function, LFAnalysis\nfrom snorkel.labeling.model import LabelModel\nimport numpy as np\n\n@labeling_function()\ndef lf_keyword(x):\n    # Return 1 if 'keyword' in text else 0\n    return 1 if 'keyword' in x else 0\n\n# Example data\ndata = ['text with keyword', 'no match']\n# Apply LFs (simulate L matrix)\nL = np.array([[1, 0], [0, 0])\n# Train LabelModel\nlabel_model = LabelModel(cardinality=2, verbose=True)\nlabel_model.fit(L_train=L, n_epochs=500, log_freq=100, seed=123)\npredictions = label_model.predict(L=L)","lang":"python","description":"Basic Snorkel flow: define labeling functions, generate label matrix, train LabelModel.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}