from mteb.abstasks.retrieval import AbsTaskRetrieval
from mteb.abstasks.task_metadata import TaskMetadata


class JLCorpusA2TRetrieval(AbsTaskRetrieval):
    metadata = TaskMetadata(
        name="JLCorpusA2TRetrieval",
        description=(
            "Emotional speech segments from the JL-Corpus, "
            "balanced over long vowels and annotated for primary and secondary emotions."
        ),
        reference="https://www.kaggle.com/tli725/jl-corpus",
        dataset={
            "path": "mteb/jl_corpus_a2t",
            "revision": "c4a08f2e641b33697745837d6e814da8b17b533c",
        },
        type="Any2AnyRetrieval",
        category="a2t",
        modalities=["text", "audio"],
        eval_splits=["test"],
        eval_langs=["eng-Latn"],
        main_score="hit_rate_at_5",
        date=("2018-01-01", "2018-12-31"),
        domains=["Spoken"],
        task_subtypes=["Speech Transcription Retrieval"],
        license="cc0-1.0",
        annotations_creators="derived",
        dialect=[],
        sample_creation="found",
        bibtex_citation=r"""
@inproceedings{james2018open,
  author = {James, Jesin and Li, Tian and Watson, Catherine},
  booktitle = {Proc. Interspeech 2018},
  title = {An Open Source Emotional Speech Corpus for Human Robot Interaction Applications},
  year = {2018},
}
""",
    )


class JLCorpusT2ARetrieval(AbsTaskRetrieval):
    """Text-to-audio retrieval on JL-Corpus emotional speech captions ↔ audio pairs."""

    metadata = TaskMetadata(
        name="JLCorpusT2ARetrieval",
        description=(
            "Emotional speech segments from the JL-Corpus, "
            "balanced over long vowels and annotated for primary and secondary emotions."
        ),
        reference="https://www.kaggle.com/tli725/jl-corpus",
        dataset={
            "path": "mteb/jl_corpus_t2a",
            "revision": "432380bbc1272245bcad607f536821cba8c13944",
        },
        type="Any2AnyRetrieval",
        category="t2a",
        modalities=["text", "audio"],
        eval_splits=["test"],
        eval_langs=["eng-Latn"],
        main_score="hit_rate_at_5",
        date=("2018-01-01", "2018-12-31"),
        domains=["Spoken"],
        task_subtypes=["Speech Transcription Retrieval"],
        license="cc0-1.0",
        annotations_creators="derived",
        dialect=[],
        sample_creation="found",
        bibtex_citation=r"""
@inproceedings{james2018open,
  author = {James, Jesin and Li, Tian and Watson, Catherine},
  booktitle = {Proc. Interspeech 2018},
  title = {An Open Source Emotional Speech Corpus for Human Robot Interaction Applications},
  year = {2018},
}
""",
    )
