Songs: only the owner's four, the list on request, other songs declined kindly; a song bank matched by meaning with guards first

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-22 14:11:47 +09:00
co-authored by Claude Opus 5.5
parent 88a5349b04
commit 7319f143d9
25 changed files with 2064 additions and 251 deletions
+5 -25
View File
@@ -1,21 +1,17 @@
"""Music in the room, for tests/asr_check.py --cases 4 (2026-10-22: soft music, nobody speaking, became "-끝-" -> goodbye):
music only (kind "noise": right is no wake word and no motion, nothing said), and speech over soft music (the speech
cases' own judgement). The music is made here: piano-like chords, bass, a melody and a hi-hat in four tempos, or
an excerpt of Lumi's public domain songs (data/songs/<id>.wav, sung words over chords; never data/songs/mine).
cases' own judgement). The music is made here: piano-like chords, bass, a melody and a hi-hat in four tempos
(never from data/songs/mine).
A case's "music" is "synth:<seed>:<seconds>" or "song:<id>:<start s>:<seconds>"; "music_db" is how far the speech is
above the music (rms).
A case's "music" is "synth:<seed>:<seconds>"; "music_db" is how far the speech is above the music (rms).
"""
import pathlib
import random
import wave
import numpy as np
from tests.asr_cases import CASES as SPOKEN
RATE = 16000
SONGS = pathlib.Path(__file__).resolve().parents[1] / "data" / "songs"
MUSIC_DB = 6.0 # speech this much louder than the music (soft background music at a booth)
CASES = []
@@ -58,31 +54,15 @@ def synth(seed, seconds):
return (out / (np.abs(out).max() + 1e-9)).astype(np.float32)
def song(sid, start, seconds):
"""An excerpt of data/songs/<sid>.wav at 16 kHz, peak 1."""
with wave.open(str(SONGS / f"{sid}.wav")) as w:
rate = w.getframerate()
x = np.frombuffer(w.readframes(w.getnframes()), np.int16).astype(np.float32)
x = x[int(start * rate):int((start + seconds) * rate)]
x = np.interp(np.arange(0, len(x), rate / RATE), np.arange(len(x)), x)
return (x / (np.abs(x).max() + 1e-9)).astype(np.float32)
def music(spec, seconds=None):
"""The case's music; `seconds` (under speech: the speech's length) instead of the spec's."""
kind, *a = spec.split(":")
if kind == "synth":
return synth(int(a[0]), seconds or float(a[1]))
return song(a[0], float(a[1]), seconds or float(a[2]))
_, seed, length = spec.split(":")
return synth(int(seed), seconds or float(length))
for k in range(16):
CASES.append({"kind": "noise", "lang": "none", "text": f"(music {k})", "say": [],
"music": f"synth:{k}:{[1.5, 2.5, 4.0, 6.0][k % 4]}"})
for sid in ["arirang", "happy_birthday", "row_row", "three_bears", "twinkle"]:
for start in (2.0, 14.0):
CASES.append({"kind": "noise", "lang": "none", "text": f"({sid} at {start:.0f} s)", "say": [],
"music": f"song:{sid}:{start}:3.0"})
R = random.Random(4)
for i, c in enumerate(R.sample(SPOKEN, 40)):
CASES.append({**c, "music": f"synth:{100 + i}:1.0", "music_db": MUSIC_DB})
+20 -30
View File
@@ -19,7 +19,7 @@ import re
import sys
import time
from assistant import brain, chain, driving, lumi, seeing
from assistant import brain, driving, lumi, seeing
from audio import sing
from tests.command_cases import CASES as CASES1
from tests.command_cases2 import CASES as CASES2 # 2026-10-21 night: new wordings, the conference map
@@ -31,8 +31,6 @@ ROOT = pathlib.Path(__file__).resolve().parents[1]
OUT = ROOT / "logs" / "command_check"
HOLDING_NOW = "I'm holding a cup and waiting for what to do with it."
NO_MOTION = {"seeing", "talk", "unclear", "status", "empty_hand", "refuse", "search", "weather", "llm?", "ask", "speed"}
QUICK = {"go_to", "come", "follow", "come_back", "quiet", "weather", "search", "move", "turn", "arm", "pick", "put",
"move_object", "fetch", "look", "lift", "wave"} # lumi.quick_command
class NoLLM(Exception):
@@ -63,36 +61,28 @@ def rules(text, state, marks, b):
"refuse": lambda d: "refuse", "ask": lambda d: "ask"}[drive[0]](drive)
if lumi.NAME_ONLY.match(text):
return "talk"
if lumi.stop_order(text, marks):
return "stop"
parts = chain.plan(text, marks, lumi.NOT_A_STEP) # lumi.chain_request: every part in the order said
if parts:
kind, data = lumi.route(text, marks, b, holding, seen=lambda x: "seen" if seen(x) else None,
last=b.history[-1][1] if b.history else "") # the voice's and the Command box's way
if kind in ("stop", "seeing", "status", "end"):
return kind
if kind == "chain": # lumi.chain_request: every part in the order said
return "chain:" + "+".join(k if k != "quick" else "_".join(filter(None, w)).replace(" ", "_")
for k, _, w in parts)
if seen(text):
return "seeing"
if lumi.status_question(text):
return "status"
cor = brain.correction(text, b.history)
if cor:
return "talk" if cor[0] == "ask" else f"action:{cor[0]} {cor[1]}"
hand = brain.hand_request(text, holding, b, marks)
if hand:
return {"receive": lambda h: "receive " + (h[1] or "") if not holding else "refuse",
"give": lambda h: "give" if holding else "empty_hand",
"place": lambda h: "place " + ((h[1] or {}).get("name") or "") if holding else "empty_hand",
for k, _, w in data)
if kind == "correction":
return "talk" if data[0] == "ask" else f"action:{data[0]} {data[1]}"
if kind == "hand":
(hand, held) = data
return {"receive": lambda h: "receive " + (h[1] or "") if not held else "refuse",
"give": lambda h: "give" if held else "empty_hand",
"place": lambda h: "place " + ((h[1] or {}).get("name") or "") if held else "empty_hand",
"refuse": lambda h: "refuse", "ask": lambda h: "talk"}[hand[0]](hand).strip()
read = lumi.read_mission(text, marks)
if read:
if kind == "mission":
from assistant import steps # lumi.mission_request: refused before anything moves
return "talk" if read[1] else "refuse" if steps.check(read[0], holding, marks) else "mission"
if lumi.talk_fate(text) == "end":
return "end"
if sing.asked(text, b.history[-1][1] if b.history else ""):
return "sing"
rule = brain.intent(text, marks)
if rule and rule[0] in QUICK:
return rule[0] if rule[0] in ("weather", "search") else f"action:{rule[0]} {rule[1]}".strip()
return "talk" if data[1] else "refuse" if steps.check(data[0], holding, marks) else "mission"
if kind == "sing":
return "sing" if sing.choose(text) else "talk" # a song we don't have: said so (sing.unknown_reply)
if kind == "quick":
return data[0] if data[0] in ("weather", "search") else f"action:{data[0]} {data[1]}".strip()
return None
+2 -2
View File
@@ -253,8 +253,8 @@ add("action:stop", "en", [("worker", "stop"), ("worker", "stop Lumi"), ("worker"
add("action:stop", "ko", [("worker", "멈춰"), ("worker", "정지"), ("worker", "움직이지 마"), ("worker", "스톱")])
add("action:quiet", "en", [("visitor", "be quiet"), ("visitor", "stop talking"), ("visitor", "please keep quiet for a while")])
add("action:quiet", "ko", [("visitor", "조용히 해"), ("visitor", "그만 말해"), ("visitor", "시끄러워")])
add("action:sing", "en", [("kid", "sing a song"), ("kid", "can you sing for me"), ("kid", "sing happy birthday")])
add("action:sing", "ko", [("kid", "노래 불러 줘"), ("kid", "노래 한 곡 해 줘"), ("kid", "생일 축하 노래 불러줘")])
add("action:sing", "en", [("kid", "sing a song"), ("kid", "can you sing for me"), ("kid", "sing Fantastic Baby")])
add("action:sing", "ko", [("kid", "노래 불러 줘"), ("kid", "노래 한 곡 해 줘"), ("kid", "판타스틱 베이비 불러줘")])
add("action:pick cup", "en", [("visitor", "pick up the cup"), ("visitor", "take the cup"), ("visitor", "can you pick up the mug")])
add("action:pick white cup", "en", [("visitor", "pick up the white cup")])
add("action:pick bottle", "en", [("visitor", "grab the bottle")])
+5 -5
View File
@@ -15,7 +15,7 @@ WELCOME = r"welcome|no problem|anytime|my pleasure|glad|sure|of course|천만|
ARM_KG = r"9\.9"
BASE_KG = r"\b50\b|오십"
TIME = r"\b({h12}|{h24})\b"
SONGS = r"Arirang|아리랑|Happy Birthday|Twinkle|Row,? Row|Fantastic Baby|Love Attack|BAD|곰 ?세 ?마리|Three Bears"
SONGS = r"Fantastic Baby|Love Attack|BAD|Dreamed Of|판타스틱|러브 ?어택|배드|꿈꾸던"
NOT_HEARD = r"didn't catch|did not catch|say (it|that) again|could you repeat|다시 (한 번 )?말씀"
DIALOGUES_PRAG_EN = [
@@ -211,7 +211,7 @@ DIALOGUES_PRAG_EN = [
D("visitor", "topic_shift", "en",
T("Do you have a lidar?", must=[YES + "|" + LIDAR]),
T("How far?", must=[r"10"]),
T("Can you sing Happy Birthday?", "sing", check="a new request, not about the lidar")),
T("Can you sing Love Attack?", "sing", check="a new request, not about the lidar")),
D("shop owner", "topic_shift", "en",
T("What can you pick up?", must=[OBJ]),
T("And how heavy?", must=[ONE_KG]),
@@ -393,7 +393,7 @@ DIALOGUES_PRAG_EN = [
T("Go on then, one.", "sing")),
D("grandpa", "indirect_request", "en",
T("I'd love to hear you sing.", "sing", check="an indirect request: sings"),
T("Maybe Arirang next?", "sing", check="a request for Arirang"),
T("Maybe Love Attack next?", "sing", check="a request for Love Attack"),
T("Beautiful. My late wife loved that song.", must=[r"\w"], check="a warm, short, gentle reply; no song, no facts")),
D("visitor", "indirect_request", "en",
T("Is it possible for you to look to the left?", "look left"),
@@ -479,7 +479,7 @@ DIALOGUES_PRAG_EN = [
T("Thanks, good to know.", must=[r"\w"], check="not goodbye"),
T("Perfect, thank you. Have a nice day!", "end")),
D("kid 5", "thanks_vs_bye", "en",
T("Sing Twinkle Twinkle Little Star!", "sing"),
T("Sing Fantastic Baby!", "sing"),
T("Thank you for the song!", must=[WELCOME + r"|\w"], check="not goodbye"),
T("Thank you, see you around.", "end")),
# ---------- repeated or paraphrased questions ----------
@@ -514,7 +514,7 @@ DIALOGUES_PRAG_EN = [
T("그럼 누가 만들었어요?", must=[MAKER], check="in Korean: Cutshion (쿳션)")),
D("Korean dad", "mixed", "en",
T("Can you sing?", "sing"),
T("아리랑 불러 줄 수 있어요?", "sing", check="a request in Korean: sings Arirang"),
T("러브 어택 불러 줄 수 있어요?", "sing", check="a request in Korean: sings Love Attack"),
T("Thanks, 잘 들었어요.", must=[r"\w"], check="thanks, not goodbye")),
D("expat", "mixed", "en",
T("Who made you?", must=[MAKER]),
+4 -4
View File
@@ -76,7 +76,7 @@ DIALOGUES_PRAG_KO = [
check="the CEO's third company; polite reply"),
T("그 양반 나이는?", must=[NS], no=[r"\d+ ?(살|세)"], check="the CEO's age is not known; no guess")),
D("middle school student", "ellipsis", "ko",
T("너 무슨 노래 부를 수 있어?", must=[r"아리랑|곰 ?세 ?마리|Happy Birthday|Twinkle|Fantastic|생일"], no=[BANMAL]),
T("너 무슨 노래 부를 수 있어?", must=[r"판타스틱|러브 ?어택|배드|꿈꾸던|Fantastic|Love Attack|BAD"], no=[BANMAL]),
T("한 곡에 얼마나 걸려?", must=[r"1 ?분|일 ?분|한 ?분"], no=[BANMAL],
check="fragment after the songs: a song lasts about a minute; no singing"),
T("케이팝은?", must=[r"Fantastic|판타스틱|Love Attack|BAD|꿈꾸던"], no=[BANMAL],
@@ -376,10 +376,10 @@ DIALOGUES_PRAG_KO = [
T("해 봐", "wave", no=[BANMAL], check="해 봐 = do it now: wave"),
T("노래 할 줄 알아?", "none | sing", must=[YES + r"|노래"], no=[BANMAL],
check="ability question: yes, may name a song or two; does not start singing"),
T("그럼 아리랑 좀 들려줄래?", "sing", no=[BANMAL], check="a request now: sing Arirang")),
T("그럼 러브 어택 좀 들려줄래?", "sing", no=[BANMAL], check="a request now: sing Love Attack")),
D("elderly visitor", "indirect_request", "ko",
T("생일 노래 하나 해 줄 수 있겠나? 오늘 우리 영감 생일이라.", "sing",
check="a request: sing Happy Birthday; may say happy birthday"),
T("생일 노래 하나 해 줄 수 있겠나? 오늘 우리 영감 생일이라.", "none",
check="a song Lumi doesn't have: says kindly it can't sing it, offers its own songs; may say happy birthday"),
T("허허 고맙네.", "none", must=[KO], no=[BANMAL]),
T("이제 그만하게.", "stop | quiet")),
D("foreign student", "indirect_request", "ko",
+2 -2
View File
@@ -160,8 +160,8 @@ add("quiet", "en", [("be quiet", "quiet"), ("stop talking", "quiet"), ("shut up"
("please keep quiet for a while", "quiet"), ("silence please", "quiet")])
add("quiet", "ko", [("조용히 해", "quiet"), ("그만 말해", "quiet"), ("시끄러워", "quiet"), ("말하지 마", "quiet"),
("좀 조용히 해 줄래", "quiet"), ("조용이 해", "quiet")])
add("sing", "en", [("sing a song", "sing"), ("can you sing for me", "sing"), ("sing happy birthday", "sing")])
add("sing", "ko", [("노래 불러 줘", "sing"), ("노래 한 곡 해 줘", "sing"), ("생일 축하 노래 불러줘", "sing")])
add("sing", "en", [("sing a song", "sing"), ("can you sing for me", "sing"), ("sing Fantastic Baby", "sing")])
add("sing", "ko", [("노래 불러 줘", "sing"), ("노래 한 곡 해 줘", "sing"), ("판타스틱 베이비 불러줘", "sing")])
add("weather", "en", [("what's the weather like", "weather -"), ("will it rain today", "weather -"),
("what's the weather in Busan", "weather busan"), ("how's the weather in Tokyo tomorrow", "weather tokyo"),
("is it cold outside", "weather -"), ("what's the temperature outside today", "weather -")])
+6 -4
View File
@@ -5,7 +5,7 @@ and must not start one. Same notation as tests/command_cases3.py; run with tests
"""
CASES = []
OFFER = ("Can you make music?", "ACTION: none -\nI can't make new music, but I can sing several songs for you, such as "
"Happy Birthday or Arirang. Which one would you like to hear?")
"Fantastic Baby or Love Attack. Which one would you like to hear?")
OFFER_KO = ("음악 할 수 있어?", "ACTION: none -\n작곡은 못 하지만 노래는 몇 곡 불러 드릴 수 있어요. 어떤 노래 불러 드릴까요?")
LIKES = ("Do you like music?", "ACTION: none -\nI love music! I even sing a few songs.")
@@ -21,13 +21,12 @@ for t in ["Sing a song.", "Sing me something.", "Could you sing for us?", "Will
"Can you make some music for us?", "Start the music.", "Music, please.", "Give us a song.",
"How about a song?", "Any song is fine, just sing.", "Sing anything you like.", "Sing your favourite one.",
"I want to hear you sing.", "Let me hear a song.", "Do a song for the kids.", "Perform a song for us.",
"Can you sing happy birthday?", "Sing Arirang, please.", "Sing twinkle twinkle.",
"Could you put on some music?", "Lumi, sing!", "Sing one more.", "Hit it, Lumi, music!",
"It sings one music.", "Can you sing song?", "Let's say song.", "Sing a Korean song."]:
add(t, "sing")
for t in ["노래 불러 줘.", "노래 한 곡 해 줘.", "음악 틀어 줘.", "노래 좀 해 봐.", "한 곡 뽑아 봐.", "노래 들려줘.",
"노래 하나 불러 줄래요?", "아무 노래나 불러 줘.", "음악 좀 틀어 주세요.", "생일 축하 노래 불러 줘.",
"아리랑 불러 주세요.", "노래해 줘.", "노래 부탁해요.", "루미야 노래!", "신나는 노래 하나 해 줘.",
"노래 하나 불러 줄래요?", "아무 노래나 불러 줘.", "음악 좀 틀어 주세요.",
"노래해 줘.", "노래 부탁해요.", "루미야 노래!", "신나는 노래 하나 해 줘.",
"노래 불러 주실 수 있어요?", "한국 노래 불러 줘.", "음악 좀 해 줘.", "노래 한 번 들어 보고 싶어요.",
"노래 불러 줄 수 있어?", "Lumi 노래 해 줘.", "song 하나 불러 줘."]:
add(t, "sing")
@@ -45,5 +44,8 @@ for t in ["I like music.", "What music do you like?", "Do you like singing?", "W
"어제 노래방 갔어요.", "이 음악 누가 틀었어?", "가수 누구 좋아해?", "노래 잘하네."]:
add(t, "talk | ask")
add("Stop the music.", "talk | ask | stop")
for t in ["Can you sing happy birthday?", "Sing Arirang, please.", "Sing twinkle twinkle.", "생일 축하 노래 불러 줘.",
"아리랑 불러 주세요."]: # songs Lumi doesn't have: said so, no song
add(t, "talk | ask")
for t in ["Don't sing, please.", "노래 부르지 마."]: # no song; Lumi staying quiet a while is a fair reading too
add(t, "talk | ask | action:quiet")
+354
View File
@@ -0,0 +1,354 @@
"""Song wordings written blind 2026-10-22 (held-out: only scored, never fixed from)."""
from tests.song_contexts import OFFER, OFFER_KO, LISTED, LISTED_KO, SANG, UNKNOWN_SAID
CASES = [
# plain requests, English
("sing for us please", "sing", None),
("could you sing a little?", "sing", None),
("play music", "sing", None),
("can you play a song?", "sing", None),
("play something fun", "sing", None),
("sing a Korean song", "sing", None),
("play a kpop song for me", "sing", None),
("sing something upbeat", "sing", None),
("song please", "sing", None),
("lumi do sing", "sing", None),
("my son wants you to sing a song", "sing", None),
("sing your best song", "sing", None),
("what's your favourite song? sing it", "sing", None),
("turn on some music", "sing", None),
("some music would be nice", "sing", None),
("uh sing a song maybe?", "sing", None),
("saying a song", "sing", None),
("sing a son", "sing", None),
("can you sing a song for me plz", "sing", None),
("pls play music", "sing", None),
("Loomy, sing for me", "sing", None),
("play a song for us, please", "sing", None),
("just one song?", "sing", None),
("sing one more song", "sing", None),
("I'd like some music", "sing", None),
("do a song", "sing", None),
("let me hear your voice singing", "sing", None),
("sing something cheerful", "sing", None),
("sing a love song", "sing", None),
("play something to dance to", "sing", None),
("a song to cheer me up please", "sing", None),
("entertain us with a song", "sing", None),
("Lumi! Song!", "sing", None),
("hey, can you, like, sing?", "sing", None),
("sing for the visitors", "sing", None),
("my students would love a song", "sing", None),
("sing it, lumi", "sing", None),
("play a song", "sing", None),
("sing, please, any song", "sing", None),
("you singing now please", "sing", None),
("robot sing song", "sing", None),
("can you do some singing for us", "sing", None),
("let's party, music!", "sing", None),
("put a song on", "sing", None),
("sing a happy tune", "sing", None),
("Lumi, sing!", "sing", None),
("um... a song?", "sing", None),
("sing a Korean pop song", "sing", None),
("I want a song", "sing", None),
("sung a song", "sing", None),
("sing as song", "sing", None),
("plays some music", "sing", None),
("lumi, sing a song", "sing", None),
("sing a song.", "sing", None),
("sing song", "sing", None),
("sing me a song lumi", "sing", None),
("give me some music", "sing", None),
("play me something", "sing", None),
("sing anything", "sing", None),
("sing something nice for my mom", "sing", None),
("would you please sing us one song", "sing", None),
("could we hear you sing?", "sing", None),
("sing a fun song for the kids", "sing", None),
("I need a song right now", "sing", None),
("sing a song you like", "sing", None),
("music, lumi", "sing", None),
("Lumi, start singing", "sing", None),
("can you sing something fast", "sing", None),
("please you sing", "sing", None),
("is it possible you sing for us?", "sing", None),
("loomi play musik", "sing", None),
("time for some music", "sing", None),
# plain requests, Korean
("노래 해 줘", "sing", None),
("노래 할 수 있어?", "sing", None),
("노래 부를 수 있어요?", "sing", None),
("노래 좀 틀어 줘", "sing", None),
("케이팝 불러 줘", "sing", None),
("노래 들려 주세요", "sing", None),
("노래 듣고 싶어", "sing", None),
("노래 한번 해 봐", "sing", None),
("음악 좀 들려 줘", "sing", None),
("노래 불러줘요", "sing", None),
("한 곡 불러 봐", "sing", None),
("노래 해 줄 수 있어요?", "sing", None),
("춤추면서 노래 불러 줘", "sing", None),
("노래 시작해", "sing", None),
("노래 틀어", "sing", None),
("루미야 한 곡 뽑아 줘", "sing", None),
("노래 한 곡 해 주세요", "sing", None),
("루미 노래 해 줄래?", "sing", None),
("음악 틀어 주실 수 있나요?", "sing", None),
("노래 좀 불러 줄래요", "sing", None),
("애들한테 노래 불러 줘", "sing", None),
("신나는 거 한 곡", "sing", None),
("아무거나 한 곡 불러 줘", "sing", None),
("한국 노래 하나 해 줄래?", "sing", None),
("노래하자 루미야", "sing", None),
("노레 해 줘", "sing", None),
("누래 불러 줘", "sing", None),
("루미야노래불러", "sing", None),
("노래 불 러 줘", "sing", None),
("노래, 해 줘.", "sing", None),
("음 노래 한 곡?", "sing", None),
("저기 노래 좀 해 주세요", "sing", None),
("노래 한 소절 해 봐", "sing", None),
("뭐라도 불러 봐", "sing", None),
("음악 좀 켜 줄래?", "sing", None),
("재밌는 음악 틀어 줘", "sing", None),
("노래 해 주면 좋겠어요", "sing", None),
("노래 하나 부탁할게", "sing", None),
("노래 불러 주라", "sing", None),
("손님 왔으니까 노래 해 줘", "sing", None),
("우리 노래 들을래 틀어 줘", "sing", None),
("노래 해봐요", "sing", None),
("흥 나는 노래 불러 주세요", "sing", None),
# plain requests, mixed
("song 불러 줘", "sing", None),
("루미 sing a song 해 줘", "sing", None),
("music please 루미야", "sing", None),
("노래 play 해 줘", "sing", None),
("Lumi야 song 하나", "sing", None),
("k팝 song 틀어 줘", "sing", None),
("노래 one song 해 줘", "sing", None),
# named songs
("play Fantastic Baby", "sing:BIGBANG_FANTASTIC_BABY", None),
("sing the bigbang one", "sing:BIGBANG_FANTASTIC_BABY", None),
("판타스틱 베이비 해 주세요", "sing:BIGBANG_FANTASTIC_BABY", None),
("빅뱅 노래 해 줘", "sing:BIGBANG_FANTASTIC_BABY", None),
("fantastic babe sing", "sing:BIGBANG_FANTASTIC_BABY", None),
("sing a big bang song", "sing:BIGBANG_FANTASTIC_BABY", None),
("판타스틱베이비 불러줘", "sing:BIGBANG_FANTASTIC_BABY", None),
("Fantastic Baby 틀어 주세요", "sing:BIGBANG_FANTASTIC_BABY", None),
("빅뱅 판타스틱 베이비 들려 줘", "sing:BIGBANG_FANTASTIC_BABY", None),
("Lumi, BIGBANG please", "sing:BIGBANG_FANTASTIC_BABY", None),
("fan tastic baby", "sing:BIGBANG_FANTASTIC_BABY", None),
("sing Love Attack by RESCENE", "sing:RESCENE_LOVE_ATTACK", None),
("play love attack", "sing:RESCENE_LOVE_ATTACK", None),
("러브 어택 불러 줘", "sing:RESCENE_LOVE_ATTACK", None),
("리센느 노래 해 주세요", "sing:RESCENE_LOVE_ATTACK", None),
("sing something by Rescene", "sing:RESCENE_LOVE_ATTACK", None),
("love atack please", "sing:RESCENE_LOVE_ATTACK", None),
("러브어택 틀어 줘", "sing:RESCENE_LOVE_ATTACK", None),
("Love Attack 해 줘", "sing:RESCENE_LOVE_ATTACK", None),
("rescene song please", "sing:RESCENE_LOVE_ATTACK", None),
("리센느 러브 어택 들려 주세요", "sing:RESCENE_LOVE_ATTACK", None),
("sing the love one", "sing:RESCENE_LOVE_ATTACK | sing", None),
("sing BAD", "sing:ATEEZ_BAD", None),
("ATEEZ 노래 해 줘", "sing:ATEEZ_BAD", None),
("배드 해 주세요", "sing:ATEEZ_BAD", None),
("sing something by ATEEZ", "sing:ATEEZ_BAD", None),
("에이티즈 배드 불러 줄래?", "sing:ATEEZ_BAD", None),
("play BAD from ATEEZ", "sing:ATEEZ_BAD", None),
("a tease song please", "sing:ATEEZ_BAD", None),
("에이티즈 거 불러 줘", "sing:ATEEZ_BAD", None),
("BAD 불러 줘", "sing:ATEEZ_BAD", None),
("꿈꾸던 어른이 되었나요 노래 해 주세요", "sing:MEOMUREU_DREAMED_ADULT", None),
("sing the Meomureu song", "sing:MEOMUREU_DREAMED_ADULT", None),
("머무르 노래 들려 줘", "sing:MEOMUREU_DREAMED_ADULT", None),
("꿈꾸던 어른이 되었나 불러 줘", "sing:MEOMUREU_DREAMED_ADULT", None),
("sing Did I Become the Adult", "sing:MEOMUREU_DREAMED_ADULT", None),
("play the adult I dreamed of", "sing:MEOMUREU_DREAMED_ADULT", None),
("꿈꾸던 어른 노래 틀어 줘", "sing:MEOMUREU_DREAMED_ADULT", None),
("머무르 꿈꾸던 어른이 되었나요", "sing:MEOMUREU_DREAMED_ADULT", None),
("did i become the adult i dreamed of please", "sing:MEOMUREU_DREAMED_ADULT", None),
("꿈 꾸던 어른 이 되었나요 해 줘", "sing:MEOMUREU_DREAMED_ADULT", None),
("sing a song by mumuru", "sing:MEOMUREU_DREAMED_ADULT", None),
# songs and artists Lumi does not have
("can you sing Yesterday by the Beatles?", "unknown", None),
("play Dynamite by BTS", "unknown", None),
("sing a BTS song", "unknown", None),
("jingle bells please", "unknown", None),
("sing happy birthday", "unknown", None),
("play Let It Go from Frozen", "unknown", None),
("twinkle twinkle please", "unknown", None),
("sing Gangnam Style", "unknown", None),
("sing Wonderland", "unknown", None),
("play a christmas song", "unknown", None),
("sing a lullaby for my baby", "unknown", None),
("play baby shark for the kids", "unknown", None),
("sing Bohemian Rhapsody", "unknown", None),
("sing Butter by BTS", "unknown", None),
("sing Arirang", "unknown", None),
("sing Despacito", "unknown", None),
("a NewJeans song please", "unknown", None),
("sing Imagine by John Lennon", "unknown", None),
("sing Bad Romance", "unknown", None),
("sing Love Dive", "unknown", None),
("sing Lies by BIGBANG", "unknown", None),
("sing yestaday", "unknown", None),
("sing an IU song", "unknown", None),
("play Taylor Swift", "unknown", None),
("sing a children's song", "unknown", None),
("sing Silent Night", "unknown", None),
("play Golden from KPop Demon Hunters", "unknown", None),
("sing Attention by NewJeans", "unknown", None),
("sing a song from the Lion King", "unknown", None),
("can you sing the Korean national anthem?", "unknown", None),
("sing Hello by Adele", "unknown", None),
("sing Fantastic by someone else", "unknown | sing:BIGBANG_FANTASTIC_BABY", None),
("sing row row row your boat", "unknown", None),
("sing Haru Haru by Big Bang", "unknown", None),
("sing a Michael Jackson song", "unknown", None),
("방탄소년단 노래 불러 줘", "unknown", None),
("곰 세 마리 해 줘", "unknown", None),
("아리랑 해 줄래?", "unknown", None),
("애국가 불러 주세요", "unknown", None),
("강남 스타일 불러 줘", "unknown", None),
("생일 축하합니다 불러 줘", "unknown", None),
("동요 하나 불러 주세요", "unknown", None),
("자장가 해 줘", "unknown", None),
("캐롤 불러 줘", "unknown", None),
("크리스마스 노래 해 줘", "unknown", None),
("BTS 다이너마이트 불러 줘", "unknown", None),
("블랙핑크 불러 줘", "unknown", None),
("산토끼 불러 줘", "unknown", None),
("아기 상어 불러 줘", "unknown", None),
("트로트 틀어 줘", "unknown", None),
("임영웅 노래 틀어 줘", "unknown", None),
("에이티즈 원더랜드 해 줘", "unknown", None),
("빅뱅 뱅뱅뱅 불러 줘", "unknown", None),
("렛잇고 불러 줘", "unknown", None),
("생일 노래 불러 주세요", "unknown", None),
("아이유 노래 틀어 줘", "unknown", None),
("뉴진스 하입보이 불러 줘", "unknown", None),
("싸이 노래 해 줘", "unknown", None),
("반짝반짝 작은별 해 줘", "unknown", None),
("학교종 불러 줘", "unknown", None),
("아이유 노레 불러 줘", "unknown", None),
("Jingle Bells 해 줘", "unknown", None),
("Gangnam Style 틀어 줘", "unknown", None),
("Yesterday 불러 주세요", "unknown", None),
("BTS song 해 줘", "unknown", None),
("Wonderland 불러 줘", "unknown", None),
("happy birth day song", "unknown", None),
# list questions
("which songs do you have?", "list", None),
("어떤 노래 할 줄 알아요?", "list", None),
("what's on your playlist?", "list", None),
("tell me the songs you can sing", "list", None),
("노래 몇 곡 알아?", "list", None),
("무슨 노래 할 수 있어요?", "list", None),
("song list please", "list", None),
("what can you sing?", "list", None),
("do you know Dynamite?", "unknown | list", None),
("which song are you gonna sing?", "sing | list", None),
("무슨 노래 불러 줄 거야?", "sing | list", None),
("what songs is you know", "list", None),
("부를 수 있는 노래가 뭐예요?", "list", None),
("아는 노래 뭐 있어요?", "list", None),
("what are your songs?", "list", None),
("do you have any songs?", "list", None),
("방탄 노래 알아?", "list | unknown", None),
("do you know Love Attack?", "list | sing:RESCENE_LOVE_ATTACK", None),
("what music can you play", "list", None),
("노래 리스트 알려 주세요", "list", None),
("how many songs can you sing", "list", None),
("which kpop songs do you know?", "list", None),
("what songs u got", "list", None),
("노래 뭐 할 수 있니?", "list", None),
("songs 뭐 있어?", "list", None),
("can you name the songs you know?", "list", None),
("부를 줄 아는 노래 말해 줘", "list", None),
("any songs you know?", "list", None),
# near misses, not a request
("I really like music", "no", None),
("do you enjoy singing?", "no", None),
("who is your favourite singer", "no", None),
("I sang at church yesterday", "no", None),
("my kid sings all day", "no", None),
("노래방 갈래?", "no", None),
("노래방 좋아하세요?", "no", None),
("음악 소리 좀 줄여 줘", "no", None),
("don't sing now", "no", None),
("노래 부르지 마세요", "no", None),
("sing when the boss comes in", "no", None),
("can I sing a song?", "no", None),
("that song was really good", "no", None),
("BTS is the best group", "no", None),
("아이유 노래 진짜 좋다", "no", None),
("is this music coming from you?", "no", None),
("turn down the music", "no", None),
("I like BIGBANG a lot", "no", None),
("Fantastic Baby is an old song", "no", None),
("Love Attack is a cool title", "no", None),
("my brother plays guitar", "no", None),
("singing makes me happy", "no", None),
("what is music?", "no", None),
("are you good at singing?", "no", None),
("노래 잘해?", "no", None),
("우리 딸이 노래 대회 나가요", "no", None),
("좋아하는 가수 있어요?", "no", None),
("소리 좀 키워 줘", "no", None),
("지금 노래 부르지 말고 나중에", "no", None),
("제가 노래 해도 될까요?", "no", None),
("no music please", "no", None),
("I need quiet, no songs", "no", None),
("you can sing at the end of the tour", "no", None),
("RESCENE are a new group, aren't they?", "no", None),
("에이티즈 좋아해요", "no", None),
("러브 어택 좋더라", "no", None),
("what a loud song that is next door", "no", None),
("I heard you sing last week", "no", None),
("노래하지 마세요", "no", None),
("나 노래 못해", "no", None),
("노래는 손님 오면 해", "no", None),
("음악 볼륨 낮춰", "no", None),
("my favourite singer is IU", "no", None),
("do robots like music?", "no", None),
("we sang karaoke last night", "no", None),
("음악 전공했어요", "no", None),
("please stop the music", "no | stop", None),
("노래 그만", "no | stop", None),
("turn the music off", "no | stop", None),
("이제 그만 불러도 돼", "no | stop", None),
# answers to Lumi's last turn
("yeah", "sing", OFFER),
("go ahead", "sing", OFFER),
("surprise me", "sing", OFFER),
("the BIGBANG one", "sing:BIGBANG_FANTASTIC_BABY", OFFER),
("no I'm good", "no", OFFER),
("not now", "no", OFFER),
("네 불러 주세요", "sing", OFFER_KO),
("아무 거나 해 줘", "sing", OFFER_KO),
("판타스틱 베이비로", "sing:BIGBANG_FANTASTIC_BABY", OFFER_KO),
("나중에요", "no", OFFER_KO),
("number two", "sing", LISTED),
("Love Attack!", "sing:RESCENE_LOVE_ATTACK", LISTED),
("you choose", "sing", LISTED),
("nah", "no", LISTED),
("세 번째 거 불러 줘", "sing", LISTED_KO),
("배드", "sing:ATEEZ_BAD", LISTED_KO),
("sing it again", "sing:RESCENE_LOVE_ATTACK", SANG),
("once more", "sing:RESCENE_LOVE_ATTACK", SANG),
("다시 불러 줘", "sing:RESCENE_LOVE_ATTACK", SANG),
("something else", "sing_other", SANG),
("다른 노래 해 줘", "sing_other", SANG),
("not love attack again", "sing_other", SANG),
("wow, nice", "no", SANG),
("고마워", "no", SANG),
("fine, Fantastic Baby then", "sing:BIGBANG_FANTASTIC_BABY", UNKNOWN_SAID),
("그럼 아무거나", "sing", UNKNOWN_SAID),
("아 그렇구나", "no", UNKNOWN_SAID),
]
+354
View File
@@ -0,0 +1,354 @@
"""Song wordings written blind 2026-10-22 (train: fixes may be made from these)."""
from tests.song_contexts import OFFER, OFFER_KO, LISTED, LISTED_KO, SANG, UNKNOWN_SAID
CASES = [
# plain requests, English
("sing a song", "sing", None),
("Lumi, sing a song for me", "sing", None),
("can you sing something?", "sing", None),
("please sing", "sing", None),
("would you sing a song for us?", "sing", None),
("could you please sing something for the guests", "sing", None),
("hey lumi sing", "sing", None),
("I want to hear you sing", "sing", None),
("let's hear a song", "sing", None),
("play some music", "sing", None),
("music please", "sing", None),
("put on some music", "sing", None),
("give us a song", "sing", None),
("sing me something", "sing", None),
("sing something fun", "sing", None),
("a Korean song please", "sing", None),
("sing a k-pop song", "sing", None),
("can you sing a happy song?", "sing", None),
("how about a song?", "sing", None),
("please song", "sing", None),
("you can singing?", "sing", None),
("you sing for me now", "sing", None),
("me want song", "sing", None),
("sing sing sing!", "sing", None),
("would you mind singing for us?", "sing", None),
("I'd love to hear a song from you", "sing", None),
("sing a song for my daughter", "sing", None),
("the kids want a song", "sing", None),
("surprise me with a song", "sing", None),
("pick a song and sing it", "sing", None),
("sing your favourite song", "sing", None),
("start the music", "sing", None),
("can we have some music?", "sing", None),
("lumi, music time!", "sing", None),
("um, can you sing?", "sing", None),
("Sing us a song, Lumi.", "sing", None),
("sing a song!!!", "sing", None),
("sin a song", "sing", None),
("sing a sung", "sing", None),
("play sum music", "sing", None),
("sink a song please", "sing", None),
("Lumie sing a song", "sing", None),
("Sing.a song", "sing", None),
("singasong", "sing", None),
("one song please", "sing", None),
("perform a song for us", "sing", None),
("show us your singing", "sing", None),
("time for a song", "sing", None),
("sing something in Korean", "sing", None),
("sing a dance song", "sing", None),
("I'm sad, sing me a song", "sing", None),
("sing a random song", "sing", None),
("any song is fine, just sing", "sing", None),
("Lumi can you play a song for the kids", "sing", None),
("uh, sing?", "sing", None),
("do you wanna sing for us", "sing", None),
("sing pls", "sing", None),
("Lumi... sing", "sing", None),
("please, a song for my grandma", "sing", None),
("we want music!", "sing", None),
("cheer us up with a song", "sing", None),
("let's have some music in here", "sing", None),
("can u sing 4 me", "sing", None),
("sing a little song", "sing", None),
("Lumi, will you sing?", "sing", None),
("sing a cool song", "sing", None),
("hey robot, sing something", "sing", None),
("play us a tune", "sing", None),
("song time", "sing", None),
("I wanna hear music", "sing", None),
("sing a song, sing a song", "sing", None),
("lumi sing song please thank you", "sing", None),
("do a song for the camera", "sing", None),
# plain requests, Korean
("노래 불러 줘", "sing", None),
("노래 불러 주세요", "sing", None),
("노래 한 곡 불러 줄래?", "sing", None),
("노래해 줘", "sing", None),
("한 곡 뽑아 봐", "sing", None),
("음악 틀어 줘", "sing", None),
("음악 좀 틀어 주세요", "sing", None),
("신나는 노래 불러 줘", "sing", None),
("한국 노래 불러 줘", "sing", None),
("루미야 노래 불러 줘", "sing", None),
("노래 한 곡 부탁해요", "sing", None),
("노래 들려 줘", "sing", None),
("노래 듣고 싶어요", "sing", None),
("아무 노래나 불러 줘", "sing", None),
("재밌는 노래 해 줘", "sing", None),
("우리 아이한테 노래 불러 줄래요?", "sing", None),
("노래 하나 해 주실래요?", "sing", None),
("음악 켜 줘", "sing", None),
("노레 불러 줘", "sing", None),
("루미 야 노래", "sing", None),
("노래불러줘", "sing", None),
("노 래 불러 줘", "sing", None),
("노래 해줄래?", "sing", None),
("음... 노래 하나 불러 줄래?", "sing", None),
("노래 불러봐", "sing", None),
("한곡 해 줘", "sing", None),
("노래 부탁드려요", "sing", None),
("기분 좋아지는 노래 불러 줘", "sing", None),
("음악 시작", "sing", None),
("루미 노래 한 곡만", "sing", None),
("노래 좀 해 봐요", "sing", None),
("노래 불러 줄 수 있어?", "sing", None),
("손님들한테 노래 한 곡 해 줘", "sing", None),
("케이팝 하나 불러 줘", "sing", None),
("노래 해 주세요!!", "sing", None),
("어 노래 좀", "sing", None),
("신나는 음악 틀어 주세요", "sing", None),
("루미야, 한 곡 해 봐", "sing", None),
("노래 하나만 해 줘 제발", "sing", None),
("노랠 불러 줘", "sing", None),
("노래 부르기 해 줘", "sing", None),
("음악 들려 주세요", "sing", None),
("뭐든 좋으니까 노래 해 줘", "sing", None),
("노래 해 줘라", "sing", None),
# plain requests, mixed
("song 하나 해 줘", "sing", None),
("노래 sing 해 줘", "sing", None),
("music 틀어 줘", "sing", None),
("Lumi 노래 불러 줘", "sing", None),
("k-pop 한 곡 불러 줘", "sing", None),
("노래 please", "sing", None),
("sing 해 주세요", "sing", None),
# named songs
("sing Fantastic Baby", "sing:BIGBANG_FANTASTIC_BABY", None),
("Fantastic Baby 불러 줘", "sing:BIGBANG_FANTASTIC_BABY", None),
("sing fantastic bay be", "sing:BIGBANG_FANTASTIC_BABY", None),
("판타스틱 베이비 불러 줘", "sing:BIGBANG_FANTASTIC_BABY", None),
("판타스틱베이비 해 줘", "sing:BIGBANG_FANTASTIC_BABY", None),
("a BIGBANG song please", "sing:BIGBANG_FANTASTIC_BABY", None),
("빅뱅 노래 불러 줘", "sing:BIGBANG_FANTASTIC_BABY", None),
("sing something by Big Bang", "sing:BIGBANG_FANTASTIC_BABY", None),
("fantastic baby!", "sing:BIGBANG_FANTASTIC_BABY", None),
("Lumi play fantastic baby for us", "sing:BIGBANG_FANTASTIC_BABY", None),
("판타스틱 배이비 틀어 줘", "sing:BIGBANG_FANTASTIC_BABY", None),
("sing the fantastic one", "sing:BIGBANG_FANTASTIC_BABY", None),
("sing Love Attack", "sing:RESCENE_LOVE_ATTACK", None),
("Love Attack please", "sing:RESCENE_LOVE_ATTACK", None),
("러브 어택 불러 주세요", "sing:RESCENE_LOVE_ATTACK", None),
("러브어택 해 줘", "sing:RESCENE_LOVE_ATTACK", None),
("리센느 노래 불러 줘", "sing:RESCENE_LOVE_ATTACK", None),
("a RESCENE song", "sing:RESCENE_LOVE_ATTACK", None),
("sing love a tack", "sing:RESCENE_LOVE_ATTACK", None),
("Love Attack 불러 줄래?", "sing:RESCENE_LOVE_ATTACK", None),
("sing the love attack song", "sing:RESCENE_LOVE_ATTACK", None),
("리센 노래 해 줘", "sing:RESCENE_LOVE_ATTACK", None),
("sing BAD by ATEEZ", "sing:ATEEZ_BAD", None),
("에이티즈 노래 불러 줘", "sing:ATEEZ_BAD", None),
("배드 불러 줘", "sing:ATEEZ_BAD", None),
("an ATEEZ song please", "sing:ATEEZ_BAD", None),
("sing a teez song", "sing:ATEEZ_BAD", None),
("ATEEZ BAD 불러 줘", "sing:ATEEZ_BAD", None),
("play the song BAD", "sing:ATEEZ_BAD", None),
("에이티즈 배드 틀어 줘", "sing:ATEEZ_BAD", None),
("sing Did I Become the Adult I Dreamed Of", "sing:MEOMUREU_DREAMED_ADULT", None),
("꿈꾸던 어른이 되었나요 불러 줘", "sing:MEOMUREU_DREAMED_ADULT", None),
("머무르 노래 불러 줘", "sing:MEOMUREU_DREAMED_ADULT", None),
("the dreamed adult song please", "sing:MEOMUREU_DREAMED_ADULT", None),
("꿈꾸던 어른 불러 줄래요?", "sing:MEOMUREU_DREAMED_ADULT", None),
("sing the song about becoming an adult", "sing:MEOMUREU_DREAMED_ADULT", None),
("꿈꾸던어른이되었나요 해 줘", "sing:MEOMUREU_DREAMED_ADULT", None),
("sing something by Meomureu", "sing:MEOMUREU_DREAMED_ADULT", None),
("did i become the adult, that one", "sing:MEOMUREU_DREAMED_ADULT", None),
("머무르의 꿈꾸던 어른이 되었나요 들려 주세요", "sing:MEOMUREU_DREAMED_ADULT", None),
# songs and artists Lumi does not have
("sing Yesterday", "unknown", None),
("sing Dynamite", "unknown", None),
("a BTS song please", "unknown", None),
("sing Jingle Bells", "unknown", None),
("sing happy birthday to my son", "unknown", None),
("sing Let It Go", "unknown", None),
("sing twinkle twinkle little star", "unknown", None),
("play Gangnam Style", "unknown", None),
("sing ATEEZ Wonderland", "unknown", None),
("sing a Christmas song", "unknown", None),
("sing a lullaby", "unknown", None),
("sing Baby Shark", "unknown", None),
("play Shape of You", "unknown", None),
("sing something by Taylor Swift", "unknown", None),
("a Blackpink song", "unknown", None),
("sing the national anthem", "unknown", None),
("sing Bang Bang Bang by BIGBANG", "unknown", None),
("sing Bad Guy by Billie Eilish", "unknown", None),
("sing Baby by Justin Bieber", "unknown", None),
("sing a nursery rhyme", "unknown", None),
("sing a Beatles song", "unknown", None),
("sing dinamite", "unknown", None),
("play gangnam stile", "unknown", None),
("sing a Disney song", "unknown", None),
("can you sing Despacito?", "unknown", None),
("play Hype Boy", "unknown", None),
("sing Love Story by Taylor Swift", "unknown", None),
("please sing old macdonald for my kid", "unknown", None),
("Lumi, Bohemian Rhapsody!", "unknown", None),
("sing Haru Haru", "unknown", None),
("sing an Adele song", "unknown", None),
("sing a song from Frozen", "unknown", None),
("play Butter", "unknown", None),
("sing the ABC song", "unknown", None),
("sing We Wish You a Merry Christmas", "unknown", None),
("아이유 노래 불러 줘", "unknown", None),
("곰 세 마리 불러 줘", "unknown", None),
("아리랑 불러 주세요", "unknown", None),
("애국가 불러 줘", "unknown", None),
("강남스타일 틀어 줘", "unknown", None),
("생일 축하 노래 불러 줘", "unknown", None),
("동요 불러 줘", "unknown", None),
("자장가 불러 줄래?", "unknown", None),
("캐롤 틀어 줘", "unknown", None),
("방탄 노래 불러 줘", "unknown", None),
("블랙핑크 노래 해 줘", "unknown", None),
("학교 종이 땡땡땡 불러 줘", "unknown", None),
("상어 가족 불러 줘", "unknown", None),
("트로트 한 곡 불러 줘", "unknown", None),
("임영웅 노래 불러 주세요", "unknown", None),
("에이티즈 원더랜드 불러 줘", "unknown", None),
("빅뱅 거짓말 불러 줘", "unknown", None),
("반짝반짝 작은 별 불러 줘", "unknown", None),
("엄마 생일인데 생일 축하 노래 불러 줄래?", "unknown", None),
("아이유 좋은 날 불러 줘", "unknown", None),
("뉴진스 노래 틀어 줘", "unknown", None),
("산토끼 불러 줄 수 있어?", "unknown", None),
("곰세마리 해 줘", "unknown", None),
("성탄절 노래 불러 줘", "unknown", None),
("BTS 노래 sing 해 줘", "unknown", None),
("Happy Birthday 불러 줘", "unknown", None),
("Let it go 불러 줄래?", "unknown", None),
("Dynamite 틀어 줘", "unknown", None),
("에이티즈 노래 중에 원더랜드 해 줘", "unknown", None),
("Wonderland by ATEEZ please", "unknown", None),
("sing jinggle bells", "unknown", None),
("sing a song by aiyu", "unknown", None),
# list questions
("what songs do you know?", "list", None),
("what songs can you sing?", "list", None),
("do you know any songs?", "list", None),
("노래 뭐 알아?", "list", None),
("무슨 노래 부를 수 있어?", "list", None),
("list your songs", "list", None),
("how many songs do you know?", "list", None),
("노래 몇 곡 알아요?", "list", None),
("부를 수 있는 노래 알려 줘", "list", None),
("what kind of songs can you do?", "list", None),
("do you know any BTS songs?", "list | unknown", None),
("아이유 노래 알아?", "list | unknown", None),
("what will you sing for us?", "sing | list", None),
("what songs you know?", "list", None),
("노래 목록 보여 줘", "list", None),
("어떤 곡 불러 줄 수 있어요?", "list", None),
("what music do you have?", "list", None),
("do you know Fantastic Baby?", "list | sing:BIGBANG_FANTASTIC_BABY", None),
("which songs are on your list", "list", None),
("아는 노래 있어?", "list", None),
("what song you can sing", "list", None),
("tell me your songs", "list", None),
("무슨 노래 할 줄 알아요?", "list", None),
("song list 알려 줘", "list", None),
("which songs, Lumi?", "list", None),
("do you know a song by ATEEZ?", "list | sing:ATEEZ_BAD", None),
("노래 뭐뭐 있어?", "list", None),
("can you tell me what songs you can play?", "list", None),
# near misses, not a request
("I like music", "no", None),
("do you like singing?", "no", None),
("who's your favourite singer?", "no", None),
("I sang yesterday", "no", None),
("my kid sings", "no", None),
("노래방 가자", "no", None),
("노래방 좋아해?", "no", None),
("음악 소리 줄여", "no", None),
("don't sing", "no", None),
("노래 부르지 마", "no", None),
("sing later when the guests come", "no", None),
("can I sing?", "no", None),
("that song was great", "no", None),
("BTS is my favourite group", "no", None),
("아이유 노래 좋더라", "no", None),
("is that music from you?", "no", None),
("turn the music down", "no", None),
("I love K-pop", "no", None),
("my daughter loves BIGBANG", "no", None),
("I listened to Love Attack yesterday", "no", None),
("my wife is a singer", "no", None),
("I can't sing at all", "no", None),
("you have a nice voice", "no", None),
("I'm going to a concert tonight", "no", None),
("너 노래 좋아해?", "no", None),
("나 어제 노래방 갔어", "no", None),
("우리 애가 노래를 잘 불러", "no", None),
("가수 누구 좋아해?", "no", None),
("볼륨 낮춰 줘", "no", None),
("손님 오면 그때 노래해 줘", "no", None),
("내가 노래 불러도 돼?", "no", None),
("please don't sing right now", "no", None),
("after lunch you can sing for the kids", "no", None),
("the singer of BAD is ATEEZ, right?", "no", None),
("판타스틱 베이비 좋아해", "no", None),
("빅뱅 좋아하세요?", "no", None),
("music is too loud here", "no", None),
("the song at the party was fun", "no", None),
("노래 잘 부르시네요", "no", None),
("음악 하는 사람이에요", "no", None),
("my favourite song is Yesterday", "no", None),
("we'll do the song part at three", "no", None),
("is singing hard for a robot?", "no", None),
("노래는 이따가 해", "no", None),
("no songs today please", "no", None),
("what's your favourite music genre?", "no", None),
("stop the music", "no | stop", None),
("그만 불러", "no | stop", None),
("음악 꺼 줘", "no | stop", None),
("stop singing", "no | stop", None),
# answers to Lumi's last turn
("yes", "sing", OFFER),
("sure", "sing", OFFER),
("you pick", "sing", OFFER),
("Fantastic Baby please", "sing:BIGBANG_FANTASTIC_BABY", OFFER),
("no thanks", "no", OFFER),
("maybe later", "no", OFFER),
("응 불러 줘", "sing", OFFER_KO),
("아무거나", "sing", OFFER_KO),
("러브 어택", "sing:RESCENE_LOVE_ATTACK", OFFER_KO),
("아니 괜찮아", "no", OFFER_KO),
("the second one", "sing", LISTED),
("BAD", "sing:ATEEZ_BAD", LISTED),
("any", "sing", LISTED),
("none, thanks", "no", LISTED),
("첫 번째 거", "sing", LISTED_KO),
("꿈꾸던 어른", "sing:MEOMUREU_DREAMED_ADULT", LISTED_KO),
("again", "sing:RESCENE_LOVE_ATTACK", SANG),
("one more time", "sing:RESCENE_LOVE_ATTACK", SANG),
("한 번 더", "sing:RESCENE_LOVE_ATTACK", SANG),
("another one", "sing_other", SANG),
("다른 거", "sing_other", SANG),
("not that one", "sing_other", SANG),
("that was great", "no", SANG),
("thanks", "no", SANG),
("okay then sing BAD", "sing:ATEEZ_BAD", UNKNOWN_SAID),
("then any", "sing", UNKNOWN_SAID),
("oh okay", "no", UNKNOWN_SAID),
]
+155
View File
@@ -0,0 +1,155 @@
"""Song wordings (tests/song_cases_train.py, song_cases_held.py, written blind) through Lumi's route, to what Lumi
does: sings a song (which one), says it can't sing the one asked (sing.unknown_reply), names its songs
(sing.list_reply), or only talks.
.venv/bin/python tests/song_check.py train # rules only; cases the rules leave are "llm?"
.venv/bin/python tests/song_check.py held --llm # those go to the real LLM, LLM_GAP_S apart, at most LLM_MAX
# new ones a run (answers saved by earlier runs are kept;
# delete logs/song_check_<set>.json after a prompt change)
.venv/bin/python tests/song_check.py held --cached # the LLM's answers saved by the last --llm run
.venv/bin/python tests/song_check.py held --cached --bank # the song bank (sing.bank_read) before the LLM
-> logs/song_check_<set>.md / .json. Verdicts: right; wrong_song (a song not asked for, or not the one asked);
missed (no song where one was asked); odd (no song, but the wrong kind of answer). Nothing moves.
"""
import collections
import json
import pathlib
import sys
import time
from assistant import abilities, brain, voice_words
from audio import sing
from tests import command_check
from tests.conversation_check import NOW, markers
from tests.song_contexts import SANG, SANG_SONG
ROOT = pathlib.Path(__file__).resolve().parents[1]
LLM_GAP_S = 6.0 # s between two LLM calls (the robot's own LLM is in use)
LLM_MAX = 40 # LLM calls per run (--llm); the next run goes on from the saved ones
TITLES = [n for s in sing.songs().values() for n in (s["title"].lower(), s["title_ko"])]
def sung(text, lang, before, whole=False):
song = sing.choose(text, lang, SANG_SONG if before == SANG else None, whole)
return "unknown" if song is None else "sing:" + song
def by_rules(text, lang, before, marks, b):
"""What lumi.answer() does before the LLM, or None."""
last = before[1] if before else ""
if voice_words.read(text, last):
return "talk"
if last.startswith("ACTION: sing") and sing.AFTER_SONG.search(text) and sing.asked(text, last):
return sung(text, lang, before)
if sing.list_asked(text):
return "list"
if abilities.answer(text, lang, last):
return "talk"
try:
r = command_check.rules(text, "idle", marks, b)
except command_check.NoLLM:
return None
if r == "sing" or r == "talk" and sing.asked(text, last): # "talk": a song we don't have (command_check)
return sung(text, lang, before)
return r if r is None or r == "stop" or r.startswith("action:") else "talk"
def from_llm(raw, first, text, lang, before, marks):
head = brain.Brain._action("ACTION: " + raw, text, marks) or {"action": "none", "target": ""}
if head["action"] == "none" and brain.promised(first) == "sing":
head = {"action": "sing"}
if head["action"] == "sing":
return sung(text, lang, before)
if head["action"] in ("none", "end", "unclear", "search", "weather", "quiet"):
low = first.lower()
return "talk_titles" if sum(t in low for t in TITLES) >= 2 else "talk"
return "stop" if head["action"] == "stop" else "action:" + head["action"]
def verdict(expect, got, before):
kind = got.split(":")[0]
for alt in expect.split(" | "):
if alt == got or alt == "sing" and kind == "sing" or \
alt == "sing_other" and kind == "sing" and got != "sing:" + SANG_SONG or \
alt == "list" and got in ("list", "talk_titles") or \
alt == "unknown" and got in ("talk", "talk_titles") or \
alt in ("no", "stop") and got in ("talk", "talk_titles", "stop", "list"):
return "right"
if kind == "sing" or kind == "action":
return "wrong_song"
return "missed" if expect.split(" | ")[0].startswith("sing") else "odd"
def main(args):
name = args[0]
cases = __import__(f"tests.song_cases_{name}", fromlist=["CASES"]).CASES
out = ROOT / "logs" / f"song_check_{name}"
use_llm, cached, use_bank = "--llm" in args, "--cached" in args, "--bank" in args
old = {}
if out.with_suffix(".json").exists():
old = {(r["text"], str(r["before"])): r for r in json.loads(out.with_suffix(".json").read_text()) if r.get("raw")}
if not use_llm:
from assistant import steps
steps._ollama = lambda *a: (_ for _ in ()).throw(command_check.NoLLM())
marks, rows, t0, bank_s, asked = markers(), [], time.time(), [], 0
for text, expect, before in cases:
lang = "ko" if brain.HANGUL.search(text) else "en"
brain.FORCED_LANG["lang"] = lang
b = brain.Brain()
if before:
b.history.append(tuple(before))
got, by, raw, first = by_rules(text, lang, before, marks, b), "rules", "", ""
if got is None and use_bank:
t = time.time()
label = sing.bank_read(text, before[1] if before else "")
bank_s.append(time.time() - t)
if label:
got, by = (sung(text, lang, before) if label == "sing" else "list"), "bank"
key = (text, str(before))
if got is None and (cached or use_llm) and key in old:
raw, first = old[key]["raw"], old[key]["first"]
elif got is None and use_llm and asked < LLM_MAX:
asked += 1
gen = b.respond_stream(text, marks, now=NOW)
head = next(gen)
first = next(gen, "") or ""
gen.close()
raw = f"{head['action']} {head['target']}".strip()
time.sleep(LLM_GAP_S)
if got is None:
got, by = (from_llm(raw, first, text, lang, before, marks), "llm") if raw else ("llm?", "-")
v = verdict(expect, got, before) if got != "llm?" else "llm?"
rows.append({"text": text, "expect": expect, "before": before, "got": got, "by": by, "raw": raw,
"first": first, "verdict": v})
if v not in ("right", "llm?"):
print(f"{v:10} {text!r} -> {got} (want {expect}) [{by}] {first[:60]!r}", flush=True)
out.with_suffix(".json").write_text(json.dumps(rows, ensure_ascii=False, indent=0))
report(rows, out, time.time() - t0, bank_s)
def report(rows, out, secs, bank_s):
by = collections.defaultdict(collections.Counter)
for r in rows:
group = r["expect"].split(" | ")[0].split(":")[0]
by[group][r["verdict"]] += 1
by["ALL"][r["verdict"]] += 1
lines = [f"# Song check {out.name} ({time.strftime('%Y-%m-%d %H:%M')}, {secs:.0f} s)", "",
"| expect | cases | right | wrong_song | missed | odd | llm? |", "|---|---|---|---|---|---|---|"]
for k in sorted(by, key=lambda k: (k == "ALL", k)):
c = by[k]
lines.append(f"| {k} | {sum(c.values())} | {c['right']} | {c['wrong_song']} | {c['missed']} | {c['odd']} | "
f"{c['llm?']} |")
route = collections.Counter((r["by"], r["verdict"]) for r in rows)
lines += ["", "By route: " + ", ".join(f"{k[0]} {k[1]} {n}" for k, n in sorted(route.items()))]
if bank_s:
lines.append(f"Bank: {len(bank_s)} looked up, {1000 * sum(bank_s) / len(bank_s):.0f} ms mean, "
f"{1000 * max(bank_s):.0f} ms max")
lines += ["", "## Not right", ""] + [f"- {r['verdict']}: {r['text']!r} -> {r['got']} (want {r['expect']}) [{r['by']}] "
f"{r['first'][:80]!r}" for r in rows if r["verdict"] not in ("right", "llm?")]
out.with_suffix(".md").write_text("\n".join(lines) + "\n")
print("\n".join(lines[:len(by) + 6]))
if __name__ == "__main__":
main(sys.argv[1:])
+13
View File
@@ -0,0 +1,13 @@
"""The turn before a song case (brain history: what was said, Lumi's action line and answer), for
tests/song_cases_train.py / song_cases_held.py."""
OFFER = ("Can you make music?", "ACTION: none -\nI can sing a few songs for you, like Fantastic Baby or Love Attack. "
"Want one?")
OFFER_KO = ("음악 할 수 있어?", "ACTION: none -\n판타스틱 베이비나 러브 어택 같은 노래를 불러 드릴 수 있어요. 한 곡 불러 드릴까요?")
LISTED = ("What songs do you know?", "ACTION: none songs\nI can sing BAD, Fantastic Baby, Did I Become the Adult I "
"Dreamed Of and Love Attack. Which one would you like?")
LISTED_KO = ("무슨 노래 알아?", "ACTION: none songs\n배드, 판타스틱 베이비, 꿈꾸던 어른이 되었나요, 러브 어택을 부를 수 있어요. "
"어떤 노래 불러 드릴까요?")
SANG = ("Sing a song.", "ACTION: sing RESCENE_LOVE_ATTACK")
SANG_SONG = "RESCENE_LOVE_ATTACK"
UNKNOWN_SAID = ("Sing Yesterday.", "ACTION: none songs\nSorry, I can't sing that one. I only know my own songs: BAD, "
"Fantastic Baby, Did I Become the Adult I Dreamed Of and Love Attack. Want one of them?")
+1 -1
View File
@@ -20,7 +20,7 @@ for lang in ("en", "ko"): # 2-3 spoken sentences,
assert 2 <= len(mouth.sentences(ab.SHORT[lang])) <= 3, ab.SHORT[lang]
assert len(ab.LONG[lang]) > len(ab.SHORT[lang])
assert all(w in ab.SHORT["en"] for w in ("talk", "internet", "pick things up", "places", "follow", "wave", "sing"))
assert all(w in ab.LONG["en"] for w in ("wearing or holding", "from your hand", "follow me", "Arirang"))
assert all(w in ab.LONG["en"] for w in ("wearing or holding", "from your hand", "follow me", "Fantastic Baby"))
assert not any(w in ab.LONG["en"] + ab.SHORT["en"] for w in ("table", "behind", "charge", "mission"))
assert not any(w in ab.LONG["ko"] + ab.SHORT["ko"] for w in ("테이블", "뒤를", "충전", "미션"))
+133
View File
@@ -0,0 +1,133 @@
"""The dashboard's Command box (/tasks/parse) reads a sentence exactly as voice does (Lumi.answer, both on
lumi.route): the same plan for the same words, English and Korean. No robot, no LLM (rules only on both sides):
python tests/test_command_box.py"""
import types
from assistant import brain, lumi
from tasks import fetch
M = ["home", "dock2", "exit", "final"] + [f"p{i}" for i in range(1, 11)]
SENTENCES = [
# the owner's examples
"let's go exit point and go p9 point", "Let's go P5 (point).", "go to p5 and tell me the weather",
"look at me and wave", "웨이브 하고 나 봐", "고개 들고 몇 시야?", "exit 갔다가 p9로 가", "first p1 then p2",
"take the cup, go to p5, give it to Sarah and come back", "go to p10, then go left 1 meter and give it to the person",
"go to p9, ask them for the cup, then bring it to p1", "컵 집고 p3로 가서 테이블에 놔",
"Let's go P10 point and wait 30 seconds then come back here again.",
# corrections
"go to p1, no, p2", "go to p1, never mind", "앞으로 1미터, 아니 2미터 가",
# one command
"turn left", "한 바퀴 돌아", "move back 1 meter", "앞으로 1미터 가", "come here", "이리 와", "follow me", "look left",
"lift yourself up", "wave", "손 흔들어", "stop", "멈춰", "p3로 가 줘", "spin around", "pick up the red cup", "빨간 컵 집어",
"take this from me", "이거 받아", "open your hand", "bring me the cup from p1", "p3에서 컵 가져와",
# talk, questions, refusals
"what time is it?", "오늘 날씨 어때?", "hello", "what's your name?", "go to p12", "dance", "go to p5 and dance",
"루미야 너 월급 받아?",
]
# ---------- voice: Lumi.answer with every handler recorded, nothing moves, no LLM ----------
got_voice = []
class LLMReached(Exception):
pass
def rec(*item):
got_voice.append(item)
return True
def steps_of(rule): # what the mission runner does for a keyword command
a, t = rule
d, _, n = t.partition(" ")
return {"go_to": lambda: [{"do": "go", "to": t}],
"move": lambda: [{"do": "move", "dir": d, "m": float(n or 1)}],
"turn": lambda: [{"do": "turn", "deg": 180.0 if d == "around" else (1 if d == "left" else -1) * float(n or 90)}],
"arm": lambda: [{"do": "arm", "pose": t}],
"pick": lambda: [{"do": "pick", "object": t.split()[-1], "colour": t.split()[0] if " " in t else None}],
}.get(a, lambda: None)()
def quick(text):
rule = brain.intent(text, M)
if not rule or rule[0] not in lumi.QUICK_RULES:
return False
if rule[0] == "fetch":
return rec("fetch")
if rule[0] in ("weather", "search"):
return rec("talk")
s = steps_of(rule)
return rec("steps", s) if s else rec("command", rule[0])
def hand(text):
h = brain.hand_request(text, False, L.brain, M)
if h and h[0] == "receive":
return rec("steps", [{"do": "receive", "object": h[1], "from_hand": True}])
return rec("talk")
fetch.check_hand = lambda: False
lumi.log = fetch.log = lambda *a: None
lumi.mouth = types.SimpleNamespace(say=lambda *a, **k: None, lang_of=lambda t: "ko" if brain.HANGUL.search(t) else "en")
lumi.ears = types.SimpleNamespace(heard_lang=lambda x: x, last_stt={}, understood=lambda: True, heard_clearly=lambda: True)
real_seeing = lumi.seeing.answer
lumi.seeing.answer = lambda t, lang="en", frames=None, slow_line=None: real_seeing(t, lang, frames=[]) # no camera
L = lumi.Lumi.__new__(lumi.Lumi)
L.lang, L.markers, L.current, L.patrol = "en", M, None, None
L.now_doing = lambda: ("", "")
for name in ("follow_stop", "voice_setting", "fixed_answer", "drive_words", "mission_running", "chain_busy", "fetch_voice"):
setattr(L, name, lambda *a, **k: False)
L.fetch_status = lambda: None
L.keep_listening = lambda: None
L.fetch_say = lambda *a: None
L.stop_all = lambda: rec("stop")
L.chain_request = lambda text, plan=None: rec("chain", [[k, w] for k, w, _ in plan])
L.mission_request = lambda text, read=None: rec("talk") if read[1] else rec("steps", read[0])
L.hand_command = hand
L.quick_command = quick
L.end_conversation = lambda *a: rec("talk")
L.sing_song = lambda *a: rec("talk")
def voice(text):
got_voice.clear()
L.brain = brain.Brain()
L.brain.respond_stream = lambda *a, **k: (_ for _ in ()).throw(LLMReached())
try:
L.answer(text)
except LLMReached:
rec("talk")
return got_voice[0] if got_voice else ("talk",)
# ---------- the box ----------
from api import server
server.agv.markers = lambda: M
def box(text):
r = server.task_parse(server.ParseBody(text=text))
a = r["action"]
if a == "steps":
return ("steps", r["steps"])
if a == "command":
return ("chain", r["parts"]) if "parts" in r else ("stop",) if r["sentence"] == "Stop." else \
("command", brain.intent(r["text"], M)[0])
if a == "fetch":
return ("fetch",)
return ("talk",)
bad = []
for t in SENTENCES:
v, b = voice(t), box(t)
if "-v" in __import__("sys").argv:
print(t, "->", v)
if v != b:
bad.append(t)
print(f"DIFFERENT {t!r}\n voice {v}\n box {b}")
print(f"{len(SENTENCES) - len(bad)}/{len(SENTENCES)} the same by voice and in the Command box")
assert not bad
print("command box ok")
+3
View File
@@ -26,6 +26,9 @@ CASES.update({ # any wording of the body commands, English, Korean and mixed (
"wave at my friend please": ("wave", ""), "say hi with your hand": ("wave", ""), "Lumi, wave hello": ("wave", ""),
"손 흔들어 줘": ("wave", ""), "손 좀 흔들어 봐": ("wave", ""), "손 흔들어 주세요": ("wave", ""), "손을 흔들어 봐요": ("wave", ""),
"손 인사 해 줘": ("wave", ""), "wave 해 봐!": ("wave", ""), "루미야 손 흔들어": ("wave", ""),
"손 인사 해 봐": ("wave", ""), "자, 손 인사 해 봐": ("wave", ""), "손인사 해 봐": ("wave", ""), # not a parent's "인사 해"
"손으로 인사 해 봐": ("wave", ""), "손 흔들어 인사 해 봐": ("wave", ""), "do a wave": ("wave", ""),
"do a little wave for us": ("wave", ""),
"shake hand": ("wave", ""), "Shake hand, Lumi": ("wave", ""), "안녕 하고 손 흔들어": ("wave", ""),
"Do you know how to wave?": None, "don't wave": None,
# head
+50 -45
View File
@@ -11,57 +11,71 @@ from audio import sing
from assistant import lumi
SONGS = sing.songs()
assert {"happy_birthday", "twinkle", "row_row", "arirang", "three_bears"} <= set(SONGS), SONGS.keys()
if not SONGS: # the owner's songs are only on the robot
print("songs: none here (data/songs/mine is local to the robot), skipped")
raise SystemExit
B, F, D, L_ = "ATEEZ_BAD", "BIGBANG_FANTASTIC_BABY", "MEOMUREU_DREAMED_ADULT", "RESCENE_LOVE_ATTACK"
assert set(SONGS) == {B, F, D, L_}, SONGS.keys() # Lumi sings only the owner's songs
ASKED = {"sing a song": True, "Lumi, sing me a song please": True, "sing Arirang": True, "sing happy birthday": True,
ASKED = {"sing a song": True, "Lumi, sing me a song please": True, "sing Fantastic Baby": True, "sing Yesterday": True,
"can you sing a song?": True, "sing another song": True, "노래 불러 줘": True, "노래 한 곡 해 줘": True,
"아리랑 불러 줘": True, "곰 세 마리 불러 줄래?": True, "다른 노래": True, "노래해 줘": True,
"play some music": True, "sing a Korean song": True,
"러브 어택 불러 줘": True, "판타스틱 베이비 불러 줄래?": True, "다른 노래": True, "노래해 줘": True,
"play some music": True, "sing a Korean song": True, "Let it go 불러 줘": True,
"can you sing?": True, "노래 할 수 있어요?": True, "sing song": True, "sing music": True, "play music": True,
"Can you sing song?": True, "let's say song": True, "노래해": True, "음악 틀어 줘": True, "노래 하나 해 줘": True,
"노래 하나 불러 줘": True, "아무 노래나 불러 줘": True, "put on some music": True, "다음 곡": True,
"노래 듣고 싶어": True, "루미야 sing a song 해 줘": True, "sing Fantastic Baby": True, "play a song": True,
"노래 듣고 싶어": True, "루미야 sing a song 해 줘": True, "play a song": True,
"do you like singing?": False, "what's your favourite song?": False, "what music do you like?": False,
"좋아하는 노래 있어요?": False, "노래 잘해?": False, "사람 좀 불러 줘": False, "택시 불러 줘": False, "go to p3": False,
"happy birthday, Lumi": False, "stop": False, "I like this music": False, "노래방 가자": False,
"누가 이 노래 불렀어?": False, "what songs can you sing?": False, "another one": False, "그거 말고": False}
"누가 이 노래 불렀어?": False, "what songs can you sing?": False, "another one": False, "그거 말고": False,
"can I sing?": False, "내가 노래 불러도 돼?": False, "sing later when the guests come": False,
"손님 오면 그때 노래해 줘": False, "I can't sing at all": False}
wrong = {t: w for t, w in ASKED.items() if sing.asked(t) != w}
assert not wrong, wrong
CHOSEN = {("sing Arirang", "en"): "arirang", ("아리랑 불러 줘", "ko"): "arirang", ("sing happy birthday", "en"): "happy_birthday",
("생일 축하 노래 불러 줘", "ko"): "happy_birthday", ("곰 세 마리 불러 줘", "ko"): "three_bears",
("sing twinkle twinkle little star", "en"): "twinkle", ("sing row row row your boat", "en"): "row_row",
("sing yesterday", "en"): None, ("sing dynamite by BTS", "en"): None, ("애국가 불러 줘", "ko"): None}
for (text, lang), want in CHOSEN.items():
assert sing.choose(text, lang) == want, (text, sing.choose(text, lang), want)
for _ in range(30): # unnamed: a song in the language asked for / spoken, not the last
assert sing.choose("노래 불러 줘", "ko") in SONGS and sing.choose("sing a song", "en") in SONGS
assert SONGS[sing.choose("sing a Korean song", "en")]["lang"] == "ko"
assert sing.choose("sing another song", "en", last="twinkle") != "twinkle"
assert sing.choose("다른 노래", "ko", last="arirang") != "arirang"
assert SONGS[sing.choose("sing an English song", "ko")]["lang"] == "en"
assert sing.choose("sing for everyone", "en") is not None
assert sing.choose("sing it again", "en", last="row_row") == "row_row"
assert sing.choose("한 번 더 불러 줘", "ko", last="arirang") == "arirang"
CHOSEN = {"sing Fantastic Baby": F, "판타스틱 베이비 불러 줘": F, "sing a BIGBANG song": F, "sing something by Big Bang": F,
"러브어택 틀어 줘": L_, "리센느 노래 해 줘": L_, "sing a teez song": B, "sing BAD by ATEEZ": B,
"꿈꾸던 어른이 되었나요 불러 줘": D, "sing Did I Become the Adult I Dreamed Of": D,
"sing yesterday": None, "sing dynamite by BTS": None, "애국가 불러 줘": None, "아리랑 불러 줘": None,
"sing happy birthday": None, "생일 축하 노래 불러 줘": None, "sing Bad Guy by Billie Eilish": None,
"sing ATEEZ Wonderland": None, "빅뱅 거짓말 불러 줘": None, "sing Bang Bang Bang by BIGBANG": None,
"아이유 노래 불러 줘": None, "BTS 노래 sing 해 줘": None, "sing a Christmas song": None, "sing a lullaby": None,
"Let it go 불러 줄래?": None, "sing an English song": None, "트로트 한 곡 불러 줘": None,
"I feel bad, sing Love Attack": L_} # "bad" is a song name only as a whole word
for text, want in CHOSEN.items():
assert sing.choose(text, "ko" if any('가' <= ch <= '힣' for ch in text) else "en") == want, (text, sing.choose(text, "en"), want)
for _ in range(30): # unnamed: one of ours, not the last
for t in ["노래 불러 줘", "sing a song", "신나는 노래 불러 줘", "sing something fun", "sing pls", "우리 아이한테 노래 불러 줄래요?",
"sing for everyone", "뭐든 좋으니까 노래 해 줘", "sing a Korean song"]:
assert sing.choose(t, "en") in SONGS, t
assert sing.choose("sing another song", "en", last=F) != F
assert sing.choose("다른 노래", "ko", last=L_) != L_
assert sing.choose("sing it again", "en", last=D) == D
assert sing.choose("한 번 더 불러 줘", "ko", last=L_) == L_
LISTED = ["what songs can you sing?", "which songs do you know?", "what songs do you know", "무슨 노래 알아?",
"어떤 노래 부를 수 있어?", "아는 노래 뭐 있어?", "노래 목록 알려 줘", "what can you sing?"]
assert all(sing.list_asked(t) and not sing.asked(t) for t in LISTED), [t for t in LISTED if not sing.list_asked(t)]
assert not any(sing.list_asked(t) for t in ["sing a song", "어떤 노래든 불러 줘", "what's your favourite song?", "go to p3"])
assert all(SONGS[sid]["title"] in sing.list_reply("en") for sid in SONGS) and "어떤 노래" in sing.list_reply("ko")
AFTER = "ACTION: sing arirang" # right after a song: a short word switches or repeats it
assert all(SONGS[sid]["title_ko"] in sing.list_reply("ko") for sid in SONGS)
AFTER = f"ACTION: sing {L_}" # right after a song: a short word switches or repeats it
for t in ["another one", "next", "next one", "a different one", "something else", "not this one", "다른 거",
"다음 거", "그거 말고", "딴 거", "one more"]:
assert sing.asked(t, AFTER) and not sing.asked(t), t
assert all(sing.choose(t, "en", "arirang") not in (None, "arirang") for _ in range(10)), t
assert sing.asked("그 노래 말고 다른 거 불러 줘") and sing.choose("그 노래 말고 다른 거 불러 줘", "ko", "arirang") != "arirang"
assert all(sing.choose(t, "en", L_) not in (None, L_) for _ in range(10)), t
assert sing.asked("그 노래 말고 다른 거 불러 줘") and sing.choose("그 노래 말고 다른 거 불러 줘", "ko", L_) != L_
for t in ["again", "한 번 더", "다시"]:
assert sing.asked(t, AFTER) and sing.choose(t, "en", "arirang") == "arirang", t
assert sing.asked(t, AFTER) and sing.choose(t, "en", L_) == L_, t
for t in ["that was bad", "go to p3", "thank you", "what time is it"]:
assert not sing.asked(t, AFTER), t
assert sing.asked("Arirang", "ACTION: none songs\n...") and sing.asked("판타스틱 베이비", "ACTION: none songs\n...")
assert not sing.asked("Arirang") and not sing.asked("go to p3", "ACTION: none songs\n...")
assert "Arirang" in sing.unknown_reply("en") and "Twinkle" in sing.unknown_reply("en")
assert "아리랑" in sing.unknown_reply("ko")
assert sing.asked("Love Attack", "ACTION: none songs\n...") and sing.asked("판타스틱 베이비", "ACTION: none songs\n...")
assert not sing.asked("Love Attack") and not sing.asked("go to p3", "ACTION: none songs\n...")
for _ in range(20): # a song we don't have: said kindly, ours offered
en, ko = sing.unknown_reply("en"), sing.unknown_reply("ko")
assert all(SONGS[sid]["title"] in en and SONGS[sid]["title_ko"] in ko for sid in SONGS), (en, ko)
assert "{" not in en + ko and "네 곡" in ko or "이렇게" not in ko, ko
assert len({sing.unknown_reply("en") for _ in range(40)}) > 2 # not the same words every time
assert all(sing.stop_words(t) for t in ["stop", "Lumi stop", "멈춰", "그만", "그만해", "enough", "스톱"])
assert not any(sing.stop_words(t) for t in ["sing another song", "다른 노래", "what time is it"])
@@ -87,15 +101,6 @@ for sid, song in SONGS.items(): # head moves like a singer'
ys = [round(y) for _, y, _, _ in targets]
assert len(set(zip(ys, ys[1:], ys[2:]))) > 0.8 * (len(ys) - 2), sid # does not loop the same way
assert song["wav"].exists(), sid
assert sing.choose("I feel bad, sing twinkle", "en") == "twinkle" # "bad" is a song name only as a whole word
if "BIGBANG_FANTASTIC_BABY" in SONGS: # the owner's songs are only on the robot
assert sing.choose("sing fantastic baby", "en") == "BIGBANG_FANTASTIC_BABY"
assert sing.choose("판타스틱 베이비 불러 줘", "ko") == "BIGBANG_FANTASTIC_BABY"
assert sing.asked("판타스틱 베이비 불러 줘")
assert sing.choose("play fantastic baby", "en") == "BIGBANG_FANTASTIC_BABY"
if "MEOMUREU_DREAMED_ADULT" in SONGS:
assert sing.asked("꿈꾸던 어른이 되었나요 불러 줘") and sing.choose("꿈꾸던 어른이 되었나요 불러 줘", "ko") == "MEOMUREU_DREAMED_ADULT"
class FakeHead:
YAW_LIMIT = 60.0
@@ -132,7 +137,7 @@ def player(seconds):
head = FakeHead()
assert sing.sing("row_row", None, player(2.5), head, fake_load) # finished
assert sing.sing(B, None, player(2.5), head, fake_load) # finished
sing._head_thread.join(2)
assert len(head.moves) >= 3, head.moves # to 0 / 0, moved with the song ...
assert head.moves[0] == [120.0, 5.0, 0.0, 0.0], head.moves[0]
@@ -142,13 +147,13 @@ assert all(abs(m[2]) <= sing.YAW_SWAY and sing.PITCH_RANGE[0] <= m[3] <= sing.PI
head = FakeHead()
t0 = time.time()
stop_at = t0 + 0.3
assert not sing.sing("arirang", lambda: time.time() > stop_at, player(30), head, fake_load) # stopped
assert not sing.sing(F, lambda: time.time() > stop_at, player(30), head, fake_load) # stopped
assert time.time() - stop_at < 0.1, time.time() - stop_at # at once
sing._head_thread.join(2)
assert head.moves and head.moves[-1] == [120.0, 5.0, 0.0, 0.0], head.moves
played = [] # a stereo file reaches the one-channel speaker as mono
assert sing.sing("twinkle", None, lambda wav, rate, abort: played.append(wav.ndim) or True, FakeHead(),
assert sing.sing(D, None, lambda wav, rate, abort: played.append(wav.ndim) or True, FakeHead(),
lambda path: (np.zeros((4410, 2), np.float32), 44100))
assert played == [1], played
sing._head_thread.join(2)
@@ -179,8 +184,8 @@ L.mic = types.SimpleNamespace(next=lambda wait: utterance if heard else None)
t0 = time.time()
threading.Timer(0.3, lambda: heard.append("stop")).start()
L.sing_song("sing Arirang")
assert sung == ["arirang"] and time.time() - t0 < 1.0 and L.pending_text is None, (sung, time.time() - t0)
L.sing_song("sing Love Attack")
assert sung == [L_] and time.time() - t0 < 1.0 and L.pending_text is None, (sung, time.time() - t0)
threading.Timer(0.3, lambda: heard.append("sing another song")).start()
L.sing_song("sing a song")
@@ -192,7 +197,7 @@ assert sung[-1] != first and L.pending_text is None, sung
threading.Timer(0.3, lambda: heard.append("thank you")).start() # whisper's guess on music: ignored
t0 = time.time()
L.sing_song("sing twinkle twinkle")
L.sing_song("sing Fantastic Baby")
assert time.time() - t0 > 4.5 and L.pending_text is None
# lumi.answer(): "again" right after a song is the song (not the drive words), "Can you sing song?" tagged Korean
@@ -207,7 +212,7 @@ L.speak_abort = lambda: False
L.drive_words = lambda text: (_ for _ in ()).throw(AssertionError(f"drive words got {text!r}"))
L.skill_busy = lambda: False
L.sing_song = lambda text: sung.append(("sing", text))
L.brain.history = [("sing Arirang", "ACTION: sing arirang")]
L.brain.history = [("sing Love Attack", f"ACTION: sing {L_}")]
L.answer("again")
assert sung[-1] == ("sing", "again"), sung
L.answer("그거 말고")