MultiEL


NameMultiEL JSON
Version 0.5 PyPI version JSON
download
home_pagehttps://github.com/wannaphong/MultiEL
SummaryMultilingual Entity Linking model by BELA model
upload_time2023-06-29 12:25:03
maintainer
docs_urlNone
authorWannaphong
requires_python>=3.6
licenseMIT License
keywords nlp natural language processing text analytics text processing localization computational linguistics
VCS
bugtrack_url
requirements faiss-gpu fairscale hydra-core hydra-submitit-launcher pyyaml pytorch-lightning transformers tqdm sentencepiece h5py protobuf ujson huggingface_hub accelerate
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # MultiEL
Multilingual Entity Linking model by BELA model

This project want to create easy-to-use Multilingual Entity Linking model by BELA model.

**Origin Project**

- Bi-encoder Entity Linking Architecture (BELA): [https://github.com/facebookresearch/BELA](https://github.com/facebookresearch/BELA)


## Install

> pip install multiel

## Usage

```python
from multiel import BELA

bela_run = BELA(device="cuda")

print(bela_run.process_batch(["นายกประยุทธ์ประกาศจัดการเลือกตั้ง"]))
```

output:
```python
[{'offsets': [0], 'lengths': [12], 'entities': ['Q2108126'], 'md_scores': [0.22365164756774902], 'el_scores': [0.6967974901199341]}]
```

#### API

```python
from multiel import BELA

BELA(
 md_threshold:float=0.2,
 el_threshold:float=0.4, 
 checkpoint_name: str="wiki", 
 device: str="cuda:0",
 config_name:str="joint_el_mel_new",
 repo:str="wannaphong/BELA"
)
```

- md_threshold: md threshold
- el_threshold: Entity Linking threshold
- checkpoint_name: checkpoint name (wiki, aida, mewsli, and e2e) or your file name with extension
- device: device
- config_name: config name (in the BELA project)
- repo: Huggingface Hub repo (Default [wannaphong/BELA](https://huggingface.co/wannaphong/BELA))

**Predict**

```python
BELA.process_batch([str, str])
```

## License

MIT license and the model is MIT license. ([BELA is MIT licensed](https://github.com/facebookresearch/BELA/blob/main/LICENSE))

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/wannaphong/MultiEL",
    "name": "MultiEL",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "NLP,natural language processing,text analytics,text processing,localization,computational linguistics",
    "author": "Wannaphong",
    "author_email": "wannaphong@yahoo.com",
    "download_url": "https://files.pythonhosted.org/packages/49/79/47ab743a239de6ff22795b884aff8be8e1029aa9b66aea58d538420e20af/MultiEL-0.5.tar.gz",
    "platform": null,
    "description": "# MultiEL\nMultilingual Entity Linking model by BELA model\n\nThis project want to create easy-to-use Multilingual Entity Linking model by BELA model.\n\n**Origin Project**\n\n- Bi-encoder Entity Linking Architecture (BELA): [https://github.com/facebookresearch/BELA](https://github.com/facebookresearch/BELA)\n\n\n## Install\n\n> 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([\"\u0e19\u0e32\u0e22\u0e01\u0e1b\u0e23\u0e30\u0e22\u0e38\u0e17\u0e18\u0e4c\u0e1b\u0e23\u0e30\u0e01\u0e32\u0e28\u0e08\u0e31\u0e14\u0e01\u0e32\u0e23\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e15\u0e31\u0e49\u0e07\"]))\n```\n\noutput:\n```python\n[{'offsets': [0], 'lengths': [12], 'entities': ['Q2108126'], 'md_scores': [0.22365164756774902], 'el_scores': [0.6967974901199341]}]\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## License\n\nMIT license and the model is MIT license. ([BELA is MIT licensed](https://github.com/facebookresearch/BELA/blob/main/LICENSE))\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Multilingual Entity Linking model by BELA model",
    "version": "0.5",
    "project_urls": {
        "Bug Reports": "https://github.com/wannaphong/MultiEL/issues",
        "Homepage": "https://github.com/wannaphong/MultiEL",
        "Source": "https://github.com/wannaphong/MultiEL"
    },
    "split_keywords": [
        "nlp",
        "natural language processing",
        "text analytics",
        "text processing",
        "localization",
        "computational linguistics"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9a5753c07bf769067c8ebdb352d356fa75040aa7a91226aca4504e6c07ad9767",
                "md5": "7e413b4676f07ef0faf3030b8723df87",
                "sha256": "c036e85f7f048339bdcdcf8401beca484351bbf9440d80cbf5ac8000ec465ec2"
            },
            "downloads": -1,
            "filename": "MultiEL-0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7e413b4676f07ef0faf3030b8723df87",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 4226920,
            "upload_time": "2023-06-29T12:25:00",
            "upload_time_iso_8601": "2023-06-29T12:25:00.869663Z",
            "url": "https://files.pythonhosted.org/packages/9a/57/53c07bf769067c8ebdb352d356fa75040aa7a91226aca4504e6c07ad9767/MultiEL-0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "497947ab743a239de6ff22795b884aff8be8e1029aa9b66aea58d538420e20af",
                "md5": "b80dec996a94c97ed11a7955b0f522a4",
                "sha256": "0aee992a50cb1632323bc327288f4f6c14e444f12cb7af4dd5f1790641e82718"
            },
            "downloads": -1,
            "filename": "MultiEL-0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "b80dec996a94c97ed11a7955b0f522a4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 4141387,
            "upload_time": "2023-06-29T12:25:03",
            "upload_time_iso_8601": "2023-06-29T12:25:03.562757Z",
            "url": "https://files.pythonhosted.org/packages/49/79/47ab743a239de6ff22795b884aff8be8e1029aa9b66aea58d538420e20af/MultiEL-0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-29 12:25:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "wannaphong",
    "github_project": "MultiEL",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "faiss-gpu",
            "specs": []
        },
        {
            "name": "fairscale",
            "specs": []
        },
        {
            "name": "hydra-core",
            "specs": []
        },
        {
            "name": "hydra-submitit-launcher",
            "specs": []
        },
        {
            "name": "pyyaml",
            "specs": []
        },
        {
            "name": "pytorch-lightning",
            "specs": []
        },
        {
            "name": "transformers",
            "specs": []
        },
        {
            "name": "tqdm",
            "specs": []
        },
        {
            "name": "sentencepiece",
            "specs": []
        },
        {
            "name": "h5py",
            "specs": []
        },
        {
            "name": "protobuf",
            "specs": [
                [
                    "==",
                    "3.20"
                ]
            ]
        },
        {
            "name": "ujson",
            "specs": []
        },
        {
            "name": "huggingface_hub",
            "specs": []
        },
        {
            "name": "accelerate",
            "specs": [
                [
                    ">=",
                    "0.9.0"
                ]
            ]
        }
    ],
    "lcname": "multiel"
}
        
Elapsed time: 0.93678s