Skip to content

Commit

Permalink
update description
Browse files Browse the repository at this point in the history
  • Loading branch information
stefantaubert committed Feb 23, 2023
1 parent 14a06f7 commit 1b2dbf3
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 43 deletions.
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cff-version: 1.2.0
title: mean-opinion-score
abstract: Command-line interface and Python library to evaluate text-to-speech mean opinion score studies done on Amazon Mechanical Turk.
abstract: Library for calculating the mean opinion score and 95% confidence interval of the standard deviation of text-to-speech ratings according to Ribeiro et al. (2011).
message: >-
If you use this software, please cite it using the
metadata from this file.
Expand All @@ -16,4 +16,4 @@ version: 0.0.1
date-released: 2023-02-23
license: MIT
url: https://github.com/stefantaubert/mean-opinion-score
doi: 10.5281/zenodo.7669641
doi: 10.5281/zenodo.7670649
57 changes: 21 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
[![PyPI](https://img.shields.io/pypi/wheel/mean-opinion-score.svg)](https://pypi.python.org/pypi/mean-opinion-score/#files)
![PyPI](https://img.shields.io/pypi/implementation/mean-opinion-score.svg)
[![PyPI](https://img.shields.io/github/commits-since/stefantaubert/mean-opinion-score/latest/master.svg)](https://github.com/stefantaubert/mean-opinion-score/compare/v0.0.1...master)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7669641.svg)](https://doi.org/10.5281/zenodo.7669641)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7670649.svg)](https://doi.org/10.5281/zenodo.7670649)

Python library to evaluate text-to-speech (TTS) mean opinion score (MOS) studies done on Amazon Mechanical Turk (MTurk).
The calculation of the confidence intervals is done in the same manner as described in (Ribeiro et al., 2011).
Python library for calculating the mean opinion score (MOS) and 95% confidence interval (CI) of the standard deviation (SD) of text-to-speech (TTS) ratings according to ["Ribeiro, F., Florêncio, D., Zhang, C., & Seltzer, M. (2011). CrowdMOS: An approach for crowdsourcing mean opinion score studies"](https://doi.org/10.1109/ICASSP.2011.5946971). To determine CIs, the authors used a two-way random effects model with the variables: diversity of intrinsic sentence quality, diversity of rater preference, and subjective uncertainty.

## Installation

Expand All @@ -22,39 +21,23 @@ pip install mean-opinion-score --user
```py
import numpy as np

from mean_opinion_score import compute_mos, compute_ci95
from mean_opinion_score import get_ci95, get_mos

_ = np.nan

# columns represent sentences
ratings = np.array([
# columns represent sentences
# algorithm 1
[
[4, 5, _, 4], # rater 1
[4, 4, 4, 5], # rater 2
[_, 3, 5, 4], # rater 3
[_, _, _, _], # rater 4
],
# algorithm 2
[
[1, 2, _, _], # rater 1
[1, 1, 1, _], # rater 2
[_, 2, 5, 1], # rater 3
[_, 1, _, 1], # rater 4
]
[4, 5, _, 4, _, 3], # rater 1
[4, 4, 4, 5, _, 4], # rater 2
[_, 3, 5, 4, _, 1], # rater 3
[_, _, _, _, _, _], # rater 4
])

alg1_mos = compute_mos(ratings[0])
alg1_ci95 = compute_ci95(ratings[0])
mos = get_mos(ratings)
ci = get_ci95(ratings)

print(f"MOS algorithm 1: {alg1_mos:.2f} ± {alg1_ci95:.4f}")
# MOS algorithm 1: 4.20 ± 0.6997

alg2_mos = compute_mos(ratings[1])
alg2_ci95 = compute_ci95(ratings[1])

print(f"MOS algorithm 2: {alg2_mos:.2f} ± {alg2_ci95:.4f}")
# MOS algorithm 2: 1.60 ± 1.7912
print(f"MOS: {mos:.2f} ± {ci:.4f}")
# MOS: 3.85 ± 1.3316
```

## Dependencies
Expand All @@ -71,20 +54,22 @@ If you notice an error, please don't hesitate to open an issue.
```sh
# update
sudo apt update
# install Python 3.8, 3.9, 3.10 & 3.11 for ensuring that tests can be run
# install Python 3.6, 3.7, 3.8, 3.9, 3.10 & 3.11 for ensuring that tests can be run
sudo apt install python3-pip \
python3.6 python3.6-dev python3.6-distutils python3.6-venv \
python3.7 python3.7-dev python3.7-distutils python3.7-venv \
python3.8 python3.8-dev python3.8-distutils python3.8-venv \
python3.9 python3.9-dev python3.9-distutils python3.9-venv \
python3.10 python3.10-dev python3.10-distutils python3.10-venv \
python3.11 python3.11-dev python3.11-distutils python3.11-venv
# install pipenv for creation of virtual environments
python3.8 -m pip install pipenv --user
python3.11 -m pip install pipenv --user

# check out repo
git clone https://github.com/stefantaubert/mean-opinion-score.git
cd mean-opinion-score
# create virtual environment
python3.8 -m pipenv install --dev
python3.11 -m pipenv install --dev
```

## Running the tests
Expand All @@ -94,7 +79,7 @@ python3.8 -m pipenv install --dev
# then, navigate into the directory of the repo (if not already done)
cd mean-opinion-score
# activate environment
python3.8 -m pipenv shell
python3.11 -m pipenv shell
# run tests
tox
```
Expand All @@ -117,18 +102,18 @@ MIT License

## Acknowledgments

Calculation and template are based on:
MOS and CI calculation is taken from:

- Ribeiro, F., Florêncio, D., Zhang, C., & Seltzer, M. (2011). CrowdMOS: An approach for crowdsourcing mean opinion score studies. 2011 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2416–2419. [https://doi.org/10.1109/ICASSP.2011.5946971](https://doi.org/10.1109/ICASSP.2011.5946971)

Funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) – Project-ID 416228727 – CRC 1410
Funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) – Project-ID 416228727 – CRC 1410.

## Citation

If you want to cite this repo, you can use this BibTeX-entry generated by GitHub (see *About => Cite this repository*).

```txt
Taubert, S. (2023). mean-opinion-score (Version 0.0.1) [Computer software]. https://doi.org/10.5281/zenodo.7669641
Taubert, S. (2023). mean-opinion-score (Version 0.0.1) [Computer software]. https://doi.org/10.5281/zenodo.7670649
```

## Changelog
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "mean-opinion-score"
version = "0.0.1"
description = "Python library to calculate mean opinion score and standard deviation."
description = "Library for calculating the mean opinion score and 95% confidence interval of the standard deviation of text-to-speech ratings according to Ribeiro et al. (2011)."
readme = "README.md"
requires-python = ">=3.6, <3.12"
license = {text = "MIT"}
Expand Down
4 changes: 0 additions & 4 deletions src/mean_opinion_score_tests/helper.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
from pathlib import Path

import numpy as np

from mean_opinion_score.calculation import get_ci95, get_mos


def get_test_resource_path(name: str) -> Path:
path = Path(f"src/mean_opinion_score_tests/res/{name}")
Expand Down

0 comments on commit 1b2dbf3

Please sign in to comment.