Skip to content

Commit

Permalink
Mod: Update version for 0.5.3.
Browse files Browse the repository at this point in the history
  • Loading branch information
Labbeti committed Jan 9, 2024
1 parent 6bd233f commit e671ed9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

All notable changes to this project will be documented in this file.

## [0.5.3] UNRELEASED
## [0.5.3] 2024-01-09
### Fixed
- Fix `BERTScoreMrefs` computation when all sizes are equal.
- Check for empty timeout list in SPICE metric.
- Fix `BERTScoreMrefs` computation when all multiple references sizes are equal.
- Check for empty timeout list in `SPICE` metric.

## [0.5.2] 2024-01-05
### Changed
- `aac-metrics` is now compatible with `transformers>=4.31`.
- Rename default device value "auto" to "cuda_if_available".
- Rename default device value `"auto"` to `"cuda_if_available"`.

## [0.5.1] 2023-12-20
### Added
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ keywords:
- captioning
- audio-captioning
license: MIT
version: 0.5.2
date-released: '2024-01-05'
version: 0.5.3
date-released: '2024-01-09'
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ If you use this software, please consider cite it as "Labbe, E. (2013). aac-metr
month = {01},
title = {{aac-metrics}},
url = {https://github.com/Labbeti/aac-metrics/},
version = {0.5.2},
version = {0.5.3},
year = {2024},
}
```
Expand Down
11 changes: 8 additions & 3 deletions src/aac_metrics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
__maintainer__ = "Etienne Labbé (Labbeti)"
__name__ = "aac-metrics"
__status__ = "Development"
__version__ = "0.5.2"
__version__ = "0.5.3"


from .classes.base import AACMetric
Expand Down Expand Up @@ -68,12 +68,17 @@
]


def list_metrics_available() -> list[str]:
"""Returns the list of metrics that can be loaded from its name."""
factory = _get_metric_factory_classes()
return list(factory.keys())


def load_metric(name: str, **kwargs) -> AACMetric:
"""Load a metric class by name.
:param name: The name of the metric.
Can be one of ("bleu_1", "bleu_2", "bleu_3", "bleu_4", "meteor", "rouge_l", "cider_d", "spice", "spider", "fense").
:param **kwargs: The keyword optional arguments passed to the metric factory.
:param **kwargs: The optional keyword arguments passed to the metric factory.
:returns: The Metric object built.
"""
name = name.lower().strip()
Expand Down

0 comments on commit e671ed9

Please sign in to comment.