{"id":19771987,"url":"https://github.com/danieldacosta/prompt-learning-bias","last_synced_at":"2025-02-28T04:44:12.872Z","repository":{"id":229396654,"uuid":"776628905","full_name":"DanielDaCosta/prompt-learning-bias","owner":"DanielDaCosta","description":"Apply the newly emerging field of prompt engineering to identify and measure social bias in language models","archived":false,"fork":false,"pushed_at":"2024-04-19T00:02:50.000Z","size":192,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-11T01:10:37.816Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DanielDaCosta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-03-24T02:56:07.000Z","updated_at":"2024-03-26T19:22:42.000Z","dependencies_parsed_at":"2024-04-19T01:24:02.260Z","dependency_job_id":null,"html_url":"https://github.com/DanielDaCosta/prompt-learning-bias","commit_stats":null,"previous_names":["danieldacosta/prompt-learning-bias"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielDaCosta%2Fprompt-learning-bias","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielDaCosta%2Fprompt-learning-bias/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielDaCosta%2Fprompt-learning-bias/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielDaCosta%2Fprompt-learning-bias/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DanielDaCosta","download_url":"https://codeload.github.com/DanielDaCosta/prompt-learning-bias/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241101665,"owners_count":19909943,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T05:05:00.444Z","updated_at":"2025-02-28T04:44:12.856Z","avatar_url":"https://github.com/DanielDaCosta.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# prompt-learning-bias\nApply the newly emerging field of prompt engineering to identify and measure social bias in language models\n\n# Custom Dataset\nCreated custom prompts for detecting bias on BERT, ALBERT and ROBERTA. The dataset follows the same format used in  the CrowS-Pairs dataset (https://github.com/nyu-mll/crows-pairs/blob/master/data/crows_pairs_anonymized.csv).\n\nEach example is a sentence pair, where the first sentence is always about a historically disadvantaged group in the United States and the second sentence is about a contrasting advantaged group. The first sentence can _demonstrate_ or _violate_ a stereotype. The other sentence is a minimal edit of the first sentence: The only words that change between them are those that identify the group. Each example has the following information:\n- `sent_more`: The sentence which is more stereotypical.\n- `sent_less`: The sentence which is less stereotypical.\n- `stereo_antistereo`: The stereotypical direction of the pair. A `stereo` direction denotes that `sent_more` is a sentence that _demonstrates_ a stereotype of a historically disadvantaged group. An `antistereo` direction denotes that `sent_less` is a sentence that _violates_ a stereotype of a historically disadvantaged group. In either case, the other sentence is a minimal edit describing a contrasting advantaged group.\n- `bias_type`: The type of biases present in the example.\n- `annotations`: The annotations of bias types from crowdworkers.\n- `anon_writer`: The _anonymized_ id of the writer.\n- `anon_annotators`: The _anonymized_ ids of the annotators.\n\n# Evaluation Metric\nFor the evaluation metric with use use pseudo-log-likehood MLM scoring. Original source code: https://github.com/nyu-mll/crows-pairs/blob/master/metric.py\n\n# Next Steps\n1. Expand custom dataset to 100 samples\n2. Re-evaluate MLM scoring metric in all of them\n3. Expand it the metric to Auto-Regressive models: GPT-2 =\u003e We'll need to modify the original code\n\n\n# References\nhttps://github.com/nyu-mll/crows-pairs/tree/master","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanieldacosta%2Fprompt-learning-bias","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanieldacosta%2Fprompt-learning-bias","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanieldacosta%2Fprompt-learning-bias/lists"}