{"id":18594481,"url":"https://github.com/applenob/clip_chinese_text_encoder","last_synced_at":"2025-04-10T16:31:05.692Z","repository":{"id":37611720,"uuid":"356460179","full_name":"applenob/clip_chinese_text_encoder","owner":"applenob","description":"CLIP中文encoder","archived":false,"fork":false,"pushed_at":"2022-06-21T22:51:29.000Z","size":28044,"stargazers_count":22,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T00:41:58.566Z","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/applenob.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}},"created_at":"2021-04-10T03:34:43.000Z","updated_at":"2024-12-12T06:26:41.000Z","dependencies_parsed_at":"2022-08-19T02:00:41.596Z","dependency_job_id":null,"html_url":"https://github.com/applenob/clip_chinese_text_encoder","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/applenob%2Fclip_chinese_text_encoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/applenob%2Fclip_chinese_text_encoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/applenob%2Fclip_chinese_text_encoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/applenob%2Fclip_chinese_text_encoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/applenob","download_url":"https://codeload.github.com/applenob/clip_chinese_text_encoder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248252690,"owners_count":21072700,"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-07T01:15:41.823Z","updated_at":"2025-04-10T16:31:00.667Z","avatar_url":"https://github.com/applenob.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CLIP中文encoder\n\nCLIP Chinese Text Encoder：本项目适配了Open AI的CLIP `ViT-B/32` 模型的文本encoder部分，搭配官方的图片encoder，使用效果不错，欢迎大家试用讨论。\n\n## 使用\n\n- 将本项目clone至本地。\n- 通过链接下载模型参数文件`clip_zh.mse.pt`和开源数据`unsplash-dataset`至目录`data`。\n    - 链接：https://pan.baidu.com/s/1-MTLT8jgOHvRX80JF2lT8w 提取码：buk0 \n- 安装依赖：`pip install -r requirements.txt`\n- 使用：在本地启动`jupyter notebook`，打开`notebooks`目录下的笔记本体验。\n    - `chinese_demo.ipynb`：以文搜图。\n    - `video_demo.ipynb`：以文搜视频。\n\n## 介绍\n\nOpen AI的CLIP模型使用海量图文对，用文本帮助图片做预训练。官方开源的模型，以文搜图的效果惊艳。但官方只采用了英文，在中文使用时必须采用翻译，增加了中文使用CLIP的不确定性。如果可以适配固定的中文encoder，并通过客观评估找出一些优质的，将会极大便利中文数据使用CLIP做下游任务。\n\n本encoder目前支持中英双语。\n\n训练原理如下图所示，encoder本身采用CLIP原来的文本encoder结构：\n\n![model](resource/clip_zh_encoder.jpg)\n\n训练数据为中英开源平行语料。\n\n## 效果\n\n以文搜图：\n\n![](resource/text_search_image.jpg)\n\n以文搜视频：\n\n![](resource/text_search_video.jpg)\n\n## 量化评估\n\n在内部有中英文标签的数据集上做了zero-shot transfer的评估，效果不错，暂不展示数据。各位有了解其他评测方案的或者开源带多语言标签的数据集的欢迎推荐。\n\n## 参考资料\n\n- [CLIP官方仓库](https://github.com/openai/CLIP)\n- [CLIP英文搜图仓库](https://github.com/haltakov/natural-language-image-search)\n- [CLIP英文搜视频仓库](https://github.com/haltakov/natural-language-youtube-search)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapplenob%2Fclip_chinese_text_encoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapplenob%2Fclip_chinese_text_encoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapplenob%2Fclip_chinese_text_encoder/lists"}