# Hierarchical Label Propagation (HLP)
Implementation of Hierarchical Label Propagation (HLP) in python.
## Installation
This code is included in the `hierarchical-label-propagation` package. To install it, you can run the following command:
```bash
pip install hierarchical-label-propagation
```
## Usage
The `hierarchical-label-propagation` package provides a class called `HLP` that can be used to run the Hierarchical Label Propagation algorithm. The following code snippet shows how to use it:
```python
from hierarchical_label_propagation import HLP
hlp = HLP() # Creates an instance with the default HLP method for AudioSet.
```
HLP can now be applied to the AudioSet targets. Using the same API, it can either be done to the target of a single example or to the targets of a batch of examples. The following code snippet shows how to apply HLP:
```python
y = hlp.propagate(y) # Propagates the labels of a single example.
```
or
```python
X, Y, file_names = batch
Y = hlp.propagate(Y) # Propagates the labels of a batch of examples.
```
Please note that hlp.propagate() takes a 1D (# classes) or 2D (Batch Size, # classes) torch.Tensor as an input and returns the propagated labels as a torch.Tensor of the same shape as the input.
the `propagate` method can also be used to propagate on continuous values using the same API. This is true if and only if a higher value indicates a higher confidence in the label. This can be useful to apply HLP to the output of a classifier as a post-processing step.
## Citation
If you use this code in your research, please consider citing the following paper:
```
Citation will be added soon.
```
Raw data
{
"_id": null,
"home_page": null,
"name": "hierarchical-label-propagation",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "HLP, Hierarchical Label Propagation, Hierarchy, Ontology",
"author": null,
"author_email": "Ludovic TUNCAY <ludovic.tuncay@irit.fr>",
"download_url": "https://files.pythonhosted.org/packages/ce/bc/cf2e077f6fea127d2ede1835023c467b692128fb874ad5fd97cf34fdfcc0/hierarchical_label_propagation-0.1.0.tar.gz",
"platform": null,
"description": "# Hierarchical Label Propagation (HLP)\nImplementation of Hierarchical Label Propagation (HLP) in python.\n\n## Installation\nThis code is included in the `hierarchical-label-propagation` package. To install it, you can run the following command:\n\n```bash\npip install hierarchical-label-propagation\n```\n\n## Usage\nThe `hierarchical-label-propagation` package provides a class called `HLP` that can be used to run the Hierarchical Label Propagation algorithm. The following code snippet shows how to use it:\n\n```python\nfrom hierarchical_label_propagation import HLP\n\nhlp = HLP() # Creates an instance with the default HLP method for AudioSet.\n``` \n\nHLP can now be applied to the AudioSet targets. Using the same API, it can either be done to the target of a single example or to the targets of a batch of examples. The following code snippet shows how to apply HLP:\n\n```python\ny = hlp.propagate(y) # Propagates the labels of a single example.\n```\nor\n```python\nX, Y, file_names = batch\nY = hlp.propagate(Y) # Propagates the labels of a batch of examples.\n```\n\nPlease note that hlp.propagate() takes a 1D (# classes) or 2D (Batch Size, # classes) torch.Tensor as an input and returns the propagated labels as a torch.Tensor of the same shape as the input.\n\nthe `propagate` method can also be used to propagate on continuous values using the same API. This is true if and only if a higher value indicates a higher confidence in the label. This can be useful to apply HLP to the output of a classifier as a post-processing step.\n\n## Citation\nIf you use this code in your research, please consider citing the following paper:\n\n```\nCitation will be added soon.\n```",
"bugtrack_url": null,
"license": null,
"summary": "Python implementation of Hierarchical Label Propagation (HLP)",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/LudovicTuncay/hierarchical-label-propagation",
"Issues": "https://github.com/LudovicTuncay/hierarchical-label-propagation/issues"
},
"split_keywords": [
"hlp",
" hierarchical label propagation",
" hierarchy",
" ontology"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "447421a7b6da9a7b74dced343ec6b7ce511d59175c6ebce2892f5ca0a673748e",
"md5": "f4a8f01eff550a60d76cc715bf97dd65",
"sha256": "fc6e0310e8f1967895e9bd3a255a422b49bad5a1654def04eb8586ec87d61d8a"
},
"downloads": -1,
"filename": "hierarchical_label_propagation-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f4a8f01eff550a60d76cc715bf97dd65",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 8219,
"upload_time": "2024-09-04T11:56:28",
"upload_time_iso_8601": "2024-09-04T11:56:28.541003Z",
"url": "https://files.pythonhosted.org/packages/44/74/21a7b6da9a7b74dced343ec6b7ce511d59175c6ebce2892f5ca0a673748e/hierarchical_label_propagation-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cebccf2e077f6fea127d2ede1835023c467b692128fb874ad5fd97cf34fdfcc0",
"md5": "7d1e6bfe71a51ffea25f138d856340fa",
"sha256": "3eba548716d6b45556b861799115de66e18a6d33c653fa470d3559cbd53b2234"
},
"downloads": -1,
"filename": "hierarchical_label_propagation-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "7d1e6bfe71a51ffea25f138d856340fa",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 8915,
"upload_time": "2024-09-04T11:56:30",
"upload_time_iso_8601": "2024-09-04T11:56:30.384307Z",
"url": "https://files.pythonhosted.org/packages/ce/bc/cf2e077f6fea127d2ede1835023c467b692128fb874ad5fd97cf34fdfcc0/hierarchical_label_propagation-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-04 11:56:30",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "LudovicTuncay",
"github_project": "hierarchical-label-propagation",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "hierarchical-label-propagation"
}