Improve Korean try-forms and English polite frames for every motion

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-02 03:44:30 +09:00
co-authored by Claude Opus 5.5
parent 5bfabd63b6
commit 4887ea9ecf
8 changed files with 115 additions and 13 deletions
+18
View File
@@ -38,3 +38,21 @@ INTENT = {
"wave": _with(["do you shake your hand", "do you wave", "shake my hand", "give me a handshake", "high five me", "wave": _with(["do you shake your hand", "do you wave", "shake my hand", "give me a handshake", "high five me",
"wave goodbye", "give a little wave", "wave your hand at me"]), "wave goodbye", "give a little wave", "wave your hand at me"]),
} }
# "mind folding your arm?", "how about turning around?", "care to follow me?": the -ing and "care to" frames
GERUND = ["mind {g}?", "would you mind {g}?", "how about {g}?", "what about {g}?", "care to {v}?", "how about you {v}?",
"any chance of {g}?", "fancy {g}?"]
_PAIRS = {
"arm_fold": [("fold your arm", "folding your arm"), ("put your arm away", "putting your arm away")],
"arm_reach": [("hold out your hand", "holding out your hand"), ("reach out your arm", "reaching out your arm")],
"turn": [("turn around", "turning around"), ("turn left", "turning left"), ("turn right", "turning right")],
"follow": [("follow me", "following me"), ("come with me", "coming with me")],
"come": [("come here", "coming here"), ("come over", "coming over")],
"look": [("look at me", "looking at me"), ("look up", "looking up"), ("look down", "looking down")],
"wave": [("wave", "waving"), ("shake my hand", "shaking my hand")],
"pick": [("pick up the <obj>", "picking up the <obj>"), ("grab the <obj>", "grabbing the <obj>")],
"arm_open": [("open your hand", "opening your hand")],
"arm_close": [("close your hand", "closing your hand")],
}
for _k, _ps in _PAIRS.items():
INTENT[_k] = INTENT.get(_k, []) + [f.format(v=v, g=g) for v, g in _ps for f in GERUND]
+5
View File
@@ -44,3 +44,8 @@ QUICK = {
"software": ["무슨 프로그램으로 움직여요", "무슨 소프트웨어 써", "뭘로 프로그래밍 됐어요", "어떤 프로그램 돌아가요", "software": ["무슨 프로그램으로 움직여요", "무슨 소프트웨어 써", "뭘로 프로그래밍 됐어요", "어떤 프로그램 돌아가요",
"소프트웨어는 뭐로 만들었습니까", "무슨 언어로 코딩됐어", "프로그램은 뭘로 짰냐"], "소프트웨어는 뭐로 만들었습니까", "무슨 언어로 코딩됐어", "프로그램은 뭘로 짰냐"],
} }
QUICK["internet"] = QUICK.get("internet", []) + ["와이파이 연결돼 있어", "와이파이 돼요", "인터넷 연결돼 있냐",
"인터넷 쓸 수 있으세요", "온라인이에요", "인터넷 검색도 돼요"]
QUICK["who"] += ["어떤 일을 하시는 분이세요", "무슨 일 하세요", "여기서 무슨 일 해요", "넌 여기서 뭐 하냐", "어떤 역할을 하십니까"]
QUICK["safety"] = QUICK.get("safety", []) + ["너 위험하냐", "옆에 있어도 괜찮아요", "가까이 가도 안전해요", "다칠 일은 없어요",
"애들이 만져도 안전해요"]
+1 -1
View File
@@ -1585,7 +1585,7 @@ def _intent(text, markers=()):
if exact or n == "?": # "come closer by five centimeters": a short drive if exact or n == "?": # "come closer by five centimeters": a short drive
return ("move", f"forward {n:g}") if exact and driving.MOVE_MIN_M <= n <= MOVE_MAX_M else None return ("move", f"forward {n:g}") if exact and driving.MOVE_MIN_M <= n <= MOVE_MAX_M else None
if action == "come_back": if action == "come_back":
if COME_BACK.fullmatch(CALLING.sub("", t).strip(" .!?,~")): if COME_BACK.fullmatch(re.sub(r"(?:^|\s)(?:빨리|당장|얼른|어서|냉큼)(?=\s|$)", " ", CALLING.sub("", t)).strip(" .!?,~")):
return ("come_back", "") # "come back", "돌아와", "go back where you were" return ("come_back", "") # "come back", "돌아와", "go back where you were"
if re.search(r"\barm\b|look pose|팔", t): if re.search(r"\barm\b|look pose|팔", t):
return ("arm", "fold") # "arm back home", "go back to your look pose" return ("arm", "fold") # "arm back home", "go back to your look pose"
+7 -6
View File
@@ -884,11 +884,11 @@ LIFT_BODY = (r"\b(?:yourself|your (?:body|torso|upper body)|body|make you|taller
MOVE_VERB = (r"\b(?:move|go|step|back up|backup|scoot|slide|shift|drive|roll|reverse|inch|come|forward|backward|ahead|" MOVE_VERB = (r"\b(?:move|go|step|back up|backup|scoot|slide|shift|drive|roll|reverse|inch|come|forward|backward|ahead|"
r"moov|moove|bak)|가|이동|움직|물러|비켜|후진|와|빠져|걸음|발짝|move|back|go") # a bare "왼쪽으로" may be a look r"moov|moove|bak)|가|이동|움직|물러|비켜|후진|전진|나가|와|빠져|걸음|발짝|move|back|go") # a bare "왼쪽으로" may be a look
LOOK_DIR = {"left": r"\bleft|왼|레프트|(?:^|\s)좌로|좌측", "right": r"\bright|\brite\b|오른|라이트|(?:^|\s)우로|우측", LOOK_DIR = {"left": r"\bleft|왼|레프트|(?:^|\s)좌로|좌측", "right": r"\bright|\brite\b|오른|라이트|(?:^|\s)우로|우측",
"up": r"\bup|\bupward|\bceiling|\bsky\b|\bhigher\b|천장|하늘|(?<!원)위", "down": r"\bdown|\bfloor|\bground|\bfeet\b|바닥|땅|아래|밑"} "up": r"\bup|\bupward|\bceiling|\bsky\b|\bhigher\b|천장|하늘|(?<!원)위|고개\S* ?드(?:세요|십시오|시오|시게)", "down": r"\bdown|\bfloor|\bground|\bfeet\b|\bbow\b|바닥|땅|아래|밑"}
LOOK_ME = (r"\b(?:at|on|to|toward|towards) (?:me|us|나)\b|\bthis way\b|\bover here\b|\bmy way\b|\bhere\b|\bwatch me\b|" LOOK_ME = (r"\b(?:at|on|to|toward|towards) (?:me|us|나)\b|\bthis way\b|\bover here\b|\bmy way\b|\bhere\b|\bwatch me\b|"
r"\bme in the eye|\bmy face\b|\bme (?=봐|보)|\blook (?:여기|here|me)\b|(?:제|내) 얼굴|나한테|저한테|쳐다봐|(?:^|\s)(?:여기|이쪽|저|나|날|절)(?:를|을)?\s*(?:(?:좀|한 ?번|잠깐|잠시|다시)\s*)*(?:바라|쳐다)?(?:봐|보세요|look)") r"\bme in the eye|\bmy face\b|\bme (?=봐|보)|\blook (?:여기|here|me)\b|(?:제|내) 얼굴|나한테|저한테|쳐다봐|(?:^|\s)(?:여기|이쪽|저|나|날|절)(?:를|을)?\s*(?:(?:좀|한 ?번|잠깐|잠시|다시)\s*)*(?:바라|쳐다)?(?:봐|보세요|look)")
@@ -1014,6 +1014,7 @@ def _to_person(text):
def _dirs(t): def _dirs(t):
t = t.replace("좌회전", "왼쪽 회전").replace("우회전", "오른쪽 회전") # "좌회전 해 봐": a left turn
return [d for d, rx in DIR.items() if re.search(rx, t)] return [d for d, rx in DIR.items() if re.search(rx, t)]
@@ -1025,7 +1026,7 @@ def _slot(kind, text, markers, holding):
return None # "홈 포지션으로 팔": the arm's pose, not the marker home return None # "홈 포지션으로 팔": the arm's pose, not the marker home
if kind == "go_to": if kind == "go_to":
if brain._mentions(text, markers).get("object") or re.search(r"\bfrom\b|에서|에 있는|\bface\b|\blook|\bpoint|" if brain._mentions(text, markers).get("object") or re.search(r"\bfrom\b|에서|에 있는|\bface\b|\blook|\bpoint|"
r"(?<![가와해] )(?<![가와해])봐|" # "가 봐": try going r"(?<![가와해여] )(?<![가와해여])봐|" # "가 봐", "움직여 봐": try going
r"\bwith (?:me|us)\b|같이|함께|따라|" r"\bwith (?:me|us)\b|같이|함께|따라|"
+ CARRY + r"|\btake (?:it|this|that|them)\b", t): + CARRY + r"|\btake (?:it|this|that|them)\b", t):
return None # "get the bottle from booth two": a fetch, the rules' / LLM's return None # "get the bottle from booth two": a fetch, the rules' / LLM's
@@ -1074,7 +1075,7 @@ def _slot(kind, text, markers, holding):
return None return None
return ("move", f"{d[0]} {n:g}") return ("move", f"{d[0]} {n:g}")
if kind == "turn": if kind == "turn":
if re.search(r"\blook|봐|\bhead\b|고개|\beyes\b|\btorso\b|\bwaist\b|\btwist|\bupper body\b|\bhips?\b|허리|상체|몸통|윗몸|" if re.search(r"\blook|(?<![해려] )(?<![해려])(?<!돌아 )봐|\bhead\b|고개|\beyes\b|\btorso\b|\bwaist\b|\btwist|\bupper body\b|\bhips?\b|허리|상체|몸통|윗몸|"
r"\btrunk\b|\bwithout driving\b", t): r"\btrunk\b|\bwithout driving\b", t):
return None # "look the other way", "twist your torso": not the base return None # "look the other way", "twist your torso": not the base
if re.search(r"반 ?바퀴", t) and not re.search(r"\d|한 ?바퀴", t): if re.search(r"반 ?바퀴", t) and not re.search(r"\d|한 ?바퀴", t):
@@ -1087,7 +1088,7 @@ def _slot(kind, text, markers, holding):
return ("turn", ("right" if re.search(r"\bright\b|오른쪽", t) else "left") + " 360") return ("turn", ("right" if re.search(r"\bright\b|오른쪽", t) else "left") + " 360")
if re.search(r"\bgo the other way\b", t): if re.search(r"\bgo the other way\b", t):
return None # "go the other way around": a way round (detour), not a turn return None # "go the other way around": a way round (detour), not a turn
if re.search(r"\baround\b|\bu-?turn\b|유턴|뒤로 ?(?:(?:좀|한 ?번|얼른|빨리|확)\s*)?(?:돌|회전)|뒤돌|\bother way\b|\babout face\b|한 바퀴", t): if re.search(r"\baround\b|\bu-?turn\b|\b(?:rotate|turn|spin) 180\b(?!\s*(?:degrees?|도))|유턴|뒤로 ?(?:(?:좀|한 ?번|얼른|빨리|확)\s*)?(?:돌|회전)|뒤돌|\bother way\b|\babout face\b|한 바퀴", t):
return None if re.search(r"\bleft|\bright\b|왼|오른", t) else ("turn", "around 180") return None if re.search(r"\bleft|\bright\b|왼|오른", t) else ("turn", "around 180")
d = [x for x in _dirs(t) if x in ("left", "right")] d = [x for x in _dirs(t) if x in ("left", "right")]
if not d and said_amount(text)[1] == 180: if not d and said_amount(text)[1] == 180:
@@ -1098,7 +1099,7 @@ def _slot(kind, text, markers, holding):
words_deg = said_amount(text)[1] words_deg = said_amount(text)[1]
if not deg and words_deg: if not deg and words_deg:
return ("turn", f"{d[0]} {words_deg:g}") return ("turn", f"{d[0]} {words_deg:g}")
if not deg and re.search(r"\bdegrees?\b|[가-힣]\s*도(?:만)?(?:\s|[.,!?~])", t + " ") and not re.search(r"(?:^|\s)(?:한|좀)\s", t): if not deg and re.search(r"degree|[가-힣]\s*도(?:만)?(?:\s|[.,!?~])", t + " ") and not re.search(r"(?:^|\s)(?:한|좀)\s", t):
return None # "삼십 도": a number the words don't give as digits return None # "삼십 도": a number the words don't give as digits
if not deg and re.search(r"\d", t): if not deg and re.search(r"\d", t):
return None # "turn left 30.": a number with no unit, asked return None # "turn left 30.": a number with no unit, asked
+2 -2
View File
@@ -64,13 +64,13 @@ SPEECH_PER_SYLLABLE = 0.12 # s of speech (Silero VAD, ears.speech_seconds)
# than ears.SPEECH_PER_SYLLABLE (0.05) for normal listening; stop words skip it # than ears.SPEECH_PER_SYLLABLE (0.05) for normal listening; stop words skip it
SONG_WORD = re.compile(r"\bsing|\bsong|\bmusic|\btunes?\b|\bplaylist|k-?pop|노래|노레|노랠|음악|곡|불러|부르|틀어|들려|케이팝", re.I) SONG_WORD = re.compile(r"\bsing|\bsong|\bmusic|\btunes?\b|\bplaylist|k-?pop|노래|노레|노랠|음악|곡|불러|부르|틀어|들려|케이팝", re.I)
SING = re.compile(r"\bsing\b|\bsay (?:a |some )?songs?\b|" # whisper writes "let's say song" SING = re.compile(r"\bsing\b|\b(?:how about|what about|mind|fancy) singing\b|\b(?:how|what) about (?:a |some )?(?:song|music)\b|\bsay (?:a |some )?songs?\b|" # whisper writes "let's say song"
r"\b(?:play|put on|turn on|start)(?: me| us)? (?:a |some |any |another |the |your )?(?:songs?|music|tunes?)\b|" r"\b(?:play|put on|turn on|start)(?: me| us)? (?:a |some |any |another |the |your )?(?:songs?|music|tunes?)\b|"
r"\b(?:another|different|next|new|other) (?:song|tune)\b|\b(?:change|switch)(?: the| this| that)? (?:songs?|music|tunes?)\b|" r"\b(?:another|different|next|new|other) (?:song|tune)\b|\b(?:change|switch)(?: the| this| that)? (?:songs?|music|tunes?)\b|"
r"(?:노래|음악|곡)\s*(?:좀\s*)?바꿔|\b(?:(?:want|like|love) to|(?:can|could|may) (?:we|i)) hear (?:a |some |one of your )?(?:songs?|music)\b|\bgive (?:us|me) (?:a |some )?(?:song|tune|music)\b|" r"(?:노래|음악|곡)\s*(?:좀\s*)?바꿔|\b(?:(?:want|like|love) to|(?:can|could|may) (?:we|i)) hear (?:a |some |one of your )?(?:songs?|music)\b|\bgive (?:us|me) (?:a |some )?(?:song|tune|music)\b|"
r"^\W*(?:lumi\W*)?(?:a |some )?(?:song|music)(?:\W+(?:please|lumi))*\W*$|" r"^\W*(?:lumi\W*)?(?:a |some )?(?:song|music)(?:\W+(?:please|lumi))*\W*$|"
r"(?:노래|음악|(?<![가-힣])곡|(?<![가-힣])송)\s*(?:를|을|좀|쫌|쪼까|쪼끔|하나|한\s*곡조?|한\s*번|한번|함|한\s*자락|자락|도|이나|나|이든|든|라도|\s)*" r"(?:노래|음악|(?<![가-힣])곡|(?<![가-힣])송)\s*(?:를|을|좀|쫌|쪼까|쪼끔|하나|한\s*곡조?|한\s*번|한번|함|한\s*자락|자락|도|이나|나|이든|든|라도|\s)*"
r"(?:불러|부르|들려|해|하(?:십시오|세요|시죠|시오|시게|자|라)|합시다|틀어|틀|뽑아|뽑으|땡겨|부탁|재생|플레이|싱\s*(?:해|하)|(?:할|부를)\s*수\s*있)|(?<![가-힣])싱\s*(?:좀\s*)?해\s*(?:줘|주|봐)|" r"(?:불러|부르|들려|해|하(?:십시오|세요|시죠|시오|시게|자|라)|합시다|부릅시다|부르자|틀어|틀|뽑아|뽑으|땡겨|부탁|재생|플레이|싱\s*(?:해|하)|(?:할|부를)\s*수\s*있)|(?<![가-힣])싱\s*(?:좀\s*)?해\s*(?:줘|주|봐)|"
r"노래\s*(?:좀|하나)?\s*(?:듣고\s*싶|들을래|듣자)|\b(?:songs?|music)\s*(?:좀\s*|하나\s*|한\s*곡\s*)?(?:불러|해|틀어|들려)|" r"노래\s*(?:좀|하나)?\s*(?:듣고\s*싶|들을래|듣자)|\b(?:songs?|music)\s*(?:좀\s*|하나\s*|한\s*곡\s*)?(?:불러|해|틀어|들려)|"
r"(?<![가-힣])(?:거|것)\s*(?:로\s*)?한\s*곡|(?:다른|딴|다음)\s*(?:노래|곡)|(?:다른|딴)\s*(?:거|걸|걸로)\s*(?:불러|들려|틀어)|^\W*(?:노래|음악)\s*(?:좀|하나)?\W*$", re.I) r"(?<![가-힣])(?:거|것)\s*(?:로\s*)?한\s*곡|(?:다른|딴|다음)\s*(?:노래|곡)|(?:다른|딴)\s*(?:거|걸|걸로)\s*(?:불러|들려|틀어)|^\W*(?:노래|음악)\s*(?:좀|하나)?\W*$", re.I)
SING_TITLE = re.compile(r"(불러|들려|틀어) ?(줘|주세요|줄래|봐|볼래)|\b(?:sing|play)\b") # "러브 어택 불러 줘": a title said with it SING_TITLE = re.compile(r"(불러|들려|틀어) ?(줘|주세요|줄래|봐|볼래)|\b(?:sing|play)\b") # "러브 어택 불러 줘": a title said with it
+2 -2
View File
@@ -15,7 +15,7 @@ from tests import ko_levels_check as kl
ROOT = pathlib.Path(__file__).resolve().parents[1] ROOT = pathlib.Path(__file__).resolve().parents[1]
# name: (plain request, [other sentences of the same meaning, verb first]); "spin left" / "spin around" / "turn all the # name: (plain request, [other sentences of the same meaning, verb first]); "spin left" / "spin around" / "turn all the
# way around" are a full spin, "hold it" a hand-over: not listed # way around" are a full spin, "hold it" a hand-over, "face left" the head or the body: not listed
CAPS = { CAPS = {
"wave": ("wave", ["shake your hand", "shake hand", "wave your hand", "wave hand", "give us a wave", "wave hello", "wave": ("wave", ["shake your hand", "shake hand", "wave your hand", "wave hand", "give us a wave", "wave hello",
"do a little wave", "shake hands with me", "let's shake hands", "wave at me", "wave to the kids", "do a little wave", "shake hands with me", "let's shake hands", "wave at me", "wave to the kids",
@@ -41,7 +41,7 @@ CAPS = {
"roll forward one meter", "go one meter forward"]), "roll forward one meter", "go one meter forward"]),
"back": ("move back half a meter", ["back up half a meter", "go back fifty centimeters", "reverse half a meter", "back": ("move back half a meter", ["back up half a meter", "go back fifty centimeters", "reverse half a meter",
"back off half a meter", "move backward fifty centimeters"]), "back off half a meter", "move backward fifty centimeters"]),
"turn": ("turn left", ["turn to the left", "rotate left", "turn your body left", "face left", "turn": ("turn left", ["turn to the left", "rotate left", "turn your body left",
"make a left turn", "turn left ninety degrees"]), "make a left turn", "turn left ninety degrees"]),
"around": ("turn around", ["do a u-turn", "turn the other way", "around": ("turn around", ["do a u-turn", "turn the other way",
"face the other way", "rotate one eighty"]), "face the other way", "rotate one eighty"]),
+70
View File
@@ -0,0 +1,70 @@
"""A second held-out set, Korean and English, written at 02:40 on 2026-11-02 and never used for fixing: only scored
on the tree before the night (the before copy) and after it, for the morning report.
.venv/bin/python tests/held2_check.py # -> logs/held2.md
"""
import pathlib
from tests import ko_levels_check as kl
ROOT = pathlib.Path(__file__).resolve().parents[1]
CASES = [
# Korean, every register
("p5 쪽으로 좀 가 볼래", "go to p5", "ko 반말"), ("p5로 고고", "go to p5", "ko konglish"), ("p5까지 이동하십시오", "go to p5", "ko 하십시오"),
("야 p5 가", "go to p5", "ko rude"), ("p5로 가 주실 수 있을까요?", "go to p5", "ko honorific"), ("p5 가자", "go to p5", "ko suggest"),
("앞으로 1미터만 이동해 줄래", "move forward one meter", "ko 반말"), ("1미터 앞으로 가 주십시오", "move forward one meter", "ko 하십시오"),
("야 1미터 앞으로 전진", "move forward one meter", "ko rude"), ("뒤로 50센티만 가 주세요", "move back half a meter", "ko 해요"),
("50센티 뒤로 물러나 봐", "move back half a meter", "ko 반말"), ("왼쪽으로 돌아 주시겠습니까?", "turn left", "ko 하십시오"),
("야 왼쪽으로 돌아", "turn left", "ko rude"), ("좌회전 해 줘", "turn left", "ko 반말"), ("오른쪽으로 45도만 돌아 주세요", "turn right 45 degrees", "ko 해요"),
("뒤로 돌아 봐라", "turn around", "ko rude"), ("반 바퀴 돌아 주실래요?", "turn around", "ko honorific"),
("위를 봐 줄래?", "look up", "ko 반말"), ("고개 좀 들어 보십시오", "look up", "ko 하십시오"), ("아래 좀 봐라", "look down", "ko rude"),
("고개 숙여 주세요", "look down", "ko 해요"), ("날 봐", "look at me", "ko 반말"), ("저 좀 봐 주시겠어요?", "look at me", "ko honorific"),
("이리 좀 와 봐", "come here", "ko 반말"), ("이리 오세요", "come here", "ko 해요"), ("야 이리 와라", "come here", "ko rude"),
("저를 따라와 주시겠어요?", "follow me", "ko honorific"), ("따라와라", "follow me", "ko rude"), ("나 따라오자", "follow me", "ko suggest"),
("손 흔들어", "wave", "ko 반말"), ("손 좀 흔드세요", "wave", "ko honorific"), ("손 흔들어 주십시오", "wave", "ko 하십시오"),
("악수하자", "wave", "ko suggest"), ("야 악수해", "wave", "ko rude"), ("손 줘 봐", "give me your hand", "ko 반말"),
("손 내밀어 주실래요?", "give me your hand", "ko honorific"), ("팔 접어 줘", "fold your arm", "ko 반말"), ("팔 접으십시오", "fold your arm", "ko 하십시오"),
("손 펴 봐라", "open your hand", "ko rude"), ("컵 집어 줘", "pick up the cup", "ko 반말"), ("컵 집으세요", "pick up the cup", "ko honorific"),
("야 컵 들어", "pick up the cup", "ko rude"), ("컵 좀 가져와 줘", "bring me the cup", "ko 반말"), ("컵 갖다주십시오", "bring me the cup", "ko 하십시오"),
("멈춰", "stop", "ko 반말"), ("멈추세요", "stop", "ko honorific"), ("야 그만해", "stop", "ko rude"), ("정지하십시오", "stop", "ko 하십시오"),
("노래 불러 줘", "sing a song", "ko 반말"), ("노래 한 곡 불러 주시겠어요?", "sing a song", "ko honorific"), ("노래 해라", "sing a song", "ko rude"),
("충전하러 가", "go charge", "ko 반말"), ("돌아와 주세요", "come back", "ko 해요"), ("몸 올려 줘", "raise your body", "ko 반말"),
# English, many ways
("head over to p5", "go to p5", "en plain"), ("p5 please", "go to p5", "en casual"), ("would you go to p5 for me?", "go to p5", "en polite"),
("you move go p5", "go to p5", "en nonnative"), ("move ahead one meter", "move forward one meter", "en plain"),
("back up fifty centimeters please", "move back half a meter", "en polite"), ("turn left, would you?", "turn left", "en polite"),
("left turn please", "turn left", "en casual"), ("you turn around please", "turn around", "en nonnative"), ("turn round", "turn around", "en plain"),
("look upward please", "look up", "en polite"), ("look down for me", "look down", "en plain"), ("look at me please", "look at me", "en polite"),
("over here, come", "come here", "en casual"), ("come to me please", "come here", "en polite"), ("follow me around", "follow me", "en plain"),
("could you follow behind me?", "follow me", "en polite"), ("wave at the camera", "wave", "en plain"), ("shake hands with us", "wave", "en plain"),
("can you wave to my friend?", "wave", "en polite"), ("reach out to me", "give me your hand", "en plain"), ("fold up your arm", "fold your arm", "en plain"),
("open the hand please", "open your hand", "en polite"), ("grab the cup please", "pick up the cup", "en polite"),
("could you bring the cup here?", "bring me the cup", "en polite"), ("stop, stop", "stop", "en casual"), ("please stop moving", "stop", "en polite"),
("sing us a song", "sing a song", "en plain"), ("go to your charger", "go charge", "en plain"), ("talk louder please", "speak louder", "en polite"),
]
NOT_NOW = [
"아까 손 흔들었잖아", "손 흔들 수 있어요?", "엄마가 이리 오래요", "컵 집지 마세요", "이따가 p5로 가 줘", "우리 애가 노래 불렀어요",
"고개 숙이는 거 봤어", "팔 접는 법 알아?", "I saw it wave yesterday", "don't wave please", "can you even wave?",
"if I clap, come to me", "my friend went to p5", "later, turn left", "he asked me to follow him",
]
def check():
rows = []
for t, en, level in CASES:
want, got = kl.read(en), kl.read(t)
rows.append(("held2", level, t, got, want, "right" if kl.same(want, got) else
"missed" if got is None or got.split()[0] in kl.command_check.NO_MOTION else "wrong"))
for t in NOT_NOW:
got = kl.read(t)
moves = got is not None and got.split()[0] not in kl.command_check.NO_MOTION
rows.append(("held2", "not_now", t, got, "no motion", "motion" if moves and got not in ("stop", "sing") else "right"))
return rows
if __name__ == "__main__":
out = kl.report(check()).replace("# Korean speech levels against English (tests/ko_levels_check.py)",
"# Second held-out set, Korean and English (tests/held2_check.py)")
(ROOT / "logs" / "held2.md").write_text(out)
print(out[:out.index("## Not right")])
+10 -2
View File
@@ -25,12 +25,20 @@ READS = [
("do you shake your hand", "action:wave"), ("can you shake your hand", "action:wave"), ("do you shake your hand", "action:wave"), ("can you shake your hand", "action:wave"),
("can you even turn left?", None), ("my son wants to fold your arm", None), ("can you turn left?", "action:turn left 90"), ("can you even turn left?", None), ("my son wants to fold your arm", None), ("can you turn left?", "action:turn left 90"),
("lift your head now", "action:look up"), ("go get the cup for me", "action:fetch go get the cup for me"), ("lift your head now", "action:look up"), ("go get the cup for me", "action:fetch go get the cup for me"),
("you go front one meter", "action:move forward 1"), ("bow your head", "action:look down"),
("rotate one eighty", "action:turn around 180"), ("turn left 180 degrees", "action:turn left 180"),
("앞으로 1미터 전진해 봐", "action:move forward 1"), ("좌회전 해 봐", "action:turn left 90"), ("p3로 움직여 봐", "action:go_to p3"),
("고개를 드세요", "action:look up"), ("빨리 돌아와", "action:come_back"), ("노래 부릅시다", "sing"), ("왼쪽 봐", "action:look left"),
("왼쪽으로 돌아봐", "action:look left"), ("번거로우시겠지만 왼쪽을 돌아보시겠어요?", "action:look left"),
("left로육십degreesturn해봐", None), ("mind folding your arm?", "action:arm fold"), ("how about singing a song?", "sing"),
] ]
STOPS = ["동작 멈춰 줄 수 있어?", "거기 서 도", "거기 서 봐라", "루미 씨, 동작 멈춰 주시겠어요?", "거기 서 주세요, 부탁드립니다", STOPS = ["동작 멈춰 줄 수 있어?", "거기 서 도", "거기 서 봐라", "루미 씨, 동작 멈춰 주시겠어요?", "거기 서 주세요, 부탁드립니다",
"could you stop it?", "would you be so kind as to stop?", "please cut it out", "freeze ok?", "you can stop?", "could you stop it?", "would you be so kind as to stop?", "please cut it out", "freeze ok?", "you can stop?",
"움직이지 말아 주세요", "움직이지 말아 줄래?", "꼼짝 마", "가만 있어 봐", "멈춥시다", "거기 서라 빨리"] "움직이지 말아 주세요", "움직이지 말아 줄래?", "꼼짝 마", "가만 있어 봐", "멈춥시다", "거기 서라 빨리",
"I'd like you to cut it out", "could you stay still?", "you can stop the robot?", "hey, cut it out would ya"]
NOT_STOPS = ["거기 서 있는 사람 누구야?", "동작 멈추는 법 알아?", "can you stop the music?", "the bus stop is there", NOT_STOPS = ["거기 서 있는 사람 누구야?", "동작 멈추는 법 알아?", "can you stop the music?", "the bus stop is there",
"waiting for it to freeze", "I want to stop by the cafe", "가만히 있으면 돼요?", "그거 그만하자고 했잖아"] "waiting for it to freeze", "I want to stop by the cafe", "가만히 있으면 돼요?", "그거 그만하자고 했잖아",
"you can stop worrying", "please don't stop talking"]
QUICK = [("이름 대 봐", "name"), ("나이 대 봐", "age"), ("이름을 말씀해 주십시오", "name"), ("야 너 몇 살이냐", "age"), QUICK = [("이름 대 봐", "name"), ("나이 대 봐", "age"), ("이름을 말씀해 주십시오", "name"), ("야 너 몇 살이냐", "age"),
("카메라 어디 달려 있어?", "cameras"), ("how old r u", "age"), ("can u sing tho?", "can_sing"), ("카메라 어디 달려 있어?", "cameras"), ("how old r u", "age"), ("can u sing tho?", "can_sing"),
("Is it safe for my kids to be near you?", "safety"), ("How do I stop you in an emergency?", "estop"), ("Is it safe for my kids to be near you?", "safety"), ("How do I stop you in an emergency?", "estop"),