{"id":20457813,"url":"https://github.com/pythainlp/multiel","last_synced_at":"2025-04-13T05:28:31.164Z","repository":{"id":177224804,"uuid":"660084131","full_name":"PyThaiNLP/MultiEL","owner":"PyThaiNLP","description":"Multilingual Entity Linking model by BELA model","archived":false,"fork":false,"pushed_at":"2023-07-20T05:00:41.000Z","size":4150,"stargazers_count":11,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-26T22:11:34.370Z","etag":null,"topics":["entity-linking","nlp-library"],"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/PyThaiNLP.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,"governance":null}},"created_at":"2023-06-29T07:56:33.000Z","updated_at":"2024-12-30T17:04:47.000Z","dependencies_parsed_at":"2023-07-23T00:16:14.164Z","dependency_job_id":null,"html_url":"https://github.com/PyThaiNLP/MultiEL","commit_stats":null,"previous_names":["wannaphong/multiel","pythainlp/multiel"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyThaiNLP%2FMultiEL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyThaiNLP%2FMultiEL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyThaiNLP%2FMultiEL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyThaiNLP%2FMultiEL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PyThaiNLP","download_url":"https://codeload.github.com/PyThaiNLP/MultiEL/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248586241,"owners_count":21128998,"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":["entity-linking","nlp-library"],"created_at":"2024-11-15T12:09:18.881Z","updated_at":"2025-04-13T05:28:31.133Z","avatar_url":"https://github.com/PyThaiNLP.png","language":"Python","readme":"# MultiEL\nMultilingual Entity Linking model by BELA model\n\nThis project want to create easy-to-use Multilingual Entity Linking model by BELA model for entity linking in 98 languages.\n\n**Origin Project**\n\n- Bi-encoder Entity Linking Architecture (BELA): [https://github.com/facebookresearch/BELA](https://github.com/facebookresearch/BELA)\n- Multilingual End to End Entity Linking: [https://arxiv.org/abs/2306.08896](https://arxiv.org/abs/2306.08896)\n\n\n## Install\n\n\u003e pip install multiel\n\n## Usage\n\n```python\nfrom multiel import BELA\n\nbela_run = BELA(device=\"cuda\")\n\nprint(bela_run.process_batch([\"Jobs was CEO of Apple\"]))\n# output: [{'offsets': [9, 16], 'lengths': [3, 5], 'entities': ['Q484876', 'Q312'], 'md_scores': [0.24852867424488068, 0.7043067216873169], 'el_scores': [0.48497316241264343, 0.9504457712173462]}]\nprint(bela_run.process_batch([\"ジョブズ氏はアップルのCEOだった\"]))\n# output: [{'offsets': [6, 6, 11], 'lengths': [5, 8, 3], 'entities': ['Q312', 'Q312', 'Q484876'], 'md_scores': [0.8206272721290588, 0.2937866449356079, 0.27033868432044983], 'el_scores': [0.9398021101951599, 0.0239552054554224, 0.4219340682029724]}]\nprint(bela_run.process_batch([\"Jobs war der CEO von Apple\"]))\n# output: [{'offsets': [13, 21], 'lengths': [3, 5], 'entities': ['Q484876', 'Q312'], 'md_scores': [0.4644337594509125, 0.7975106835365295], 'el_scores': [0.6950674653053284, 0.9626906514167786]}]\nprint(bela_run.process_batch([\"जॉब्स एप्पल के सीईओ थे\"]))\n# output: [{'offsets': [6, 15], 'lengths': [5, 4], 'entities': ['Q312', 'Q484876'], 'md_scores': [0.5419769883155823, 0.20518577098846436], 'el_scores': [0.8974292874336243, 0.3540962338447571]}]\nprint(bela_run.process_batch([\"จ๊อบเคยเป็นซีอีโอบริษัทแอปเปิล\"]))\n# output: [{'offsets': [11, 23], 'lengths': [6, 7], 'entities': ['Q484876', 'Q312'], 'md_scores': [0.30301809310913086, 0.6399497389793396], 'el_scores': [0.7142490744590759, 0.8657019734382629]}]\n```\n\n#### API\n\n```python\nfrom multiel import BELA\n\nBELA(\n md_threshold:float=0.2,\n el_threshold:float=0.4, \n checkpoint_name: str=\"wiki\", \n device: str=\"cuda:0\",\n config_name:str=\"joint_el_mel_new\",\n repo:str=\"wannaphong/BELA\"\n)\n```\n\n- md_threshold: md threshold\n- el_threshold: Entity Linking threshold\n- checkpoint_name: checkpoint name (wiki, aida, mewsli, and e2e) or your file name with extension\n- device: device\n- config_name: config name (in the BELA project)\n- repo: Huggingface Hub repo (Default [wannaphong/BELA](https://huggingface.co/wannaphong/BELA))\n\n**Predict**\n\n```python\nBELA.process_batch([str, str])\n```\n\n## How to train the model?\n\nSee more: [Multilingual End to End Entity Linking\n](https://github.com/facebookresearch/BELA)\n## License\n\nMIT license and the model is MIT license. ([BELA is MIT licensed](https://github.com/facebookresearch/BELA/blob/main/LICENSE))\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpythainlp%2Fmultiel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpythainlp%2Fmultiel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpythainlp%2Fmultiel/lists"}