{"id":13422316,"url":"https://github.com/thunlp/HATT-Proto","last_synced_at":"2025-03-15T12:30:41.033Z","repository":{"id":44163999,"uuid":"157370563","full_name":"thunlp/HATT-Proto","owner":"thunlp","description":"Code and dataset of AAAI2019 paper Hybrid Attention-Based Prototypical Networks for Noisy Few-Shot Relation Classification","archived":false,"fork":false,"pushed_at":"2019-01-24T17:25:09.000Z","size":5617,"stargazers_count":189,"open_issues_count":2,"forks_count":36,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-01T05:51:13.583Z","etag":null,"topics":["few-shot","relation-extraction"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thunlp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-13T11:37:03.000Z","updated_at":"2025-01-08T09:06:44.000Z","dependencies_parsed_at":"2022-07-30T11:08:02.760Z","dependency_job_id":null,"html_url":"https://github.com/thunlp/HATT-Proto","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thunlp%2FHATT-Proto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thunlp%2FHATT-Proto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thunlp%2FHATT-Proto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thunlp%2FHATT-Proto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thunlp","download_url":"https://codeload.github.com/thunlp/HATT-Proto/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243730939,"owners_count":20338742,"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":["few-shot","relation-extraction"],"created_at":"2024-07-30T23:00:41.507Z","updated_at":"2025-03-15T12:30:39.567Z","avatar_url":"https://github.com/thunlp.png","language":"Python","funding_links":[],"categories":["Hybrid Attention-Based Prototypical Networks for Noisy Few-Shot Relation Classification. AAAI 2019"],"sub_categories":["[few-shot 知乎](https://zhuanlan.zhihu.com/p/58298920)"],"readme":"# Hybrid Attention-Based Prototypical Networks for Noisy Few-Shot Relation Classification\n\nCode and data for AAAI2019 paper [Hybrid Attention-Based Prototypical Networks for Noisy Few-Shot Relation Classification](https://gaotianyu1350.github.io/assets/aaai2019_hatt_paper.pdf).\n\nAuthor: Tianyu Gao*, Xu Han*, Zhiyuan Liu, Maosong Sun. (\\* means equal contribution)\n\n## Dataset and Word Embedding\n\nWe evaluate our models on [FewRel](https://thunlp.github.io/fewrel), a large-scale dataset for few-shot relation classification. It has 100 relations and 700 instances for each relation. You can find some baseline models from [here](https://github.com/thunlp/fewrel).\n\nDue to the large size, we did not upload the glove file (pre-trained word embedding). Please download `glove.6B.50d.json` from [Tsinghua Cloud](https://cloud.tsinghua.edu.cn/f/b14bf0d3c9e04ead9c0a/?dl=1) or [Google Drive](https://drive.google.com/open?id=1UnncRYzDpezPkwIqhgkVW6BacIqz6EaB) and put it under `data/` folder.\n\n## Usage\n\nTo run our code, use this command for training\n```bash\npython train.py {MODEL_NAME} {N} {K} {NOISE_RATE}\n```\nand use this command for testing\n```bash\npython test.py {MODEL_NAME} {N} {K} {NOISE_RATE}\n```\nwhere {MODEL_NAME} could be `proto` or `proto_hatt`, `{N}` is the num of classes, `{K}` is the num of instances for each class and `{NOISE_RATE}` is the probability that one instance is wrong-labeled.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthunlp%2FHATT-Proto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthunlp%2FHATT-Proto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthunlp%2FHATT-Proto/lists"}