Skip to main content

音韻的類似性を考慮した検索システムの評価用データセット。替え歌の歌詞から構築された特定ジャンルの単語ペアを収録。

Project description

soramimi-phonetic-search-dataset

音韻検索システムの評価用データセット。替え歌の歌詞から構築された特定ジャンルの単語ペアを収録。

日本語 | English

概要

このデータセットは、音韻が類似した単語を検索するシステムの評価に使用できます。 特定ジャンルの単語だけで歌詞の音韻を模倣する替え歌(いわゆる「〇〇で歌ってみた」)から抽出した単語ペアを含み、特に韻やリズムの一致を重視する音韻検索の評価に適しています。

各手法の評価結果はleaderboardをご覧ください。 細かな prompt/input の派生実験や probe スクリプトは、別リポジトリの soramimi-phonetic-search-experiments で管理します。

データセット形式

デフォルトのデータセット src/soramimi_phonetic_search_dataset/data/baseball.json は、各 query について以下の情報を持ちます。

  • query: 検索クエリ
  • positive: 正解となる単語の一覧
  • hard_negatives: 正解ではないが音韻的に紛らわしい負例の一覧

hard_negatives は、各 query に対して単語リスト全体を rank_by_vowel_consonant_editdistancevowel_ratio=0.5 を指定して並べ替え、その順位から positive に含まれる単語を除いた上位100件として作成しています。

使い方

インストール

pip install soramimi-phonetic-search-dataset

基本的な使用例

from soramimi_phonetic_search_dataset import evaluate_ranking_function

# カスタムのランキング関数を定義
def my_ranking_function(
  query_texts: list[str], wordlists: list[list[str]]
) -> list[list[str]]:
    # ここにあなたの音韻的類似度に基づくランキングロジックを実装
    return ranked_wordlists

# 評価の実行
results = evaluate_ranking_function(ranking_func=my_ranking_function, topn=10)
print(f"Recall@10: {results.metrics.recall}")

LLMでの試行回数を減らしたい場合は、先頭10件のクエリだけを使う小データセットも利用できます。

from soramimi_phonetic_search_dataset import (
    evaluate_ranking_function,
    load_small_dataset,
)

small_dataset = load_small_dataset()
results = evaluate_ranking_function(
    ranking_func=my_ranking_function,
    topn=10,
    dataset=small_dataset,
)
print(f"Recall@10 on small dataset: {results.metrics.recall}")

リポジトリ内のサンプルスクリプトでも --dataset_size small を指定すると、同じ10件版で評価できます。

サンプルのランキング関数

以下のランキング関数が実装済みです:

  • rank_by_mora_editdistance: モーラ編集距離によるランキング
  • rank_by_vowel_consonant_editdistance: 母音と子音の編集距離によるランキング
  • rank_by_phoneme_editdistance: 音素編集距離によるランキング
  • rank_by_kanasim: KanaSimによるランキング
from soramimi_phonetic_search_dataset import rank_by_mora_editdistance

results = evaluate_ranking_function(ranking_func=rank_by_mora_editdistance, topn=10)
print(results.metrics.recall)

ライセンス

データセット使用上の注意

  • このデータセットは、歌詞や実在の人名・キャラクター等の単語リストといった第三者のコンテンツを含んでいます。歌詞データは文節単位で分割・再構成され、元の文脈を復元できないよう慎重に加工されています。また、単語リストは一般に公開されている情報のみを使用しています。

  • 研究目的での利用については、商用・非商用を問わず可能です。ただし、以下の点にご注意ください:

    • データセットの利用に関する法令遵守はユーザーの責任となります
    • データセットから元の歌詞を復元する行為は避けてください
    • 単語リストは音韻検索の評価以外の目的での使用はお控えください

引用

このデータセットを引用する場合は、以下の形式を使用してください:

@inproceedings{島谷2025soramimi,  
  author={島谷 二郎},  
  title={「〇〇で歌ってみた」替え歌を用いた音韻類似単語検索ベンチマークの構築},  
  booktitle={言語処理学会第31回年次大会 併設ワークショップ JLR2025},
  url={https://github.com/jiroshimaya/soramimi-phonetic-search-dataset},  
  year={2025},  
  month={3},  
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

soramimi_phonetic_search_dataset-0.0.20.tar.gz (380.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file soramimi_phonetic_search_dataset-0.0.20.tar.gz.

File metadata

  • Download URL: soramimi_phonetic_search_dataset-0.0.20.tar.gz
  • Upload date:
  • Size: 380.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for soramimi_phonetic_search_dataset-0.0.20.tar.gz
Algorithm Hash digest
SHA256 4a18f5d1a3b19c0f69802d501203b73c33d672be86428ae07d00b17c0daf555b
MD5 049f413f1ff0646caa133854f4ebc697
BLAKE2b-256 7993996ba28abd44cdc748ac3ff452ca1425645997fdd67df42ad8d44d476449

See more details on using hashes here.

File details

Details for the file soramimi_phonetic_search_dataset-0.0.20-py3-none-any.whl.

File metadata

  • Download URL: soramimi_phonetic_search_dataset-0.0.20-py3-none-any.whl
  • Upload date:
  • Size: 127.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for soramimi_phonetic_search_dataset-0.0.20-py3-none-any.whl
Algorithm Hash digest
SHA256 855332e40ef91753baada8cc91765f244f1b22974b94c820104d6ccac98b9056
MD5 ae95a6f048aac4f575fba131809f0280
BLAKE2b-256 16a19c23eb70766579325a0864200ebda8ff90c1259a802d88a557a4db5d236e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page