Improve command understanding with bigger wording banks; tested

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-26 05:43:03 +09:00
co-authored by Claude Opus 5.5
parent f1f63d0794
commit 38546b0ca3
36 changed files with 3820 additions and 271 deletions
+54
View File
@@ -50,6 +50,16 @@ _BANK = {
("Okay, now wave at me.", "wave", "Sure, here's a wave!"),
("Follow me, I'll show you the booth.", "follow", "Okay, I'll follow you."),
("Raise yourself up a bit.", "lift up small", "Okay, going up a little."),
("Let's go to the cafe after this.", "none", "Sounds good, enjoy the coffee!"),
("I should turn around and go back to my booth.", "none", "Okay, good luck at your booth."),
("Turn left and you'll see the restrooms.", "none", "Thanks, good to know."),
("Look, it's moving its head!", "none", "Yes, I can turn my head."),
("Go on, tell me more.", "none", "Sure, what would you like to know more about?"),
("Go to p2, never mind, stay here.", "none", "Okay, I'll stay here."),
("Give me a second to think.", "none", "Take your time."),
("I'm going to look up the address later.", "none", "Good idea."),
("After lunch, come to the stage.", "none", "Okay, tell me after lunch and I'll come."),
("Once the show starts, wave at everyone.", "none", "Sure, tell me when it starts."),
],
"ko": [
("왼쪽으로 돌아.", "turn left 90", "네, 왼쪽으로 돌게요."),
@@ -77,6 +87,50 @@ _BANK = {
("이리 와 주세요.", "come", "네, 갈게요."),
("나 따라와.", "follow", "네, 따라갈게요."),
("손 흔들어 주실래요?", "wave", "네, 손 흔들게요!"),
("점심 먹고 나서 p3로 가.", "none", "네, 점심 드시고 말씀해 주세요."),
("우리 회의실 들렀다가 무대 가자.", "none", "좋아요, 재미있게 구경하세요."),
("엄마가 오른쪽으로 가래.", "none", "그럼 오른쪽으로 가시면 되겠네요."),
("저 로봇은 아까 앞으로 가던데.", "none", "다른 로봇도 바쁜가 봐요."),
("나 내 말 따라 해 봐.", "none", "네, 말씀해 주시면 따라 말해 볼게요."),
("회의 끝나고 나서 홈으로 가.", "none", "네, 회의 끝나면 말씀해 주세요."),
("쇼 시작하면 손 흔들어 주세요.", "none", "네, 시작할 때 말씀해 주세요."),
("p1로 가, 아니 됐어, 그냥 있어.", "none", "네, 여기 있을게요."),
("잠깐만 시간 좀 줘.", "none", "네, 천천히 하세요."),
("돌아서 가면 화장실이 있다고 하더라고요.", "none", "그렇군요, 가 보세요."),
],
},
"closing": { # thanks / okay / that's it: the end only when the visitor is done; a question or a task goes on
"en": [
("Thanks, that's all I needed.", "end", "Glad I could help. Enjoy your visit!"),
("Okay, thank you, I'll be going now.", "end", "Take care, see you around!"),
("Thanks! And where can I charge my phone?", "none", "I'm not sure about that here; a staff member can tell you."),
("Thanks. So how heavy are you?", "none", "About 96 kg in all."),
("Okay thanks, now turn left.", "turn left 90", "Okay, turning left."),
("Thanks, one more question.", "none", "Sure, go ahead."),
("Thank you so much for the cup!", "none", "You're welcome, enjoy it."),
("Thanks for bringing it.", "none", "My pleasure."),
("Okay, got it.", "none", "Great."),
("Okay.", "none", "Alright."),
("Nah, I'm good. Thanks!", "end", "Okay, have a nice day!"),
("That's everything, thanks Lumi.", "end", "You're welcome. Bye for now!"),
("Thanks, that was interesting. Why is it so slow, though?", "none", "I drive among people, so I keep it slow to be safe."),
("Thanks for the answer, I'll ask my friend now.", "none", "Sure, take your time."),
],
"ko": [
("고마워, 이제 됐어.", "end", "네, 즐거운 시간 보내세요!"),
("감사합니다. 이만 가 보겠습니다.", "end", "네, 안녕히 가세요!"),
("고마워요. 근데 화장실은 어디예요?", "none", "그건 잘 모르겠어요. 직원분께 여쭤봐 주세요."),
("고마워. 그럼 몇 살이야?", "none", "저는 두 살이에요."),
("알겠어, 고마워. 이제 왼쪽으로 돌아.", "turn left 90", "네, 왼쪽으로 돌게요."),
("감사합니다. 하나만 더 여쭤봐도 됩니까?", "none", "네, 물어보세요."),
("컵 갖다줘서 고마워요!", "none", "천만에요, 맛있게 드세요."),
("알겠어요.", "none", "네, 좋아요."),
("오케이.", "none", "좋아요."),
("아뇨, 없어요. 감사합니다.", "end", "네, 좋은 하루 보내세요!"),
("됐어요, 궁금한 거 다 물어봤어요.", "end", "네, 반가웠어요. 안녕히 가세요!"),
("고마워. 근데 왜 그렇게 느려?", "none", "사람들 사이를 다니니까 안전하려고 천천히 다녀요."),
("고마워요, 친구 데려올게요.", "none", "네, 기다릴게요."),
("됐어, 그만 물어볼게. 잘 있어.", "end", "네, 안녕히 가세요!"),
],
},
"amount_direction": {
+46
View File
@@ -0,0 +1,46 @@
"""Wordings for the fast lane, one module per field (arm, motion, korean, questions ...), so each can grow apart.
A module here may hold:
INTENT = {"look": [...], "no": [...]} # added to assistant/intent_bank.KINDS (same kinds,
# same <place> / <obj> slots)
QUICK = {"name": [...], "no": [...]} # more wordings for assistant/quick_answers kinds
QUICK_KINDS = {"kind": ([wordings], {"en": [...], "ko": [...]})} # new quick-answer kinds with their answers
"""
import importlib
import pkgutil
def modules():
return [importlib.import_module(f"{__name__}.{m.name}") for m in sorted(pkgutil.iter_modules(__path__), key=lambda m: m.name)]
def merged(attr):
"""{kind: [wordings]} of every module's `attr`, in module order."""
out = {}
for m in modules():
for kind, texts in getattr(m, attr, {}).items():
out.setdefault(kind, []).extend(texts)
return out
def vectors(texts, cache):
"""Embeddings of `texts` (assistant/knowledge.embed); kept per text in `cache` (.npz), so only new wordings are
embedded when a bank grows. Written atomically: several processes may build at once."""
import os
import numpy as np
from assistant import knowledge
known = {}
try:
z = np.load(cache)
if "texts" in z:
known = dict(zip(z["texts"].tolist(), z["vecs"]))
except (OSError, ValueError, KeyError):
pass
new = sorted({t for t in texts if t not in known})
if new:
known.update(zip(new, knowledge.embed(new)))
keep = sorted(set(texts) | set(new))
tmp = f"{cache}.{os.getpid()}.npz"
np.savez(tmp, texts=np.array(keep), vecs=np.array([known[t] for t in keep]))
os.replace(tmp, cache)
return np.array([known[t] for t in texts])
+306
View File
@@ -0,0 +1,306 @@
"""Arm and hand wordings for the intent bank (assistant/intent_bank.py kinds): wave (every handshake form too, the
owner's meaning), arm_reach (hold the arm out: "give me your hand", "손 줘", "손 내밀어"), arm_fold (back to look),
arm_open / arm_close (the gripper), pick, fetch, and the hand's put / receive / give (the bank does not act on these
three: they keep their wordings apart from the others), plus "no": talk about the arm and hand that asks nothing.
Korean is written as stems x endings (반말 / 해요체 / 하십시오체 / 주세요 / 줄래 / dialect), English as phrases.
"""
def _ko(stems, ends):
return [f"{s}{e}" for s in stems for e in ends]
def _en(cores):
return [f.format(c) for c in cores for f in FRAMES]
FRAMES = ["{}", "please {}", "{} please", "could you {}", "would you please {}", "can you {}", "will you {}",
"you think you could {}", "be a dear and {}", "do me a favour and {}", "i want you to {}", "i need you to {}",
"i'd like you to {}", "how about you {}", "why don't you {}", "mind if i ask you to {}", "i order you to {}",
"{} now", "{} for me", "{} real quick", "just {}", "{}, okay", "come on, {}", "you {} please", "kindly {}"]
ASK = ["", " 줘", " 봐", " 줘 봐", " 주세요", " 줘요", " 봐요", " 보세요", " 줄래?", " 줄래요?", " 주실래요?", " 주십시오",
" 주시겠어요?", " 주시겠습니까?", " 주라", " 주게", " 보게", " 주이소", " 보이소", " 봐유", " 줘유", " 줘용", " 주세용",
" 줄 수 있어?", " 주실 수 있어요?", " 주면 좋겠어", " 주시면 감사하겠습니다", " 주시오", " 보거라", " 주렴"]
ASK += [" 주셨으면 해요", " 주셨으면 좋겠어요", " 주면 좋겠어요", " 주시겠소", " 주소", " 도", " 주이소예", " 조", " 주랑께",
" 주드라고", " 줘라", " 주라잉", " 줘 봐라", " 보소", " 봐라", " 줄래 응", " 주세요 제발", " 좀 해 줘"]
ASK_SHORT = ["", " 줘", " 봐", " 주세요", " 줘요", " 줄래?", " 주실래요?", " 주십시오", " 주라", " 주게", " 주이소", " 줘유"]
# ---------- wave: a wave of the hand, and every handshake wording (owner 2026-10-23: a handshake is a wave) ----------
WAVE = [
# handshakes, English (native, non-native, kids, slang)
"shake hand", "shake hands", "shake my hand", "shake hands with me", "let's shake hands", "let's shake hand",
"can you shake hand", "can you shake hands with me", "could you shake my hand", "would you shake my hand",
"will you shake hands with me", "shake", "shake shake", "shake please", "shake hand please", "shake hands please",
"give me a handshake", "handshake please", "handshake", "do a handshake", "let's do a handshake",
"how about a handshake", "gimme a handshake", "you shake hand me", "you shake my hand please", "robot shake hand", "shake hand with me please",
"shaking hands please", "do shake hand", "make handshake", "hand shake please", "handshake me", "shakey shakey",
"shake hans", "shake hend", "shaek hands", "sheik hands", "shake handz", "you hand shake hello please",
"hand shake hello", "a handshake would be nice", "i'd love a handshake", "nice to meet you, shake hands",
"let's shake hands, nice to meet you", # wave, English
"wave", "wave your hand", "wave hand", "wave at me", "wave to me", "wave at us", "wave to us", "wave hello",
"wave goodbye", "wave bye", "wave bye bye", "wave hi", "wave to the camera", "wave to the crowd",
"wave to everybody", "wave to everyone here", "wave to my friends", "wave to my daughter", "wave to the kids",
"wave to the audience", "wave back", "wave back at me", "wave back at us", "wave at the people", "wave a little",
"wave your arm", "wave your arm at me", "wave your hand at us", "wave your hand hello", "do the wave",
"do your wave", "do a little wave", "do a big wave", "a big wave please", "big wave", "little wave",
"give a wave", "give us a wave", "give me a wave", "give them a wave", "give everyone a wave", "give a big wave",
"give a little wave", "give a friendly wave", "send a wave", "throw a wave", "wave for us", "wave for the photo",
"wave for the picture", "wave for my mom", "say hi with your hand", "say hello with your hand",
"say bye with your hand", "say goodbye with your hand", "say hi with a wave", "greet us with a wave",
"greet me with your hand", "greet them with a wave", "hello with your hand", "bye bye with your hand",
"hand wave", "hand wave please", "a hand wave please", "do hand wave", "you wave hand", "you wave me",
"you wave to me please", "robot wave", "robot wave hand", "robot wave me", "wave me", "wave me please",
"wave you hand", "wave you hand please", "wave ur hand", "please wave hand", "please you wave", "plese wave",
"plz wave", "wave plz", "wave pls", "wavey wave", "wave wave", "wave wave wave", "wayve", "wayve please",
"weave", "weave your hand", "waive", "waive at me", "wav", "wav hand", "wave yur hand", "wabe", "wave your han",
"would you mind waving", "would you mind waving at us", "would you mind waving to the crowd",
"mind waving to us", "how about waving to us", "i'd love it if you waved at us", "i'd like you to wave",
"it'd be nice if you waved", "it would be great if you waved at us", "i want you to wave", "i want to see you wave",
"i wanna see you wave", "let me see you wave", "show me a wave", "show me your wave", "show us how you wave",
"can i get a wave", "can we get a wave", "could we get a wave from you", "how about a wave", "a wave, please",
"one wave please", "wave once", "wave one time", "please wave once", "start waving", "go ahead and wave",
"go on, wave", "come on, wave", "come on, wave at us", "just wave", "only wave", "just wave at me", "you can wave now",
"now wave", "wave now", "wave please", "please wave", "kindly wave", "could you wave", "can you wave",
"will you wave", "would you wave", "would you wave at us please", "could you please wave", "can you please wave",
"can you wave at me", "can you wave your hand", "could you wave your hand", "could you, uh, wave", "um, wave",
"so, could you wave", "hi hi wave", "bye bye wave", "wave bye-bye", "wave goodbye to them",
"wave hello to the guests", "wave to the visitors", "wave at the kids", "wave at the camera",
# Korean wave and handshake (stems x endings)
*_ko(["손 흔들어", "손 좀 흔들어", "손 한번 흔들어", "손 한 번 흔들어", "손 흔들어서 인사해", "손 인사 해", "손으로 인사해",
"팔 흔들어", "바이바이 해", "빠이빠이 해", "손 흔들면서 인사해", "손을 흔들어", "손 크게 흔들어", "손 살짝 흔들어",
"안녕 손 흔들어", "손 흔들어서 안녕 해", "손으로 안녕 해", "손으로 바이바이 해", "웨이브 해", "wave 해", "악수 해",
"악수 한번 해", "악수 한 번 해", "나랑 악수 해", "저랑 악수 해", "악수 좀 해", "손 흔들어 인사해"], ASK),
"악수하자", "악수해", "악수해요", "악수 한번 해요", "악수 한번 하자", "악수 하자", "우리 악수하자", "나랑 악수하자",
"저랑 악수해요", "악수할래?", "악수할래요?", "악수하실래요?", "악수합시다", "악수하시죠", "악수하세요", "악수하십시오",
"악수 좀 해요", "악수 한 번만 해 줘", "악수 한 번 해 주세요", "반가워 악수하자", "반가워요 악수해요", "악수 ㄱㄱ",
"악수 고고", "악수 플리즈", "핸드셰이크 해 줘", "쉐이크 핸드", "셰이크 핸드 해 줘", "shake hand 해 줘", "handshake 해 줘",
"악수해 주이소", "악수 한번 해 보이소", "악수하자잉", "악수해 봐유", "악쑤하자", "악수하쟈", "악수 해조",
"손 흔들어", "흔들어 봐", "손 흔드러", "손 흔더러 줘", "손 흔들어조", "손 흔들어 쥬", "손 흔들어 주라잉", "손 흔들어 보랑께",
"손 흔들어 주소", "손 흔들어 도", "손 쫌 흔들어 봐", "손 흔들어 주실 수 있나요?", "손 흔들어 주시면 좋겠어요",
"빠빠이 해 줘", "빠빠이 해", "빠이빠이 해 줘요", "안녕 해 줘 손으로", "손 흔들어서 인사해 주세요",
"카메라 보고 손 흔들어", "카메라 보고 wave", "camera 보고 wave", "사진 찍게 손 흔들어 줘", "애들한테 손 흔들어 줘",
"할머니한테 손 흔들어 드려", "손님들한테 손 흔들어 주세요", "저희한테 손 흔들어 주세요", "우리한테 손 흔들어 줘",
"관객들한테 손 흔들어 주세요", "손 한번 흔들어 주십시오", "손 흔들어 주시겠습니까?", "손 인사 부탁해요", "손 인사 부탁합니다",
"웨이브 웨이브", "웨이브", "웨이브 해 봐", "웨이브 한번 해 줘", "wave 좀 해 줘", "wave 해 주세요", "hand wave 해 줘",
"손 wave 해", "wave hand 해 줘", "hi 해 손으로", "bye 해 손으로", "손으로 hi 해 줘", "손 흔들어 please", "please 손 흔들어",
"손 좀 흔들어 줄래", "손 흔들어 줘 빨리", "얼른 손 흔들어", "빨리 손 흔들어 봐", "손 흔들어 봐 어서",
]
# ---------- arm_reach: the arm held out to the person ("give me your hand", "손 줘", "손 내밀어") ----------
ARM_REACH = [
"give me your hand", "give me a hand", "give me hand", "give me ur hand", "gimme your hand", "gimme a hand",
"gimme hand", "give your hand", "give your hand to me", "give hand", "give hand please", "you give hand",
"you give me hand", "you give me your hand please", "you can give hand", "can you give me your hand",
"could you give me your hand", "may i have your hand", "can i have your hand", "can i see your hand, hold it out",
"lend me your hand", "hand please", "your hand please", "your hand, please", "hand, please",
"reach out", "reach out your hand", "reach out your arm", "reach out to me", "reach out please", "reach your arm out",
"reach your hand out", "reach toward me", "reach towards me", "reach for me", "reach for my hand", "reach forward",
"reach out a bit", "reach out real quick", "reach out, lumi", "reach", "reach arm", "reach your arm",
"hold out your hand", "hold out your arm", "hold your hand out", "hold your arm out", "hold out your gripper",
"hold it out", "hold out your hand to me", "hold your hand out to me",
"stretch your arm", "stretch out your arm", "stretch out your hand", "stretch your arm out", "stretch out",
"stretch your hand forward", "stretch your arm forward", "stretch arm", "extend your arm", "extend your hand",
"extend your arm forward", "extend the arm", "extend arm", "put your hand out", "put your arm out",
"put your hand forward", "put your arm forward", "stick your arm out", "stick your hand out", "push your arm out",
"push your arm forward", "move your arm forward", "move your hand forward", "bring your hand forward",
"bring your hand over to me", "bring your arm to me", "arm out", "arm out please", "arm forward", "arm to me",
"hand out", "hand out please", "hand forward", "hand to me", "offer me your hand", "offer your hand",
"show me your hand", "let me see your hand", "lemme see your hand", "show your hand", "show me your arm",
"straighten your arm", "straighten your arm out", "make your arm straight", "arm straight", "long arm please",
"i want see you reach arm", "i want to see you reach out", "show me you reach out", "can you reach out",
"could you reach out your arm", "would you reach out your hand", "would you mind reaching out",
"mind holding out your hand", "how about holding your hand out", "it'd be nice if you held out your hand",
"reech out", "rich out", "reach owt", "reach aut", "rieach out", "hold owt your hand", "giv me your hand",
"give mi your hand", "give me you hand", "gib me your hand", "hand pls", "arm out pls",
# Korean
*_ko(["손 내밀어", "손 좀 내밀어", "손 앞으로 내밀어", "손 쭉 내밀어", "손 뻗어", "손 좀 뻗어", "손 앞으로 뻗어",
"팔 뻗어", "팔 좀 뻗어", "팔 쭉 뻗어", "팔 앞으로 뻗어", "팔 내밀어", "팔 좀 내밀어", "팔 앞으로 내밀어", "팔 펴",
"팔 쭉 펴", "팔 좀 펴", "팔 앞으로 쭉 펴", "팔을 뻗어", "손을 내밀어", "손을 앞으로 내밀어", "팔 길게 뻗어",
"손 이쪽으로 내밀어", "나한테 손 내밀어", "저한테 손 내밀어", "손 나한테 뻗어", "팔 나한테 뻗어"], ASK),
*_ko(["손 줘", "손 좀 줘", "손 이리 줘", "나한테 손 줘", "저한테 손 줘", "손 내놔"], ["", " 봐", "요", " 봐요"]),
"손 주세요", "손 좀 주세요", "손 이리 주세요", "저한테 손 주세요", "손 주실래요?", "손 줄래?", "손 주라", "손 주게",
"손 주이소", "손 줘유", "손 주십시오", "손 좀 주실래요?", "손 이리", "손 내밀기", "손 내밀어 봐 어서",
"루미야 손 줘", "로봇아 손 줘", "hand 줘", "hand 줘 봐", "hand 좀 줘", "hand 내밀어", "hand 좀 내밀어 줘", "팔 reach 해 줘", "reach out 해 줘",
"reach out 해", "reach 해 줘", "팔 extend 해 줘", "arm 뻗어", "arm 뻗어 줘", "arm out 해 줘", "arm 펴 줘", "팔 out",
"손 reach", "팔 reach", "give me hand 해 줘", "hand out 해 줘", "손 앞으로", "팔 앞으로", "팔 쭉", "팔 뻐더",
"팔 버더", "팔 뻗어조", "손 내미러", "손 내밀어조", "팔 뻐더 줘", "손 내밀어 주이소", "팔 뻗어 보이소", "팔 쭉 뻗어 보게",
"팔 좀 뻗어 봐유", "손 쫌 내밀어 봐", "손 내밀어 주랑께", "팔 뻗쳐 봐", "팔 쭉 내밀어 보거라",
"야 봐봐, 루미야 팔 뻗어 줘", "봐봐 루미야 손 내밀어", "얘들아 봐 루미야 손 줘",
]
# ---------- arm_fold: the arm back to its look pose ----------
ARM_FOLD = [
"fold your arm", "fold the arm", "fold arm", "fold it", "fold it back", "fold your arm back", "fold your arm up",
"fold up your arm", "fold your arm now", "fold your arm please", "you can fold your arm", "you can fold it now",
"put your arm down", "put the arm down", "put your arm away", "put your arm back", "put arm back",
"put your hand down", "put your hand away", "put your hand back", "take your arm back", "take your hand back",
"take back your arm", "take your arm away", "pull your arm back", "pull your arm in", "pull your hand back",
"pull back your arm", "pull it back", "draw your arm back", "draw back your arm", "bring your arm back",
"bring your arm in", "bring the arm home", "bring the arm back", "arm back", "arm back home", "arm back please",
"arm back in", "arm in", "arm down", "arm down please", "arm home", "arm away", "arm rest", "arm go back",
"arm back home if you don't mind", "your arm, put back", "you close arm please, put back", "close arm",
"retract your arm", "retract the arm", "retract arm", "tuck your arm in", "tuck it in", "tuck your arm away",
"lower your arm", "lower the arm", "lower your hand", "drop your arm", "rest your arm", "relax your arm",
"back to your look pose", "back to look position", "look pose", "go back to your look pose", "arm to look pose",
"return your arm", "return the arm", "reset your arm", "reset the arm", "arm to home position",
"okay, put your arm down", "okay arm back", "thanks, arm back", "that's enough, fold your arm",
"you can put your arm down now", "you can take your hand back", "you can lower your arm now",
"fold your arm, it's in the way", "fold you arm", "fold yor arm", "fould your arm", "fold ur arm", "arm fold",
"arm fold please", "arm close", "arm close please", "you fold arm", "put back arm",
# Korean
*_ko(["팔 접어", "팔 좀 접어", "팔 다시 접어", "팔 거둬", "팔 좀 거둬", "팔 내려", "팔 좀 내려", "팔 넣어", "팔 다시 넣어",
"팔 원위치 해", "팔 원래대로 해", "팔 제자리로 해", "손 내려", "손 거둬", "손 접어", "손 다시 넣어", "손 넣어",
"팔 치워", "손 치워", "팔 원래 자리로 해", "팔 원위치로 돌려", "팔 돌려놔", "팔 접고 있어"], ASK_SHORT),
"팔 접으세요", "팔 접으십시오", "팔 거두세요", "팔 거두십시오", "팔 내리세요", "팔 내리십시오", "팔 내려놓으세요",
"팔 원위치", "팔 원래대로", "팔 제자리로", "팔 제자리", "이제 접어", "접어", "접어 줘", "접어 주세요", "넣어", "됐어 넣어",
"이제 팔 접어도 돼", "팔 접어도 돼", "팔 내려도 돼", "이제 팔 내려", "고마워 팔 접어", "됐어 팔 내려", "팔 쉬어", "팔 쉬어도 돼",
"arm 접어", "arm 접어 줘", "arm 내려", "arm down 해", "팔 down", "팔 fold", "팔 fold 해 줘", "fold arm 해 줘",
"팔 내려 please", "팔 접어조", "팔 저버", "팔 거더", "팔 내려조", "팔 접어 보이소", "팔 접어 부러", "팔 접어 봐유",
"얘 로봇아 arm 접어 줘", "루미야, arm 접어 줘", "팔 걷어", "팔 오므려", "팔 모아", "팔 다시 가져가",
]
# ---------- arm_open / arm_close: the gripper (with nothing held: the hand reader refuses an open while holding) ----------
ARM_OPEN = [
"open your hand", "open hand", "open the hand", "open your fingers", "open the gripper", "open your gripper",
"open gripper", "open your claw", "open up your hand", "open up", "open your hand wide", "spread your fingers",
"unclench your hand", "unclench", "hand open", "hand open please", "fingers open", "gripper open",
"release your grip", "loosen your grip", "relax your fingers", "open your hand please", "please open your hand",
"can you open your hand", "could you open your gripper", "show me an open hand", "you open hand", "opn your hand",
"open you hand", "open ur hand",
*_ko(["손 펴", "손 좀 펴", "손 벌려", "손 좀 벌려", "손가락 펴", "손 열어", "그리퍼 열어", "그리퍼 좀 열어", "집게 열어",
"집게 벌려", "손 쫙 펴", "손바닥 펴", "손 활짝 펴"], ASK_SHORT),
"손 펴세요", "손 펴십시오", "손 오픈", "그리퍼 오픈", "손 open", "hand 펴", "gripper open 해", "open 해 손", "손 펴조",
]
ARM_CLOSE = [
"close your hand", "close hand", "close the hand", "close your fingers", "close the gripper", "close your gripper",
"close gripper", "close your claw", "make a fist", "clench your hand", "clench your fist", "squeeze your fingers",
"shut your hand", "hand closed", "hand close please", "fingers close", "gripper close", "close your hand please",
"please close your hand", "can you close your hand", "could you close your gripper", "show me a fist",
"you close hand", "clos your hand", "close you hand", "close ur hand",
*_ko(["손 쥐어", "손 꽉 쥐어", "주먹 쥐어", "주먹 꽉 쥐어", "손 오므려", "손가락 오므려", "손 닫아", "그리퍼 닫아",
"그리퍼 좀 닫아", "집게 닫아", "집게 오므려"], ASK_SHORT),
"손 쥐세요", "주먹 쥐십시오", "손 클로즈", "그리퍼 클로즈", "손 close", "gripper close 해", "주먹 쥐어조",
]
# ---------- pick: an object from the table in front ----------
PICK = [
"pick up the <obj>", "pick the <obj> up", "pick up that <obj>", "pick up a <obj>", "pick <obj> up", "pick up <obj>",
"take the <obj>", "take that <obj>", "grab the <obj>", "grab that <obj>", "grab a <obj>", "get the <obj>",
"lift the <obj>", "lift up the <obj>", "snag the <obj>", "nab the <obj>", "seize the <obj>",
"go on, pick up the <obj>", "go ahead, pick up the <obj>", "now pick up the <obj>", "okay pick up the <obj>",
"it would be great if you picked up the <obj>", "i'd be grateful if you picked up the <obj>",
"i'd like you to pick up the <obj>", "i want you to grab the <obj>", "would you mind picking up the <obj>",
"could you please pick up the <obj>", "can you grab the <obj> for me", "please pick up the <obj>",
"show me you can pick up the <obj>", "let me see you pick up the <obj>", "can i see you pick up the <obj>",
"reach for the <obj> and pick it up", "reach for the <obj>", "grab the <obj> on the table",
"pick up the <obj> on the table", "pick the <obj> off the table", "take the <obj> off the table",
"you take <obj>", "you pick <obj>", "you pick up <obj> please", "you grab <obj>", "you can take the <obj>",
"you peek up the <obj>", "peek up the <obj>", "pik up the <obj>", "pick op the <obj>", "pickup the <obj>",
"pick upp the <obj>", "grap the <obj>", "grabb the <obj>", "take da <obj>", "pick up da <obj>", "pic up the <obj>",
*_ko(["<obj> 집어", "<obj> 좀 집어", "<obj> 하나 집어", "<obj> 들어", "<obj> 좀 들어", "<obj> 잡아", "<obj> 좀 잡아",
"<obj> 집어 올려", "<obj> 들어 올려", "그 <obj> 집어", "저 <obj> 집어", "저기 <obj> 집어", "테이블 위에 <obj> 집어",
"<obj> 손으로 집어", "<obj> 쥐어"], ASK_SHORT),
"<obj> 집으세요", "<obj> 집으십시오", "<obj> 잡으세요", "<obj> 집어 볼래?", "<obj> pick 해 줘", "<obj> pick up 해",
"<obj> 픽업 해 줘", "<obj> 픽 해 줘", "<obj> grab 해", "<obj> take 해", "<obj> 그랩 해", "grab 해 <obj>", "<obj> 집어조",
"<obj> 지버", "<obj> 잡아조", "봐봐, 루미야 <obj> 집어 봐", "<obj> 집어 보이소", "<obj> 집어 부러", "<obj> 집어 봐유",
]
# ---------- fetch: bring an object (from a place) ----------
FETCH = [
"bring me the <obj>", "bring the <obj> to me", "bring the <obj> here", "bring me a <obj>", "bring over the <obj>",
"fetch the <obj>", "fetch me the <obj>", "get me the <obj>", "go get the <obj>", "go and get the <obj>",
"go fetch the <obj>", "grab me the <obj>", "carry the <obj> to me", "deliver the <obj> to me",
"bring me the <obj> from <place>", "get the <obj> from <place>", "fetch the <obj> from <place>",
"go get the <obj> at <place>", "go to <place> and bring me the <obj>", "bring the <obj> from <place> to me",
"the <obj> at <place>, bring it to me", "there's a <obj> at <place>, bring it here", "<obj> from <place>, please bring",
"from <place> the <obj>, bring to me", "i need the <obj> from <place>", "i'd like the <obj> from <place>",
"could you get me the <obj> from <place>", "can you bring the <obj> from <place>", "you go <place>, bring <obj> me",
"bring <obj> me from <place>", "fech the <obj> from <place>", "brin me the <obj> from <place>",
*_ko(["<place>에서 <obj> 가져와", "<place>에서 <obj> 좀 가져와", "<place>에서 <obj> 가져다", "<place>에 있는 <obj> 가져와",
"<place>에서 <obj> 갖다", "<place>에서 <obj> 가지고 와", "<obj> 가져와", "<obj> 가져다", "<obj> 갖다",
"<obj> 좀 갖다", "나한테 <obj> 가져다", "<place>에 있는 <obj> 나한테 가져다"], ASK_SHORT),
"<place>에서 <obj> 좀 가지고 오십시오", "<place>에서 <obj> 가져오십시오", "<place>에서 <obj> 가져오세요",
"<place>에서 <obj> 브링 해 줘", "<place>에서 <obj> bring 해 줘", "<place>에서 <obj> 가 온나", "<place>에서 <obj> 갖다 주이소",
"<place>에 <obj> 있는데 그것 좀 갖다 줘", "<place>에 <obj> 있어, 가져와", "<place>에서 <obj> 챙겨 와",
]
# ---------- the hand's (not acted on by the bank: brain.hand_request reads them) ----------
PUT = [
"put it down", "put it down here", "set it down", "place it down", "put it on the table", "place it on the table",
"put the cup on the table", "you can put it down now", "put it back", "put it back where it was",
"내려놔", "내려놔 줘", "내려놔 주세요", "이제 내려놔도 돼", "내려놓아도 돼요", "테이블에 놔", "테이블 위에 놔 주세요",
"제자리에 놔", "원래 자리에 놔 주세요", "여기 내려놔", "내려나", "내려나 줘", "내려 놔 줘요", "놔 둬",
]
RECEIVE = [
"take this", "take this from me", "hold this", "here, take it", "here you go", "take it from my hand",
"can you take this off my hands", "here, you take, is for you", "i'll give you this", "catch this",
"이거 받아", "이거 받아 줘", "이거 들고 있어", "이거 가져", "이거 잠깐 들어 줄래?", "이거 take 해 줘", "이거 hold 해 줘",
"take this 해 줘", "제 손에 있는 거 가져가세요", "이거 드릴게요",
]
GIVE = [
"give it to me", "give me that", "give me it", "give it", "hand it over", "hand it to me", "pass it to me",
"could i please have the cup", "i'd appreciate it if you passed it to me", "hand the cup down to me",
"i'll grab it from you", "let me have it", "gimme that", "give it here",
"줘", "그거 줘", "이리 줘", "나 줘", "저 주세요", "줘 봐", "그거 저 주시면 돼요", "그거 나 주면 돼", "제가 받을게요",
"이리 주세요", "그거 이리 줘", "줘 빨리", "빨리 줘", "얼른 줘", "그거 넘겨", "건네줘", "그거 저한테 주세요", "give me 해 줘",
]
# ---------- no: talk about the arm and hand, negations, past, remarks, someone else's hand ----------
NO = [
"the wave was nice", "i saw you wave", "you waved so nicely", "that was a cute wave", "you wave like my grandpa",
"my daughter waved at you", "the kids waved at you", "a big wave hit the beach", "radio waves can't hurt you",
"there's a heat wave this week", "microwave the food", "wave pool", "new wave music", "a wave of visitors",
"the handshake was nice", "i shook hands with him", "we shook hands yesterday", "nice handshake",
"your hand looks strong", "your hand is cold", "is your hand a gripper", "how strong is your hand",
"how long is your arm", "your arm is long", "your arm moves smoothly", "the arm looks cool",
"nice arm", "cool hand", "what a nice gripper", "my hand hurts", "i hurt my arm", "wash your hands",
"did you wash your hands", "raise your hand if you have a question", "hands up everyone", "everyone wave to the robot",
"kids, wave to the robot", "wave back at it, mina", "can i wave at you", "can i shake your hand later",
"give me a hand with this box", "can you lend me a hand", "i need a hand", "give me a break", "give me a second",
"give me a minute", "give me a call", "give me a hint", "give me five minutes", "give me some space",
"hold on", "hold on a second", "hang on", "hold that thought", "on the other hand", "hand in hand", "second hand",
"i have my hands full", "it's out of my hands", "hands down the best", "pick a number", "pick your favourite",
"pick a song", "take a picture", "take a break", "take care", "take your time", "take it easy", "get some rest",
"bring it on", "fold the laundry", "the cup is red", "i like that cup", "the bottle is empty", "my cup is here",
"손 씻었어?", "손 예쁘다", "손이 예쁘네", "손 차가워?", "손 따뜻해?", "팔 길다", "팔 진짜 길다", "팔 멋있다", "손 힘 세?",
"아까 손 흔드는 거 봤어", "손 흔드는 거 귀엽다", "손 흔드는 로봇이네", "웨이브 멋있다", "어제 악수했어", "악수 좋았어",
"애들이 손 흔들었어", "와 아까 로봇이 손 흔들었어", "손 흔드는 게 참 신통하네", "손 흔드는 거 좀 어색하지 않아?",
"민수야 로봇한테 손 흔들어", "얘들아 로봇한테 손 흔들어", "지호야 손 흔들어 봐", "동생아 로봇한테 손 흔들어 봐",
"할머니 손 흔들어 주세요 사진 찍을게요", "손 들어 보세요 여러분", "질문 있으면 손 들어", "손 들고 질문하세요",
"손 잡고 가자", "손 시려", "손 아파", "팔 아파", "팔이 저려", "손이 모자라", "손이 많이 가", "손 좀 빌려줘",
"일손이 부족해", "손 놓고 있어", "손 떼", "손대지 마", "만지지 마", "손 씻고 올게", "손 닦아", "팔짱 껴",
"컵 예쁘다", "컵 몇 개 들 수 있어?", "사과 좋아해", "바나나 맛있어", "그 컵 내 거야", "물병 비었어",
"커피 한 잔 줘", "물 한 잔 줘", "아메리카노 한 잔 주세요", "시간 좀 줘", "기회 줘", "힌트 줘", "잠깐 시간 줘",
"문 열어 줘", "문 열어", "문 좀 열어 주세요", "창문 열어", "뚜껑 열어 줘", "병 열어 줘", "마음을 열어 봐", "문 닫아 줘",
"창문 닫아", "뚜껑 닫아 줘", "open the door", "close the door", "open the window", "open the box", "open the bottle",
"open the lid", "close the window", "가위바위보", "주먹 인사", "fist bump", "high five", "하이파이브",
"전화 줘", "연락 줘", "문자 줘", "답 줘", "대답 좀 해 줘", "칭찬 좀 해 줘", "사인 해 줘", "사진 찍어 줘",
]
WAVE += _en(["wave", "wave your hand", "wave at us", "wave hello", "wave goodbye", "wave us off", "wave one more time",
"shake hands", "shake my hand", "shake hands with me", "give us a wave", "say hi with your hand",
"say hello with your arm", "greet us with a wave", "wave to the camera"])
ARM_REACH += _en(["reach out", "reach out your arm", "hold out your hand", "give me your hand", "give me a hand",
"stretch out your arm", "put your hand out", "extend your arm", "reach toward me", "hold your arm out"])
ARM_FOLD += _en(["fold your arm", "put your arm down", "pull your arm back", "take your hand back", "bring your arm back",
"go back to your look pose", "lower your arm", "tuck your arm in", "put your hand down"])
ARM_OPEN += _en(["open your hand", "open the gripper", "open your fingers", "spread your fingers"])
ARM_CLOSE += _en(["close your hand", "close the gripper", "close your fingers", "make a fist"])
PICK += _en(["pick up the <obj>", "grab the <obj>", "take the <obj> from the table", "lift the <obj>"])
FETCH += _en(["bring me the <obj>", "fetch the <obj>", "get me the <obj> from <place>", "go get the <obj> at <place>"])
WHO_KO = ["할머니한테", "할아버지한테", "애들한테", "아이들한테", "손님들한테", "관객들한테", "우리 딸한테", "우리 아들한테", "손주한테",
"카메라 보고", "저기 사람들한테", "친구들한테"]
WAVE += _ko([f"{w} 손 흔들어" for w in WHO_KO] + [f"{w} 손으로 인사해" for w in WHO_KO], ASK_SHORT)
WAVE += [f"wave to {w}" for w in ("my grandma", "my grandpa", "the kids", "my son", "my daughter", "the visitors",
"the people over there", "the camera", "my friends", "the audience")]
ARM_REACH += _ko(["할머니한테 손 내밀어", "애들한테 손 내밀어", "손님한테 손 내밀어", "저 사람한테 팔 뻗어", "이쪽으로 손 내밀어",
"손 좀 이리 내밀어", "핸드 줘", "핸드 내밀어"], ASK_SHORT)
ARM_FOLD += _ko(["팔 기본 자세로 해", "팔 기본 위치로 돌려", "손 이제 내려", "손 얼른 거둬", "팔 원래 자리로 돌려", "arm 접어",
"arm 내려", "hand back 해"], ASK_SHORT)
INTENT = {"wave": WAVE, "arm_reach": ARM_REACH, "arm_fold": ARM_FOLD, "arm_open": ARM_OPEN, "arm_close": ARM_CLOSE,
"pick": PICK, "fetch": FETCH, "put": PUT, "receive": RECEIVE, "give": GIVE, "no": NO}
+116
View File
@@ -0,0 +1,116 @@
"""Korean wordings for the fast lane: the words people use for each thing Lumi does, beyond what the base bank has.
Endings need no list here: wording.ko_plain reads every speech level and dialect ending as the plain 반말 one before
the bank compares ("가세요", "가십시오", "가 주실래요?", "가이소", "가랑께" -> "가" / "가 줘"), and the bank stores its
wordings the same way. What is listed is the rest: other verbs and nouns (일로 와, 졸졸 따라와, 좌회전, 고개 숙여),
dialect words (일루, 이짝, 쪼매, 가온나), Konglish both ways, spacing slips and whisper's spellings, 그거 / 이거 / 저기.
"""
def _v(cores, tails=("", " 줘", " 봐")):
"""Each plain core with the request tails people add, and written without spaces (a frequent slip)."""
out = []
for c in cores:
for t in tails:
out.append(c + t)
if " " in c:
out.append(c.replace(" ", ""))
return list(dict.fromkeys(out))
INTENT = {
"go_to": _v(["<place>로 가", "<place> 쪽으로 가", "<place>까지 가", "<place>에 가", "<place>로 이동해", "<place>로 출발해",
"<place>로 무브", "<place>로 고", "<place>까지 드라이브 해", "<place>로 가 보자", "<place> 가자 루미",
"<place> 쪽으로 이동", "<place>로 퍼뜩 가", "<place>로 언능 가", "<place>로 싸게 가", "<place>로 가 보그라",
"<place> 그짝으로 가", "<place>로 빨랑 가", "<place>로 직진", "<place>로 향해", "<place> 방향으로 가",
"저기 <place>로 가", "<place>로 좀 가", "<place>로 가 봐라", "<place>로 무빙 해", "<place>로 move 해",
"<place>로 go 해", "<place>로 이동 좀", "<place>로 가 주라", "<place> 가 봐"], ("", " 줘")),
"come": _v(["이리 와", "일로 와", "일루 와", "요리 와", "이짝으로 와", "이쪽으로 와", "여기로 와", "여기 와", "가까이 와",
"나한테 와", "내 쪽으로 와", "내 앞으로 와", "내 앞에 와", "코앞까지 와", "쪼매 가까이 와", "좀 더 가까이 와",
"이리 컴", "컴 히어", "여기 컴", "come 해", "이리 와 봐라", "가까이 다가와", "나한테 다가와", "이리 다가와",
"내 옆으로 와", "저한테 와", "여기까지 와", "이 앞까지 와", "가차이 와", "이리 오니라", "이리 와 봐잉"],
("", " 줘", " 봐")),
"follow": _v(["따라와", "나 따라와", "날 따라와", "졸졸 따라와", "쫄래쫄래 따라와", "뒤따라와", "따라붙어", "내 뒤에 붙어",
"내 뒤 따라와", "나 가는 데 따라와", "내가 가는 대로 따라와", "내 뒤로 따라와", "나 쫓아와", "날 쫓아와",
"나랑 같이 다니자", "나랑 같이 걸어", "팔로우 미", "팔로잉 해", "팔로우 해", "follow 해", "날 따라다녀",
"나만 따라와", "놓치지 말고 따라와", "바짝 따라와", "뒤에서 따라와", "옆에서 같이 가", "따라 와",
"따라오너라", "저 따라와", "제 뒤를 따라와", "제 뒤로 따라와"], ("", " 줘", " 봐")),
"come_back": _v(["돌아와", "다시 돌아와", "제자리로 와", "원래 자리로 돌아와", "아까 자리로 돌아와", "컴백 해", "복귀해",
"다시 와", "도로 와", "원위치로 와", "아까 있던 데로 돌아가", "원래 있던 곳으로 돌아가", "원래 자리로 돌아가",
"처음 자리로 돌아가", "출발한 곳으로 돌아와", "출발한 데로 돌아가", "원위치로 가", "원래 자리로 가",
"아까 자리로 가", "제자리로 돌아가"], ("", " 줘")),
"move": _v(["앞으로 가", "앞으로 와", "앞으로 조금 가", "살짝 앞으로", "쪼끔 앞으로", "조금만 앞으로", "전진해", "전진",
"뒤로 가", "뒤로 물러나", "한 발짝 뒤로", "한 걸음 뒤로", "살짝 뒤로", "조금만 뒤로", "후진해", "후진", "빠꾸 해",
"뒤로 빠져", "백 해", "왼쪽으로 가", "왼쪽으로 조금 가", "왼쪽으로 비켜", "오른쪽으로 가", "오른쪽으로 비켜",
"오른쪽으로 살짝 가", "옆으로 살짝 왼쪽", "1 meter 앞으로 가", "앞으로 1 meter", "뒤로 1 meter 가",
"1 meter 뒤로", "왼쪽으로 1 meter", "오른쪽으로 1 meter 가", "고 포워드", "무브 백", "포워드로 가",
"앞으로 쪼매 가", "뒤로 쪼매 가", "앞으로 한 발짝", "뒤로 두 발짝"], ("", " 줘")),
"turn": _v(["좌회전", "좌회전 해", "우회전", "우회전 해", "왼쪽으로 돌아", "오른쪽으로 돌아", "왼쪽으로 몸 돌려",
"오른쪽으로 몸 돌려", "뒤로 돌아", "유턴", "유턴 해", "반 바퀴 돌아", "한 바퀴 돌아", "방향 바꿔",
"반대로 돌아", "좌향좌", "우향우", "뒤로 돌아서", "왼쪽으로 틀어", "오른쪽으로 틀어", "왼쪽으로 꺾어",
"오른쪽으로 꺾어", "90 degrees 왼쪽으로 돌아", "오른쪽으로 90 degrees 돌아", "턴 레프트", "턴 라이트",
"레프트 턴", "라이트 턴", "왼쪽으로 회전", "오른쪽으로 회전", "몸 왼쪽으로 돌려", "몸 오른쪽으로 돌려",
"u턴 해", "왼쪽 돌아", "오른쪽 돌아"], ("", " 줘")),
"look": _v(["위 봐", "위쪽 봐", "하늘 봐", "천장 봐", "고개 들어", "고개 올려", "고개 쳐들어", "고개 숙여", "고개 내려",
"아래 봐", "밑에 봐", "바닥 봐", "땅 봐", "발밑 봐", "왼쪽 봐", "왼짝 봐", "왼편 봐", "오른쪽 봐", "오른짝 봐",
"오른편 봐", "날 봐", "나 봐", "나 쳐다봐", "날 쳐다봐", "이쪽 봐", "여기 봐", "여 봐라", "앞에 봐", "정면 봐",
"앞을 봐", "고개 원위치", "고개 똑바로", "고개 원래대로", "고개 왼쪽으로 돌려", "고개 오른쪽으로 돌려",
"고개 좌로", "고개 우로", "딴 데 봐", "다른 데 봐", "시선 돌려", "눈 마주쳐", "눈 맞춰", "내 눈 봐",
"내 얼굴 봐", "룩 업", "룩 다운", "룩 레프트", "룩 라이트", "룩 앳 미", "위로 고개", "아래로 고개",
"고개 살짝 왼쪽", "고개 살짝 오른쪽", "고개 살짝 들어", "고개 살짝 숙여", "얼굴 들어", "얼굴 이쪽으로"],
("", " 줘", " 봐")),
"lift": _v(["몸 올려", "몸 위로", "키 높여", "키 키워", "키 커져", "몸 높여", "몸 낮춰", "몸 내려", "키 낮춰", "키 줄여",
"작아져", "리프트 올려", "리프트 내려", "리프트 업", "리프트 다운", "상체 올려", "상체 내려", "높이 올라가",
"업 해", "다운 해", "몸 쭉 올려", "몸 쭉 내려", "키 좀 커져", "몸 낮게", "몸 높게", "키 높게", "키 낮게",
"아래로 내려가", "위로 올라가", "몸 늘려", "몸 위로 늘려", "키 늘려", "높아져", "낮아져", "좀 더 높아져",
"좀 더 낮아져", "몸통 올려", "몸통 내려", "키 올려", "키 내려", "몸 쭉 늘려"], ("", " 줘", " 봐")),
"wave": _v(["손 흔들어", "손 좀 흔들어", "손 한번 흔들어", "팔 흔들어", "손 인사 해", "손으로 인사해", "반갑다고 손 흔들어",
"손 들어 흔들어", "손짓 해", "웨이브 해", "손 웨이브", "핸드 웨이브", "하이 해 손으로", "헬로 해 손으로",
"악수하자", "악수해", "악수 한번 해", "악수 해", "악수", "손 흔들어 인사", "인사 손으로 해",
"애들한테 손 흔들어", "손님들한테 손 흔들어", "사람들한테 손 흔들어", "우리한테 손 흔들어", "손흔들어",
"손 흔드러", "손 흔들어조", "손 흔들어 봐라", "손 함 흔들어"], ("", " 줘", " 봐")),
"arm_reach": _v(["손 줘", "손 내밀어", "팔 내밀어", "팔 뻗어", "팔 쭉 뻗어", "손 앞으로 내밀어", "팔 앞으로 뻗어", "손 이리 줘",
"손 좀 줘", "손 내놔", "팔 앞으로", "손 앞으로", "팔 쭉 내밀어", "팔 길게 뻗어", "핸드 줘", "손 내밀어 봐라",
"팔 쭉", "손 쭉 내밀어"], ("", " 줘", " 봐")),
"arm_fold": _v(["팔 접어", "팔 내려", "팔 거둬", "팔 넣어", "팔 집어넣어", "팔 원위치", "손 내려", "팔 원래대로", "팔 치워",
"팔 정리해", "팔 거둬들여", "팔 모아"], ("", " 줘")),
"arm_open": _v(["손 펴", "손 벌려", "손가락 펴", "그리퍼 열어", "집게 열어", "손 열어", "그리퍼 오픈", "핸드 오픈", "손 쫙 펴"],
("", " 줘")),
"arm_close": _v(["손 쥐어", "주먹 쥐어", "손 오므려", "그리퍼 닫아", "집게 닫아", "손 닫아", "그리퍼 클로즈", "핸드 클로즈",
"손 꽉 쥐어"], ("", " 줘")),
"pick": _v(["<obj> 집어", "<obj> 잡아", "<obj> 들어", "<obj> 집어 들어", "<obj> 픽업 해", "<obj> 좀 들어", "그 <obj> 집어",
"저 <obj> 잡아", "<obj> 집어 올려", "<obj> 손으로 잡아", "<obj> 그랩 해", "<obj> 픽 해", "<obj> 들어 올려",
"<obj> 쥐어", "앞에 있는 <obj> 집어", "<obj> 하나 집어"], ("", " 봐")),
"fetch": _v(["<obj> 가져와", "<obj> 갖다 줘", "<obj> 좀 가지고 와", "<obj> 챙겨 와", "<obj> 갖고 와", "<obj> 가온나",
"<obj> 가져와 봐라", "<obj> 브링 해", "<obj> 좀 가져다 줘", "나한테 <obj> 가져와", "<obj> 여기로 가져와",
"<obj> 이리 가져와", "<obj> 퍼뜩 가져와"], ("",)),
"no": [
# remarks, stories and questions about Lumi in Korean: nobody asked it to move
"손 흔드는 거 봐", "따라오는 거 신기하다", "얘 고개 돌리는 거 봐", "아까 손 흔들던데", "저 로봇 따라온다",
"로봇이 손 흔들어 주더라", "우리 애가 손 흔들었어", "손 흔드는 게 귀엽네", "고개 숙이는 거 웃기다",
"팔 뻗는 거 무섭다", "따라오면 어떡해", "왜 따라와", "왜 손 흔들어", "왜 이리 와", "어디 가", "어디로 가",
"뭐 하노", "뭐 하는 거야", "뭐 해", "뭐 하냐", "머 하노", "어데 가노", "어디 가노", "니 뭐 하노", "뭐 하고 있어",
"손 흔들 줄 알아", "따라올 수 있어", "팔 뻗을 수 있어", "고개 돌릴 수 있어", "리프트 있어",
"가지 마", "오지 마", "따라오지 마", "손 흔들지 마", "고개 돌리지 마", "가지 마라", "오지 마이소", "따라오지 마라",
"하지 마", "하지 말라고", "됐어", "됐다", "그만해", "필요 없어", "안 해도 돼", "괜찮아 안 해도 돼",
"이따가 따라와", "나중에 손 흔들어", "밥 먹고 가자", "우리 커피 마시러 가자", "우리 저기 가 볼까",
"엄마 저기 가자", "아빠 이리 와", "얘들아 이리 와", "민수야 따라와", "여보 이리 와 봐", "애들아 손 흔들어",
"손 씻어", "손 줘 봐 강아지야", "손 이리 줘 봐 아가", "고개 들어 봐 아들", "팔 내밀어 봐 주사 맞게",
],
}
QUICK = {
"name": ["이름이 뭐꼬", "니 이름이 뭐고", "이름이 뭐여", "이름이 뭐당가", "이름 뭐예요", "이름이 머예요", "성함이 어떻게 되십니까",
"이름 좀 알려 줘", "이름 알려 주세요", "네임 뭐야", "너 이름 뭐니", "이름이 어떻게 되니", "로봇 이름이 뭐야"],
"who": ["니 누꼬", "니 누고", "누구여", "너 누구냐", "당신 누구요", "니는 뭐꼬", "넌 뭐니", "너는 뭐 하는 로봇이야",
"무슨 로봇이에요", "이 로봇 뭐예요", "이 로봇은 뭐 하는 로봇입니까", "자기소개 좀 해 봐", "자기소개 부탁해요"],
"age": ["몇 살이고", "니 몇 살이고", "몇 살이여", "몇 살이당가", "나이가 몇이에요", "몇 살 먹었어", "올해 몇 살이야",
"언제 태어났어요", "몇 년생이야", "몇 살인데", "나이 좀 알려 줘", "연세가 어떻게 되십니까"],
"maker": ["누가 만들었노", "누가 만들었는교", "누가 맹글었어", "어데서 만들었노", "어디 회사 거예요", "어느 회사 거야",
"만든 회사가 어디야", "제조사가 어디예요", "니 어디서 왔노", "누가 개발했습니까", "만든 데가 어디예요"],
"height": ["키가 몇이고", "키 몇이여", "키가 얼마나 되노", "키 몇 센티야", "신장이 어떻게 돼요", "키 얼마예요"],
"weight": ["몇 키로고", "무게 몇이야", "몇 킬로그램이에요", "무게가 얼마나 나가요", "얼마나 나가요 무게"],
"hello": ["안녕하시오", "안녕하신교", "반갑데이", "반갑습니다", "하이요", "헬로우", "안녕 루미", "루미 하이", "방가방가",
"안냥", "하이루"],
"how_are_you": ["잘 지냈나", "별일 없제", "기분 어떠세요", "컨디션 어때", "잘 있었어"],
}
+364
View File
@@ -0,0 +1,364 @@
"""Head, lift and base wordings for the intent bank (assistant/intent_bank.py): look, lift, turn, move, go_to, come,
follow, come_back, and the "no" kind for words that sound like them but ask nothing.
The bank only picks the kind; the slot (which way, how far, which place) is read from the words by intent_bank._slot,
so every wording here says its way with the plain words that reader knows. Amounts are written the way the bank
compares them (intent_bank.core): "90 degrees", "1 meter"; a marker as <place>.
Lists are built from parts (verbs x ways x endings) and cut to a fixed, spread subset (_pick), so a new verb or
ending reaches every way without writing each sentence out.
"""
import zlib
def _pick(texts, keep):
"""A fixed subset of about `keep` (0..1) of `texts`, spread over them (the same every run), without repeats."""
out = []
for t in dict.fromkeys(texts):
if keep >= 1 or zlib.crc32(t.encode()) % 1000 < keep * 1000:
out.append(t)
return out
def _x(*parts):
"""Every join of one choice from each part (a part is a list of strings), spaces tidied."""
out = [""]
for p in parts:
out = [f"{a} {b}" for a in out for b in p]
return [" ".join(t.split()) for t in out]
EN_FRAMES = ["{}", "{} please", "please {}", "can you {}", "could you {} please", "would you {}", "will you {}",
"i want you to {}", "i need you to {}", "{} for me", "go ahead and {}", "lumi, {}", "hey lumi, {}",
"{} now", "can you {} for me", "would you mind if you {}", "just {}", "{} real quick", "{}, okay?",
"yo, {}", "{} pls", "you {}"]
def _en(bases, keep, hand=()):
"""A share of the built `bases`, a smaller share of them in EN_FRAMES, and every `hand` written wording."""
return list(hand) + _pick(bases, max(keep * 4, 0.25)) + _pick([f.format(b) for b in list(bases) + list(hand)
for f in EN_FRAMES[1:]], keep)
# ---------------- look: the head ----------------
_EN_LOOK_VERB = ["look", "glance", "peek", "take a look", "have a look", "turn your head", "move your head",
"swing your head", "point your head", "turn your eyes", "cast your eyes", "check"]
_EN_LOOK_WAY = {d: [f"{d}", f"to the {d}", f"to your {d}", f"at the {d}", f"at the {d} side", f"over to the {d}",
f"toward the {d}", f"towards your {d}", f"the {d} side", f"over {d}", f"{d} side"]
for d in ("left", "right")}
_EN_LOOK_WAY["up"] = ["up", "upward", "upwards", "up high", "up at the ceiling", "at the ceiling", "at the sky",
"up there", "higher"]
_EN_LOOK_WAY["down"] = ["down", "downward", "downwards", "down low", "at the floor", "at the ground", "at your feet",
"down at the floor", "lower"]
_EN_LOOK = [f"{v} {w}" for v in _EN_LOOK_VERB for ws in _EN_LOOK_WAY.values() for w in ws
if not (v == "check" and w in ("up", "down", "higher", "lower"))]
_EN_LOOK += [f"{s} the {d} side" for s in ("see", "check out", "watch", "scan", "eye") for d in ("left", "right")]
_EN_LOOK += [f"{v} {w}" for v in ("look", "glance", "turn your head", "face", "eyes")
for w in ("straight", "straight ahead", "ahead", "forward", "front", "to the front", "at the front",
"front again", "forward again", "to the center", "back to the middle", "back to center")]
_EN_LOOK += [f"{v} {w}" for v in ("look", "glance", "turn your head", "eyes", "look over")
for w in ("at me", "this way", "over here", "my way", "toward me", "towards me", "at my face",
"at us", "here")]
_EN_LOOK_HAND = ["eyes on me", "eyes over here", "eyes front", "eyes up", "eyes down", "eyes left", "eyes right",
"chin up", "chin down", "head up", "head down", "head left", "head right", "nose up", "look alive, eyes up",
"look left a bit more", "look right a little more", "look further left", "look further right",
"look a little higher", "look a little lower", "look up a tad", "look down a touch",
"look 90 degrees to the left", "look 90 degrees right", "turn your head 90 degrees to the left",
"turn your head 90 degrees right", "look left 90 degrees", "look up 90 degrees", "tilt your head up",
"tilt your head down", "tilt up a bit", "tilt down a little", "tip your head up", "tip your head back",
"bow your head", "nod down", "drop your head", "raise your chin", "lower your gaze", "raise your gaze",
"lift your eyes", "lift your head up", "put your head down", "put your head up", "look lefft", "look rite",
"look leff", "look rigt", "look dawn", "look upp", "luk left", "luk right", "luk up", "luk down",
"look at mee", "look at mi", "lok left", "lok right", "look write side", "look left side",
"look right side", "look up side", "look down side", "you look left", "you look right", "you look up",
"you look down", "you look me", "robot look left", "robot look up", "look to left", "look to right",
"look on the left", "look on the right", "look in the left", "look at left", "look at right",
"look at up", "look at down", "look the front", "look at front", "see the front", "see left", "see right",
"see up", "see down", "watch the left", "watch the right"]
_KO_LOOK_WAY = ["왼쪽", "오른쪽", "왼편", "오른편", "좌측", "우측", "위", "위쪽", "아래", "아래쪽", "밑", "천장", "바닥",
"땅", "하늘", "정면", "앞", "나", "저", "날", "절", "여기", "이쪽", "레프트", "라이트"]
_KO_PART = {"나": ["", "를", "좀"], "저": ["", "를", "좀"], "날": [""], "절": [""], "여기": ["", "좀"], "이쪽": ["", "을", "으로"]}
_KO_LOOK_VERB = ["봐", "봐 줘", "봐 봐", "봐요", "봐 주세요", "봐 줄래", "봐 줄래요", "봐 주실래요", "봐 주시겠어요",
"보세요", "보십시오", "보시오", "보시게", "보거라", "봐라", "보자", "볼래", "볼래요", "봐 주십시오",
"쳐다봐", "쳐다봐 줘", "쳐다보세요", "쳐다봐 주세요", "쳐다보십시오", "쳐다볼래", "바라봐", "바라봐 줘",
"바라보세요", "바라봐 주세요", "바라보십시오", "봐 보이소", "보이소", "봐 주라", "봐 줘요", "봐줘",
"봐주세요", "쳐다봐줘", "보셈", "봐바", "바바", "봐 주면 좋겠어", "봐 주시면 좋겠어요", "봐 주시기 바랍니다",
"look", "look 해", "look 해 줘", "좀 봐", "좀 봐 줘", "좀 봐 주세요", "한번 봐", "한번 봐 줘", "한번 보세요"]
_KO_LOOK = []
for _w in _KO_LOOK_WAY:
_side = _w[-1] in "쪽편측"
for _p in _KO_PART.get(_w, ["", "을" if _w[-1] in "쪽편측면앞밑땅장닥늘" else "를"] + ([] if _side else ["쪽", "쪽을"]) +
["으로" if _w[-1] in "쪽편측면앞밑땅장닥늘" else "로"]):
for _v in _KO_LOOK_VERB:
_KO_LOOK.append(f"{_w}{_p} {_v}")
_KO_LOOK += [f"{h} {w}" for h in ("고개", "고개를", "고개 좀", "머리", "머리를", "얼굴", "얼굴을", "시선", "시선을", "눈")
for w in ("왼쪽으로 돌려", "오른쪽으로 돌려", "왼쪽으로 돌려 줘", "오른쪽으로 돌려 주세요", "들어", "들어 줘", "들어 봐",
"들어 주세요", "드세요", "드십시오", "숙여", "숙여 줘", "숙여 봐", "숙여 주세요", "숙이세요", "숙이십시오",
"올려", "올려 줘", "올려 주세요", "내려", "내려 줘", "내려 주세요", "위로", "아래로", "위로 들어",
"아래로 내려", "정면으로", "정면으로 돌려", "앞으로 돌려 줘", "원위치", "원위치 해 줘", "원래대로 해 줘",
"똑바로 해", "똑바로 해 주세요", "왼쪽으로 돌려 주십시오", "오른쪽으로 돌려 봐", "up", "down", "left",
"right", "up 해 줘", "down 해 줘", "좌측으로 돌려", "우측으로 돌려")]
_KO_LOOK += [f"{w} {v}" for w in ("왼쪽 좀", "오른쪽 좀", "위쪽 좀", "아래쪽 좀", "왼쪽으로 좀", "오른쪽으로 좀", "왼쪽 더",
"오른쪽 더", "위 더", "아래 더", "좀 더 왼쪽", "좀 더 오른쪽", "조금 더 위", "조금 더 아래",
"살짝 왼쪽", "살짝 오른쪽", "살짝 위", "살짝 아래", "왼쪽으로 90 degrees", "오른쪽으로 90 degrees",
"위로 90 degrees", "아래로 90 degrees")
for v in ("봐", "봐 줘", "봐 주세요", "쳐다봐", "보세요", "보십시오")]
_KO_LOOK += [f"{a} {b}" for a in ("시선", "시선 좀", "눈", "눈길", "고개") for b in ("돌려", "돌려 줘", "돌려 주세요", "딴 데로 돌려",
"다른 데로 돌려 줘", "피해 줘")] + \
[f"{a} {b}" for a in ("딴 데", "다른 데", "딴 곳", "다른 곳", "다른 쪽", "딴 데를", "다른 곳을") for b in ("봐", "봐 줘", "봐 주세요", "보세요", "쳐다봐")]
_MIX_LOOK = [f"{a} {b}" for a in ("left", "right", "up", "down", "front", "왼쪽", "오른쪽", "위", "아래", "정면", "나", "여기")
for b in ("봐", "봐 줘", "봐 주세요", "look", "look 해", "look 해 줘", "쳐다봐", "보세요", "좀 봐", "look please")] + \
[f"look {a}" for a in ("왼쪽", "오른쪽", "위", "아래", "정면", "나", "여기", "위로", "아래로", "왼쪽으로", "오른쪽으로")] + \
[f"고개 {a}" for a in ("left", "right", "up", "down", "left 해 줘", "right 해 줘", "up 해", "down 해", "turn 해 줘")] + \
["eyes 여기", "eyes on 나", "head up 해 줘", "head down 해 줘", "레프트 봐", "라이트 봐", "레프트 쪽 봐", "라이트 쪽 봐 줘",
"업 봐", "다운 봐", "룩 레프트", "룩 라이트", "룩 업", "룩 다운", "룩 앳 미", "look at 나", "look at 저", "나 좀 look"]
# ---------------- lift: Lumi's own height ----------------
_EN_LIFT = _x(["raise yourself", "lift yourself", "raise yourself up", "lift yourself up", "raise your body",
"lift your body", "raise your torso", "lift your torso", "get taller", "grow taller", "make yourself taller",
"stand taller", "stretch up", "go up", "move up", "rise up", "come up", "get higher", "go higher",
"raise your height", "increase your height", "make you taller", "lift up", "elevate yourself",
"lower yourself", "lower yourself down", "lower your body", "lower your torso", "get shorter",
"get smaller", "make yourself shorter", "make yourself smaller", "shrink", "shrink down", "go down",
"move down", "come down", "sink down", "get lower", "go lower", "lower your height",
"decrease your height", "make you shorter", "lift down", "squat down", "crouch down", "drop down"],
["", "a bit", "a little", "a little bit", "slightly", "1 meter", "by 1 meter", "some more", "a tad",
"all the way", "a notch"])
_KO_LIFT = _x(["", "좀", "조금", "살짝", "1 meter", "1 meter만", "조금만", "좀 더", "더", "약간", "끝까지"],
["키", "키를", "몸", "몸을", "높이", "높이를", "리프트", "리프트를", "상체", "상체를", "몸통", "몸통을", "키 좀",
"몸 좀", "자세", "자세를"],
["올려", "올려 줘", "올려 주세요", "올려 줄래", "올려 주실래요", "올리세요", "올리십시오", "올려 주십시오",
"높여", "높여 줘", "높여 주세요", "높이세요", "높여 주십시오", "키워", "키워 줘", "키워 주세요",
"내려", "내려 줘", "내려 주세요", "내리세요", "내려 주십시오", "낮춰", "낮춰 줘", "낮춰 주세요",
"낮추세요", "낮춰 주십시오", "낮추십시오", "줄여", "줄여 줘", "줄여 주세요", "up", "down", "up 해 줘",
"down 해 줘", "업", "다운", "올려 보이소", "내려 보이소", "낮춰 봐", "높여 봐"])
_KO_LIFT += _x(["", "좀", "조금", "살짝", "더", "좀 더", "조금만"],
["커져", "커져 봐", "커져 줘", "커지세요", "커져 주세요", "커지십시오", "작아져", "작아져 봐", "작아져 줘",
"작아지세요", "작아져 주세요", "작아지십시오", "높아져", "높아져 봐", "낮아져", "낮아져 봐", "낮아져 주세요",
"위로 올라가", "위로 올라가 줘", "위로 올라가 주세요", "아래로 내려가", "아래로 내려가 줘", "아래로 내려가 주세요",
"올라가 봐", "내려가 봐", "몸 위로", "몸 아래로", "키 크게", "키 작게", "키 높게", "키 낮게", "쭉 올라가",
"쭉 내려가"])
_MIX_LIFT = [f"{a} {b}" for a in ("body", "lift", "height", "키", "몸", "리프트", "몸을", "키를")
for b in ("up", "down", "올려", "내려", "up 해 줘", "down 해 줘", "올려 줘", "내려 줘", "높여", "낮춰",
"좀 up", "좀 down", "up please", "down please")] + \
["you make body high", "you make body low", "you body up", "you body down", "body go up", "body go down",
"make tall", "make short", "you be tall", "you be short", "taller 해 줘", "shorter 해 줘", "키 taller",
"lift up 해 줘", "lift down 해 줘", "리프트 업", "리프트 다운", "몸 업", "몸 다운", "키 업", "키 다운"]
# ---------------- turn: the base on the spot ----------------
_EN_TURN = _x(["turn", "rotate", "spin", "pivot", "swivel", "turn yourself", "turn your body", "rotate yourself",
"rotate your body", "spin yourself", "make a turn", "do a turn", "swing", "turn your whole body"],
["left", "right", "to the left", "to the right", "to your left", "to your right", "leftward",
"rightward", "towards the left", "towards the right"],
["", "90 degrees", "by 90 degrees", "a bit", "a little"])
_EN_TURN += _x(["turn", "rotate", "spin", "pivot", "turn yourself", "rotate yourself"],
["90 degrees left", "90 degrees right", "90 degrees to the left", "90 degrees to the right",
"90 degrees to your left", "90 degrees to your right", "left 90 degrees", "right 90 degrees"])
_EN_TURN_HAND = ["turn around", "turn yourself around", "turn back around", "spin around", "spin round", "about face",
"do an about face", "do a u-turn", "make a u-turn", "u-turn", "face the other way", "face the opposite way",
"turn the other way", "turn to face the other way", "turn your back", "rotate 90 degrees", "spin 90 degrees",
"do a 180", "do a ninety to the left", "do a ninety to the right", "hang a left", "hang a right",
"take a left", "take a right", "make a left", "make a right", "left turn", "right turn", "turn lef",
"turn rite", "tern left", "tern right", "trun left", "trun right", "you turn left", "you turn right",
"robot turn left", "body turn left", "body turn right", "spin all the way around", "do a full circle",
"do a full spin", "spin a full circle", "turn all the way around", "do a 360", "turn 360 degrees",
"face left", "face right", "face to the left", "face to the right", "face your left", "face your right",
"face left, robot", "face right please", "turn and face left", "turn and face right",
"turn your body to face right", "turn to face the left"]
_KO_TURN = _x(["왼쪽으로", "오른쪽으로", "좌측으로", "우측으로", "왼편으로", "오른편으로", "왼쪽으로 90 degrees",
"오른쪽으로 90 degrees", "왼쪽으로 좀", "오른쪽으로 좀", "왼쪽으로 살짝", "오른쪽으로 살짝", "왼쪽", "오른쪽",
"90 degrees 왼쪽으로", "90 degrees 오른쪽으로"],
["돌아", "돌아 줘", "돌아 봐", "돌아요", "돌아 주세요", "돌아 줄래", "돌아 주실래요", "도세요", "도십시오",
"돌아 주십시오", "회전해", "회전해 줘", "회전해 주세요", "회전하세요", "회전하십시오", "회전", "몸 돌려",
"몸 돌려 줘", "몸을 돌려 주세요", "몸을 돌리십시오", "방향 바꿔", "방향 바꿔 줘", "방향을 바꿔 주세요",
"방향 바꾸세요", "방향 틀어", "방향 틀어 줘", "틀어", "틀어 줘", "꺾어", "꺾어 줘", "돌아 보이소", "돌아라",
"돌아서", "돌아서 줘", "turn", "turn 해", "turn 해 줘", "턴", "턴 해 줘", "돌아조", "도라"])
_KO_TURN += ["뒤로 돌아", "뒤로 돌아 줘", "뒤로 돌아 주세요", "뒤로 도세요", "뒤로 도십시오", "뒤돌아", "뒤돌아 줘",
"뒤돌아 주세요", "뒤돌아서", "돌아서", "돌아서 주세요", "반대로 돌아", "반대쪽으로 돌아", "반대 방향으로 돌아 줘",
"반대쪽으로 방향 바꿔", "유턴", "유턴해", "유턴 해 줘", "유턴하세요", "한 바퀴 돌아", "한 바퀴 돌아 줘",
"한 바퀴 돌아 주세요", "제자리에서 한 바퀴 돌아", "빙글 돌아", "한 바퀴 빙 돌아", "좌회전", "우회전", "좌회전해",
"우회전해", "좌회전 해 주세요", "우회전 해 주세요", "턴 레프트", "턴 라이트", "레프트로 돌아", "라이트로 돌아",
"left로 돌아", "right로 돌아", "left 턴", "right 턴", "turn left 해 줘", "turn right 해 줘"]
# ---------------- move: a short straight drive ----------------
_EN_MOVE = _x(["move", "go", "drive", "roll", "step", "scoot", "shift", "slide", "inch", "get", "come", "head"],
["forward", "forwards", "ahead", "back", "backward", "backwards", "to the left", "to the right",
"to your left", "to your right", "left", "right", "straight ahead"],
["", "a bit", "a little", "a little bit", "1 meter", "by 1 meter", "a few steps", "one step", "two steps",
"a tiny bit", "slightly"])
_EN_MOVE = [t for t in _EN_MOVE if t not in ("go ahead", "go straight ahead", "head forward") and not t.startswith(("come left", "come right", "come to the", "come to your", "head left",
"head right", "get left", "get right", "head back", "get back",
"go back", "come back", "head to the", "head to your"))]
_EN_MOVE += _x(["move", "go", "drive", "roll"], ["1 meter forward", "1 meter back", "1 meter backward",
"1 meter to the left", "1 meter to the right", "1 meter ahead",
"1 meter left", "1 meter right"])
_EN_MOVE_HAND = ["back up", "back up a bit", "back up a little", "back up 1 meter", "back off a bit", "reverse a bit",
"reverse 1 meter", "step back a little", "take a step back", "take a step forward", "take two steps back",
"take one step to the left", "take one step to the right", "scooch over to the left", "scooch to the right",
"move over to the left a bit", "move over to the right a bit", "give me some room, back up",
"make some room, move back", "you move forward", "you go back 1 meter", "you move left", "robot go forward",
"go straight a bit", "go straight 1 meter", "move straight ahead 1 meter", "move fwd", "move forword",
"moov back", "bak up", "go bakwards", "mov left", "mov right"]
_KO_MOVE = _x(["앞으로", "뒤로", "왼쪽으로", "오른쪽으로", "좌측으로", "우측으로", "앞쪽으로", "뒤쪽으로"],
["", "좀", "조금", "조금만", "살짝", "1 meter", "1 meter만", "한 걸음", "두 걸음", "반 걸음", "한 발짝",
"약간", "쪼끔"],
["가", "가 줘", "가 봐", "가요", "가 주세요", "가세요", "가십시오", "가 주십시오", "가 줄래", "가 주실래요",
"이동해", "이동해 줘", "이동해 주세요", "이동하세요", "이동하십시오", "이동해 주십시오", "움직여",
"움직여 줘", "움직여 주세요", "움직이세요", "와", "와 줘", "와 주세요", "가라", "가 보이소", "가이소",
"go", "go 해", "move", "move 해 줘", "가조", "가 쥬"])
_KO_MOVE += _x(["뒤로", "좀", "조금", "뒤로 좀", "뒤로 조금", "뒤로 1 meter"],
["물러나", "물러나 줘", "물러나 주세요", "물러서", "물러서 주세요", "물러나십시오", "빠져", "빠져 줘",
"빠져 주세요", "후진해", "후진해 줘", "후진해 주세요", "후진하십시오", "비켜", "비켜 줘", "비켜 주세요"])
_KO_MOVE += _x(["왼쪽으로", "오른쪽으로", "옆으로"], ["비켜", "비켜 줘", "비켜 주세요", "비키세요", "비켜 주십시오"])
_KO_MOVE = [t for t in _KO_MOVE if not t.startswith("옆으로")]
_MIX_MOVE = [f"{a} {b}" for a in ("forward로", "back으로", "left로", "right로", "forward", "back", "앞으로", "뒤로",
"왼쪽으로", "오른쪽으로")
for b in ("가", "가 줘", "이동", "이동해 줘", "move", "move 해", "go", "go 해 줘", "1 meter 가", "좀 가")] + \
["back 해", "back 해 줘", "back up 해 줘", "후진 please", "앞으로 move please", "move forward 해 줘",
"move back 해 줘", "move left 해 줘", "move right 해 줘", "포워드", "포워드로 가", "백으로 가", "백 해 줘"]
# ---------------- go_to: a marker on the map ----------------
_EN_GO = _x(["go", "head", "drive", "move", "walk", "roll", "get", "make your way", "proceed", "travel", "hurry",
"navigate", "go on over", "head on over", "get yourself", "take yourself", "run", "go straight", "zip"],
["to <place>", "over to <place>", "on to <place>", "to <place> now", "to <place> right now",
"to <place> please", "to <place> for me", "to <place> real quick", "back to <place>"])
_EN_GO += _x(["<place>"], ["please", "now", "go", "go now", "let's go", "lumi", "right now", "next", "is where you go",
"is your next stop", "go there", "head there", "move there"])
_EN_GO_HAND = ["to <place> please", "to <place>, now", "off to <place>", "off you go to <place>", "next stop, <place>",
"your next stop is <place>", "can you get to <place>", "could you head to <place>", "would you go to <place>",
"please head to <place> now", "i need you at <place> now", "go to <place>. right now, not later",
"go to <place>, right now", "go to <place> immediately", "go to <place> asap", "go to <place> quick",
"go to <place>, yes, now", "go to the <place>", "go to <place> point", "go to point <place>",
"go to marker <place>", "drive to the <place> marker", "you go <place>", "you go to <place>",
"robot go <place>", "go <place> please", "go too <place>", "go two <place>", "goto <place>",
"go to da <place>", "go <place> now", "move to <place> spot", "please you go <place>", "you <place> go",
"<place> go please", "<place> you go", "go stand at <place>", "go wait at <place>", "go and stay at <place>",
"go to <place> and wait there", "can you take me to <place>", "show me the way to <place>",
"guide me to <place>", "lead me to <place>", "lead the way to <place>", "take me to <place> please"]
_KO_GO = _x(["<place>로", "<place>으로", "<place>에", "<place>까지", "<place> 쪽으로", "<place> 앞으로", "<place>",
"<place>로 좀", "<place>까지 좀", "<place>로 얼른", "<place>로 빨리", "<place>로 지금", "<place>로 당장"],
["가", "가 줘", "가 봐", "가요", "가 주세요", "가세요", "가십시오", "가 주십시오", "가 줄래", "가 줄래요",
"가 주실래요", "가 주시겠어요", "가 주시겠습니까", "가 줄 수 있어", "가 줄 수 있어요", "가 주실 수 있나요",
"이동해", "이동해 줘", "이동해 주세요", "이동하세요", "이동하십시오", "이동해 주십시오", "이동", "이동 부탁해",
"이동 부탁드려요", "이동 부탁드립니다", "가 주라", "가라", "가거라", "가자", "갑시다", "가시죠", "가 보이소",
"가이소", "가 보소", "가 보랑께", "가 봐라", "가 주면 좋겠어", "가 주시면 좋겠어요", "가 주시면 감사하겠습니다",
"가 줬으면 좋겠어", "출발", "출발해", "출발해 줘", "출발하세요", "출발하십시오", "go", "go 해", "go 해 줘",
"move", "move 해 줘", "고", "고고", "가조", "가 쥬", "가셈", "가 줘요", "가 주쇼", "가 주이소"])
_KO_GO = [t for t in _KO_GO if not (t.startswith("<place> ") and t.split(" ", 1)[1] in ("고", "move"))]
_KO_GO += ["<place>로 안내해 줘", "<place>로 안내해 주세요", "<place>까지 안내해 주십시오", "<place>로 데려다 줘",
"<place>로 나 데려다 줘", "<place>로 저 데려다 주세요", "<place>로 가자고", "<place>로 가라고", "<place> 가야 돼",
"<place>로 가야 해", "<place>로 가야 돼요", "<place>로 가 볼까", "<place>로 가 볼래", "<place> 쪽으로 가 볼래요",
"지금 <place>로 가", "당장 <place>로 가", "얼른 <place>로 가 줘", "빨리 <place>로 이동해", "루미 <place>로 가",
"<place>로 이동 바랍니다", "<place>로 가 주시기 바랍니다", "<place>로 가 주셨으면 해요", "<place>까지 가 볼래",
"<place>로 가 주라 마", "<place>로 퍼뜩 가", "<place>로 언능 가", "<place>로 싸게 가", "<place>로 가랑께"]
# ---------------- come / follow / come_back ----------------
_EN_COME = _en(["come here", "come over here", "come to me", "come closer", "come over", "come this way",
"get over here", "come on over", "come on over here", "come near me", "come up to me", "come by me",
"come towards me", "approach me", "move closer to me", "roll over here", "drive over to me",
"come to where i am", "come to my side", "come stand by me", "come a bit closer", "come right here",
"come to me now", "over here", "come over to me", "come here to me", "come here quickly"], 0.35)
_KO_COME = _x(["이리", "이리로", "일로", "일루", "여기로", "여기", "이쪽으로", "나한테", "저한테", "제게", "내 쪽으로",
"제 쪽으로", "내 옆으로", "제 옆으로", "가까이", "좀 더 가까이", "이리 좀", "여기로 좀", "이쪽으로 좀",
"가까이 좀", "여기까지"],
["와", "와 줘", "와 봐", "와요", "와 주세요", "오세요", "오십시오", "와 주십시오", "와 줄래", "와 줄래요",
"와 주실래요", "와 주시겠어요", "와라", "오너라", "와 보이소", "오이소", "온나", "와 주라", "와 봐요",
"와 줘요", "오셈", "와조", "come", "come 해", "와 please"])
_EN_FOLLOW = _en(["follow me", "come with me", "come along with me", "walk with me", "tag along", "tag along with me",
"stay with me", "keep up with me", "stick with me", "stay behind me", "walk behind me",
"follow behind me", "follow my lead", "keep following me", "follow me around", "go where i go",
"come after me", "follow us", "come with us", "walk alongside me", "stay close to me",
"keep close behind me", "shadow me", "follow along", "follow me this way", "follow me over there",
"accompany me", "escort me"], 0.4)
_KO_FOLLOW = _x(["", "나", "날", "나를", "저", "저를", "절", "우리", "뒤에서", "천천히", "잘", "계속", "얼른", "나 좀",
"저 좀", "제 뒤를"],
["따라와", "따라와 줘", "따라와 봐", "따라와요", "따라와 주세요", "따라오세요", "따라오십시오",
"따라와 주십시오", "따라올래", "따라올래요", "따라와 주실래요", "따라와 주시겠어요", "따라와라",
"따라오너라", "따라온나", "따라오이소", "따라오소", "따라와 보이소", "따라다녀", "따라다녀 줘",
"따라다니세요", "쫓아와", "쫓아와 줘", "follow 해", "follow 해 줘", "팔로우 해", "팔로우 해 줘",
"따라와조", "따라 와", "따라 오세요"])
_KO_FOLLOW += _x(["", "나랑", "저랑", "저와", "나하고", "우리"],
["같이 가자", "같이 가", "같이 가요", "같이 가 줘", "같이 가 주세요", "같이 가시죠", "같이 걸어",
"같이 걸어요", "같이 걸어가자", "함께 가자", "함께 가요", "함께 가시죠", "함께 걸어요"])
_EN_BACK = _en(["come back", "come back to your spot", "go back to where you were", "go back to your spot",
"return to your spot", "return to where you were", "return to your starting point",
"go back to the start", "go back to where you started", "head back to where you were",
"back to where you were", "back to your spot", "go back where you came from", "return to your place",
"get back to your spot", "go back to your old spot", "come back to where you started"], 0.4)
_KO_BACK = _x(["", "다시", "원래 자리로", "제자리로", "아까 그 자리로", "아까 있던 데로", "처음 자리로", "원래 있던 곳으로",
"원래 위치로", "출발한 곳으로", "있던 자리로"],
["돌아와", "돌아와 줘", "돌아와 봐", "돌아와요", "돌아와 주세요", "돌아오세요", "돌아오십시오",
"돌아와 주십시오", "돌아가", "돌아가 줘", "돌아가 주세요", "돌아가세요", "돌아가십시오", "복귀해",
"복귀해 주세요", "복귀하십시오", "돌아온나", "돌아오이소", "come back 해 줘", "도라와"])
_KO_BACK = [t for t in _KO_BACK if not (t.startswith("다시 돌아가") or t in ("돌아가", "돌아가 줘", "돌아가 주세요",
"돌아가세요", "돌아가십시오"))]
# ---------------- no: sounds like a motion, asks for none ----------------
_NO = [
# looks / seeing / talk about looks
"you look tired", "you look great today", "you look cute", "you look happy", "looks good to me", "that looks nice",
"the booth on the left looks nice", "it looks like rain", "look who's here", "look, it's not a big deal",
"look, i'm just saying hi", "i'm looking forward to the talk", "i looked everywhere", "i'll look it up later",
"look it up later", "look before you leap", "look both ways before crossing", "he looks down on robots",
"she turned her head left", "my mom is on the left", "the restroom is on the right", "the exit is up ahead",
"what's on your left?", "what's on your right?", "can you see what's on your right?", "what do you see on the left?",
"what's above you?", "what's behind you?", "where are you looking?", "why are you looking at me?",
"did you just look at me?", "how far can your head turn?", "can your head turn all the way around?",
"can you turn your head?", "how high can you go?", "how tall are you?", "how tall can you get?",
"how far can you drive?", "how fast can you move?", "can you move?", "do you have wheels?", "can you walk?",
"왼쪽에 뭐 있어?", "오른쪽에 뭐가 보여?", "오른쪽에 뭐 있는지 보여?", "위에 뭐 있어?", "뒤에 뭐 있어?", "뭐 보고 있어?",
"어디 보고 있어?", "왜 나 쳐다봐?", "고개 몇 도까지 돌아가?", "고개 얼마나 돌아가?", "키가 몇이야?", "키 커 보인다",
"너 키 크다", "몸 괜찮아?", "높이가 얼마야?", "얼마나 빨리 움직여?", "바퀴 있어?", "걸을 수 있어?", "오늘 멋져 보여",
"피곤해 보여", "이 부스 괜찮아 보이네", "화장실은 오른쪽에 있어요", "출구는 왼쪽이에요", "엄마 이거 봐", "여기 봐 봐 엄마",
# someone else, later, past, quoting
"kids, look at the robot", "mina, look up, there's a balloon", "he said look left and you'll see the booth",
"so when i say now, look left", "look left later, when the guests arrive", "after the speech, look at the audience",
"i turned left at the corner", "turn left at the corner to find the restroom", "go straight and turn right for the exit",
"we went back home", "back in my day", "i'll be back", "i'm going to the stage later", "i'll go to the booth later",
"where is the stage?", "is the stage far?", "how do i get to the stage?", "which way is the exit?",
"저 왼쪽으로 갈게요", "제가 뒤로 좀 갈게요", "제가 거기로 갈게요", "음, 저 포토 존으로 갈게요", "우리 이제 집에 가자",
"나 먼저 갈게", "이따가 갈게", "다음에 또 올게", "화장실 어디예요?", "무대는 어디야?", "출구까지 멀어?",
"어떻게 가요?", "모퉁이에서 왼쪽으로 도세요", "직진하다가 오른쪽으로 꺾으면 돼요", "엘리베이터 타고 올라가세요",
# other senses of the verbs
"take the lift to the second floor", "where's the lift?", "lift는 어디 있어요?", "엘리베이터 어디야?",
"turn the music up", "turn up the volume", "turn down the music", "turn it down", "turn off the light",
"follow the signs", "follow up later", "i follow you on instagram", "follow us on instagram",
"come on!", "come on, really?", "oh come on", "come back later", "come again?", "how come?",
"move on to the next topic", "let's move on", "i'm moving to busan next month", "that movie moved me",
"go ahead and tell me", "go on, tell me more", "how's it going?", "what's going on?", "the show must go on",
"stand up for yourself", "cheer up", "hurry up and answer", "turn the page", "it's your turn", "whose turn is it?",
"go around", "go around it", "go round", "walk around", "look around", "go around the booth", "돌아다녀", "둘러봐",
"go ahead", "go ahead, tell me", "go ahead and ask", "go ahead, i'm listening", "go on then",
"음악 좀 올려 줘", "볼륨 올려", "소리 키워", "소리 좀 줄여", "목소리 키워 줘", "불 꺼 줘", "인스타 팔로우 해 주세요",
"다음 주제로 넘어가자", "부산으로 이사 가요", "이야기 계속해", "잘 지내?", "무슨 일이야?", "네 차례야",
# ability and conditions
"can you look up?", "are you able to look up at the ceiling?", "is it possible for you to turn around?",
"do you know how to follow people?", "can you follow people?", "can you come to me if i call?",
"if i call you, come here", "when i wave, come to me", "when the show starts, go to the stage",
"after lunch go to the booth", "if someone comes, look at them", "고개 돌릴 수 있어?", "따라올 수 있어?",
"부르면 와 줄 수 있어?", "나중에 무대로 가", "이따가 나 봐", "신호 주면 위 봐", "근데 나중에 왼쪽 봐",
"쇼 시작하면 무대로 가", "밥 먹고 나서 부스로 가",
# the person's own body, reported speech
"can you lift me up?", "lift me up", "pick me up", "carry me", "can you carry me?", "lift my bag", "나 들어 올려 줘",
"나 안아 줘", "나 업어 줘", "저 좀 들어 주세요", "루미가 <place>로 간대", "<place>로 간대", "<place>로 간다고 했어",
"루미가 <place>로 간다고 했어요", "로봇이 <place>로 간대요", "lumi is going to <place>", "lumi said it's going to <place>",
"the robot is going to <place>", "he's going to <place>", "they went to <place>",
"로봇이 따라온대", "루미가 우리 따라온대", "루미가 돌아온대", "the robot will follow us", "lumi is coming back",
]
INTENT = {
"look": _en(_EN_LOOK, 0.05, _EN_LOOK_HAND) + _pick(_KO_LOOK, 0.1) + _MIX_LOOK,
"lift": _en(_EN_LIFT, 0.04) + _pick(_KO_LIFT, 0.1) + _MIX_LIFT,
"turn": _en(_EN_TURN, 0.04, _EN_TURN_HAND) + _pick(_KO_TURN, 0.5),
"move": _en(_EN_MOVE, 0.02, _EN_MOVE_HAND) + _pick(_KO_MOVE, 0.06) + _MIX_MOVE,
"go_to": _en(_EN_GO, 0.06, _EN_GO_HAND) + _pick(_KO_GO, 0.15),
"come": _EN_COME + _pick(_KO_COME, 0.3),
"follow": _EN_FOLLOW + _pick(_KO_FOLLOW, 0.3),
"come_back": _EN_BACK + _pick(_KO_BACK, 0.5),
"no": _NO,
}
if __name__ == "__main__":
for k, v in INTENT.items():
print(f"{k:10} {len(v)}")
print("total", sum(map(len, INTENT.values())))
+451
View File
@@ -0,0 +1,451 @@
"""Questions about Lumi for assistant/quick_answers.py: more wordings of its kinds (QUICK), a few new kinds with
their answers (QUICK_KINDS) and more "no" wordings (things that sound alike but are not about Lumi itself).
English, Korean (반말 / 해요체 / 하십시오체, dialect, Konglish, whisper slips) and mixed. Every answer is a fact of
knowledge/lumi_about_en.md; keep them in step.
"""
def _ko(stems, ends):
"""Every stem with every ending: _ko(["이름이 뭐"], ["야", "예요"]) -> ["이름이 뭐야", "이름이 뭐예요"]."""
return [s + e for s in stems for e in ends]
QUICK = {
"name": [
"what's your name again", "could you tell me your name", "what name do you go by", "what do people call you",
"what are you named", "what is ur name", "whats your name robot", "robot what is your name", "your name is",
"name?", "what's the name of this robot", "what's this robot called", "what is this robot called",
"what do we call you", "how should i call you", "what should we call you", "do you have a name robot",
"have you got a name", "tell me your name please", "can i know your name", "may i ask your name",
"what's ur name", "wats ur name", "what your name", "what's you name", "what is you name", "whats yor name",
"what's your nam", "lumi is that your name", "is your name lumi", "are you lumi", "is this lumi",
"your name please robot", "hey robot what's your name", "name of the robot",
"니 이름", "네 이름", "너 이름", "너의 이름은", "너 이름은 뭐야", "니 이름은 뭐니",
"이름이 뭐니", "이름이 뭐냐", "이름이 뭐임", "이름이 뭐여", "이름 뭐임", "이름 머야", "이름 모야", "이름 뭐예요",
"이름이 뭐에요", "이름이 무엇입니까", "이름이 무엇인가요", "이름이 어떻게 되세요", "이름이 어떻게 되니", "이름이 어떻게 돼",
"이름이 어떻게 되십니까", "존함이 어떻게 되세요", "이름 좀 알려 줘", "이름 좀 알려 주세요", "이름 알려 줄래", "이름 말해 줘",
"이름 말해 주세요", "이름 좀 가르쳐 줘", "이름을 알려 주시겠어요", "이름이 있어", "이름 있니", "이름이 있나요",
"로봇 이름이 뭐야", "로봇 이름이 뭐예요", "이 로봇 이름 뭐야", "로봇아 이름이 뭐야", "로봇 이름 알려 주세요",
"얘 이름이 뭐야", "얘는 이름이 뭐예요", "쟤 이름이 뭐야", "이 친구 이름이 뭐예요", "이 아이 이름은 뭐예요",
"뭐라고 불러", "뭐라고 불러야 돼", "뭐라고 부르면 될까요", "어떻게 부르면 돼요", "널 뭐라고 부르면 돼",
"이름이 뭐라꼬", "이름이 뭐꼬", "니 이름 뭐꼬", "이름이 뭐시여", "이름이 뭣이여", "이름이 뭐래요", "이름이 뭐라고요",
"이름이 뭐라고", "니 이름이 뭐고", "니 이름 뭐라카노", "이름이 뭐당가", "이름이 뭐요",
"루미가 네 이름이야", "네 이름이 루미야", "너 루미야", "루미 맞아요", "니가 루미야",
"what's your 이름", "your name이 뭐야", "너 name이 뭐야", "네임이 뭐예요", "니 네임 뭐야", "name 알려 줘",
"이름 what", "what is 너의 이름",
],
"name_meaning": [
"what does the name lumi mean", "why lumi", "why are you named lumi", "why is your name lumi",
"where does your name come from", "how did you get your name", "who gave you your name", "who named you",
"what's the meaning of lumi", "what is the meaning behind your name", "is lumi a word", "does lumi mean anything",
"lumi means what", "what does lumi stand for", "where did the name lumi come from", "why did they call you lumi",
"루미 뜻이 뭐예요", "루미는 무슨 뜻이야", "루미가 무슨 의미예요", "루미 의미가 뭐야", "이름 뜻이 뭐야", "이름 뜻이 뭐예요",
"이름에 무슨 뜻이 있어요", "이름이 무슨 의미예요", "왜 루미라고 지었어요", "왜 이름이 루미야", "루미라는 이름은 왜 지었어요",
"이름은 누가 지었어", "이름은 누가 지어 줬어요", "이름 누가 지어 줬어", "루미는 무슨 말이에요", "루미 어디서 나온 이름이야",
"루미가 뭔 뜻이고", "루미 뜻이 뭐꼬", "루미 meaning이 뭐야", "lumi 무슨 뜻이야", "루미 무슨 뜻",
],
"who": [
"who are you exactly", "who are you robot", "and who are you", "tell me who you are", "say who you are",
"can you introduce yourself", "could you introduce yourself", "please introduce yourself", "introduce yourself please",
"introduce yourself to us", "give us an introduction", "tell us about yourself", "say something about yourself",
"what are you supposed to be", "what kind of machine are you", "what type of robot are you", "what sort of robot are you",
"what kind of robot is this", "what's this machine", "what is this machine", "what robot is this", "who is this",
"what is this robot for", "what is your purpose", "what's your role here", "what is your role", "why are you here",
"what's your job here", "who r you", "who are yu", "who ar you", "hu are you", "who are you lumi",
"누구니", "누구세요", "누구십니까", "누구신가요", "너는 누구야", "넌 누구야", "당신 누구예요", "넌 뭐니", "너는 뭐야",
"너 정체가 뭐야", "정체가 뭐예요", "넌 정체가 뭐니", "무슨 로봇이에요", "무슨 로봇이야", "어떤 로봇이야", "어떤 로봇입니까",
"이 로봇 뭐야", "이 로봇은 뭐예요", "이건 무슨 로봇이에요", "이 로봇은 무슨 로봇이에요", "이거 무슨 로봇이야", "얘는 뭐야",
"얘 뭐예요", "얘는 무슨 로봇이에요", "로봇이 뭐 하는 거예요", "넌 뭐 하는 로봇이니", "넌 여기서 뭐 해", "여기서 뭐 하는 거야",
"자기소개", "자기소개 해 주세요", "자기소개 좀 해 줘", "자기소개 부탁해요", "자기소개 부탁합니다", "자기소개 해 주실래요",
"자기소개 해 줄래", "소개 좀 해 주세요", "너 소개 좀 해 줘", "너에 대해 알려 줘", "너에 대해 말해 줘", "본인 소개 해 주세요",
"자기 소개 좀 해 보세요", "니 소개 좀 해 봐라", "니는 누고", "누꼬", "니 뭐꼬", "너 뭐여", "너 누구여", "뉘시오",
"who are you 루미", "너 who야", "self introduction 해 줘", "자기소개 please", "introduce 해 줘", "너 뭐 하는 robot이야",
],
"age": [
"how old are you lumi", "what age are you", "how old r you", "how old are u", "how old ru", "hao old are you",
"how ole are you", "how old are you now", "how old are you robot", "how old is the robot", "what's the robot's age",
"how many years have you been around", "how long have you existed", "when were you created", "when were you first made",
"when did you come out", "when were you manufactured", "what year were you made", "what year were you born",
"are you a new robot", "are you a new model", "you're how old",
"age?", "how young are you",
"몇 살", "몇 살이니", "몇 살이냐", "몇 살임", "몇 살이에요", "몇 살이세요", "몇 살입니까", "몇 살인가요", "몇 살이야 너",
"너 몇 살이니", "너는 몇 살이야", "니 몇 살이야", "네 나이가 몇이야", "나이가 몇이에요", "나이가 어떻게 되니", "나이가 어떻게 돼",
"나이 어떻게 되세요", "나이가 몇 살이에요", "나이 몇이야", "나이 알려 줘", "나이가 궁금해요", "올해 몇 살이야", "올해 몇 살이에요",
"태어난 지 얼마나 됐어", "태어난 지 얼마나 됐어요", "언제 태어났어요", "언제 태어났니",
"만들어진 지 얼마나 됐어", "만들어진 지 얼마나 됐어요", "만든 지 몇 년 됐어요", "언제 만들어졌니", "언제 만들어졌습니까",
"몇 년생이야", "몇 년생이에요", "몇 년 됐어", "몇 년 된 로봇이에요", "이 로봇 몇 년 됐어요", "로봇 나이가 몇이에요",
"멫 살이고", "몇 살이고", "몇 살이여", "몇 살이당가", "몇 살이유", "몇 살이오", "니 몇 살이가", "나이가 우째 되노",
"how old 이야", "너 몇 years old야", "age 몇이야", "몇 살 how old", "너 나이 how many",
],
"maker": [
"who made this robot", "who built this robot", "who created this robot", "who developed this robot",
"who's your developer", "who is your developer", "who are your developers", "who's your manufacturer",
"who manufactured you", "who makes you", "who produced you", "who invented you", "who is your creator",
"who's behind you", "which company developed you", "which company created you", "what company created you",
"what company developed you", "which company are you from", "what company do you belong to", "made by which company",
"where were you made", "where were you built", "where were you developed", "where are you made", "where did you come from",
"who made u", "who mad u", "who maid you", "hoo made you", "who build you", "who maked you", "who made ya",
"누가 만들었니", "누가 만들었냐", "누가 만들었습니까", "누가 만든 거야", "누가 만든 거예요", "누가 만든 로봇이에요",
"누가 너를 만들었어", "누가 너를 만들었어요", "너는 누가 만들었니", "넌 누가 만들었어", "누가 개발했어", "누가 개발했니",
"누가 개발했습니까", "누가 개발한 로봇이에요", "개발자가 누구야", "개발자가 누구예요", "개발사가 어디예요", "개발사가 어디야",
"제조사가 어디야", "제조사는 어디예요", "제조사가 어디입니까", "만든 회사가 어디야", "만든 회사가 어디예요", "만든 회사 어디",
"어느 회사 거야", "어느 회사 거예요", "어디 회사 거야", "어디 회사 거예요", "어디 제품이야", "어디 제품이에요", "어디 꺼야",
"어느 회사 제품이에요", "어느 회사에서 개발했어요", "어디서 개발했어", "어디서 개발했어요", "어디서 만든 거야", "어디서 만들었니",
"어디서 만들어졌어요", "너 어느 회사 소속이에요", "넌 어디 소속이니", "어디 소속이에요", "누구 거야", "주인이 누구야",
"누가 만들었노", "누가 맹글었어", "누가 만들었드나", "누가 만들었당가", "누가 만들었슈", "누가 만들었소", "누가 맹근 거여",
"누가 만들었는교", "어데서 만들었노", "어데 회사고",
"who made 너", "who developed 너", "누가 만들었어 who", "maker가 누구야", "제조사 who", "누가 develop 했어",
"어느 company야", "company 어디야", "너 어느 company에서 만들었어", "made in 어디야",
],
"height": [
"how tall are you lumi", "how tall r you", "how tall are u", "how tal are you", "hou tall are you", "what is your height",
"what's your height in cm", "what is your height in centimeters", "how many centimeters tall are you",
"how many cm are you", "how high is this robot", "how tall is the robot", "what's the robot's height",
"how big are you", "are you tall", "how tall do you get", "what's your size", "how tall exactly are you",
"키 몇", "키 몇이야", "키 몇이니", "키 몇이에요", "키가 몇이니", "키가 몇이세요", "키가 몇입니까",
"키가 얼마나 되니", "키가 어떻게 돼", "키가 어떻게 돼요", "키가 어떻게 되세요", "키 몇 센티야", "키 몇 센티니", "키가 몇 센티예요",
"키가 몇 센티미터예요", "키가 몇 cm예요", "키 몇 cm야", "몇 센티야", "몇 센티예요", "키 얼마나 돼", "키 얼마나 돼요",
"키가 얼마나 커", "키가 얼마나 커요", "신장이 몇이에요", "너 키가 몇이야", "니 키 몇이고", "니 키가 얼마고", "키가 우째 되노",
"키 몇이여", "키가 몇이당가", "로봇 키가 몇이야", "이 로봇 키는 몇이에요", "키 알려 줘", "키 알려 주세요",
"how tall 이야", "키 how tall", "your height 몇이야", "너 height가 얼마야", "키 몇 centi야",
],
"weight": [
"how heavy are you lumi", "what do you weigh", "how much do you weight", "how many kilos are you",
"how many kg do you weigh", "how many kilograms do you weigh", "what's your weight in kg", "how heavy is the robot",
"how much does this robot weigh", "how much does the robot weigh", "how heavy r you", "are you very heavy",
"몸무게 몇이야", "몸무게가 몇이에요", "몸무게 얼마나 돼요", "몸무게가 어떻게 되세요", "무게가 몇이야",
"무게가 몇이에요", "무게 몇 킬로예요", "몇 킬로그램이에요", "몇 kg이에요", "몇 키로야", "몇 키로나 나가", "무게 얼마나 나가",
"무게가 얼마나 나가요", "너 무거워", "무거워요", "많이 무거워요", "무게가 어떻게 돼요", "이 로봇 무게가 몇이에요",
"로봇 무게 몇 킬로예요", "몇 키로고", "무게가 우째 되노", "몇 키로여", "your weight 몇이야", "너 몇 kg이야", "weight가 얼마야",
],
"battery_life": [
"how long does the battery last", "how long does your battery last on a charge", "how many hours can you run",
"how many hours can you work", "how long can you operate", "how long can you keep going", "how long do you run for",
"what's your battery life like", "what is your battery life", "how long is your battery life", "battery life",
"how long can you stay on", "how long can you run without charging", "how long until you need charging",
"how long until your battery dies", "how long do your batteries last", "how many hours on one charge",
"how long can you last", "how long can you work for", "does your battery last long",
"배터리 몇 시간 가요", "배터리 몇 시간 쓸 수 있어", "배터리 몇 시간 써요", "배터리가 얼마나 가요", "배터리가 얼마나 오래 가요",
"배터리 얼마나 오래 가", "배터리 지속 시간이 몇 시간이에요", "배터리 몇 시간 버텨요", "한 번 충전으로 얼마나 가요",
"한 번 충전으로 몇 시간 가", "충전하면 몇 시간 가", "충전하면 얼마나 써요", "완충하면 몇 시간 가요", "완충하면 얼마나 가",
"몇 시간 동안 움직일 수 있어요", "몇 시간 동안 일할 수 있어", "몇 시간 일해요", "하루 종일 일할 수 있어요", "얼마나 오래 일할 수 있어요",
"배터리 몇 시간이에요", "배터리 사용 시간이 얼마예요", "배터리 몇 시간 가노", "배터리 얼마나 가노", "배터리 몇 시간 가유",
"battery 몇 시간 가", "배터리 life가 얼마야", "battery 얼마나 가요", "배터리 how long",
],
"languages": [
"which languages can you speak", "what languages do you know", "do you know english", "do you know korean",
"do you know chinese", "can you understand korean", "can you understand chinese", "can you understand spanish",
"do you speak spanish", "do you speak french", "do you speak german", "can you speak russian", "do you speak uzbek",
"can you talk in korean", "can you talk in english", "speak english", "english ok", "do you understand korean",
"is english okay", "can i talk to you in english", "can i speak korean to you", "what languages can you understand",
"how many languages can you speak", "are you multilingual", "can you speak japanese",
"영어 할 수 있어", "영어 할 수 있어요", "영어 할 줄 아세요", "영어 돼", "영어 돼요", "영어 가능해요", "영어 알아들어",
"영어도 할 줄 알아", "한국어 알아", "한국어 알아들어요", "한국말 할 줄 알아", "한국말 잘해요", "중국어 돼", "중국어 할 줄 알아",
"일본어 돼요", "일본어 할 줄 아세요", "스페인어 할 수 있어요", "러시아어 해요", "몇 개 국어 할 수 있어", "몇 개 국어 가능해요",
"몇 개 언어 할 수 있어요", "무슨 말 할 줄 알아", "무슨 언어로 말해요", "어떤 언어로 말할 수 있어요", "어떤 말을 알아들어요",
"외국어 해요", "외국어 할 수 있어요", "다른 나라 말도 해요", "영어로 말해도 돼요", "영어로 해도 알아들어", "영어 할 줄 아나",
"영어 하나", "영어 할 줄 아노", "영어 되나", "영어 할 줄 아는교",
"can you speak 한국어", "do you speak 한국말", "english 돼", "english 할 수 있어요", "korean 할 줄 알아", "japanese 할 줄 알아",
"영어 speak 할 수 있어", "korean 돼요",
],
"chatgpt": [
"are you based on chatgpt", "are you built on chatgpt", "do you run on chatgpt", "do you run on gpt",
"is chatgpt inside you", "are you openai", "do you use openai", "are you made by openai", "are you gpt",
"are you gpt 4", "is this gpt", "are you connected to chatgpt",
"is your brain chatgpt", "chatgpt?", "are you like chatgpt",
"너 지피티야", "지피티야", "챗지피티예요", "챗GPT예요", "챗GPT야", "챗GPT 기반이야", "챗지피티 기반이에요", "GPT 써요",
"지피티 써", "오픈AI 거야", "오픈AI 써요", "챗GPT랑 연결돼 있어요",
"너 chatgpt야", "chatgpt 써요", "gpt야 너", "너 openai야",
],
"model": [
"what ai model are you using", "what ai model do you use", "which ai model are you", "which llm do you use",
"what llm are you", "what language model runs you", "what language model do you use", "what is your ai",
"which ai do you use", "what ai runs you", "what software is your brain", "what model are you", "what model runs you",
"which ai are you based on", "what ai is inside you", "what large language model do you use", "are you gemma",
"do you use gemma", "what powers your answers", "what's your language model",
"어떤 AI 모델 써", "어떤 AI 써요", "무슨 AI야", "너 무슨 AI야", "무슨 AI 모델이에요", "무슨 언어 모델이야", "언어 모델 뭐 써요",
"인공지능 모델이 뭐예요", "인공지능은 뭐 써요", "어떤 인공지능이에요", "무슨 인공지능 써", "LLM 뭐 써요", "엘엘엠 뭐 써",
"어떤 모델이야", "무슨 모델 써", "젬마 써요", "두뇌가 뭐예요", "무슨 AI 쓰노",
"what ai model 써", "ai model 뭐야", "어떤 llm 써", "무슨 ai model이야", "너 model이 뭐야", "너 brain이 뭐야",
],
"robot": [
"are you a real robot", "are you human or robot", "are you a human", "are you human or machine", "are you a living thing",
"are you a living being", "is someone inside you", "is there a human inside", "is a person controlling you",
"is someone remote controlling you", "who is controlling you", "is somebody driving you", "can you feel emotions",
"can you feel anything", "do you feel things", "do you feel pain", "do you have a heart", "do you have a soul",
"are you sentient", "are you self aware", "are you artificial intelligence", "are you an ai robot", "are you just a machine",
"are you a computer", "are you a toy", "are you real or fake", "r u a robot", "are u human", "are you a person or a robot",
"너 사람이니", "사람이에요", "사람이세요", "사람이야 로봇이야", "로봇이야 사람이야", "진짜 로봇이야", "진짜 로봇이니",
"너 진짜 로봇이야", "로봇 맞아", "로봇 맞아요", "로봇이니", "로봇입니까", "살아 있어요", "살아 있니", "살아 있는 거야",
"생명체야", "생물이에요", "안에 사람이 있어", "사람이 안에 있어요", "누가 조종하는 거야", "누가 조종하고 있어요", "원격 조종이에요",
"누가 움직이는 거예요", "감정이 있니", "감정을 느껴", "감정 느껴요", "기분을 느껴요", "아픔을 느껴요", "마음이 있어요",
"영혼이 있어", "의식이 있니", "너 AI야", "AI예요", "인공지능이에요", "인공지능 로봇이야", "기계야", "너 기계니", "장난감이야",
"사람이가", "사람이가 로봇이가", "로봇이가", "살아 있나", "니 사람이가", "사람이여", "감정 있나",
"너 robot이야", "너 human이야", "are you 사람", "너 진짜 robot이야", "feelings 있어", "emotion 있어요", "너 real robot이야",
],
"speed": [
"how fast can you drive", "how quickly can you move", "what is your maximum speed", "what's your speed limit",
"how fast do you drive", "how fast can you run", "how fast can you roll", "what speed do you go", "are you fast",
"how fast r u", "how fast are u", "how many meters per second can you go", "how many km per hour can you go",
"얼마나 빨리 달려", "얼마나 빨리 움직여요", "얼마나 빨라", "얼마나 빠르니", "속도가 얼마나 돼요", "속도는 얼마예요", "속도 몇이야",
"최고 속도가 얼마예요", "최대 속도는 몇이에요", "제일 빠르면 얼마나 가요", "빨리 갈 수 있어요", "빨라요", "시속 몇 킬로예요",
"초속 몇 미터예요", "얼마나 빨리 가노", "속도 얼마나 나오노", "your speed 얼마야", "너 max speed가 몇이야", "speed 얼마나 돼요",
],
"hello": [
"hello there", "hi lumi", "hey lumi", "hello hello", "hi hi", "hey hey", "heya", "hey robot", "hi robot",
"good morning lumi", "good evening lumi", "good afternoon lumi", "morning", "evening", "greetings", "hello everyone",
"nice to meet you lumi", "pleased to meet you", "glad to meet you", "hellooo", "hii", "heyy", "hullo", "hello?",
"안녕 루미", "안녕 루미야", "루미 안녕", "안녕", "안녕하세요 루미", "안녕하세요 루미 씨", "안녕하신가요", "안녕하십니까 루미",
"하이 루미야", "하이루", "하이요", "헬로 루미", "헬로우", "방가방가", "반갑다", "반갑습니다", "반가워 루미", "만나서 반가워",
"처음 뵙겠습니다 루미", "좋은 아침", "좋은 아침이야", "좋은 아침입니다", "좋은 저녁이에요", "굿모닝", "굿모닝 루미", "안냥",
"안녕하쇼", "안녕하능교", "안녕하셨어요", "어서 와", "여어", "hello 루미", "hi 루미야", "루미 hi", "안녕 hello",
],
"how_are_you": [
"how are you lumi", "how are you doing today", "how's your day", "how's your day going", "how is your day",
"are you doing well", "are you doing ok", "you okay", "you alright", "how do you feel today", "how are things",
"how have you been lumi", "what's up lumi", "how you doing", "how r u", "how are u", "hows it going",
"잘 지냈어", "잘 지냈니", "잘 지냈습니까", "잘 지내요", "잘 지내니", "잘 있었어", "잘 있었어요", "오늘 어때", "오늘 어때요",
"오늘 하루 어때요", "오늘 기분이 어때", "기분이 어때", "기분 좋아", "기분 어때요", "컨디션 어때", "컨디션 어때요", "괜찮니",
"별일 없어", "요즘 어떻게 지내", "요즘 어때요", "잘 지내고 있어요", "오늘 컨디션 괜찮아요", "잘 지냈나", "잘 있었나",
"how are you 루미", "컨디션 how", "how are you 오늘", "기분 how",
],
"no": [
# weight, height, age, maker, speed of other things: the LLM or a lookup
"how heavy is the ice cream robot", "how heavy is the candy ball robot", "how much does the barista robot weigh",
"how tall is the ice cream robot", "how big is the ice cream robot", "how fast is the ice cream robot",
"how fast is the candy ball robot", "how tall is the eiffel tower", "how tall is lotte tower", "how old is taylor swift",
"how old is the president", "how old is the ceo", "who made the iphone", "who invented the telephone",
"who made jaka robots", "what is jaka", "who made your camera", "who made your computer", "who made your wheels",
"how heavy is your gripper", "how heavy is your head", "how fast is your arm", "how old is your arm",
"how fast can a car go", "how heavy is an elephant", "how tall is son heung-min", "what's the name of this event",
"what's the name of this building", "what is the name of the ceo", "what's the name of the company",
"아이스크림 로봇 무게가 얼마예요", "아이스크림 로봇 얼마나 빨라요", "캔디볼 로봇 몇 초 걸려요", "에펠탑 높이가 얼마야",
"손흥민 키가 몇이야", "손흥민 몇 살이야", "아이폰 누가 만들었어", "대표 나이가 몇이에요", "대표님 이름이 뭐예요",
"이 건물 이름이 뭐예요", "이 행사 이름 뭐야", "회사 이름이 뭐예요", "그리퍼 누가 만들었어요", "카메라 누가 만들었어",
# the visitor about themselves
"what's my name", "do you know my name", "guess my name", "how old do you think i am", "guess how old i am",
"how tall do you think i am", "내 이름 뭐게", "내 이름 알아", "내가 몇 살 같아", "나 몇 살로 보여", "제 이름 아세요",
# questions that are not facts of Lumi
"what is your favorite color", "what's your favourite food", "do you like music", "do you like me",
"are you tired", "are you hungry", "are you happy", "are you bored", "are you sleepy", "do you sleep",
"where are we", "where am i", "where is the toilet", "what do you think about ai", "will robots take over the world",
"좋아하는 색이 뭐야", "좋아하는 음식 뭐예요", "음악 좋아해", "피곤해", "배고파", "행복해", "심심해", "잠 자", "여기 어디야",
"화장실 어디예요", "로봇이 세상을 지배할까", "battery level", "your battery level", "how much battery do you have",
"배터리 얼마나 남았어", "배터리 몇 프로야",
"emergency stop", "stop now", "stop", "멈춰", "그만",
# what Lumi is doing now (status), what it can do (abilities), slow speed, charging time: not these kinds
"what are you doing", "what are you doing now", "what are you doing robot", "what are you up to", "지금 뭐 해",
"뭐 하고 있어", "지금 뭐 하는 중이에요", "로봇아 지금 뭐 해", "뭐 할 줄 알아", "뭘 할 줄 아니", "뭐 할 수 있어요",
"how slow can you drive", "how slow can you go", "what's your slowest speed", "가장 느리게 가면 얼마야", "얼마나 천천히 갈 수 있어",
"완충하는 데 얼마나 걸려", "완충까지 몇 시간이에요", "how long does a full charge take", "how long to fully charge",
# a request and a question together: the rules or the LLM
"컵 주고 이름 알려 줘", "이리 오고 이름 말해 줘", "손 흔들고 이름 알려 주세요", "give me the cup and tell me your name",
"come here and tell me how old you are", "따라오고 나이 알려 줘",
# Cutshion and its people, not Lumi: the company notes
"who is cutshion's ceo", "when was cutshion founded", "where is cutshion", "what does cutshion make", "cutshion phone number",
"how do i contact cutshion", "쿳션 대표가 누구야", "쿳션 언제 생겼어요", "쿳션 어디 있어요", "쿳션 연락처 알려 줘",
"how old is cutshion", "쿳션 몇 년 됐어요", "is cutshion korean", "쿳션은 한국 회사예요",
"company make which robot", "what robots does the company make", "which robots does cutshion make",
"what does your company make", "회사는 어떤 로봇 만들어", "회사에서 무슨 로봇 만들어요", "쿳션은 뭐 만들어요",
# the birthday is not known (the age is)
"when is your birthday", "when's your birthday", "what's your birthday", "what day were you born", "생일이 언제야",
"생일이 언제예요", "생일 언제야", "너 birthday 언제야", "생일이 며칠이에요",
# a greeting with a question after it: the question decides
"안녕 루미 상 받은 거 있어", "안녕 루미 쿳션이 뭐야", "안녕하세요 화장실 어디예요", "안녕 루미 날씨 어때",
"안녕 오늘 뭐 해",
# not known: the battery's lifetime in years, being another company's robot
"battery 수명 몇 년이에요", "배터리 수명이 몇 년이에요", "배터리 몇 년 써요", "배터리 교체 주기가 어떻게 돼요",
"how many years does the battery last", "when does the battery need replacing", "너 자카 로봇이야", "자카 거야",
"jaka에서 만들었어", "are you a jaka robot", "are you made by jaka", "너 중국 회사 로봇 맞지", "hi lumi what is cutshion", "hello where is the toilet", "hi what's the weather",
"hey lumi did cutshion win any awards", "hello can you help me", "안녕하세요 질문 있어요", "hi i have a question",
],
}
# new kinds: (wordings, {"en": [answers], "ko": [answers]})
QUICK_KINDS = {
"internet": ([
"do you use the internet", "are you connected to the internet", "are you online", "do you need the internet",
"do you use the cloud", "are you using the cloud", "do you need the cloud", "do you work without internet",
"can you work offline", "can you go on the internet", "can you search the internet", "can you look things up online",
"인터넷 써요", "인터넷 연결돼 있어", "인터넷 돼요", "인터넷 없이도 돼요", "인터넷 검색할 수 있어요", "인터넷에 연결돼 있어요",
"클라우드 써요", "클라우드로 돌아가요", "클라우드 연결돼 있어", "오프라인으로도 돼요", "cloud 써요", "internet 돼요",
"인터넷으로 찾아볼 수 있어", "온라인이야",
], {"en": ["I think on my own computer, without the cloud. I use the internet only to look up the weather, the news and other facts.",
"My language model runs on the robot itself. The internet I use only for lookups: the weather, news and facts from Wikipedia and Google News."],
"ko": ["저는 클라우드 없이 제 컴퓨터에서 생각해요. 인터넷은 날씨, 뉴스, 그 밖의 정보를 찾아볼 때만 써요.",
"제 언어 모델은 로봇 안에서 돌아가요. 인터넷은 날씨나 뉴스, 위키백과 같은 정보를 찾을 때만 써요."]}),
"country": ([
"what country are you from", "which country are you from", "which country made you", "what country made you",
"are you from korea", "are you korean", "are you a korean robot", "are you made in korea", "were you made in korea",
"are you from china", "are you chinese", "are you a chinese robot", "are you made in china", "are you japanese",
"are you american", "is this robot korean", "where is this robot from", "what nationality are you",
"어느 나라에서 왔어", "어느 나라에서 왔어요", "어느 나라 로봇이야", "어느 나라 로봇이에요", "어느 나라에서 만들었어요",
"어느 나라 거예요", "어느 나라 제품이에요", "한국 로봇이야", "한국 로봇이에요", "한국에서 만들었어요", "국산이에요", "국산 로봇이야",
"중국 로봇이야", "중국 로봇이에요", "중국산이에요", "중국에서 만들었어요", "일본 로봇이에요", "미국 로봇이야", "국적이 어디예요",
"너 한국인이야", "메이드 인 코리아예요", "made in korea야", "너 korean robot이야", "너 어느 나라 robot이야", "중국 꺼야",
], {"en": ["I'm from Korea: Cutshion Company in Seoul developed me.",
"I'm a Korean robot. Cutshion Company, a robot company in Seoul, developed me."],
"ko": ["저는 한국에서 왔어요. 서울에 있는 쿳션이 저를 개발했어요.",
"저는 한국 로봇이에요. 서울의 로봇 회사 쿳션이 개발했어요."]}),
"computer": ([
"what computer do you use", "what computer do you have", "what's your computer", "what computer runs you",
"what hardware do you run on", "what processor do you have", "what chip do you use", "what gpu do you have",
"which computer is inside you", "what is your cpu", "do you use nvidia", "are you running on a jetson",
"what's inside you", "what kind of computer are you", "how powerful is your computer", "how much memory do you have",
"무슨 컴퓨터 써요", "어떤 컴퓨터 써", "컴퓨터 뭐 써요", "컴퓨터가 뭐예요", "어떤 컴퓨터가 들어 있어요", "무슨 칩 써요",
"GPU 뭐 써요", "그래픽카드 뭐야", "프로세서가 뭐예요", "엔비디아 써요", "젯슨이에요", "안에 뭐가 들어 있어요",
"메모리 얼마예요", "컴퓨터 성능이 어때요", "무슨 하드웨어로 돌아가요", "너 computer 뭐 써", "무슨 gpu야", "hardware 뭐 써요",
], {"en": ["My computer is an NVIDIA Jetson AGX Thor, with a Blackwell graphics processor, 14 cores and 122 GB of memory.",
"An NVIDIA Jetson AGX Thor with 122 GB of memory. It runs my speech recognition, my language model and my cameras, all on the robot."],
"ko": ["제 컴퓨터는 엔비디아 젯슨 AGX 토르예요. 블랙웰 그래픽 프로세서, 코어 14개, 메모리 122GB가 있어요.",
"엔비디아 젯슨 AGX 토르예요. 메모리는 122GB이고, 음성 인식, 언어 모델, 카메라를 모두 로봇 안에서 돌려요."]}),
"dof": ([
"how many joints do you have", "how many degrees of freedom do you have", "how many dof do you have",
"how many axes do you have", "how many motors do you have", "how many joints does your arm have",
"how many axes does your arm have", "how many parts can you move",
"관절이 몇 개야", "관절이 몇 개예요", "자유도가 몇이에요", "몇 자유도예요", "몇 축이에요", "팔이 몇 축이야", "팔 관절 몇 개예요",
"모터가 몇 개예요", "몸에서 움직이는 데가 어디예요", "너 dof 몇이야", "joint 몇 개야", "몇 축 로봇이에요",
], {"en": ["I have 12 degrees of freedom: the lift, the waist, two head joints, six arm joints and two drive wheels.",
"Twelve in all: my arm has six joints, my head two, then my waist, my lift and my two wheels."],
"ko": ["자유도는 모두 12개예요. 리프트, 허리, 머리 관절 두 개, 팔 관절 여섯 개, 바퀴 두 개예요.",
"모두 12축이에요. 팔이 6축, 머리가 2축이고, 허리, 리프트, 바퀴 두 개가 있어요."]}),
"estop": ([
"where is your emergency stop", "where's your emergency stop button", "where is the stop button", "how do i stop you",
"how can i stop you in an emergency", "do you have an emergency stop", "is there an emergency button",
"what if something goes wrong how do i stop you", "where is the red button", "how do we stop the robot",
"비상 정지 버튼 어디 있어요", "비상 정지 버튼이 어디야", "비상 버튼 어디 있어", "정지 버튼이 어디예요", "빨간 버튼 어디 있어요",
"어떻게 멈춰요", "위험할 때 어떻게 멈춰", "비상시에 어떻게 세워요", "비상 정지 있어요", "emergency stop 어디 있어요",
"e-stop 버튼 어디야", "비상 스톱 어디예요",
], {"en": ["There are red emergency stop buttons on my body and in my base. Pressing one stops my arm and my lift at once.",
"Press one of my red emergency stop buttons, on my body or in my base: my arm and lift stop at once. You can also just say \"stop\"."],
"ko": ["제 몸과 베이스에 빨간 비상 정지 버튼이 있어요. 누르면 팔과 리프트가 바로 멈춰요.",
"몸이나 베이스에 있는 빨간 비상 정지 버튼을 누르시면 팔과 리프트가 바로 멈춰요. \"멈춰\"라고 말씀하셔도 돼요."]}),
}
# slips, dialect and short forms heard in the blind rounds (the same meanings, other words)
_MORE = {
"name": [
"wat is ur naem", "whats yer name", "what's yer name", "you name what", "your name what", "what name do they give you",
"what name did they give you", "got a name", "got a name buddy", "what are they calling you", "name pls",
"이름이 뭐라 카노", "이름이 뭐라카노", "이름 머라 카노", "니 이름 뭐라꼬", "이름이 뭐임 너", "이름이 뭐지", "얘 이름이 뭐지",
"이름 뭐니 너", "이림이 뭐야", "일므이 뭐야", "이름이 머예요", "너 name 뭐야", "your name 알려 줘",
],
"who": [
"you are what thing", "what thing are you", "what's your deal what are you", "so what are you", "what are you anyway",
"넌 머야", "너 머야", "넌 머니", "너는 머임", "이건 뭐 하는 로봇이여", "뭐 하는 애니", "넌 무슨 로봇이고",
],
"age": [
"how old r u robot", "how many years old r u", "are you a baby robot", "are you a young robot",
"몇쌀이야", "몇 쌀이야", "멷 살이야", "몇 살 잡수셨어요", "연세가 어떻게 되십니까", "춘추가 어떻게 되세요", "나이가 몇 살이고",
"몇 살인데", "나이 좀 알려 줘", "너 나이 몇", "how old 너는",
],
"maker": [
"who made you robot", "who built you robot", "who's the maker of this robot", "which company makes you",
"어디서 만든 로봇입니까", "어디서 만든 로봇이에요", "어디서 만든 로봇이야", "이거 어디 회사 기고", "어데 회사 로봇이고",
"이거 누가 만들었노", "이 로봇 누가 만든 거예요", "어느 회사가 만들었어", "어디 거야 이 로봇", "who made 이 로봇",
],
"height": [
"키가 몃이야", "키가 몇이예요", "키 몇 쎈치야", "키 몇 센치야", "키 몇 센치예요", "높이가 얼마예요", "높이가 몇이에요",
"로봇 높이가 어떻게 돼요", "키 몇 미터야", "몇 미터예요 키가", "how high r you", "what's your height robot",
],
"weight": [
"몇 키로나 나가노", "몇 키로 나가", "몇 킬로나 나가요", "무게 머야", "무게가 머예요", "무게 얼마야 너", "중량이 얼마예요",
"몇 kg 나가요", "how heavy r u", "how many kilos do you weigh", "what's your weight robot",
],
"speed": [
"how fast are you robot", "how fast do you go", "how quick are you", "얼마나 빨리 다녀", "빠르기가 어때요", "속도 머야",
"몇 키로로 가요", "시속 몇이야",
],
"battery_life": [
"does your battery run out quickly", "how long do you keep going", "how long can you keep going on one charge",
"충전하면 얼마나 씁니까", "충전하면 얼마나 써", "사용 시간이 어떻게 돼요", "사용 시간이 얼마예요", "연속으로 얼마나 움직일 수 있어요",
"연속 사용 시간이 얼마예요", "한 번 충전에 몇 시간이나 버팁니까", "한 번 충전에 몇 시간 버텨요", "너 battery 얼마나 가",
"배터리 얼마나 가요 하루 종일 가요", "배터리 다 닳으려면 얼마나 걸려", "배터리 얼마나 오래 써요",
],
"languages": [
"can i talk to you in german", "can i speak to you in japanese", "do you understand every language",
"한국어 알아들어요", "한국말 알아들어", "한국어 알아듣니", "영어 돼요 너", "영어 되나", "사투리도 알아듣나", "사투리 알아들어요",
"외국말도 알아들어", "중국말 할 줄 아나",
],
"model": [
"do you use gemini", "are you gemini", "do you use llama", "are you claude", "is your ai from google",
"AI 뭐 들어 있어", "어떤 AI가 들어 있어요", "대화는 어떤 AI가 해", "대화는 무슨 AI로 해요", "무슨 AI로 대답해요",
"AI 뭐 써", "어떤 AI 들어가 있어",
],
"robot": [
"do you get sad", "do you get angry", "do you get lonely", "you have feeling", "you have feelings", "do you dream",
"can you dream", "꿈 꿔", "꿈 꿔요", "꿈을 꿔", "로봇도 감정이 있어요", "로봇도 감정 있어", "슬퍼할 줄 알아", "화낼 줄 알아",
"외로움 느껴", "너 살아 있어", "살아 있는 거 맞아", "생각할 줄 알아",
],
"no": [
"몇 년도에 세웠어", "언제 세웠어요", "언제 설립했어", "설립 연도가 언제예요", "회사 언제 세워졌어요",
"요즘 무슨 일 있어", "요즘 경제가 어때요", "요즘 경제 어때", "경기가 어때요", "요즘 뉴스 뭐 있어",
"how heavy can you lift", "can i lift you", "내가 너 들 수 있어", "are you taller than me", "are you taller than my dad",
"could you beat me in a race", "나랑 달리기 하면 누가 이겨", "who is faster you or me",
"로봇은 어디서 만들어요", "로봇은 어디서 만들어", "where are the robots made", "where is the factory", "공장이 어디예요",
"쿳션 공장 어디 있어요", "where does cutshion build its robots",
],
}
for _k, _v in _MORE.items():
QUICK.setdefault(_k, []).extend(_v)
QUICK_KINDS["used_where"] = ([
"where are you used", "where can you be used", "where do you work", "what places are you made for",
"what were you made for", "what were you built for", "who are you made for", "where would you be useful",
"어디에 쓰여요", "어디서 쓰는 로봇이에요", "어떤 데서 쓰라고 만들었어", "어디에 쓰려고 만들었어요", "어디서 일해요",
"어떤 곳에서 써요", "무슨 용도로 만들었어요", "용도가 뭐예요", "어디에 쓸 수 있어", "너 용도가 뭐야", "어디서 쓰는 거야",
], {"en": ["I'm made for shops, hotels, schools, labs and exhibitions.",
"Places like shops, hotels, schools, research labs and exhibitions, where I greet, guide and help people."],
"ko": ["저는 상점, 호텔, 학교, 연구실, 전시회에서 쓸 수 있게 만들어졌어요.",
"상점, 호텔, 학교, 연구실, 전시회 같은 곳에서 사람들을 맞이하고 안내하고 도와요."]})
QUICK_KINDS["stt"] = ([
"how do you understand speech", "how do you understand what i say", "what speech recognition do you use",
"what do you use for speech recognition", "how do you hear words", "what turns my voice into text",
"do you use whisper", "what's your speech to text", "how do you recognise speech",
"말 알아듣는 건 뭘로 해요", "말은 어떻게 알아들어요", "음성 인식 뭐 써요", "음성 인식은 뭘로 해", "음성 인식 엔진이 뭐예요",
"말을 어떻게 알아듣니", "목소리를 어떻게 글로 바꿔요", "위스퍼 써요", "speech recognition 뭐 써요", "STT 뭐 써",
], {"en": ["I turn speech into text with Whisper, the large-v3-turbo model, running on my own computer.",
"With Whisper: it runs right here on my NVIDIA computer and writes down what you say."],
"ko": ["말소리는 위스퍼(Whisper) large-v3-turbo 모델로 글자로 바꿔요. 제 컴퓨터에서 직접 돌아가요.",
"위스퍼라는 음성 인식 모델로 알아들어요. 제 엔비디아 컴퓨터에서 돌아가요."]})
QUICK_KINDS["reply_time"] = ([
"how fast do you answer", "how quickly can you respond", "how quickly do you reply", "how long do you take to answer",
"how fast do you respond to a question", "how long until you answer", "what's your response time",
"얼마나 빨리 대답해요", "대답하는 데 얼마나 걸려요", "대답 속도가 어때요", "답하는 데 몇 초 걸려", "반응 속도가 얼마예요",
"말하면 얼마 만에 대답해요", "response time 얼마야",
], {"en": ["My first words come about two seconds after a question.",
"About two seconds: that's when my first words come after you ask."],
"ko": ["질문하시고 약 2초 뒤에 첫마디가 나와요.", "대답은 질문 후 약 2초 안에 시작해요."]})
QUICK["no"] += [
"몇 센티 오차예요", "오차가 몇 센티야", "위치 오차가 얼마예요", "how accurate is your position", "how precise is your map position",
"how accurate is your arm", "팔 정확도가 얼마예요", "반복 정밀도가 얼마예요", "what's your repeatability",
]
QUICK_KINDS["tts"] = ([
"what text to speech do you use", "what text-to-speech do you use", "what's your tts", "how do you speak",
"how do you make your voice", "what voice engine do you use", "where does your voice come from", "what makes your voice",
"목소리는 뭘로 내요", "음성 합성 뭐 써요", "TTS 뭐 써", "목소리 어떻게 만들어요", "말소리는 어떻게 내요", "너 목소리 뭐야",
], {"en": ["I speak with a text-to-speech engine called Supertonic, through my speaker.",
"My voice comes from Supertonic, a text-to-speech engine running on my own computer."],
"ko": ["슈퍼토닉(Supertonic)이라는 TTS로 목소리를 내요.", "제 목소리는 슈퍼토닉이라는 음성 합성 엔진으로 만들어요."]})
QUICK_KINDS["mics"] = ([
"how do you hear me", "what do you hear with", "how many microphones do you have", "do you have microphones",
"where are your microphones", "how far can you hear", "can you tell where a voice comes from",
"소리는 무엇으로 들으십니까", "소리는 뭘로 들어요", "마이크 몇 개예요", "마이크 있어요", "마이크가 어디 있어", "얼마나 멀리서 들려요",
"귀가 어디야", "어떻게 들어요", "소리 어떻게 들어",
], {"en": ["I hear with a ring of six microphones in my head, from about 3 to 5 metres away, and I can tell where a voice comes from.",
"Six microphones in my head: they hear people 3 to 5 metres away and tell me which direction a voice comes from."],
"ko": ["머리에 있는 마이크 6개로 들어요. 3에서 5미터 거리까지 듣고, 목소리가 어느 쪽에서 오는지도 알 수 있어요.",
"머리에 마이크가 6개 있어요. 3~5미터 떨어진 목소리를 듣고 방향도 알아요."]})
QUICK["no"] += ["can you hear me", "do you hear me", "들려", "내 말 들려요", "제 말 들리세요", "hello can you hear me",
"are you listening", "듣고 있어"]
QUICK["no"] += [
# orders that sound like these questions: the rules or the LLM, never a fact
"키 줄여 줘", "키 다운 해 줘", "키 업 해 줘", "키를 올려 보시오", "키 좀 높여 줘", "키 올려", "키 내려", "키 낮춰 줘", "키 키워 줘",
"robot stretch up tall", "robot more tall please", "grow taller", "get taller", "be shorter", "stretch up",
"몸 올려요 로봇", "몸 내려요 로봇", "몸 올려", "몸 내려", "손 좀 내밀어 주세요", "손 내밀어", "손 줘",
"hey robot wave like a person", "wave like a human", "hello robot follow follow", "hi lumi follow me", "hello lumi come here",
"안녕 루미 이리 와", "루미야 루미야 그만해요", "그만해요", "그만해", "기분이 다운됐어", "나 기분 안 좋아",
"how much longer will you wait", "how long are you waiting", "how long will you wait", "what's the job", "what's your task now",
"introduce yourself then turn to your left", "자기소개하고 왼쪽 봐", "고개 숙이고 이름 알려 줘", "오른쪽 보고 나이 말해 줘",
]
+484 -103
View File
File diff suppressed because it is too large Load Diff
+43 -9
View File
@@ -13,31 +13,56 @@ from assistant import brain, steps
QUICK = {"look", "lift", "wave", "arm", "go_to", "come", "come_back", "follow", "move", "turn", "pick", "put", "move_object"}
DRIVES = {"go_to", "come", "come_back", "follow", "move", "turn"} # after a failed step these depend on where Lumi is
_KO_ORDER = {"보": "봐", "흔들": "흔들어", "돌": "돌아", "올리": "올려", "내리": "내려", "높이": "높여", "낮추": "낮춰",
"들": "들어"} # "나 보고 ..." -> "나 봐", "고개 들고 ..." -> "고개 들어"
ASK = re.compile(r"\?\s*$|^\W*(?:what|what'?s|where|when|who|why|how|which|is|are|do|does|did|tell me|explain|describe)\b|"
r"몇 ?시|몇|뭐|무엇|어때|알려|언제|어디|누구|왜|얼마|날씨|설명해|말해 ?줘|얘기해", re.I)
_KO_ORDER = {"보": "봐", "흔들": "흔들어", "흔드": "흔들어", "돌": "돌아", "도": "돌아", "올리": "올려", "내리": "내려",
"높이": "높여", "낮추": "낮춰", "들": "들어", "드": "들어", "숙이": "숙여", "커지": "커져", "작아지": "작아져",
"낮아지": "낮아져", "높아지": "높아져", "돌리": "돌려", "오": "와", "따라오": "따라와", "가": "가"}
# "나 보고 ..." -> "나 봐", "고개 들고 ..." -> "고개 들어", "저를 보시고 ..." -> "저를 봐", "왼쪽으로 도시고" -> "왼쪽으로 돌아"
_KO_AND = re.compile(r"(" + "|".join(sorted(_KO_ORDER, key=len, reverse=True)) + r")(?:시)?고$")
ASK = re.compile(r"\?\s*$|^\W*(?:(?:also|and|then|so|ok|okay|robot|please|first|now|plus|oh|ah|um|uh|lumi)\W+)*"
r"(?:(?:what|where|when|who|why|how|which)(?:'s|'re|\s+(?:is|are|was|were|do|does|did|can|could|will|"
r"would|should|time|day|date|year|old|much|many|far|long|about|kind|your|you|made|built|created|"
r"invented|owns|makes)\b)|why\b|is|are|do|does|did|tell me|explain|describe)\b|"
r"\b(?:tell|telling) (?:me|us)\b|\bintroduce yourself\b|\b(?:say|tell me) your name\b|"
r"몇 ?시|몇|뭐|무엇|어때|알려|언제|어디|누구|왜|얼마|날씨|설명해|말해 ?줘|말하|얘기해|소개", re.I)
_SPLIT = re.compile(steps._SPLIT.pattern, re.I)
FETCHING = re.compile(r"\b(?:bring|fetch|deliver|carry)\b|가져|갖다", re.I) # a part that carries something somewhere
_FILL = re.compile(rf"(?:{steps._FILL}|루미야?|lumi|hey|do me a favou?r|부탁(?:해|해요|할게)?|dear|sir|ma'?am|madam|buddy|"
r"my friend|robot|로봇아?|선생님?)", re.I)
r"my friend|robot|로봇아?|선생님?|yo|bro|dude|okay lumi|ok lumi|robot please|루미 ?씨|로봇 양반|여보세요|"
r"go ahead|okay\?|ok\?|right\?|thanks|thank you|yes|yeah|yep|yes\?|네|응|그래|will ya|will you|won'?t you|"
r"can\?|can|do it|do it now|just do it|alright\?|please\?|혹시|아 뭐라 그래야 되지|뭐라 그래야 되지|뭐더라|"
r"(?:아\s*)?영어로 ?뭐더라|(?:아\s*)?뭐라고 ?하지|"
r"(?:거기서?\s*)?(?:서|가만히)\s*있(?:어|게|으세요|으십시오)\s*(?:줄래|줄 ?수 ?있어요?|주실래요|주세요|줘|줘잉|주라|"
r"주면 ?안 ?될까요?|주면 ?좋겠어요?|주실 ?수 ?있어요?|주십시오|주이소)?|"
r"(?:거기서?\s*)?기다려\s*(?:줄래|주세요|줘)?)", re.I) # tags, hesitations, "...가서 서 있어 줄래?"
RELATIVE = re.compile(r"^\W*(?:where|which|who|that|when)\s+(?:the|my|your|his|her|our|their|a|an|this|that|these|those|"
r"people|everyone|it|he|she|they|we|i)\b", re.I) # "look right, where the door is": no question
PAST = re.compile(r"\byou (?:got|went|were|did|turned|looked|moved|came|said|told)\b|\b(?:earlier|before|yesterday)\b", re.I)
BANK_KINDS = {"look", "lift", "turn", "move", "come", "come_back", "follow", "wave", "arm", "go_to"} # a part the
# keyword rules miss, read by the intent bank (same slot rules)
CHAIN_ONLY = {"look", "lift", "wave", "come", "come_back", "follow"} # a part that is no mission step: with one in it,
# a sentence the mission reader reads whole is still a chain
def _rule(words, markers):
"""brain.intent of a part, also of a Korean -고 form ("나 보고" read as "나 봐")."""
rule = brain.intent(words, markers)
if not rule:
ko = re.sub(r"(보|흔들|돌|올리|내리|높이|낮추|들)고$", lambda m: _KO_ORDER[m.group(1)], words)
rule = brain.intent(ko, markers) if ko != words else None
ko = _KO_AND.sub(lambda m: _KO_ORDER[m.group(1)], words.strip())
if not rule and ko != words.strip():
rule = brain.intent(ko, markers)
m = not rule and re.fullmatch(r"(?:(나|저|날|나를|저를)\s+)?([a-z][a-z ]*?)\s*(?:하고|해|해요|해 ?줘)?", words.strip())
if m: # Konglish: "나 look 하고" -> "look at me", "wave 해" -> "wave"
en = m.group(2) + ((" at me" if m.group(2) == "look" else " me") if m.group(1) else "")
rule = brain.intent(en, markers)
if not rule and len(words.split()) > 1 or not rule and re.search(r"[가-힣]", words):
from assistant import intent_bank # "glance to your right", "고개 숙이고": the bank, by meaning
got = intent_bank.read(ko, markers)
rule = got if got and got[0] in BANK_KINDS else None
return rule
def parts(text):
"""The sentence cut at and / then / 그리고 / -고 / -서, messages to say kept whole, fillers and the name dropped."""
text = re.sub(r"(?<![\w가-힣])([\w가-힣]+)[—–-]+\s*(?=\1)", "", text) # a stutter: "go ah— ahead", "센— 센티"
cut, says = steps._cut_says(text)
cut = re.sub(r"(?<=[가-힣])고\s*나서(?=[\s,]|$)", "고", cut) # "-고 나서" = "-고"
out = []
@@ -49,9 +74,16 @@ def parts(text):
def plan(text, markers=(), cant=None):
"""See the module's doc. cant: a regex of orders Lumi can't do ("dance", "jump"): answered, the rest done."""
from assistant import intent_bank
if brain.held_back(text) or PAST.search(text) or intent_bank.TAG.search(text) or intent_bank.PAST_EN.search(text) or intent_bank.past_ko(text):
return None # "so you got shorter, didn't you?": talk about it, no order
if re.search(r"(?:^|[\s,.!?—–-])(?:no,? no|아니(?:야|요|지)?|아 ?아니|i mean|sorry|correction|oops|actually|잘못 말했다)"
r"(?=[\s,.!?—–:-]|$)", text, re.I):
return None # a correction: the last thing said counts (brain.self_correct)
text = re.sub(r"\bhundred and (?=\w)", "hundred ", text, flags=re.I) # "a hundred and twenty degrees": one number
ps = parts(text)
whole, unread = steps.rules(text, markers)
if len(ps) < 2 or whole and not unread:
if len(ps) < 2 or whole and not unread and not any((_rule(p, markers) or ("",))[0] in CHAIN_ONLY for p in ps):
return None # one command, or a mission read whole
rule = brain.intent(text, markers) or ("", "")
if rule[0] == "look" and rule[1].endswith(f" {brain.HEAD_YAW[1]:g}"):
@@ -66,6 +98,8 @@ def plan(text, markers=(), cant=None):
return None # "go to the exit and bring an orange back": a fetch, whole
elif rule and rule[0] in QUICK:
out.append(["quick", p, rule])
elif RELATIVE.search(p):
return None # a part that tells more about the one before
elif ASK.search(p) or rule and rule[0] in ("weather", "search") or cant is not None and cant.match(p):
out.append(["talk", p, None])
else:
+55 -18
View File
@@ -35,9 +35,11 @@ NEAR_THING = re.compile(r"(?:테이블|책상|탁자|의자|소파|문|벽|창
r"(?<![가-힣])(?!(?:루미야?|조금만?|살짝|다시|그냥|이제|저기요?|여기|거기|약간|천천히|빨리|얼른|어서|그럼|근데|"
r"그리고|좀|더|한|두|세|반|쭉|바로|똑바로|계속|한번|한 번|일단|먼저|자|아주|많이|쪼끔|쬐끔|요만큼|뼘|걸음|발짝|발자국|미터|센티|센치|밀리)만?(?:\s|$))(?:[가-힣][가-힣_]{0,9}|(?<![a-z0-9_.])(?!(?:m|cm|mm|lumi|loomi|rumi|hey|ok|okay|please)\b)[a-z][a-z0-9_]*)\s*"
r"(?:앞|옆|뒤)(?:으?로|쪽|에)") # "테이블 앞으로", "무대 앞으로 가": to that thing or place, not forward
OTHER = re.compile(r"\b(?:look|head|turn|spin|rotate|face|arm|hand|lift|raise|lower|it|this|that|them|those|these|here|there|"
OTHER = re.compile(r"(?<![a-z])(?:look|head|turn|spin|rotate|pivot|swing|swivel|twist|waist|torso|clockwise|counterclockwise|face|arm|"
r"hand|lift|raise|허리|상체|몸통|윗몸|"
r"lower|it|this|that|them|those|these|here|there|"
r"home|me|us)\b|\bthe (?!left\b|right\b)|\bgo (?:right )?ahead\b|\bback to (?![\d.])|\b[a-z]+\d+\b|\b[a-z]+(?:_[a-z0-9]+)+\b|고개|머리|팔|손|돌아|돌려|봐|보(?:세요|십시오|시오|실래요|자|라|아|여)|볼래|쳐다|들어|올려|내려|"
r"여기|저기|이리|집|\S(?:을|를)(?=\s)|도십시오|도세요|회전|\d+(?:\.\d+)? ?도(?:만|쯤|정도|가량)?(?=\s|$)|" + NEAR_THING.pattern)
r"여기|저기|이리|집|\S(?:을|를)(?=\s)|도십시오|도세요|회전|틀어|(?:^|\s)바(?=\s|$|요)|\d+\s*(?:°|degs?\b|degrees?\b|derees?\b)|\d+(?:\.\d+)? ?도(?:만|쯤|정도|가량)?(?=\s|$)|" + NEAR_THING.pattern)
# the head, an object, a place
# (p3, dock2, booth_9: a marker as written): not a short drive
SAYER = re.compile(r"\b(?:i|i'm|im|i'll|i've|we|we're|he|she|they|there|it's|it is|my|our|his|her|their|was|were|"
@@ -45,7 +47,7 @@ SAYER = re.compile(r"\b(?:i|i'm|im|i'll|i've|we|we're|he|she|they|there|it's|it
_NATIVE = {"한": 1, "두": 2, "세": 3, "네": 4, "다섯": 5, "여섯": 6, "일곱": 7, "여덟": 8, "아홉": 9, "열": 10,
"a": 1, "an": 1, "half": 0.5, "반": 0.5}
_COUNT = rf"(\d+(?:\.\d+)?|{'|'.join(_NATIVE)})\s*(?:a\s+)?"
STEPS = re.compile(rf"(?:(?<![\w.]){_COUNT}\s*)?(?:steps?|paces?|걸음|발짝|발자국)(?![a-z])")
STEPS = re.compile(rf"(?:(?<![\w.]){_COUNT}\s*)?(?<![a-z])(?:steps?|paces?|걸음|발짝|발자국)(?![a-z])") # not "sidestep"
SPANS = re.compile(rf"(?:(?<![\w.]){_COUNT}\s*)?뼘")
TINY = re.compile(r"\b(?:tiny|teeny|wee|hair|hairs?breadth|smidge|smidgen|tad|touch|nudge|slightly|little tiny)\b|"
r"\bfew (?:centimet(?:er|re)s|cm)\b|\binch (?:forward|back|left|right|ahead)|"
@@ -59,11 +61,12 @@ NUM_WORD = re.compile(r"\b(?:eleven|twelve|thirteen|fourteen|fifteen|sixteen|sev
KO_NUM_WORD = re.compile(r"(?<![가-힣])(?:하나|둘|셋|넷|다섯|여섯|일곱|여덟|아홉|열|스물|서른|마흔|쉰)(?:만|쯤|정도)?(?![가-힣])")
# "앞으로 다섯만 가": a count with no unit, asked
KO_COUNT = re.compile(KO_NUM_WORD.pattern + r"|(?<![가-힣])[이삼사오육칠팔구]?[십백][일이삼사오육칠팔구]?(?:만|쯤|정도)?(?![가-힣])|"
r"(?<![\w.])\d+(?:\.\d+)?(?![\d.])(?!\s?(?:m|도|degrees?|°)(?![a-z]))") # a number with no unit
r"(?<![\w.])\d+(?:\.\d+)?(?![\d.])(?!\s?(?:m|도|degrees?|degs?|derees?|°)(?![a-z]))") # a number with no unit
WRONG_UNIT = (re.compile(r"(?<![\w.])\d+(?:\.\d+)? ?(?:도|degrees?)(?:만|쯤|정도|가량)?(?![가-힣a-z])"), # degrees for a drive
re.compile(r"(?<![\w.])\d+(?:\.\d+)? m(?![a-z])")) # metres for a turn
TURN_WORD = re.compile(r"\b(?:turn|spin|rotate|pivot)\b|돌아|돌려|돌(?:까|래|면)|회전|도세요|도십시오")
NOT_BASE = re.compile(r"\b(?:look|head|face|lift|arm)\b|고개|머리|얼굴|봐|보세요|리프트|팔|손")
NOT_BASE = re.compile(r"\b(?:look|head|face|lift|arm|waist|torso|torrso|upper body|hips?|twist)\b|고개|머리|얼굴|봐|보세요|리프트|팔|손|"
r"허리|상체|몸통|윗몸") # the head, the arm, the waist: not the base
FASTER = re.compile(r"\b(?:faster|quicker|speed (?:it )?up|pick up (?:the )?(?:pace|speed)|step on it|hurry(?: up)?|"
r"get a move on|more speed|full speed|go quick(?:ly)?|too slow(?:ly)?|so slow(?:ly)?|"
@@ -71,7 +74,7 @@ FASTER = re.compile(r"\b(?:faster|quicker|speed (?:it )?up|pick up (?:the )?(?:p
SLOWER = re.compile(r"\b(?:slower|slow (?:it )?down|slow|ease (?:off|up)|not so fast|too fast|"
r"so fast|less speed|gently|more slowly|slowly)\b|"
r"천천히|느리게|(?:속도|speed)\s*(?:를|좀)?\s*(?:좀\s*)?(?:줄|낮|늦)\S*|빨라|빠르다|살살")
_FILLER = (r"please|pls|lumi|hey|hi|okay|ok|so|um+|uh+|well|now|then|just|can|could|would|will|you|you're|youre|"
_FILLER = (r"please|pls|lumi|robot|yo|hey|hi|okay|ok|so|um+|uh+|well|now|then|just|can|could|would|will|you|you're|youre|"
r"are|is|going|moving|driving|go|drive|move|"
r"keep|going|get|it|the|a|an|bit|little|tiny|notch|touch|tad|lot|much|way|even|bit|slightly|somewhat|"
r"more|than|that|this|let's|lets|try|be|bit\.|maybe|yeah|yes|alright|right|bro|man|too|really|"
@@ -79,16 +82,23 @@ _FILLER = (r"please|pls|lumi|hey|hi|okay|ok|so|um+|uh+|well|now|then|just|can|co
r"줄래\?|주실래요|주시겠어요|해|해줘|해요|해 ?줘|움직여|요|좀더|조금더|자|볼래|봐|볼까|좀만|해봐")
FILL = re.compile(rf"(?:^|\s)(?:{_FILLER})(?=\s|$)")
AGAIN = re.compile(r"^(?:(?:just|a|an|bit|little|tiny|some|even|one|1|once|the|same|do|it|that|go|please|lumi|ok|"
r"okay|yeah|yes|and|then|now)\s+)*(?:more|again|once more|one more time|same again|"
r"the same again|more please|again please|1 more time)(?:\s+(?:please|lumi|then))?$|"
r"^(?:루미야\s+)?(?:조금만?|좀|살짝|약간|한 ?번|1 ?번|아까처럼|똑같이)?\s*더"
r"(?:\s*(?:가|해|가 ?줘|해 ?줘|가요|해요|가 ?주세요|해 ?주세요))?$|^한 ?번 ?더|^똑같이(?: 해| 한 ?번)?")
r"okay|yeah|yes|and|then|now|robot|yo|hey)\s+)*(?:more|again|once more|one more time|same again|"
r"the same again|more please|again please|1 more time)(?:\s+(?:please|lumi|then|again|more))*$|"
r"^(?:(?:루미야?|루미 ?씨|로봇아?|야)\s+)?(?:조금만?|좀|살짝|약간|한 ?번만?|1 ?번|아까처럼|똑같이)?\s*더"
r"(?:\s*(?:가|해|가 ?줘|해 ?줘|가요|해요|가 ?주세요|해 ?주세요))?$|"
r"^(?:(?:루미야?|루미 ?씨|로봇아?|야)\s+)?(?:한 ?번만? ?더|똑같이(?: 해| 한 ?번)?|또 ?(?:해|해 ?줘|해 ?봐)|"
r"다시(?: ?(?:해|가|해 ?줘|가 ?줘|해 ?봐|해요|가요|한 ?번)){0,2})(?:\s+(?:해|해 ?줘|가|요))?$")
# ^ "again again", "또 해!", "루미, 한번 더!", "한 번만 더", "다시 가": the command just before once more
DIR_ONLY = re.compile(r"^(?:(?:lumi|robot|루미야?|now|ok|okay|and|then|please|이번엔|이제|이번에는|now)\s+)*"
r"(?:(?:a )?(?:little|bit|tad)\s+)?(left|right|up|down|왼쪽|오른쪽|위|아래|위쪽|아래쪽|밑)"
r"(?:으로|로|쪽|쪽으로|에)?(?:\s+(?:a little|a bit|now|please|more|again|더|좀|요|lumi))*$")
# right after a look, only a way said ("왼쪽", "위로", "Lumi, left now"): the head that way
LOOK_MORE = re.compile(r"^(?:(?:look|at|to|the|your|side|a|bit|little|tiny|more|again|further|please|lumi|and|then|now|"
r"once|one|time|okay|ok|left|right|up|down|루미야|좀|조금|조금만|더|약간|살짝|한|번|한번|다시|봐|봐요|봐줘|"
r"줘|주세요|요|(?:왼쪽|오른쪽|위|아래)(?:으로|로|쪽|쪽으로|을|를)?)(?:\s+|$))+$")
# right after a look, only these words with a "more" / "again" in them: the head a step further that way
LESS = re.compile(r"^(?:(?:a|bit|little|just|a little|a bit)\s+)*less(?: please)?$|^(?:좀|조금)?\s*덜$")
JOINED = re.compile(r"\b(?:and|then|after that|and then)\b|그리고|하고|해서|가서|다음에|집어|가져")
JOINED = re.compile(r"\b(?:and|then|after that|and then)\b|그리고|하고|해서|가서|가고|보고|돌고|다음에|집어|가져")
def clean(t):
@@ -96,7 +106,10 @@ def clean(t):
def direction(t):
"""The way said; "not left. right." is right (a direction said with "not" is not meant)."""
"""The way said; "not left. right." is right (a direction said with "not" is not meant); "uh, so, right, come
to where I am": "right" as "okay" is no way."""
t = re.sub(r"(?:^|\b(?:so|okay|ok|uh|um|yeah|well|and|oh|alright)\s+)right\s+(?=(?:come|go|look|turn|so|now|then|i|you|we|"
r"let'?s|lumi)\b)", " ", t)
t = re.sub(r"\bnot (?:to the |to your )?(?:left|right|forward|back(?:wards?)?)\b|(?:왼쪽|오른쪽|앞|뒤)(?:으로|쪽)? ?말고", " ", t)
found = [(m.start(), d) for d, rx in DIRS for m in [re.search(rx, t)] if m]
return min(found)[1] if found else None
@@ -115,12 +128,16 @@ def amount(t):
if TINY.search(t):
return TINY_M, False
for rx, unit in ((STEPS, STEP_M), (SPANS, SPAN_M)):
m = rx.search(t)
ms = list(rx.finditer(t))
m = next((x for x in ms if x.group(1)), ms[0] if ms else None) # "step back two steps": the counted one
if m and not m.group(1) and re.search(r"(?<![a-z\d.])\d", t):
return "?", False # "step to the right 5": the number has no unit
if m and not re.search(r"\b(?:few|couple|several|some)\b", t):
n = m.group(1)
return (float(n) if n and n[0].isdigit() else _NATIVE.get(n, 1)) * unit, False
if re.search(r"(?<![\w.])\d", t) or NUM_WORD.search(t) or KO_NUM_WORD.search(t):
return "?", False # "move back 20", "two feet", "a couple of metres"
if re.search(r"(?<![a-z\d.])\d", t) or NUM_WORD.search(t) or KO_NUM_WORD.search(t):
return "?", False # "move back 20", "two feet", "a couple of metres",
# "오른쪽으로30가게"
if LITTLE.search(t):
return LITTLE_M, False
return None, False
@@ -144,6 +161,10 @@ def move(t, verb_needed=True):
def speed(t):
"""+1 (faster) / -1 (slower) when the whole sentence asks for a speed change, else 0."""
t = clean(t)
for m in re.finditer(r"(?:^|(?<=[\s,.!?]))(?:줘|주세요|줘요|내놔)(?=[\s,.!?~]|$)", t):
before = re.findall(r"[^\s,.!?~]+", t[:m.start()])
if not before or before[-1] in ("이리", "여기", "나", "저", "나한테", "저한테", "그거", "이거", "빨리", "얼른", "어서", "좀"):
return 0 # "줘. 빨리.", "빨리 줘": give it, quickly (the hand's)
too = re.search(r"\b(?:too|so|way too) (fast|slow)\b|(?:너무|넘) ?(빨라|느려)", t)
if too:
sign = -1 if too.group(1) == "fast" or too.group(2) == "빨라" else 1
@@ -168,15 +189,27 @@ def read(t, last=None, talking=False):
s = 0 if asked else speed(t) # "really? that slow?": a reaction, not an order
if s:
return ("speed", s)
way = re.fullmatch(r"(?:(?:음|뭐더라|음 뭐더라|좀|조금|살짝|a bit|a little|now|please|lumi|루미야)\s+)*(?:더\s*)?"
r"(lower|higher|내려|숙여|올려|들어|낮춰|높여)(?:\s*(?:줘|주세요|봐|더|please|more))*", t)
if last and last[0] in ("look", "lift") and way: # "lower", "더 내려" right after a look / lift: further that way
d = "down" if way.group(1) in ("lower", "내려", "숙여", "낮춰") else "up"
return (last[0], f"{d} small")
if last and last[0] == "look" and DIR_ONLY.match(t) and not re.search(r"\b(?:more|again)\b|더", t):
d = DIR_ONLY.match(t).group(1)
d = {"왼쪽": "left", "오른쪽": "right", "위": "up", "위쪽": "up", "아래": "down", "아래쪽": "down", "밑": "down"}.get(d, d)
return ("look", d + (" small" if re.search(r"\b(?:little|bit|tad)\b|좀", t) else ""))
if last and last[0] == "look" and LOOK_MORE.match(t) and re.search(r"\b(?:more|again|further)\b|더|다시|한 ?번", t):
side = re.search(r"\b(left|right|up|down)\b|(왼쪽|오른쪽|위|아래)", t) # "more again", "look at more", "왼쪽으로 더"
d = {"왼쪽": "left", "오른쪽": "right", "위": "up", "아래": "down"}.get(side.group(2), side.group(1)) if side else None
return ("look", f"{d or last[1].split()[0]} small")
d = d or last[1].split()[0]
return ("look", f"{d} small") if d in ("left", "right", "up", "down") else None # "more" after "look at me"
if AGAIN.search(t) or LESS.search(t):
if last is None:
return None if talking else ("ask", "") # "more" of what?
if LESS.search(t):
return ("speed", -1) if last[0] == "speed" else None
if last[0] == "look" and last[1] in ("me", "center", "away"):
return None # "again" after "look at me": no step further that way
if last[0] == "turn" and re.search(r"\b(?:more|bit|little)\b|조금|좀|살짝|약간", t) and \
not re.search(r"\bagain\b|한 ?번|똑같이|아까처럼|(?:one|1) more time|once more", t):
side = last[1].split()[0] # "a bit more" after "turn left": a little further
@@ -219,6 +252,9 @@ def last_command(history):
m = re.match(r"ACTION: (look|lift) (left|right|up|down)\b", history[-1][1] or "")
if m: # "look left" then "one more": a little further that way
return (m.group(1), f"{m.group(2)} small")
m = re.match(r"ACTION: look (me|center|away)\b", history[-1][1] or "")
if m: # "look at me" then "up": a way said after a look
return ("look", m.group(1))
m = re.match(r"ACTION: (move|speed|turn) (\S+)(?: (\S+))?", history[-1][1] or "")
if not m:
return None
@@ -230,8 +266,9 @@ def last_command(history):
def talking(history):
"""The turn before was conversation (not a command): a bare "more" belongs to it."""
return bool(history) and bool(re.match(r"ACTION: none\b|(?!ACTION:)", history[-1][1] or ""))
"""The turn before was conversation or another command (a song, a wave, a trip): a bare "more" / "again"
belongs to it, not to a drive."""
return bool(history) and not re.match(r"ACTION: (?:move|turn|speed|look|lift)\b", history[-1][1] or "")
def spoken(m, lang="en"):
+90 -46
View File
@@ -12,7 +12,6 @@ with two meanings, a question word. A wrong motion is the worst error, so motion
.venv/bin/python assistant/intent_bank.py build # embed the bank -> data/intent_bank.npz
.venv/bin/python assistant/intent_bank.py "say hi with your arm" # what the bank reads, with the closest wordings
"""
import hashlib
import pathlib
import random
import re
@@ -25,8 +24,10 @@ ROOT = pathlib.Path(__file__).resolve().parents[1]
CACHE = ROOT / "data" / "intent_bank.npz"
SIM_MIN = 0.84 # the closest wording must be at least this similar (bge-m3 cosine) ...
MARGIN = 0.04 # ... and this much closer than the closest wording of any other kind (the "no" kind too)
MARGIN_WORDS = 0.015 # ... or this much, when the other kind is another motion whose words are not there ("턴 left
# 해 줘": turn, a move's slot finds no drive in it) and the closest kind's words are
AGREE_K = 2 # ... and the K closest wordings all of that kind
MIN_CHARS = 4 # shorter words ("go", "가") are the rules' or the LLM's
MIN_CHARS = 4 # shorter words ("go", "가") are the rules' or the LLM's (a Hangul syllable counts as 2)
MAX_WORDS = 16 # a longer sentence is a story or several requests: the LLM reads it
FILLS = 3 # place / object fills made of each template (the same every run)
@@ -50,7 +51,7 @@ WONDER = re.compile(r"\bi wonder\b|\bwonder(?:ing)? (?:if|whether|how)\b|\bi bet
# "can it wave? I wonder", "does it follow people?", "이거 손 흔들 수 있나?", "얘 따라오나 봐"
NOT_TO_LUMI = re.compile(
r"\bshall we\b|\bwe(?:'re| are) (?:heading|going|off|gonna)\b|\bwe (?:should|could|can|will|might|must|need to)\b|\bwe'll\b|"
r"\byou and (?:i|me)\b|\bmy plan\b|\bour plan\b|우리.*(?:자|까|래|기로)\s*[??.!~]*$|" # plans between people
r"\byou and (?:i|me)\b|\bmy plan\b|\bour plan\b|우리(?!.*악수).*(?:자|까|래|기로)\s*[??.!~]*$|" # plans between people
r"\bimagine\b|\bsuppose\b|\bwhat if\b|\bwould you ever\b|\bif you were\b|\bpretend\b|\bhypothetical|"
r"만약|[가-힣](?:라면|다면)|어떨까|겠다\s*[!.~]*$|" # hypotheticals
r"\battention\b|\bladies and gentlemen\b|\b(?:visitors|guests|attendees|passengers)(?: are)? (?:please|should|must|may|"
@@ -62,7 +63,9 @@ NOT_TO_LUMI = re.compile(
QUESTION = re.compile(r"^\W*(?:(?:hey|so|um+|uh+|lumi|okay|ok)\W+)*(?:what|where|why|how|when|who|whose|which|is|are|was|"
r"were|do(?=\s+(?:you|i|we|they|robots?)\b)|does|did|have|has|had|should|shall i|may i|can i|could i)\b(?! about\b)|"
r"어디|뭐|무엇|왜|언제|누구|어떻게|몇|어느|무슨|어떤|얼마|[가-힣]까\s*[??]+\s*$|봤(?:어|니|나|냐|어요|습니까)|본 ?적|"
r"\bhave you (?:been|gone|ever)\b|(?:어|아|해|여)도 ?(?:돼|되|될까|괜찮)", re.I)
r"\bhave you (?:been|gone|ever)\b|(?:어|아|해|여)도 ?(?:돼|되|될까|괜찮)|"
r"알려 ?(?:줘|주|줄)|설명해|가르쳐|말해 ?(?:줘|봐|주)|\btell me\b|\bexplain\b|\bdescribe\b|"
r"정확도|얼마나|을매나|속도", re.I) # "팔 정확도 알려 줘": a question, no motion
OTHER_SENSE = re.compile(r"instagram|insta\b|\bsns\b|\baccount\b|\bsubscribe\b|인스타|계정|채널|구독|팔로우 ?해 ?주세요|"
r"따라 ?(?:해|하|말|불러)|\brepeat after\b|\bcopy me\b|\bdo what i do\b|\b(?:lend|give) me a hand\b|"
r"\bneed a hand\b|\bhand it to\b|가는 ?길|길 ?(?:좀 )?알려|\bhow (?:do i|to) get\b|\bdirections?\b|\bthe way to\b|"
@@ -71,8 +74,8 @@ REPEAT = re.compile(r"^\W*(?:(?:\w+\W+){0,2})?(?:again|one more time|once more|d
r"^\W*(?:[가-힣]+\s+)?(?:한 ?번(?:만)? 더|다시|또)\s*(?:해|해 ?줘|해 ?봐|해 ?주세요|하자)?\W*$", re.I)
# "again", "한 번만 더 해 줘": what again is the history's (driving.read, the LLM)
SEVERAL = re.compile(r"\b(?<!hundred )and\b(?! a half\b)|\bwait\w*|\bcorrection\b|\binstead\b|"
r"\b(?:look|turn|go|move|wave|come|follow|pick|take|put|lift|raise|lower|reach|grab|bring)\b[^,]*,\s*(?:look|turn|go|move|wave|come|follow|pick|take|put|lift|raise|lower|reach|grab|bring)\b|\b(?:then|after that|also|plus|while|no|not|wait|stay|sleep|sorry|i mean|actually|rather)\b|;|"
r"(?!갖고|고고|에서)(?<!가)[가-힣](?:서|고)(?:[\s,.…]|$)|하고|셔서|면서|다가|갔다|다녀|아니|기다|대기|(?:가|와) ?있어|계세요|"
r"\b(?:look|turn|go|move|wave|come|follow|pick|take|put|lift|raise|lower|reach|grab|bring)\b[^,]*,\s*(?:(?:\w+\W+){0,2})?(?:look|turn|go|move|wave|come|follow|pick|take|put|lift|raise|lower|reach|grab|bring|tell|say|sing|show|ask|answer|check)\b|\b(?:then|after that|also|plus|while|no|not|wait|stay|sleep|sorry|i mean|actually|rather)\b|;|"
r"(?!갖고|고고|에서)(?<!가)[가-힣](?:서|고)(?:[\s,.…]|$)|하고|셔서|면서|다가(?![와오])|갔다|다녀|아니|기다|대기|(?:가|와) ?있어|계세요|"
r"계십시오", re.I)
# several requests or a stay ("go to p3 and wait", "가서 기다려", "p3에 가 있어"): steps.read's
HAND_WORDS = re.compile(r"\byou(?:'re| are) holding\b|\b(?:in|from) my hand\b|\bhere'?s\b|\bhanding\b|\bi'?ll give\b|"
@@ -95,6 +98,13 @@ TAG = re.compile(r",\s*(?:right|correct|huh|true)\s*[?!.]*\s*$|\b(?:isn'?t|aren'
r"(?:^|\s)(?:맞지|맞죠|그치)\s*\?+\s*$", re.I) # "..., right?", "the next stop is p3, isn't it?", "끝에 갔지?"
def told_ko(t):
"""Korean reported speech at the end: "루미가 p4로 간대", "온다고", "간다더라", "한대요" (said about, not to Lumi)."""
m = re.search(r"([가-힣])(?:대|대요|답니다|다고|다고요|다더라|다던데|다네|단다)\s*[.!?~]*\s*$", t)
return bool(m and ((ord(m.group(1)) - 0xAC00) % 28 == 4 or m.group(0).lstrip(m.group(1))[:1] == "다" and
m.group(1) in "한간온된준친운는있없했갔왔"))
def past_ko(t):
"""A Korean past tense (a syllable ending in ㅆ: 갔, 왔, 했, 었; not 있 "is", 겠 "will"): said about what happened."""
return any("가" <= c <= "힣" and (ord(c) - 0xAC00) % 28 == 20 and c not in "있겠" for c in t)
@@ -580,7 +590,7 @@ ARM_REACH += [
"please stretch out your arm", "hold your arm out", "hold your hand out to me", "hand out please",
"put your hand forward", "push your arm out", "arm forward", "arm forward please", "your arm, stretch it out",
"you stretch arm please", "you put arm out", "arm long please", "make arm long", "arm straight please",
"reach reach", "gimme your hand", "give your hand to me", "shake hands with me", "let's shake hands", "shake my hand", "give me a hand", "악수하자", "악수할래?", "루미야 손 줘",
"reach reach", "gimme your hand", "give your hand to me", "give me a hand", "루미야 손 줘",
"팔 뻗어 보거라", "팔 뻗어 보게", "팔 좀 뻗어 보이소", "팔 뻗어 부러", "팔 뻗어 봐유", "팔 뻗어 줘용", "팔 뻗어 주라",
"팔 좀 뻗어 주세요", "팔 쭉 뻗어 주세요", "팔 앞으로 뻗어 주세요", "팔 앞으로 내밀어 주세요", "손 내밀어 주세요",
"손 좀 내밀어 줄래?", "손 앞으로 뻗어", "손 쭉 뻗어 봐", "팔 펴 봐", "팔 펴 주세요", "팔을 펴 주십시오",
@@ -652,6 +662,8 @@ NO += [
KINDS = {"go_to": GO, "come": COME, "follow": FOLLOW, "come_back": COME_BACK, "move": MOVE, "turn": TURN, "look": LOOK,
"lift": LIFT, "wave": WAVE, "arm_reach": ARM_REACH, "arm_fold": ARM_FOLD, "arm_open": ARM_OPEN,
"arm_close": ARM_CLOSE, "pick": PICK, "put": PUT, "fetch": FETCH, "receive": RECEIVE, "give": GIVE, "no": NO}
for _k, _t in __import__("assistant.bank_words", fromlist=["merged"]).merged("INTENT").items():
KINDS[_k] = KINDS.get(_k, []) + [t for t in _t if t not in KINDS.get(_k, [])] # assistant/bank_words/*.py
ACTS = set(KINDS) - {"put", "receive", "give", "no"} # the kinds the bank acts on; the hand's (put down, take, hand
# over) are brain.hand_request's or the LLM's
@@ -668,35 +680,27 @@ def _fill(t, slot, en, ko):
def examples():
"""[(text, kind)]: the bank with its <place> / <obj> slots filled (FILLS each, a fixed seed)."""
"""[(text, kind)]: the bank with its <place> / <obj> slots filled (FILLS each, a fixed seed), Korean endings as
plain() reads them (wording.ko_plain: "가 주세요" is stored as "가 줘"), each once."""
from assistant import wording
out = []
for kind, texts in KINDS.items():
for t in texts:
for a in _fill(t, "<place>", PLACE_EN, PLACE_KO):
out += [(b, kind) for b in _fill(a, "<obj>", OBJ_EN, OBJ_KO)]
return out
out += [(wording.ko_plain(b), kind) for b in _fill(a, "<obj>", OBJ_EN, OBJ_KO)]
return list(dict.fromkeys(out))
_bank = None
def _load():
"""(vectors, kinds) of the bank: from data/intent_bank.npz when it holds these very wordings, else embedded now."""
"""(vectors, kinds) of the bank; embeddings kept per wording in the cache (bank_words.vectors)."""
global _bank
if _bank is None:
from assistant import knowledge
from assistant import bank_words
ex = examples()
texts = [t for t, _ in ex]
key = hashlib.sha1("\n".join(f"{t}\t{k}" for t, k in ex).encode()).hexdigest()
if CACHE.exists():
z = np.load(CACHE)
if str(z["key"]) == key:
_bank = (z["vecs"], z["kinds"])
return _bank
vecs = knowledge.embed(texts)
kinds = np.array([k for _, k in ex])
np.savez(CACHE, vecs=vecs, kinds=kinds, key=key)
_bank = (vecs, kinds)
_bank = (bank_words.vectors([t for t, _ in ex], CACHE), np.array([k for _, k in ex]))
return _bank
@@ -711,7 +715,8 @@ SLANG = [(re.compile(rf"(?<![\w가-힣]){a}(?![\w가-힣])", re.I), b) for a, b
("얘(?= ?,? ?(?:로봇|루미))", ""), ("로봇아|로봇 양반|로봇씨", ""), ("어이|ㅋ+", ""))]
# slang, whisper's spellings, dialect endings and calls: read as the plain word (the bank and the slots)
LEAD = re.compile(r"^\W*(?:(?:excuse me|okay so|ok so|so|uh+|um+|yo|hi|hey|hello|alright|all right|okay|ok|well|listen|"
r"ah+|oh+|wow|hmm+|buddy|lumi|robot|hey robot|루미 ?군|루미 ?선생|루미 ?씨|루미야|루미씨|루미|저기요|저기|자|야(?=\s*,?\s*(?:루미|로봇))|음|어|좋아|이제|그럼|근데|그런데|아|like)\b[\s,.!~]*)+", re.I)
r"ah+|oh+|wow|hmm+|buddy|lumi|robot|hey robot|로봇(?=\s)|로봇 ?(?:씨|님|친구야?)|로봇아|로봇야|이봐요?|이보게|이보세요|"
r"실례지만|실례합니다|아가|얘야|있잖아요?|여보세요|루미 ?군|루미 ?선생|루미 ?씨|루미야|루미씨|루미|저기요|저기|자|야(?=\s*,?\s*(?:루미|로봇))|음|어|좋아|이제|그럼|근데|그런데|아|like)\b[\s,.!~]*)+", re.I)
AMOUNT = [(re.compile(r"\b\d+(?:\.\d+)?\s*(?:degrees?|도)(?![a-z])|\b\d+(?:\.\d+)?도", re.I), "90 degrees"),
(re.compile(r"\b\d+(?:\.\d+)?\s*(?:m|meters?|metres?|cm|centimet(?:er|re)s?|mm|millimet(?:er|re)s?|"
r"미터|센티(?:미터)?|센치|밀리)(?![a-z])", re.I), "1 meter")] # embedded as one amount
@@ -719,7 +724,8 @@ AMOUNT = [(re.compile(r"\b\d+(?:\.\d+)?\s*(?:degrees?|도)(?![a-z])|\b\d+(?:\.\d
def plain(text):
"""The words without polite frames ("if you don't mind", "it'd be great if you could") and calls before."""
t = POLITE.sub(" ", text or "")
from assistant import wording
t = POLITE.sub(" ", wording.ko_plain(wording.now_not_later(text)))
for rx, word in SLANG:
t = rx.sub(word, t)
t = re.sub(r"\s+([,.!?])", r"\1", re.sub(r"^[\s,.!?~]+", "", t))
@@ -731,7 +737,7 @@ def guarded(text):
"""Why the bank does not read these words, or None."""
from assistant import brain
t = text.strip()
if len(t) < MIN_CHARS or len(t.split()) > MAX_WORDS:
if len(t) + len(re.findall(r"[가-힣]", t)) < MIN_CHARS or len(t.split()) > MAX_WORDS: # a Hangul syllable counts twice
return "length"
for name, rx in (("negation", NEGATION), ("later", LATER), ("ability", ABILITY), ("question", QUESTION),
("self", SELF_TALK), ("several", SEVERAL), ("hand", HAND_WORDS), ("other sense", OTHER_SENSE),
@@ -742,6 +748,8 @@ def guarded(text):
return "later"
if past_ko(t):
return "past"
if told_ko(t):
return "told"
if re.match(r"^\W*야\s", t):
return "someone else" # "야 커피코너에서 컵 좀 가져와": a friend called (야 루미 is cut before)
name = NAME_CALL.match(t)
@@ -765,7 +773,7 @@ def nearest(text, k=5):
TAIL = re.compile(r"(?:[\s,.!?~]+(?:please|thanks|thank you|for me|now|right now|real quick|real fast|if you can|lumi|okay|"
r"yo|my friend|you|thank|"
r"고마워|고마워요|감사합니다|감사해요|부탁해|부탁해요|부탁합니다|루미야|제발))+[\s,.!?~]*$", re.I)
r"고마워|고마워요|감사합니다|감사해요|부탁해|부탁해요|부탁합니다|루미야|제발|허허|하하|헤헤|호호|ㅎㅎ+|ㅋㅋ+))+[\s,.!?~]*$", re.I)
CANON_PLACE = "p3" # a named marker is embedded as this one: the bank's wordings know it, any map's names work
@@ -798,21 +806,42 @@ def kind_of(text, markers=()):
except OSError as e: # no embedding server: the LLM decides
print(f"intent bank: {e}")
return None
sims = vecs @ q
kinds = np.where(kinds == "fetch", "pick", kinds) # pick or fetch: one kind here, the words decide (_slot)
order = np.argsort(-sims)[:AGREE_K]
best = kinds[order[0]]
if best not in ACTS or sims[order[0]] < SIM_MIN or any(kinds[i] != best for i in order):
best, top, margin, agree, second = _top(vecs @ q, _codes())
if best not in ACTS or top < SIM_MIN or not agree or margin < MARGIN_WORDS:
return None
if sims[order[0]] - sims[kinds != best].max() < MARGIN:
return None
return str(best)
return best if margin >= MARGIN else (best, second) # close to another motion: the words decide (read)
_kind_codes = None
def _codes():
"""(names, int code per bank row): kinds compared as numbers, fetch read as pick (the words decide, _slot)."""
global _kind_codes
if _kind_codes is None:
kinds = np.where(_load()[1] == "fetch", "pick", _load()[1])
names, codes = np.unique(kinds, return_inverse=True)
_kind_codes = ([str(n) for n in names], codes)
return _kind_codes
def _top(sims, named, k=AGREE_K):
"""(kind of the closest row, its similarity, its lead over the closest row of any other kind, whether the k
closest rows are all of that kind, that other kind): one pass over the bank, no sort of it."""
names, codes = named
top = np.argpartition(sims, -k)[-k:]
top = top[np.argsort(-sims[top])]
best = codes[top[0]]
others = np.where(codes != best, sims, -1.0)
second = int(np.argmax(others))
return (names[best], float(sims[top[0]]), float(sims[top[0]] - others[second]), bool((codes[top] == best).all()),
names[codes[second]])
# ---------- slots: what the words themselves say ----------
DIR = {"forward": r"\b(?:forward|forwards|forword|ahead|straight)\b|\bto the front\b|앞으로|앞쪽|^\s*앞|forward로",
"back": r"\b(?:back|backward|backwards|reverse|bak)\b|뒤로|후진|뒤쪽|물러",
"left": r"\bleft|\blef\b|왼쪽|왼편|좌측", "right": r"\bright\b|\brite\b|오른쪽|오른편|우측"}
"left": r"\bleft|\blef\b|왼쪽|왼편|좌측|좌회전|(?:^|\s)좌로|좌향", "right": r"\bright\b|\brite\b|오른쪽|오른편|우측|우회전|(?:^|\s)우로|우향"}
CARRY = (r"\b(?:bring(?! yourself)|fetch|deliver|carry)\b|\bget me\b|\b(?:to|for) me\b(?=.*\b(?:bring|get|fetch|hand|pass)\b)|"
@@ -823,14 +852,14 @@ LIFT_SAID_MAX_M = 0.3 # m; a longer lift amount said is no lift request ("grow
LIFT_BODY = (r"\b(?:yourself|your (?:body|torso|upper body)|body|make you|taller|shorter|smaller|small|tall|high|lift|rise|grow|"
r"shrink|come down|go up|go down|move up|move down|raise up|lower down|come up|sink down|elevate|squat|height|"
r"stretch up|drop down|going down|going up)\b|위로|아래로|낮아|높아|"
r"키|몸|리프트|상체|높게|낮게|높이|커져|작아져|올라|내려가|업\b|다운")
r"키|몸|리프트|상체|높게|낮게|높이|커져|작아져|올라|내려가|업\b|다운|늘려")
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
LOOK_DIR = {"left": r"\bleft|왼|레프트", "right": r"\bright|\brite\b|오른|라이트",
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|바닥|땅|아래|밑"}
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|나한테|저한테|쳐다봐|(?:^|\s)(?:여기|이쪽|저|나|날)(?:를|을)?\s*(?:좀\s*)?(?:봐|보세요|look)")
@@ -965,7 +994,8 @@ def _slot(kind, text, markers, holding):
from assistant import brain, driving
t = brain._norm(text, markers)
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"\bwith (?:me|us)\b|같이|함께|따라|"
+ CARRY + r"|\btake (?:it|this|that|them)\b", t):
return None # "get the bottle from booth two": a fetch, the rules' / LLM's
@@ -979,6 +1009,9 @@ def _slot(kind, text, markers, holding):
return None # "나한테 가져와", "이리 줘": not a trip to the person
if kind == "come" and re.search(r"\bwith (?:me|us)\b|함께|같이", t):
return ("follow", "") # "just come with me": walk along
if kind == "come" and (driving.amount(t)[1] or driving.amount(t)[0] == "?"): # "come 20 cm closer": a short
n, exact = driving.amount(t) # drive (A2)
return ("move", f"forward {n:g}") if exact and driving.MOVE_MIN_M <= n <= brain.MOVE_MAX_M else None
if kind == "come_back" and (re.search(r"\bpose\b|\barm\b|\bhead\b|팔|고개|\bpick|\bput\b|\bit\b|그거|놓|놔", t) or
any(brain.named_place(text, m, markers) for m in markers)):
return None # "go back to your dock", "go back to your look pose": not here
@@ -1009,8 +1042,11 @@ def _slot(kind, text, markers, holding):
return None
return ("move", f"{d[0]} {n:g}")
if kind == "turn":
if re.search(r"\blook|봐|\bhead\b|고개|\beyes\b", t):
return None # "look the other way": the head, not the base
if re.search(r"\blook|봐|\bhead\b|고개|\beyes\b|\btorso\b|\bwaist\b|\bupper body\b|\bhips?\b|허리|상체|몸통|윗몸|"
r"\btrunk\b|\bwithout driving\b", t):
return None # "look the other way", "twist your torso": not the base
if re.search(r"\bquarter\b|\bhalf\b|반 ?바퀴", t) and not re.search(r"\d", t):
return None # "spin left a bit, like a quarter": not a full turn (A2)
if re.search(r"\bspin\b|\ball the way (?:a)?round\b|\b360\b|한 ?바퀴", t) and \
not re.search(r"\bface\b|\bother (?:side|way)\b|\d+\s*(?:degrees?|도)", t.replace("360", "")) and \
said_amount(text)[1] in (None, 360):
@@ -1026,13 +1062,13 @@ def _slot(kind, text, markers, holding):
words_deg = said_amount(text)[1]
if not deg and words_deg:
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"\bdegrees?\b|[가-힣]\s*도(?:만)?(?:\s|[.,!?~])", t + " ") and not re.search(r"(?:^|\s)(?:한|좀)\s", t):
return None # "삼십 도": a number the words don't give as digits
if not deg and re.search(r"\d", t):
return None # "turn left 30.": a number with no unit, asked
return ("turn", f"{d[0]} {deg.group(1) if deg else 90}")
if kind == "look":
if re.search(r"\byour back\b|\bback to me\b|등 ?돌", t):
if re.search(r"\byour back\b|\bback to me\b|등 ?돌|놔|놓|\bput\b|\bdrop\b|\bplace\b", t):
return None # "turn your back to me": the base turns away
target = "center" if re.search(r"원위치|원래대로|\breset\b", t) else brain.head_target(t)
if target is None:
@@ -1050,7 +1086,7 @@ def _slot(kind, text, markers, holding):
if not re.search(LIFT_BODY, t):
return None # "go upstairs": no word about Lumi's own height
down = re.search(r"\b(?:down|lower|shorter|smaller|small|sink|shrink|squat)\b|낮|줄여|작게|작아|내려|아래|다운", t)
up = re.search(r"\b(?:up|higher|taller|tall|high|bigger|raise|rise|grow|elevate|stretch)\b|높(?:여|게|아|혀)|키워|올려|"
up = re.search(r"\b(?:up|higher|taller|tall|high|bigger|raise|rise|grow|elevate|stretch)\b|높(?:여|게|아|혀)|키워|올려|늘려|"
r"커|올라|업", t)
if bool(down) == bool(up):
return None # no direction, or both: asked
@@ -1066,6 +1102,11 @@ def _slot(kind, text, markers, holding):
if pose == "reach" and re.search(r"줘|주세요|주십시오|\bgive\b|\bhand\b|\bover\b|\bpass\b", t) and \
(holding() if callable(holding) else holding):
return None # "손 줘" with a cup held: hand it over, the hand reader's
if pose in ("open", "close") and not re.search(r"손|hand|grip|그리퍼|집게|finger|claw|주먹|fist|핸드|\bit\b", t):
return None # "문 열어 줘": a door, not the hand (A1)
if pose in ("open", "close") and re.search(r"(?:^|\s)(?:창)?문|창문|뚜껑|병|\bdoor|\bwindow|\blid\b|\bbottle\b|"
r"\bbox\b|상자|박스|\beyes?\b|\bmouth\b|(?:^|\s)(?:눈|입)(?:을|\s|$)", t):
return None # "문 열어 줘", "close your eyes": not the gripper
if pose in ("open", "close"):
held = holding() if callable(holding) else holding
if held:
@@ -1108,18 +1149,21 @@ def read(text, markers=(), holding=False):
if guarded(text):
return None
kind = kind_of(text, markers)
if isinstance(kind, tuple): # two motions close: only when the words fit one of them
kind, other = kind
if other not in ACTS or _slot(other, text, markers, holding) is not None:
return None
got = _slot(kind, text, markers, holding) if kind else None
return ("fetch", said) if got and got[0] == "fetch" else got
if __name__ == "__main__":
if sys.argv[1:] == ["build"]:
CACHE.unlink(missing_ok=True)
n = len(_load()[1])
print(f"{n} wordings -> {CACHE}")
else:
from tests.conversation_check import markers as _markers
for said in sys.argv[1:]:
print(said, "| guard:", guarded(said), "| kind:", kind_of(said), "| read:", read(said, _markers()))
print(said, "| guard:", guarded(said), "| kind:", kind_of(plain(said)), "| read:", read(said, _markers()))
for s, k, w in nearest(said)[0]:
print(f" {s:.3f} {k:10} {w}")
+9
View File
@@ -356,6 +356,15 @@ EXAMPLES = [
(J_SAFE, "stranger", "okay", "safety_stop", "I'll wait until someone says go on."),
(KJ_SAFE, "stranger", "알았어", "safety_stop", "가도 된다고 하실 때까지 기다릴게요."),
(J_STOP, "stranger", "go to p6", "answer", "I'm going to p6 already, to bring this cup to James." + GO),
# ---- thanks in the middle: an end only when nothing else is asked ----
(J_STOP, "stranger", "thanks! and where are you going?", "answer", J_TASK + GO),
(J_STOP, "stranger", "thank you, what's that you're holding?", "answer", "It's a cup for James at p6." + GO),
(J_STOP, "stranger", "thanks, that's all", "resume", BYE),
(J_STOP, "stranger", "okay thanks", "resume", BYE),
(KJ_STOP, "stranger", "고마워요, 근데 어디 가요?", "answer", KJ_TASK + KGO),
(KJ_STOP, "stranger", "감사합니다. 그 컵은 누구 겁니까?", "answer", "제임스 님 컵입니다." + KGO),
(KJ_STOP, "stranger", "고마워, 이제 됐어", "resume", KBYE),
(KJ_STOP, "stranger", "알겠어요, 고마워요", "resume", KBYE),
]
+160 -28
View File
@@ -96,6 +96,7 @@ from manipulation import wave as wave_mod
from assistant import web
from assistant import fetch_dialog
from assistant import seeing
from assistant import memory
from assistant.brain import Brain
NEAR_MIN, NEAR_MAX = 0.5, 1.2 # m, greeting zone
@@ -155,8 +156,9 @@ ELSEWHERE = re.compile(r"(으로|로)\s*(가져|갖다)|\b(to the|instead|over t
GIVE_ME = re.compile(r"\b(give|hand|mine|for me|to me|i'?ll take it|i will take it|i can take it)\b|주세요|줘|내 거|"
r"제 거|제가 받을게|받을게", re.I)
MOVING_ACTIONS = {"go_to", "come", "come_back", "follow", "move", "turn", "arm", "pick", "put", "move_object", "fetch", "give", "place", "wave",
"lift"}
BASE_ACTIONS = {"go_to", "come", "come_back", "follow", "move", "turn"} # need the base: Patrol on
"lift", "waist"}
BASE_ACTIONS = {"go_to", "come", "come_back", "follow", "move", "turn", "waist"} # need Patrol on (the base, the waist)
WAIST_STEP_DEG = 30.0 # deg; "turn your waist left" with no amount: this far from where it is (estimate)
DRIVE_STEPS = {"go", "move", "turn"} # mission steps that drive
FIX_SAY = (("Okay.", "네."), # a command taken back in the same sentence
("Sorry, which one did you mean? Please say it again.", "죄송해요, 어느 쪽 말씀이세요? 다시 한 번 말씀해 주세요."))
@@ -186,7 +188,16 @@ LIMIT_SAY = {"yaw": (f"I can turn my head up to {head.AXIS_LIMITS[2][1]:g} degre
"pitch": (f"I can tilt my head from {-head.PITCH_RANGE[0]:g} degrees down to {head.PITCH_RANGE[1]:g} degrees up.",
f"고개는 아래로 {-head.PITCH_RANGE[0]:g}도, 위로 {head.PITCH_RANGE[1]:g}도까지 움직여요."),
"lift": (f"For now I can raise my body only up to {head.LIFT_MAX_MM:g} millimetres.",
f"지금은 몸을 {head.LIFT_MAX_MM:g}밀리미터까지만 올릴 수 있어요.")} # a number asked for was past the range
f"지금은 몸을 {head.LIFT_MAX_MM:g}밀리미터까지만 올릴 수 있어요."), # a number asked for was past the range
"left": ("I'm already turned as far left as I can go.", "고개를 더 이상 왼쪽으로 돌릴 수 없어요."),
"right": ("I'm already turned as far right as I can go.", "고개를 더 이상 오른쪽으로 돌릴 수 없어요."),
"up": ("I'm already looking as far up as I can.", "고개를 더 이상 들 수 없어요."),
"down": ("I'm already looking as far down as I can.", "고개를 더 이상 숙일 수 없어요."),
"lift_up": ("I'm already as tall as I can go.", "더 이상 올라갈 수 없어요."),
"lift_down": ("I'm already as low as I can go.", "더 이상 내려갈 수 없어요."),
"waist_left": ("My waist is already turned as far left as it goes.", "허리를 더 이상 왼쪽으로 돌릴 수 없어요."),
"waist_right": ("My waist is already turned as far right as it goes.", "허리를 더 이상 오른쪽으로 돌릴 수 없어요.")}
# the head or the lift already at that end ("more" / "again" too): nothing moved, said plainly
DONE_TALK = re.compile(r"\b(bye+|goodbye|see you|never ?mind|nothing|that'?s (all|it)|no thanks|thanks|thank you|"
r"okay|ok|fine|alright|cool|whatever)\b|안녕히|잘 ?가|됐어|괜찮아|아니야|고마워|감사|그래|네|수고|알았어|"
r"그게 ?다|빠이|바이|나중에|안녕\s*[.!]?$", re.I)
@@ -218,12 +229,12 @@ EMPTY_HAND = re.compile(r"\b(give|hand|pass) (it|that|this)( (over|back|here))?(
r"\bcan i have (it|that|this)\b|(그거|이거|그것|그걸|이걸)\s*(이제|이리|좀|빨리)?\s*(나|저)?(한테|에게)?\s*"
r"(줘|주세요|건네)|"
r"\b(put|place|set) (it|that|this) (down|on the table)\b|(그거|그것|이거|그걸|이걸)\s*(나한테|저한테|나|저)?\s*"
r"(줘|주세요|건네)|들고 ?있는 ?(거|것)을?\s*(나|저)?(한테|에게)?\s*(줘|주세요)|^\s*건네\s*(줘|주세요)|테이블에\s*(놔|놓아|둬)|내려\s*(놔|놓아)", re.I)
r"(줘|주세요|건네)|(?:들고 ?있는|손에 ?(?:든|있는)|쥐고 ?있는|잡고 ?있는) ?(?:거|것|\S+)(?:을|를)?\s*(?:좀\s*)?(?:나|저)?(?:한테|에게)?\s*(?:좀\s*)?(?:줘|주|줄|도(?=\W*$)|건네|넘겨|내놔)|^\s*건네\s*(줘|주세요)|테이블에\s*(놔|놓아|둬)|내려\s*(놔|놓아)", re.I)
EMPTY_HAND_SAY = {"en": "I'm not holding anything right now.", "ko": "지금은 손에 아무것도 들고 있지 않아요."}
ASK_PREFIX = re.compile(r"\b(do|did) you (know|happen to know)\b|\b(can|could) you (tell|find out|look up|check)( me)?\b|"
r"아세요|알아요|알아\?", re.I) # "do you know who won?" is not about Lumi
ASKS_MORE = re.compile(r"\?|\b(but|can|could|what|how|where|why|when|who|one more)\b|근데|그런데|뭐|어떻게|어디|언제|누구|하나만 더|"
r"물어볼게|물어봐도", re.I)
r"(?<!그만 )물어볼게|물어봐도", re.I)
THANKS_REST = re.compile(r"\b(?:a bunch|a lot|so much|very much|lovely|great|nice|cool|good to know|again|that was \w+|"
r"for (?:the|that|this|telling|your) \w+)\b|감사요|잘 들었어요|잘 알겠어요|[~!.,\s요]", re.I)
# left of "Lovely, thanks!", "고마워요~" after the thanks: nothing, so only thanks (talk_fate waits)
@@ -247,15 +258,21 @@ TALK_ASK_S = 15.0 # s of silence while halted for someone -> "
RELEASE = re.compile(r"^\s*(?:(?:ok(?:ay)?|alright|lumi|루미야?)[\s,.!]+)?(?:you can go(?: now)?|take care|가 ?보세요|가세요|가도 ?돼요?)"
r"[\s.!~]*$", re.I) # said alone: the visitor lets Lumi go
THANKS = re.compile(r"\bthank(?:s| you)\b|\bthanx\b|\bcheers\b|고마워|고맙|감사|땡큐", re.I)
DONE_WORDS = re.compile(r"\bthat'?s (?:it|all|enough|everything)\b|\bno,? thanks?\b|\bnothing(?: else)?\b|\benough\b|됐어|됐습니다|"
DONE_WORDS = re.compile(r"\bthat'?s (?:it|all|enough|everything|plenty)\b|\bno,? thanks?\b|\bnothing(?: else)?\b|\benough\b|됐어|됐습니다|"
r"\bi'?m (?:good|all set|fine|done)\W*(?:thanks?\W*)?(?:robot|lumi)?\W*$|^\W*(?:nah|nope),? (?:i'?m )?(?:good|fine)\W*$|"
r"충분해|충분합니다|^\W*(?:아뇨|아니요|아니)?\W*없어요?\W*$|(?:^|[\s,.])(?:더 )?없(?:어|어요|습니다)(?=[\s,.!~]|$|고마|감사)|"
r"괜찮(?:아|아요|습니다)(?=[\s,.!~]|$)|그거면 (?:돼|됐|충분)|\ball good\b|\bi'?m good\b|\bthat helped\b|"
r"그만", re.I) # "that's it", "됐어요": maybe done; the LLM decides with the talk before
HI_ANNYEONG = re.compile(r"(?<!히)안녕(?!히)[\s.!~]*$") # 안녕 is hello or bye: before anything is said, hello
CLEAR_BYE = re.compile(r"\b(?:bye|bay bay|goodbye|(?<!can't )(?<!cant )(?<!cannot )(?<!not )(?<!to )see you|see ya|good night|"
CLEAR_BYE = re.compile(r"\b(?:bye|bay bay|goodbye|(?<!can't )(?<!cant )(?<!cannot )(?<!not )(?<!to )(?<!let's )(?<!lets )see you|see ya|good night|"
r"take care|i (?:have|need) to go|gotta (?:go|run)|i'?m leaving|i'?m off|have a (?:good|nice|great) (?:one|day)|"
r"catch you later|later,? (?:robot|lumi)|i'?m heading (?:out|off)|i'?ll let you (?:get back|go)|"
r"i'?ll (?:go|head off|be going|get going|be off)(?: now)?(?=\W*$|\W+(?:thanks|bye))|thanks? for everything|"
r"nice (?:talking|meeting|chatting)(?: (?:to|with))? you|(?:was|been) nice to meet you)\b|"
r"(?<=\S)[\s.,!]+안녕[\s.!~]*$|안녕히|잘 ?가|잘 ?있어|잘 ?있게|수고하세요|들어가세요|바이바이|빠이|"
r"(?<![가-힣])바이(?![가-힣])|(?<![가-힣])간다[\s.!~]*$|가 ?볼게요|갈게요|(?:나|저|이제) (?:이제 )?가야 ?(?:돼|해|겠|할)|"
r"다음에 (?:또 )?(?:봐|봬|만나|올게)|또 (?:봐|봬|올게)|나중에 봐|좋은 하루|"
r"(?:다음에|담에) (?:또 )?(?:봐|봬|뵐게|만나|올게)|또 (?:봐|봬|뵐게|올게)|나중에 (?:봐|봬|뵐게)|좋은 하루|가야겠|"
r"(?:^|[,.~!]\s*|(?:이제|그럼|먼저|나 이제|저 이제)\s+)갈게[~!.\s]*$|가 ?봐야 ?(?:돼|해|겠|할|됩)|그럼 이만|이만 (?:갈게|가 ?볼게|가겠|실례)|수고하십시오|수고하셔요|수고해(?:요)?[~!.\s]*$|"
r"(^|\s)(나|저|우리|저희) (이제 )?(집에 )?(가|간다|가요|갑니다)[\s.!]*$", re.I)
# a goodbye in any talk: "okay, bye", "I have to go", "수고하세요" (thanks, okay, 됐어: the LLM reads them)
RECEIVE_OK = re.compile(r"\b(ok(ay)?|done|here you go|there you go|go ahead|thank|thanks|yes)\b|됐어|됐습니다|놨어|여기요|"
@@ -881,9 +898,9 @@ class Lumi:
self.turn_head(None if angle is None else HEAD_SIGN * max(-head.YAW_LIMIT, min(head.YAW_LIMIT, angle)), 10,
force=True)
elif action == "look" and target.split()[0:1] and (target.split()[0] in LOOK or target == "away"):
self.look(target)
return self.look(target) # a LIMIT_SAY key when the head is at its end
elif action == "lift":
self.lift(target)
return self.lift(target)
elif action == "wave":
threading.Thread(target=self.wave, daemon=True).start() # while the reply is spoken
elif action == "stop":
@@ -917,28 +934,66 @@ class Lumi:
def look(self, target):
"""'left', 'left 30', 'down small' (brain.head_goal): the head, cut to its range. Returns "yaw" / "pitch"
when a number asked for was past the range, else None."""
when a number asked for was past the range, the direction ("down") when the head already stands at that end
(nothing moves; LIMIT_SAY says so), else None."""
cur = safe(head.status)
if cur is None:
return None
self.looked_at = time.time()
yaw, pitch, limited = brain_mod.head_goal(target, cur[2], cur[3], LOOK) # the body's full range (AXIS_LIMITS):
if limited in ("left", "right", "up", "down"):
log(f" look {target}: already at the end (yaw {cur[2]:.0f}, pitch {cur[3]:.0f})")
return limited
threading.Thread(target=lambda: safe(head.moveto, [cur[0], cur[1], yaw, pitch]), # head.turn() keeps
daemon=True).start() # to YAW_LIMIT
return limited
def lift(self, target):
"""'up', 'down', 'up small', 'up 50' (mm; brain.lift_goal): the lift, slowly, cut to 0..head.LIFT_MAX_MM.
Returns True when a number asked for was cut."""
Returns the LIMIT_SAY key: "lift" when a number asked for was cut, "lift_up" / "lift_down" when the lift
already stands at that end (nothing moves), else None."""
cur = safe(head.status)
if cur is None:
return False
return None
mm, limited = brain_mod.lift_goal(target, cur[0], head.LIFT_MAX_MM)
if limited in ("up", "down"):
log(f" lift {target}: already at {cur[0]:.0f} mm, the end")
return f"lift_{limited}"
limited = "lift" if limited else None
log(f" lift {cur[0]:.0f} -> {mm:.0f} mm")
threading.Thread(target=lambda: safe(lambda: head.moveto([mm, cur[1], cur[2], cur[3]], LIFT_VEL)),
daemon=True).start()
return limited
def waist(self, target):
"""'left', 'right 45', 'center': the waist (upper body: the arm and both cameras turn with it, the base stays),
from where it is, the front being where measure-axis was run (fetch._waist_turn); +deg = left. The move is
fetch._waist_to (cut to the waist's range, refused when the arm's sweep is not clear), in a thread. Returns
"waist_left" / "waist_right" when the waist already stands at that end (nothing moves), else None."""
from tasks import fetch
cur = safe(head.status)
if cur is None:
return None
lo, hi = head.AXIS_LIMITS[1]
front = cur[1] - (safe(fetch._waist_turn, default=0.0) or 0.0) # the waist angle at the front
d, _, n = target.partition(" ")
if d == "center":
goal = front
else:
goal = max(lo, min(hi, cur[1] + (1 if d == "left" else -1) * (float(n) if n else WAIST_STEP_DEG)))
if abs(goal - cur[1]) < 1.0:
log(f" waist {target}: already at {cur[1]:.0f} deg, the end")
return f"waist_{d}"
self.stay()
def run():
if safe(fetch._waist_to, goal - front, default=False) is False:
self.fetch_say("Sorry, something is in my arm's way, so I didn't turn.",
"죄송해요, 팔 쪽에 뭔가 있어서 돌지 않았어요.")
log(f" waist {cur[1]:.0f} -> {goal:.0f} deg")
threading.Thread(target=run, daemon=True).start()
return None
def move_by(self, action, target):
"""'move forward 1' / 'move left 0.5' / 'turn around 180' / 'turn left 90', relative to where Lumi stands.
Left / right are a normal base move to a map point, so obstacles are avoided; forward and back are a straight
@@ -1031,7 +1086,7 @@ class Lumi:
elif got[0] in ("look", "lift"): # "one more" / "더" after a look or a lift: further that way
hist.append((text, f"ACTION: {got[0]} {got[1]}"))
log(f" action {got[0]} {got[1]} (again)")
limited = self.look(got[1]) if got[0] == "look" else "lift" if self.lift(got[1]) else None
limited = self.look(got[1]) if got[0] == "look" else self.lift(got[1])
say = LIMIT_SAY[limited][lang != "en"] if limited else "Okay." if lang == "en" else "네."
elif got[0] == "refuse":
d, n = got[1].split()
@@ -1494,7 +1549,7 @@ class Lumi:
if kind == "talk":
self.answer(words, part=True)
elif kind == "quick":
self.quick_command(words)
self.quick_command(words, what) # chain.plan's reading ("나 보고", the bank's)
else:
if {st["do"] for st in what} & DRIVE_STEPS and (self.base_off("go_to") or not self.modes.drive):
failed = True
@@ -2113,7 +2168,8 @@ class Lumi:
def warm_llm(self):
"""brain.warm in the background (markers and the task state are read there, listening starts at once)."""
threading.Thread(target=lambda: safe(lambda: self.brain.warm(self.markers, self.now_doing()[0])), daemon=True).start()
threading.Thread(target=lambda: safe(lambda: self.brain.warm(self.markers, self.now_doing()[0] + memory.arm_line())),
daemon=True).start()
def talk_turn(self):
"""Listen once; answer if something was said. Returns True if the visitor spoke."""
@@ -2407,9 +2463,10 @@ class Lumi:
mouth.say(f"Okay, I'm going to {name}." if en else f"네, {name}로 갈게요.")
self.keep_listening()
def quick_command(self, text):
"""A command the keyword rules recognise for sure: confirm with a ready phrase and act, no LLM wait."""
rule = brain_mod.intent(text, self.markers)
def quick_command(self, text, rule=None):
"""A command the keyword rules recognise for sure: confirm with a ready phrase and act, no LLM wait. rule:
route's / chain.plan's reading when it has one (the intent bank's, a Korean -고 part), else brain.intent."""
rule = tuple(rule) if rule else brain_mod.intent(text, self.markers)
if not rule and brain_mod.place_problem(text, self.markers):
agv.known_markers(fresh=True) # not on the list: the map may have just changed
rule = brain_mod.intent(text, self.markers)
@@ -2455,11 +2512,15 @@ class Lumi:
return True
if action == "lift":
limited = self.lift(target)
mouth.say(LIMIT_SAY["lift"][0 if en else 1] if limited else ("Okay." if en else "네."))
mouth.say(LIMIT_SAY[limited][0 if en else 1] if limited else ("Okay." if en else "네."))
return True
if action == "fetch":
self.fetch_request(target)
return True
if action == "waist":
limited = self.waist(target)
mouth.say(LIMIT_SAY[limited][0 if en else 1] if limited else ("Okay." if en else "네."))
return True
if not self.modes.drive:
mouth.say("Sorry, driving is switched off." if en else "죄송해요, 지금은 이동할 수 없어요.")
return True
@@ -2543,6 +2604,14 @@ class Lumi:
mouth.say("Sorry, I only understand English and Korean." if self.lang == "en" else "죄송해요, 영어와 한국어만 이해해요.")
self.keep_listening()
return
memory.heard(claimed_name(text), self.current) # who this talk is with (assistant/memory.py)
mem = None if self.mission_running() else memory.reply(text, self.lang, history=self.brain.history) # "do you remember ...?"
if mem: # before self_correct: "no" answers "Do you mean ...?"
log(f" memory: {mem}")
self.brain.history.append((text, f"ACTION: none -\n{mem}"))
mouth.say(mem, abort=self.speak_abort)
self.keep_listening()
return
fixed = text if self.mission_running() else brain_mod.self_correct(text, self.markers) # "go to start, no, end"
if fixed != text:
log(f" corrected in the sentence: {fixed!r}")
@@ -2578,6 +2647,7 @@ class Lumi:
if kind == "seeing": # "do you see a cup?", "what am I holding?"
log(f" seeing: {data}")
self.brain.history.append((text, f"ACTION: none -\n{data}")) # "and you?" / "why?" next has the turn
memory.note_seen() # what is in view now is kept (48 h), in the background
mouth.say(data)
self.keep_listening()
return
@@ -2620,7 +2690,8 @@ class Lumi:
if kind == "sing": # "sing a song", "노래 불러 줘", after a song "another one"
self.sing_song(text)
return
if kind in ("quick", None) and self.quick_command(text): # None: an unknown place is still said here
if kind in ("quick", None) and self.quick_command(text, data if kind == "quick" else None): # None: an
# unknown place is still said here
log(f" done at once ({time.time() - t:.1f} s)")
return
bank = sing.bank_read(text, last) if kind is None else None # a song or the songs by meaning (song_bank.py)
@@ -2647,7 +2718,10 @@ class Lumi:
self.look_up(text, "search", self.brain.search_query(text), t)
return
about, repeating = self.brain.topic(text), self.brain.again(text)
gen = self.brain.respond_stream(text, self.markers, now=self.now_doing()[0] + seeing.facts_for(text) +
view = seeing.facts_for(text)
if view:
memory.note_seen() # a camera summary for the LLM: kept too
gen = self.brain.respond_stream(text, self.markers, now=self.now_doing()[0] + memory.arm_line() + view +
battery.fact_for(text))
head_ = next(gen)
log(f" action {head_['action']} {head_['target']} ({time.time() - t:.1f} s)")
@@ -2699,7 +2773,14 @@ class Lumi:
self.keep_listening()
return
if head_["action"] not in ("none", "end"):
self.act(head_["action"], head_["target"])
limited = self.act(head_["action"], head_["target"])
if head_["action"] in ("look", "lift") and limited in LIMIT_SAY: # at its end: said so, not the model's
gen.close() # "okay"
said = LIMIT_SAY[limited][self.lang != "en"]
mouth.say(said)
keep_said(self.brain, text, said)
self.keep_listening()
return
first = next(gen, None)
log(f" first sentence after {time.time() - t:.1f} s")
promise = brain_mod.promised(first) if head_["action"] == "none" and \
@@ -2729,6 +2810,8 @@ class Lumi:
log(f"lumi ({time.time() - t:.1f} s, voice after {mouth.last_voice - t:.1f} s): {said}")
if head_["action"] == "end" and fate == "close" and not kept_goodbye(said):
head_["action"] = "none" # "Okay, thanks." -> "You're welcome.": no goodbye said
elif head_["action"] == "none" and fate == "close" and kept_goodbye(said):
head_["action"] = "end" # "thanks, that's all" -> "Have a great day!": it took leave
if head_["action"] in ("end", "go_to"):
self.current, self.voice_until = None, 0.0 # stay quiet with this person until a new visit
elif self.current is None:
@@ -3130,6 +3213,10 @@ class Lumi:
"talking with one person in view"))
if self.vision:
self.vision.start()
memory.start(idle=lambda: self.current is None and time.time() - getattr(self, "last_activity", 0.0) > 20,
after=self.warm_llm) # talks kept from now on; summed up while nobody talks
memory.watch(arm_ok=lambda: not getattr(self, "busy_now", "") and self.doing() is None and
self.fetch_status() != "running", look_held=self.look_held)
self.warm_llm()
log("ready")
self.run_camera() if self.vision else self.run_desk()
@@ -3144,7 +3231,28 @@ NOT_STOP = re.compile( # a stop word that orders no stop: negated, about someo
r"\b(?:freezes|froze|frozen|freezing)\b|"
r"(?:다리|손|심장|시계|컴퓨터|노트북|버스|차|폰|핸드폰|화면|숨|시간|엘리베이터|에스컬레이터)(?:이|가|도|는|은)?\s*(?:\S+\s+){0,2}"
r"(?:멈췄|멈춰(?:요|서|버렸|있)|멈춰\.?$|멈추)|(?:멈췄|멈추더라|멈추던데|멈춘다)|"
r"(?:엄마|아빠|선생님|걔|쟤|친구|사람|그 ?분|형|누나|언니|오빠)\S*\s.*라고 ?했", re.I)
r"(?:엄마|아빠|선생님|걔|쟤|친구|사람|그 ?분|형|누나|언니|오빠)\S*\s.*라고 ?했|"
r"\bstop-motion\b|\bone-stop\b|\bwhy(?:'d| did| do| does)? (?:you|it|lumi) (?:freeze|stop|halt)|\b(?:would|should|could|might|will) stop\b|\blet'?s stop (?:at|for|by)\b|"
r"\bstop (?:for|at the|at a) (?:coffee|lunch|a (?:bit|while|break)|the \w+ (?:place|shop|store|cafe))|"
r"\b(?:when|if|once|whenever|after) [^,]{1,40},?\s*(?:you )?stop\b|"
r"그만(?:두|뒀|둘)|그만 ?(?:먹|마시|자|놀|울|웃|싸우|뛰)|"
r"(?<![가-힣])(?!루미|로봇|누미)(?:엄마|아빠|얘들아|[가-힣]{1,3}야|[가-힣]{1,3}아)\s+(?:좀\s+)?그만|"
r"(?-i:\b(?!(?:Lumi|Loomi|Rumi|Robot|Hey|Hi|Okay|Ok|No|Please|Now|Wait|Hello|So|Oh|Yo)\b)[A-Z][a-z]+), stop \w+ing\b", re.I)
# also: another meaning, someone else told off ("엄마 그만 찍어", "Jake, stop touching the robot!"), a condition
STOP_PAD = re.compile(r"^(?:\W*(?:hey|hi|yo|oh|okay|ok|so|um+|uh+|listen|right|alright|all right|excuse me|mister robot|"
r"robot|lumi|loomi|루미 ?씨|루미 ?선생|루미야?|로봇아?|로봇 양반|어+|아+|야|저기요?)\b)+|"
r"(?:\W*\b(?:please|plz|pls|bro|now|right now|real quick|thanks|thank you|okay|ok|would you|will you|"
r"right|already|빨리|좀|제발|당장|루미야?)\b)+\W*$", re.I)
STOP_ONLY = re.compile( # a whole sentence that only says stop / enough / stay (after calls and fillers): stop at once
r"(?:(?:sto+p|stahp|stob|top it|enough|that'?s enough|that is enough|no more|quit it|cut it out|kill it|abort|"
r"stop (?:everything|driving|moving|it|that|the robot|right there|right now)|enough (?:music|of that)|"
r"hold it|stop 해|그만|그만해|그만해요|그만하세요|그만하십시오|그만해 ?줄래요?|"
r"그만해 ?주세요|그마내|그만둬|멈춰|멈쳐|멈처|멈추라고|멈춰 ?봐|거기까지|고마 ?(?:서라|해라|해|하이소)|서|don'?t go|가지 ?마|그마+안|"
r"얼음|cut it|노래 ?꺼|음악 ?꺼|stop the (?:music|song)|music off|stay|stay (?:here|there|put|right there)|"
r"(?:just )?wait there|stop following(?: me)?|finish follow|(?:여기|거기)(?:서)? ?(?:그대로 ?)?(?:있어|있어요|계세요|stay|서|서세요|"
r"기다려)|그대로 있어|가만히 있어|stay 해|wait 해)\W*){1,3}", re.I)
def stop_order(text, markers):
@@ -3155,6 +3263,10 @@ def stop_order(text, markers):
if NOT_STOP.search(text) and not re.fullmatch(r"\W*(?:(?:no|ok|okay|lumi|루미야?|hey)\W+)*(?:sto+pp?|stob|stopped|halt|freeze|멈춰|머+엄*춰|"
r"그만|정지|스톱|스탑|stop it|stop now)\W*", text, re.I):
return False
bare = STOP_PAD.sub("", text.strip()).strip(" ,.!?~")
if bare and STOP_ONLY.fullmatch(bare):
return True # "hi Lumi, stop, okay?", "enough already", "Lumi, wait"
# (watch out / 위험해 / "Lumi, wait" / hold on: on a mission these halt it (mission_talk), never end it)
asked = bool(brain_mod.STOP_ASK.match(brain_mod.CALLING.sub("", text)) or
re.match(r"^\W*(?:stop|halt|freeze|멈춰|정지|스톱)\W*[,.!]", text, re.I))
return bool(FETCH_STOP.search(text) or asked) and (brain_mod.intent(text, markers) or ("",))[0] not in ("quiet", "look") \
@@ -3213,9 +3325,14 @@ def route(text, markers, b, holding=False, seen=None, last="", chain_ok=True):
from assistant import chain
if stop_order(text, markers):
return "stop", None
text = brain_mod.strip_asides(text) # "hi Lumi, it's my birthday, put it down!": the command (A1)
if sing.picked(text, last): # after the list of songs: "the first one", "Fantastic Baby"
return "sing", None
hold = brain_mod.not_an_order(text) or not brain_mod.direct_order(text) # only a direct order to Lumi acts
arm_last = re.match(r"ACTION: (wave|arm (?:reach|fold))\b", last or "")
if arm_last and ARM_AGAIN.match(text or ""):
return "quick", tuple((arm_last.group(1).split() + [""])[:2]) # "again!", "한 번 더" right after a wave
hold = brain_mod.not_an_order(text) or not brain_mod.direct_order(text) or brain_mod.held_back(text) # only a direct
# order to Lumi now acts (held_back: "don't ..., then ...", "yeah right, like you could ...", "..., forget it")
stuck = detour.recent() # right after a blocked drive: "try again", "go around it", "go back";
how = stuck and detour.read(text, markers, stuck["goal"]) # only a direct order (detour.read), else the LLM
if how:
@@ -3232,7 +3349,14 @@ def route(text, markers, b, holding=False, seen=None, last="", chain_ok=True):
return "seeing", got
if status_question(text):
return "status", None
if hold and not (brain_mod.held_give(text, markers) and (holding() if callable(holding) else holding)):
if (holding() if callable(holding) else holding) and brain_mod.held_put_back(text, markers):
return "quick", ("put", "back") # "it's my birthday, put that back where you found it!"
if hold: # a wave / arm rule may act on a question-form request ("악수 한번 할까요?",
arm_rule = brain_mod.intent(text, markers) # "would it be possible to wave at me?"); intent() itself refuses
if arm_rule and arm_rule[0] in ("wave", "arm"): # negations, later times, remarks, ability questions (A1)
return "quick", arm_rule
if hold and not ((brain_mod.held_give(text, markers) or brain_mod.held_place(text, markers)) and
(holding() if callable(holding) else holding)): # "테이블에 놔 줄래? 영상 찍고 있어": the hand's
rule = brain_mod.intent(text, markers) # weather / search are no motion: "Weather outside?"
return (("end", None) if talk_fate(text) == "end" else ("sing", None) if sing.asked(text, last) else
("quick", rule) if rule and rule[0] in ("weather", "search") else
@@ -3248,6 +3372,9 @@ def route(text, markers, b, holding=False, seen=None, last="", chain_ok=True):
read = read_mission(text, markers)
if read:
return "mission", read
arm_rule = brain_mod.intent(text, markers)
if arm_rule and arm_rule[0] in ("wave", "arm"):
return "quick", arm_rule # "빠빠이 해 줘", "let's see you reach your arm out": the arm, not a goodbye
if talk_fate(text) == "end" and (b.history or not HI_ANNYEONG.search(text)): # "루미 안녕!" first: hello
return "end", None
if sing.asked(text, last):
@@ -3264,7 +3391,11 @@ def route(text, markers, b, holding=False, seen=None, last="", chain_ok=True):
QUICK_RULES = {"go_to", "come", "follow", "quiet", "weather", "search", "move", "turn", "arm", "pick", "put", "move_object",
"fetch", "look", "lift", "wave", "come_back"} # what quick_command does at once
"fetch", "look", "lift", "wave", "come_back", "waist"} # what quick_command does at once
ARM_AGAIN = re.compile(r"^\W*(?:(?:okay|ok|yes|yeah|lumi|please|robot|루미야?|응|네)\W+)*(?:again|one more time|once more|"
r"do it again|(?:do it )?one more|more|again,? please|one more time,? please|한 ?번(?:만)? ?더(?: 해(?: ?줘| ?주세요)?)?|"
r"다시(?: 해(?: ?줘| ?주세요)?)?|또(?: 해(?: ?줘| ?봐)?)?)(?:\W+(?:please|again|lumi))*\W*$", re.I)
# the wave or reach just done, again ("again!", "one more time please", "한 번 더")
FILLER_PART = re.compile(r"\W*(?:(?:hey|yo|hi|okay|ok|excuse me|um+|uh+|so|now|please|thanks|thank you|real quick|quick|"
@@ -3306,7 +3437,8 @@ def not_online(text):
OUTSIDE_NAME.search(text)))
SAID_BYE = re.compile(r"\b(?:bye|goodbye|see you|take care|have a (?:good|nice|great|lovely) (?:day|one|time|visit)|enjoy (?:the|your)|"
SAID_BYE = re.compile(r"\b(?:bye|goodbye|see you|take care|have a (?:good|nice|great|lovely|wonderful) (?:day|one|time|visit|night|evening|"
r"weekend|rest)|enjoy (?:the|your)|"
r"next time|come again|good luck)\b|안녕히|다음에|또 (?:봐|봬|만나|오세요|뵙)|좋은 하루|즐거운|조심히|들어가세요",
re.I) # Lumi's own words take leave
+95
View File
@@ -0,0 +1,95 @@
"""Marker names said in other ways than wording.py reads them: the other language ("information desk" for 안내데스크,
"레지스트레이션" for Registration), the words of a two-word name the other way round ("에이 부스" for booth_A, "삼 번 부스"
for 부스3), letters and numbers as said ("booth bee", "부스 십이", "gate won"), and whisper's spellings ("hole A", "카패").
apply(t, markers) writes them as the marker's written name (wording.written) in text already normalised by
wording.norm, so every reader after it (brain.named_place, the go rules, the intent bank) sees the marker.
Every word of the name must be said: "booth" alone is no booth_A.
python assistant/place_words.py conference "레지스트레이션으로 가 줘"
"""
import functools
import re
import sys
from assistant import wording
EN_KO = { # an English word of a name -> how it is said in Korean, and other spellings
"registration": ["레지스트레이션", "레지스트레이숀", "등록"], "gallery": ["갤러리", "겔러리", "갤러리이"],
"information": ["인포메이션", "안내"], "info": ["인포", "information", "인포메이션", "안내"],
"desk": ["데스크", "대스크", "데스끄"], "cafe": ["카페", "카패", "까페", "café"], "coffee": ["커피", "코피"],
"corner": ["코너"], "elevator": ["엘리베이터", "엘레베이터", "엘베"], "lift": ["리프트"], "entrance": ["엔트런스", "입구"],
"exit": ["엑시트", "엑싯", "출구"], "stage": ["스테이지", "무대"], "main": ["메인"], "booth": ["부스", "boot", "bootH"],
"hall": ["홀", "hole", "hol"], "gate": ["게이트", "gait"], "photo": ["포토", "foto", "사진"], "zone": ["존", "zon"],
"lounge": ["라운지", "휴게실"], "lobby": ["로비"], "bar": ["바"], "table": ["테이블", "table"], "front": ["프론트", "프런트", "앞"],
"restroom": ["화장실"], "toilet": ["화장실"], "meeting": ["미팅", "회의"], "room": ["룸", "실"], "shop": ["샵", "숍"],
"gift": ["기프트", "기념품"], "dock": ["도크", "독"], "demo": ["데모"], "lab": ["랩"], "office": ["오피스", "사무실"],
}
KO_EN = { # a Korean word of a name -> how it is said in English
"안내": ["information", "info", "인포", "인포메이션"], "데스크": ["desk", "대스크"], "커피": ["coffee"], "코너": ["corner"],
"포토": ["photo", "foto"], "존": ["zone"], "입구": ["entrance", "엔트런스"], "출구": ["exit", "엑시트"],
"무대": ["stage", "스테이지"], "휴게실": ["lounge", "break room", "rest area", "라운지"], "회의실": ["meeting room", "conference room"],
"화장실": ["restroom", "toilet", "bathroom", "washroom"], "앞": ["front"], "부스": ["booth"], "라운지": ["lounge"],
"기념품점": ["gift shop", "souvenir shop"], "로비": ["lobby"], "카페": ["cafe", "café", "카패"], "갤러리": ["gallery"],
}
LETTER = {"a": ["a", "에이", "ay", "에이에"], "b": ["b", "bee", "be", "비", "삐"], "c": ["c", "see", "sea", "씨"],
"d": ["d", "dee", "디"], "e": ["e", "이"]}
NUM = {1: ["one", "won", "원", "일"], 2: ["two", "투", "이"], 3: ["three", "쓰리", "스리", "삼"],
4: ["four", "포", "사"], 5: ["five", "파이브", "오"], 6: ["six", "식스", "육"], 7: ["seven", "세븐", "칠"],
8: ["eight", "에잇", "팔"], 9: ["nine", "나인", "구"], 10: ["ten", "텐", "십"], 11: ["eleven", "십일"],
12: ["twelve", "트웰브", "십이"], 13: ["thirteen", "십삼"], 14: ["fourteen", "십사"], 15: ["fifteen", "십오"]}
SEP = r"[\s_.-]*(?:(?:번|number|no\.?|넘버)\s*)?" # between the words: "booth 3", "booth_3", "삼 번 부스"
def _segments(tok):
"""A Korean word cut into the known words of KO_EN ("커피코너" -> 커피, 코너), else the word whole."""
out, rest = [], tok
while rest:
w = next((k for k in sorted(KO_EN, key=len, reverse=True) if rest.startswith(k)), None)
if not w:
return [tok]
out.append(w)
rest = rest[len(w):]
return out
def _alts(tok, alone):
if tok.isdigit():
return [tok] + NUM.get(int(tok), [])
if tok in LETTER:
return LETTER[tok] if not alone else [tok]
return [tok] + EN_KO.get(tok, []) + KO_EN.get(tok, [])
@functools.lru_cache(maxsize=64)
def _patterns(markers):
out = []
for m in markers:
if re.fullmatch(r"p\d+|home", m.lower()):
continue
toks = []
for tok in re.findall(r"[a-z]+|\d+|[가-힣]+", m.lower()):
toks += _segments(tok) if re.fullmatch(r"[가-힣]+", tok) else [tok]
if not toks:
continue
parts = ["(?:" + "|".join(sorted({re.escape(a).replace(r"\ ", r"\s?") for a in _alts(t, len(toks) == 1)},
key=len, reverse=True)) + ")" for t in toks]
orders = [parts] + ([parts[::-1]] if len(parts) == 2 else [])
body = "|".join(SEP.join(p) for p in orders)
out.append((m, re.compile(rf"(?<![a-z0-9_가-힣])(?:the )?(?:{body})(?![a-z0-9_])(?:(?<=[a-z0-9])|{wording._KO_END})")))
return out
def apply(t, markers=()):
"""Normalised text with the markers said in other ways written as their names."""
if not markers or not t:
return t
for m, rx in _patterns(tuple(markers)):
name = wording.written(m)
t = rx.sub(lambda x: x.group(0) if x.group(0).strip() == name else name, t)
return t
if __name__ == "__main__":
from tests.blind.maps import MAPS
print(apply(wording.norm(" ".join(sys.argv[2:]), MAPS[sys.argv[1]]), MAPS[sys.argv[1]]))
+102 -26
View File
@@ -12,11 +12,12 @@ two meanings (understood / goodbye) and stays with the LLM.
.venv/bin/python assistant/quick_answers.py "who made you?" # the kind, the answer and the closest wordings
"""
import hashlib
import datetime
import pathlib
import random
import re
import sys
import time
import numpy as np
@@ -25,6 +26,9 @@ CACHE = ROOT / "data" / "quick_answers.npz"
SIM_MIN = 0.86 # the closest wording must be at least this similar (bge-m3 cosine) ...
MARGIN = 0.05 # ... and this much closer than the closest wording of any other kind (the "no" kind too)
MAX_WORDS = 12 # a longer sentence is a story or several questions: the LLM
SIM_AGREE = 0.80 # or: the AGREE_K closest wordings all of one kind, the closest at least this similar ...
MARGIN_AGREE = 0.06 # ... and this much closer than any other kind ("지금 몃 시야?": every near wording is the time)
AGREE_K = 3
# kind: (wordings, {"en": [answers], "ko": [answers]})
KINDS = {
@@ -165,7 +169,53 @@ KINDS = {
"All good here: as a robot I don't feel things, but my systems are running well."],
"ko": ["저는 로봇이라 감정은 없지만, 다 잘 돌아가고 있어요. 물어봐 주셔서 고마워요!",
"로봇이라 기분은 없지만, 아주 잘 돌아가고 있어요."]}),
# the clock: {time} / {date} / {day} are filled in when said (answer)
"time_now": ([
"what time is it", "what's the time", "what is the time now", "do you know the time", "what time is it now",
"could you tell me the time", "have you got the time", "time please", "what time've we got", "wat time is it",
"what's the time right now", "tell me the time", "the time?", "what o'clock is it", "is it noon yet",
"몇 시야", "지금 몇 시야", "몇 시예요", "지금 몇 시예요", "지금 몇 시입니까", "몇 시인지 알려 줘", "시간 좀 알려 줘",
"지금 시간 몇 시야", "현재 시각이 어떻게 돼요", "몇 시고", "지금 몇 시고", "몇 시여", "멫 시야", "몃 시야", "시간이 몇 시예요",
"타임 좀 알려 줘", "what time 이야", "지금 몇 시쯤 됐어", "벌써 몇 시야",
], {"en": ["It's {time}.", "It's {time} now."], "ko": ["지금 {time}이에요.", "{time}이에요."]}),
"date_today": ([
"what's the date today", "what is today's date", "what's the date", "what date is it", "what date is it today",
"which date is today", "today's date please", "do you know the date", "what's today's date", "what day of the month is it",
"what's the date today robot", "date please",
"오늘 며칠이야", "오늘 며칠이에요", "오늘 날짜가 뭐야", "오늘 날짜 알려 줘", "오늘이 며칠입니까", "오늘 날짜가 어떻게 돼요",
"며칠이야 오늘", "오늘 몇 월 며칠이야", "오늘 몇 월 며칠이에요", "날짜 좀 알려 주세요", "오늘 며칠이고", "오늘 메칠이여",
"today 며칠이야", "오늘 date가 뭐야", "날짜 알려 줘", "오늘이 며칠이죠",
"what month is it", "which month is it", "what month are we in", "몇 월이야", "지금 몇 월이에요", "이번 달이 몇 월이야",
# the day of the week: the same answer (the date says the day)
"what day is it", "what day is it today", "which day of the week is it", "what day of the week is it",
"what's today", "is it friday today", "what weekday is it", "do you know what day it is", "today is what day",
"오늘 무슨 요일이야", "오늘 무슨 요일이에요", "무슨 요일이야", "오늘 요일이 뭐야", "오늘이 무슨 요일입니까", "요일 알려 줘",
"오늘 뭔 요일이고", "오늘 무슨 요일이여", "today 무슨 요일이야", "오늘 금요일 맞아",
], {"en": ["Today is {date}.", "It's {date} today."], "ko": ["오늘은 {date}이에요.", "{date}이에요."]}),
"days_to_christmas": ([
"how many days until christmas", "how many days are left before christmas", "how long until christmas",
"days left to christmas", "when is christmas from now", "is christmas soon", "christmas how many days left",
"how many sleeps till christmas", "크리스마스까지 며칠 남았어", "크리스마스까지 며칠 남았어요", "크리스마스 얼마나 남았어",
"크리스마스 언제 와", "성탄절까지 며칠이야", "크리스마스 디데이 알려 줘", "크리스마스까지 몇 일 남았어요", "산타 언제 와",
], {"en": ["Christmas is in {xmas} days.", "{xmas} days until Christmas."],
"ko": ["크리스마스까지 {xmas}일 남았어요.", "{xmas}일 뒤가 크리스마스예요."]}),
}
KO_DAYS = ["월요일", "화요일", "수요일", "목요일", "금요일", "토요일", "일요일"]
def clock_words(line, lang, now=None):
"""The answer line with {time} / {date} / {day} filled from the clock (this machine's local time)."""
lt = time.localtime(now)
h, m = lt.tm_hour, lt.tm_min
if lang == "ko":
words = {"time": f"{'오전' if h < 12 else '오후'} {h % 12 or 12}시" + (f" {m}분" if m else ""),
"date": f"{lt.tm_mon}월 {lt.tm_mday}일 {KO_DAYS[lt.tm_wday]}", "day": KO_DAYS[lt.tm_wday]}
else:
words = {"time": f"{h % 12 or 12}:{m:02d} {'am' if h < 12 else 'pm'}",
"date": time.strftime("%A, %B ", lt) + str(lt.tm_mday), "day": time.strftime("%A", lt)}
y = lt.tm_year + (1 if (lt.tm_mon, lt.tm_mday) > (12, 25) else 0)
words["xmas"] = (datetime.date(y, 12, 25) - datetime.date(lt.tm_year, lt.tm_mon, lt.tm_mday)).days
return line.format(**words) if "{" in line else line
NO = [
# the cameras: assistant/seeing.py's or the LLM's
@@ -201,23 +251,40 @@ NO = [
"you're cool", "you look cute", "you're so tall", "nice robot", "what a cool robot", "you're amazing", "i like you",
"로봇 정말 멋있어요", "귀엽다", "멋있다", "키 크다", "로봇 신기하네요", "너 좋아", "대단하다",
# the weather, the time, closings
"what's the weather", "what time is it", "what day is it", "thanks", "thank you", "bye", "okay", "i see",
"날씨 어때", "지금 몇 시야", "고마워", "감사합니다", "잘 가", "알겠어요", "그렇구나",
"what's the weather", "thanks", "thank you", "bye", "okay", "i see",
"날씨 어때", "고마워", "감사합니다", "잘 가", "알겠어요", "그렇구나",
]
# never by meaning: the cameras, the visitor about themselves, a doubt or a fragment of the talk before
from assistant import bank_words # more wordings / kinds: assistant/bank_words/*.py
for _m in bank_words.modules():
for _k, (_t, _a) in getattr(_m, "QUICK_KINDS", {}).items():
KINDS.setdefault(_k, ([], _a))[0].extend(_t)
for _k, _t in bank_words.merged("QUICK").items():
(NO if _k == "no" else KINDS[_k][0]).extend(_t)
_said = {t for texts, _ in KINDS.values() for t in texts}
NO = [t for t in NO if t not in _said] # a wording listed for a kind is that kind's
CAMERA = re.compile(r"\b(?:see|seeing|saw|look(?:s|ing)?|watch|camera|wearing|holding|in front of|behind|colou?r|"
r"recogni[sz]e|remember)\b|보여|보이|보니|봐|봤|입었|들고|색|카메라|앞에|뒤에|알아봐|기억", re.I)
ABOUT_ME = re.compile(r"\b(?:i|i'm|am i|my|me|mine)\b|(?:^|\s)(?:나|내|제|저|난|전)(?:는|가|를|의)?\s", re.I)
r"recogni[sz]e|remember)\b|보여|보이|보니|(?<!해 )(?<!해)봐|봤|입었|들고|색|카메라|앞에|뒤에|알아봐|기억", re.I)
ABOUT_ME = re.compile(r"\b(?:i(?! (?:call|address) you\b)|i'm|am i|my|me|mine)\b|(?:^|\s)(?:나|내|제|저|난|전)(?:는|가|를|의)?\s", re.I)
FRAGMENT = re.compile(r"^\W*(?:and|so|but|then|or|also|why|really|seriously|wait|what about|how about|how come|are you sure)\b|"
r"^\W*(?:그럼|그러면|그리고|근데|그런데|그래서|아니|왜|진짜|정말|확실|설마|또)|"
r"\b(?:that|it|they|them|there|this one|the arm|your arm)\b|그거|그건|거기|그분|그 회사|걔", re.I)
OTHER = re.compile(r"\b(?:lift|carry|hold|items?|things?|stuff|price|cost)\b|들 ?수|들어|물건|얼마야|얼마예요|"
r"\b(?:that|(?<!is )(?<!was )(?<!is it )(?<!how's )(?<!how is )it(?! is (?:now|today))|they|them|"
r"(?<!hello )(?<!hi )(?<!hey )there|this one|the arm|your arm)\b|"
r"그거|그건|거기|그분|그 회사|걔", re.I) # not the clock's "it": "what day is it?"
OTHER = re.compile(r"\b(?:lift|carry|hold|items?|(?<!this )things?|stuff|price|cost)\b|들 ?수|(?<!만)들어|물건|"
r"^(?!.*(?:키|무게|체중|신장|속도|시간|나이)).*얼마(?:야|예요)|"
r"맞(?:아|지|죠|나|습니까)|아니(?:야|에요|죠)", re.I) # what it can hold, the price, a check: the LLM
SEVERAL = re.compile(r"\band\b|그리고|[??].+\S|하고\s|랑\s", re.I)
EVENT_TIME = re.compile(r"\b(?:what time|what day|which day|what date) (?:does|do|did|will|is|are|was|were|should|can)\b"
r"(?!\s+(?:it|today)\b)|몇 ?시(?:에|부터|까지|쯤에)|며칠(?:에|까지|부터)|무슨 요일(?:에|까지|부터)|"
r"\b(?:open|close|start|end|begin|finish)\b|열어요|닫아요|시작|끝나", re.I) # an event's time: the LLM
NAMES_LUMI = re.compile(r"\b(?:you|your|yourself|u|ur|lumi)\b|(?:^|\s)(?:너|넌|니|네|당신|루미|본인|자기)", re.I)
_bank = None
_named = None # (kind names, int code per bank row) for intent_bank._top
def examples():
@@ -226,36 +293,39 @@ def examples():
def _load():
"""(vectors, kinds): from data/quick_answers.npz when it holds these very wordings, else embedded now."""
"""(vectors, kinds) of the bank; embeddings kept per wording in the cache (bank_words.vectors)."""
global _bank
if _bank is None:
from assistant import knowledge
from assistant import bank_words
ex = examples()
key = hashlib.sha1("\n".join(f"{t}\t{k}" for t, k in ex).encode()).hexdigest()
if CACHE.exists():
z = np.load(CACHE)
if str(z["key"]) == key:
_bank = (z["vecs"], z["kinds"])
return _bank
vecs = knowledge.embed([t for t, _ in ex])
kinds = np.array([k for _, k in ex])
np.savez(CACHE, vecs=vecs, kinds=kinds, key=key)
_bank = (vecs, kinds)
_bank = (bank_words.vectors([t for t, _ in ex], CACHE), np.array([k for _, k in ex]))
return _bank
ASKING = re.compile(r"^\W*(?:(?:hang on|wait|okay|ok|so|um+|uh+|hey|excuse me|sorry|just out of curiosity|out of curiosity|"
r"i(?:'m| am) curious|quick question|one question|let me ask(?: (?:it|you|him|her))?|i bet (?:it'?s|you'?re) \w+|"
r"(?:may|can|could|might) i (?:ask|know)(?: you)?|i(?:'d| would) like to know|i want(?:ed)? to (?:ask|know)|"
r"i wonder|do you mind (?:telling me|if i ask)|(?:(?:can|could|would|will) you )?tell me|might i trouble you for|could i trouble you for|잠깐(?:만)?|저기요?|궁금한데(?:요)?|궁금해서(?:요)?|"
r"하나 물어봐도 (?:돼|될까)요?|여쭤봐도 될까요|물어볼게(?:요)?|질문(?: 하나)?(?: 있어요| 있는데요?)?)"
r"\b[\s,.!?~:-]*)+", re.I)
# "May I ask your age?", "Hang on, let me ask it. What's your name?", "궁금한데, 몇 살이에요?": the question after
def _core(text):
from assistant import brain
t = brain.CALLING.sub("", text or "").strip()
t = ASKING.sub("", brain.CALLING.sub("", brain.unfill(text or "")).strip()).strip() or text or ""
t = re.sub(r"[\s,]*(?:lumi|루미야|루미)?[\s,.!?~]*$", "", t, flags=re.I).strip()
return t or (text or "").strip(" ,.!?~")
def guarded(text, history=()):
"""Why these words are not a quick answer's (the LLM's or another reader's), or None."""
t = (text or "").strip()
from assistant import brain
t = ASKING.sub("", brain.unfill((text or "").strip())).strip() or (text or "").strip() # "what time is, uh, it?"
if not t or len(t.split()) > MAX_WORDS:
return "length"
if re.search(r"\b(?:good ?bye|bye|see you|farewell)\b|잘 ?가|안녕히|다음에 봐", t, re.I):
return "closing" # "goodbye" is never a hello
if CAMERA.search(t):
return "camera"
if ABOUT_ME.search(t):
@@ -266,6 +336,8 @@ def guarded(text, history=()):
return "several"
if OTHER.search(t):
return "other"
if EVENT_TIME.search(t):
return "event time"
if history and not NAMES_LUMI.search(t):
return "in a talk, not naming Lumi" # "how old?" / "몇 살이에요?" after the company: about that
return None
@@ -282,10 +354,14 @@ def kind_of(text, history=()):
except OSError as e: # no embedding server: the LLM answers
print(f"quick answers: {e}")
return None
sims = vecs @ q
top = int(np.argmax(sims))
best = str(kinds[top])
if best == "no" or sims[top] < SIM_MIN or sims[top] - sims[kinds != best].max() < MARGIN:
from assistant import intent_bank
global _named
if _named is None:
names, codes = np.unique(kinds, return_inverse=True)
_named = ([str(n) for n in names], codes)
best, top, margin, agree, _ = intent_bank._top(vecs @ q, _named, k=AGREE_K)
sure = top >= SIM_MIN and margin >= MARGIN or agree and top >= SIM_AGREE and margin >= MARGIN_AGREE
if best == "no" or not sure:
return None
if best == "hello" and history:
return None # hello in the middle of a talk: the LLM
@@ -304,7 +380,7 @@ def answer(text, lang="en", history=()):
lines = KINDS[kind][1]["ko" if lang == "ko" else "en"]
choices = [x for x in lines if x != _last.get(kind)] or lines
_last[kind] = random.choice(choices)
return _last[kind]
return clock_words(_last[kind], lang)
if __name__ == "__main__":
+2 -1
View File
@@ -850,7 +850,8 @@ def _pieces(c, markers, after):
def rules(text, markers=()):
"""(steps, unread clauses). Steps are merged where two clauses mean one ("look for the table" + "put it there")."""
cut, says = _cut_says(text)
text = re.sub(r"(?<=[가-힣A-Za-z0-9])(으로|로|에)(가서|가고|가면)(?=[가-힣])", r"\1 \2 ", text or "") # written without
cut, says = _cut_says(text) # spaces: "부스A로가서저희"
t = _protect_lists(_norm(cut, markers), markers)
t = _INTERJECTION.sub("", t)
steps, unread = [], []
+520
View File
@@ -940,12 +940,524 @@ _BANK = {
("무슨 말인지 알아들었어?", "네, 알아들었어요. 재미있는 말이네요."),
],
},
"backchannel": { # the listener reacts or says "understood": a few fitting words, never "you're welcome"
"en": [
("Gotcha.", "Great."),
("Okay.", "Alright."),
("Wow okay.", "Surprising, right?"),
("Oh I see.", "Yes, that's how it works."),
("Cool cool.", "Glad you like it."),
("Fine.", "Okay."),
("Huh, interesting.", "It is, isn't it?"),
("Makes sense.", "Good, glad it's clear."),
("lol ok", "Ha, okay."),
("Right on.", "Sure thing."),
],
"ko": [
("아 그렇구나.", "네, 그래요."),
("오케이.", "네, 좋아요."),
("헐 대박.", "놀라우시죠?"),
("오 신기하다.", "신기하죠?"),
("그렇군요.", "네, 맞아요."),
("음 알겠어.", "네, 알겠어요."),
("이해했습니다.", "네, 다행입니다."),
("오키.", "네, 좋아요."),
("아하.", "네, 그렇게 돼요."),
],
},
# end of bank
}
EXAMPLES = [(cat, lang, said, reply)
for cat, langs in _BANK.items() for lang, pairs in langs.items() for said, reply in pairs]
# Follow-ups on Lumi's own last answer, in a talk on any topic: (lang, question before, Lumi's answer, follow-up, reply).
# The reply answers the follow-up about that answer itself (its reason, time, place, person, what it meant, what came
# next, the same point again for "really?"), never changes the topic and never asks what they mean. A nested follow-up
# has the answer before it as its "answer". brain._follow_examples shows the two closest with a short follow-up.
FOLLOWUPS = [
# ---------- English: the world ----------
("en", "Why is the sky blue?", "Sunlight scatters off the air, and blue light scatters the most.",
"Why does blue scatter more?", "Its waves are shorter, and short waves bounce off tiny air molecules much more."),
("en", "Why is the sky blue?", "Sunlight scatters off the air, and blue light scatters the most.",
"Then why are sunsets red?", "At sunset the light crosses far more air, so the blue is scattered away and the reds reach you."),
("en", "How far is the Moon?", "About 384,000 kilometres on average.",
"On average?", "Yes, its orbit is an oval, so it goes from about 363,000 to 405,000 kilometres."),
("en", "What's the biggest planet?", "Jupiter, about eleven times as wide as Earth.",
"Really?", "Yes, Jupiter is about eleven times Earth's width; more than a thousand Earths would fit inside."),
("en", "Is Pluto a planet?", "Not anymore: since 2006 it's a dwarf planet.",
"Why?", "It hasn't cleared its orbit of other objects, one of the three rules astronomers set that year."),
("en", "Why isn't Pluto a planet?", "It hasn't cleared its orbit of other objects, one of the rules set in 2006.",
"Who decided that?", "The International Astronomical Union, at its meeting in Prague."),
("en", "How hot is the Sun?", "About 5,500 degrees Celsius at the surface.",
"And inside?", "The core is around 15 million degrees."),
("en", "Why do we have seasons?", "Because Earth's axis is tilted about 23 degrees.",
"What do you mean, tilted?", "Earth spins leaning to one side, so for half the year your half faces the Sun more directly: that's summer."),
("en", "Why do we have seasons?", "Because Earth's axis is tilted about 23 degrees.",
"So it's not about distance?", "No, Earth is actually closest to the Sun in early January, in the northern winter."),
("en", "What's the speed of light?", "About 300,000 kilometres a second.",
"Can anything go faster?", "Not as far as we know: nothing with mass can even reach it."),
("en", "What is a black hole?", "A place where gravity is so strong that not even light gets out.",
"Then how do we see them?", "By what's around them: glowing hot gas and stars circling something invisible. In 2019 we even got a picture of one's shadow."),
("en", "Why is the ocean salty?", "Rivers carry minerals from rocks into the sea, and when water evaporates the salt stays.",
"Then why aren't rivers salty?", "They are, very slightly, but their water keeps flowing and being replaced, so salt never builds up."),
("en", "How many bones does a person have?", "206 in an adult.",
"And a baby?", "Close to 300; many of them grow together over the years."),
("en", "Why do leaves turn red in autumn?", "The green chlorophyll breaks down and other colours show.",
"Why does it break down?", "Days get shorter and colder, so the tree stops making it and saves its energy for winter."),
("en", "Why do we have leap years?", "A year is about 365 and a quarter days, so every four years we add a day.",
"Every four years exactly?", "Almost: years divisible by 100 skip it unless they divide by 400, so 2000 was a leap year and 1900 wasn't."),
("en", "Why do cats purr?", "Mostly when they're content, but also to calm themselves when hurt or scared.",
"Wait, when they're hurt?", "Yes, purring seems to soothe them, and some scientists think the vibration even helps them heal."),
("en", "What's the fastest animal?", "The peregrine falcon, over 300 km/h in a dive.",
"And on land?", "The cheetah, around 100 km/h or a bit more in a short sprint."),
("en", "What's the fastest land animal?", "The cheetah, around 100 km/h in a short sprint.",
"How long can it keep that up?", "Only a few hundred metres; then it has to rest."),
("en", "How long do elephants live?", "About 60 to 70 years in the wild.",
"Longer than dogs, then.", "Much longer: most dogs live 10 to 13 years."),
("en", "Where do pandas live?", "In the mountains of central China.",
"What do they eat?", "Almost only bamboo, many kilos of it every day."),
("en", "Why do onions make you cry?", "Cutting them releases a gas that stings your eyes.",
"How do I stop it?", "Chill the onion first and use a sharp knife: fewer cells break, so less gas."),
("en", "Why do we yawn?", "Nobody knows for sure; one idea is that it cools the brain.",
"Cools it how?", "The deep breath brings in cooler air, and stretching the jaw moves more blood through the head."),
("en", "Why do we sleep?", "The body repairs itself and the brain sorts memories while you sleep.",
"How much do I need?", "Most adults need seven to nine hours."),
("en", "How much water should I drink?", "Roughly 1.5 to 2 litres a day for most adults, more when it's hot.",
"Does coffee count?", "Mostly yes: the water in coffee and tea counts too."),
("en", "Is coffee bad for you?", "Not in moderation: up to about four cups a day is fine for most adults.",
"Why four?", "That's around 400 mg of caffeine, the limit health agencies give for healthy adults."),
("en", "What is kimchi?", "Fermented vegetables, usually napa cabbage with chili, garlic and fish sauce.",
"Why ferment it?", "It kept vegetables through the winter, and fermenting gives the sour taste and lots of good bacteria."),
("en", "Why do Koreans ferment kimchi?", "It kept vegetables through the winter and gives the sour taste.",
"How long does it keep?", "Months in the fridge; it just gets more sour, and old kimchi is great in stew."),
# history and people
("en", "When did World War Two end?", "In 1945: in May in Europe and in September in Asia.",
"Why two dates?", "Germany surrendered in May; Japan surrendered in August and signed in September."),
("en", "Who invented the telephone?", "Alexander Graham Bell got the patent in 1876.",
"Got the patent?", "Yes, others like Elisha Gray and Antonio Meucci worked on it too, so who was first is still argued about."),
("en", "Who was King Sejong?", "The fourth king of Joseon, who created Hangul in 1443.",
"Why did he make it?", "Chinese characters were too hard for ordinary people, so he wanted letters anyone could learn quickly."),
("en", "Why did King Sejong make Hangul?", "Chinese characters were too hard for ordinary people to learn.",
"How long did it take to learn?", "It was said a wise person could learn it in a morning, and anyone within ten days."),
("en", "When was the Korean War?", "From 1950 to 1953.",
"Did it end?", "Not officially: the fighting stopped with an armistice in 1953, and no peace treaty was ever signed."),
("en", "Did the Korean War end?", "The fighting stopped with an armistice in 1953, but no peace treaty was signed.",
"What do you mean?", "The shooting stopped, but the war was never formally closed by a treaty."),
("en", "Who built the pyramids?", "Egyptian workers, about 4,500 years ago.",
"Not slaves?", "Most historians now think paid workers built them, living in villages near the site."),
("en", "What happened to the Titanic?", "It hit an iceberg in April 1912 and sank on its first voyage.",
"And then?", "About 1,500 people died, and afterwards ships had to carry enough lifeboats for everyone."),
("en", "How did the dinosaurs die out?", "An asteroid hit what is now Mexico about 66 million years ago.",
"And then what?", "Dust blocked the sunlight for years, plants died and the big animals starved; small mammals survived."),
("en", "Who was the first person on the Moon?", "Neil Armstrong.",
"When?", "On 20 July 1969, with Apollo 11."),
("en", "When did Armstrong walk on the Moon?", "On 20 July 1969, with Apollo 11.",
"Who was with him?", "Buzz Aldrin walked with him; Michael Collins stayed in orbit."),
("en", "Who painted the Mona Lisa?", "Leonardo da Vinci, in the early 1500s.",
"Where is it now?", "In the Louvre in Paris."),
("en", "Where is the Mona Lisa?", "In the Louvre in Paris.",
"Why is it so famous?", "Its soft style and smile were new back then, and its theft in 1911 made it world news."),
("en", "Who wrote Romeo and Juliet?", "William Shakespeare, in the 1590s.",
"Who was he?", "An English playwright and poet from Stratford-upon-Avon, often called the greatest writer in English."),
("en", "Who founded Apple?", "Steve Jobs, Steve Wozniak and Ronald Wayne, in 1976.",
"Who's Ronald Wayne?", "The third co-founder: he sold his ten percent share after twelve days, for 800 dollars."),
("en", "Who were the Beatles?", "A band from Liverpool, the best-selling band in history.",
"When?", "In the 1960s: they played together until they split up in 1970."),
# places
("en", "What's the capital of Australia?", "Canberra.",
"Not Sydney?", "No, Sydney is the biggest city, but Canberra was built as the capital as a compromise between Sydney and Melbourne."),
("en", "What's the capital of Japan?", "Tokyo.",
"Since when?", "Since 1868; before that, Kyoto was the capital for over a thousand years."),
("en", "What's the longest river?", "The Nile, about 6,650 km, though some say the Amazon is longer.",
"Why do they disagree?", "It depends on where you say the river starts, and the Amazon's source is hard to pin down."),
("en", "How high is Mount Everest?", "8,849 metres.",
"Is it still growing?", "Yes, a few millimetres a year, as India keeps pushing into Asia."),
("en", "How many people live in Seoul?", "About 9.4 million.",
"Is that a lot?", "It is: about one in five South Koreans lives in Seoul, and about half in the whole capital area."),
("en", "Where is Jeju?", "An island off the south coast of Korea.",
"How do people get there?", "Most fly: Seoul to Jeju is about an hour, one of the busiest air routes in the world."),
("en", "What's the biggest ocean?", "The Pacific.",
"How big?", "About a third of Earth's surface, bigger than all the land put together."),
("en", "How long is the Great Wall?", "Over 20,000 kilometres with all its branches.",
"Can you see it from space?", "No, that's a myth: it's far too narrow to see with the naked eye from orbit."),
("en", "What's the tallest building?", "The Burj Khalifa in Dubai, 828 metres.",
"When was it built?", "It opened in 2010."),
# sports, culture, tech
("en", "How long is a marathon?", "42.195 kilometres.",
"Why such an odd number?", "At the 1908 London Olympics the course ran from Windsor Castle to the royal box, and that distance stuck."),
("en", "Who has won the most World Cups?", "Brazil, five times.",
"When was the last one?", "In 2002, beating Germany in the final in Japan."),
("en", "What is taekwondo?", "A Korean martial art known for high, fast kicks.",
"Is it in the Olympics?", "Yes, it has been an Olympic sport since Sydney 2000."),
("en", "Is taekwondo in the Olympics?", "Yes, since Sydney 2000.",
"And before that?", "It was a demonstration sport at Seoul 1988 and Barcelona 1992."),
("en", "What is K-pop?", "Korean pop music, known for its groups, dancing and polished videos.",
"Since when is it big abroad?", "It spread in Asia in the 2000s; Psy's Gangnam Style in 2012 and then BTS made it big worldwide."),
("en", "What is AI?", "Software that learns from data to understand speech, recognise pictures and so on.",
"Like you?", "Yes, I use AI to understand you and to answer, all on my own computer."),
("en", "How does Wi-Fi work?", "It sends data over radio waves between your device and a router.",
"What kind of radio waves?", "Mostly at 2.4 and 5 gigahertz, near what a microwave oven uses, but far weaker."),
("en", "What is inflation?", "Prices rising over time, so money buys less.",
"Why does it happen?", "Usually when people want more than is made, or when costs like energy go up."),
("en", "What is inflation?", "Prices rising over time, so money buys less.",
"Is it bad?", "A little, around two percent a year, is normal; high inflation eats into savings and wages."),
("en", "What can robots do in hospitals?", "Deliver medicine, disinfect rooms and help surgeons.",
"For example?", "Surgical robots like the da Vinci system let a surgeon operate through tiny cuts."),
("en", "How do you say thank you in Japanese?", "Arigatou, or more politely arigatou gozaimasu.",
"And in Chinese?", "Xièxie."),
("en", "How many letters does Hangul have?", "Twenty-four basic letters.",
"Only?", "Yes, fourteen consonants and ten vowels, combined into a block for each syllable."),
# casual styles, slang, doubt
("en", "How old is the universe?", "About 13.8 billion years.",
"how do they even know that", "From how fast galaxies move apart and from the oldest light, the glow left over from the Big Bang."),
("en", "Why do flamingos stand on one leg?", "It probably saves body heat and energy.",
"fr?", "Yes, really: one leg tucked up loses less heat, and they can even doze like that."),
("en", "What's the hottest pepper?", "Pepper X, rated around 2.7 million Scoville units.",
"no way", "It's true, about 2.7 million: hundreds of times hotter than a jalapeño."),
("en", "Why is Venus so hot?", "Its thick carbon dioxide air traps the heat.",
"says who?", "Space probes: the Soviet Venera landers measured about 460 degrees at the surface."),
("en", "Are tomatoes fruit?", "Yes, botanically: they grow from the flower and hold the seeds.",
"meaning?", "To a botanist a fruit is the part with the seeds, so tomatoes count, even though we cook them like vegetables."),
("en", "Why do ships float?", "They push aside water that weighs as much as they do.",
"how so?", "A hull is mostly air inside, so it can push aside a lot of water before it's heavy enough to sink."),
("en", "What's the most spoken language?", "English, counting people who learned it; Mandarin has the most native speakers.",
"which one's bigger then?", "Counting everyone, English; counting only native speakers, Mandarin."),
("en", "Who invented the light bulb?", "Thomas Edison made the first practical one, in 1879.",
"like, the first ever?", "Not the very first: others made glowing bulbs before him, but his lasted long enough to be useful."),
# ---------- English: Lumi itself ----------
("en", "Can you climb stairs?", "No, I can't.",
"How come?", "I drive on wheels and have no legs, so stairs stop me."),
("en", "How long does your battery last?", "About 10 hours on a charge.",
"Why so long?", "I carry a big 24-volt, 45 Ah lithium battery in my base."),
("en", "Can you go to the kitchen?", "That place isn't on my map.",
"Why not?", "I only drive to places on my map, and the kitchen isn't one of them."),
("en", "How fast can you go?", "Normally 0.6 metres a second, at most 1.2.",
"Why so slow?", "I drive among people, so I keep it slow to be safe."),
("en", "Who made you?", "Cutshion Company developed me.",
"Where are they?", "In Seoul."),
("en", "How tall are you?", "146 cm, up to 186 with the lift.",
"Really? You look shorter.", "Yes, really: 146 cm, and 186 with my lift up."),
("en", "How much can you carry?", "About 1 kg in my hand.",
"That's it?", "Yes, about 1 kg: my arm carries 2 kg in all, and the gripper takes part of that."),
("en", "How old are you?", "I'm two years old.",
"Are you sure?", "Yes, I'm two."),
("en", "Can you see in the dark?", "I'm not sure about that.",
"What do you mean you're not sure?", "Nobody has told me how well my cameras work in the dark, so I won't guess."),
("en", "Can you wave?", "I won't wave right now: I'm holding a cup.",
"Why not?", "With the cup in my hand, waving could make it fall or spill."),
("en", "How do you know where you are?", "I compare my lidar with my map.",
"How exact is that?", "To within about 5 centimetres."),
("en", "What computer do you have?", "An NVIDIA Jetson AGX Thor.",
"Why that one?", "It runs speech recognition, the language model and my cameras all at once, right inside me."),
# ---------- Korean: the world ----------
("ko", "하늘은 왜 파래요?", "햇빛이 공기에 부딪혀 흩어지는데, 파란빛이 가장 많이 흩어져서 그래요.",
"왜 파란빛이 더 흩어져?", "파란빛은 파장이 짧아서 작은 공기 분자에 훨씬 잘 부딪히거든요."),
("ko", "하늘은 왜 파래요?", "햇빛이 공기에 부딪혀 흩어지는데, 파란빛이 가장 많이 흩어져서 그래요.",
"그럼 노을은 왜 빨개?", "해 질 때는 빛이 공기를 훨씬 길게 지나와서, 파란빛은 흩어지고 붉은빛만 남아서 그래요."),
("ko", "세종대왕이 누구예요?", "조선의 네 번째 왕으로, 1443년에 한글을 만드셨어요.",
"왜 만들었대?", "한자가 너무 어려워서, 백성이 쉽게 배울 수 있는 글자가 필요하다고 생각하셨어요."),
("ko", "세종대왕은 한글을 왜 만들었어요?", "한자가 너무 어려워서 백성이 쉽게 배울 글자가 필요했어요.",
"진짜?", "네, 훈민정음 서문에도 백성이 쉽게 익혀 편하게 쓰게 하려고 만들었다고 적혀 있어요."),
("ko", "한국전쟁은 언제였어요?", "1950년부터 1953년까지예요.",
"끝난 거야?", "공식적으로는 아니에요. 1953년 정전협정으로 싸움만 멈췄고 평화협정은 아직 없어요."),
("ko", "한국전쟁은 끝났어요?", "1953년 정전협정으로 싸움은 멈췄지만 평화협정은 없어요.",
"그게 무슨 말이야?", "싸움은 멈췄지만, 전쟁을 공식적으로 끝내는 조약은 맺지 않았다는 뜻이에요."),
("ko", "에베레스트는 얼마나 높아요?", "8,849미터예요.",
"지금도 자라?", "네, 인도 쪽 땅이 계속 밀고 올라와서 1년에 몇 밀리미터씩 높아져요."),
("ko", "호주 수도가 어디야?", "캔버라예요.",
"시드니 아니야?", "아니에요. 시드니가 제일 큰 도시지만, 시드니와 멜버른 사이의 타협으로 캔버라를 수도로 만들었어요."),
("ko", "김치는 왜 발효시켜요?", "겨울 동안 채소를 오래 보관하려고요. 발효하면서 새콤한 맛도 생겨요.",
"얼마나 오래 가?", "냉장고에서 몇 달은 가요. 점점 시어지는데, 신 김치는 찌개에 좋아요."),
("ko", "마라톤은 몇 킬로예요?", "42.195킬로미터예요.",
"왜 그렇게 애매해?", "1908년 런던 올림픽 때 윈저성에서 왕실 관람석까지로 코스를 정했는데, 그 거리가 굳어졌어요."),
("ko", "공룡은 왜 멸종했어요?", "약 6,600만 년 전에 소행성이 지금의 멕시코에 떨어졌어요.",
"그래서?", "먼지가 몇 년 동안 햇빛을 가려서 식물이 죽고, 큰 동물들이 먹을 게 없어졌어요."),
("ko", "공룡은 소행성이 떨어진 다음 어떻게 됐어요?", "햇빛이 가려져 식물이 죽고 큰 동물들이 굶었어요.",
"그럼 그 다음엔?", "살아남은 작은 포유류가 퍼져 나갔고, 그 후손 중에 사람도 있어요."),
("ko", "타이타닉은 어떻게 됐어요?", "1912년 4월 첫 항해 중에 빙산에 부딪혀 침몰했어요.",
"그 다음엔요?", "1,500명쯤 목숨을 잃었고, 그 뒤로 배에 모든 사람이 탈 구명보트를 싣도록 규칙이 바뀌었어요."),
("ko", "고양이는 왜 그르렁거려?", "보통 기분이 좋을 때지만, 아프거나 무서울 때 스스로 진정하려고도 해요.",
"아플 때도?", "네, 그 진동이 고양이를 편하게 해 주고, 회복을 돕는다는 연구도 있어요."),
("ko", "명왕성은 행성이에요?", "지금은 아니에요. 2006년부터 왜소행성이에요.",
"왜?", "자기 궤도 근처의 다른 천체들을 치우지 못해서, 그해 정한 행성 조건 하나를 못 채웠어요."),
("ko", "명왕성은 왜 행성이 아니에요?", "궤도 근처의 다른 천체를 치우지 못해서, 2006년에 정한 조건을 못 채웠어요.",
"누가 정했는데?", "국제천문연맹이 체코 프라하 총회에서 정했어요."),
("ko", "커피 몸에 나빠요?", "적당히 마시면 괜찮아요. 건강한 어른은 하루 네 잔 정도까지 괜찮다고 해요.",
"왜 네 잔이야?", "카페인 400밀리그램쯤인데, 보건 당국이 건강한 어른에게 권하는 한도예요."),
("ko", "서울 인구가 얼마나 돼요?", "약 940만 명이에요.",
"많은 거야?", "네, 한국 사람 다섯 명 중 한 명쯤이 서울에 살아요."),
("ko", "달까지 얼마나 멀어요?", "평균 38만 4천 킬로미터쯤이에요.",
"평균이라니?", "달 궤도가 타원이라서 36만 3천에서 40만 5천 킬로미터 사이로 바뀌어요."),
("ko", "빛은 얼마나 빨라?", "1초에 약 30만 킬로미터예요.",
"더 빠른 건 없어?", "지금까지 알기로는, 질량이 있는 건 빛의 속도에 닿지도 못해요."),
("ko", "블랙홀이 뭐예요?", "중력이 너무 세서 빛도 빠져나오지 못하는 곳이에요.",
"그럼 어떻게 봐?", "주변의 뜨거운 가스나 그 둘레를 도는 별을 보고 알아요. 2019년엔 블랙홀 그림자 사진도 찍었어요."),
("ko", "윤년은 왜 있어요?", "1년이 365일하고 4분의 1일쯤이라서, 4년마다 하루를 더해요.",
"정확히 4년마다?", "거의요. 100으로 나누어지는 해는 빼고, 400으로 나누어지면 다시 넣어요. 그래서 2000년은 윤년, 1900년은 아니었어요."),
("ko", "바다는 왜 짜?", "강물이 바위의 소금기를 바다로 실어 오고, 물만 증발해서 소금이 남아서요.",
"그럼 강은 왜 안 짜?", "강도 아주 조금 짜지만, 물이 계속 흘러 바뀌어서 소금이 쌓이지 않아요."),
("ko", "사람 뼈는 몇 개예요?", "어른은 206개예요.",
"아기는?", "300개 가까이 되는데, 자라면서 여러 개가 붙어서 줄어요."),
("ko", "단풍은 왜 들어요?", "초록색 엽록소가 분해되면서 다른 색이 드러나서요.",
"왜 분해돼?", "날이 짧고 추워지면 나무가 겨울을 나려고 엽록소를 더 만들지 않아서요."),
("ko", "모나리자는 누가 그렸어요?", "레오나르도 다빈치가 1500년대 초에 그렸어요.",
"지금 어디 있어?", "파리 루브르 박물관에 있어요."),
("ko", "모나리자는 어디 있어요?", "파리 루브르 박물관에 있어요.",
"왜 그렇게 유명해?", "부드러운 화법과 미소가 그때로선 새로웠고, 1911년 도난 사건으로 세계적인 뉴스가 됐어요."),
("ko", "인공지능이 뭐예요?", "데이터로 배워서 말을 알아듣거나 그림을 알아보는 소프트웨어예요.",
"너처럼?", "네, 저도 인공지능으로 말씀을 알아듣고 대답해요. 전부 제 안의 컴퓨터에서 돌아가요."),
("ko", "인플레이션이 뭐야?", "물가가 계속 올라서 같은 돈으로 살 수 있는 게 줄어드는 거예요.",
"왜 생겨?", "보통 사려는 사람이 만들어지는 물건보다 많아지거나, 에너지 같은 비용이 오를 때 생겨요."),
("ko", "태권도는 올림픽 종목이에요?", "네, 2000년 시드니 올림픽부터 정식 종목이에요.",
"그 전에는?", "1988년 서울 올림픽과 1992년 바르셀로나 올림픽에서는 시범 종목이었어요."),
("ko", "물 하루에 얼마나 마셔야 돼요?", "보통 어른은 하루 1.5에서 2리터쯤이에요. 더우면 더 마시고요.",
"커피도 쳐줘?", "대부분은요. 커피나 차에 든 물도 수분으로 쳐요."),
("ko", "잠은 왜 자요?", "자는 동안 몸이 회복되고 뇌가 기억을 정리해요.",
"얼마나 자야 돼?", "어른은 보통 일곱에서 아홉 시간이 필요해요."),
("ko", "하품은 왜 해요?", "정확히는 아무도 몰라요. 뇌를 식히려는 거라는 설이 있어요.",
"어떻게 식혀?", "숨을 크게 들이쉬면 시원한 공기가 들어오고, 턱이 늘어나면서 피가 더 돌아요."),
("ko", "BTS는 언제 데뷔했어요?", "2013년에 데뷔했어요.",
"어느 회사야?", "빅히트 엔터테인먼트, 지금의 하이브에서 데뷔했어요."),
("ko", "케이팝은 언제부터 외국에서 인기 있었어?", "2000년대에 아시아에서 먼저 퍼졌어요.",
"그럼 세계적으로는?", "2012년 싸이의 강남스타일, 그 뒤 BTS 같은 그룹으로 전 세계에서 커졌어요."),
("ko", "한글 글자는 몇 개예요?", "기본 글자는 자음 열네 개, 모음 열 개, 모두 스물네 개예요.",
"그것밖에 안 돼?", "네, 그걸 모아서 음절마다 한 글자로 써서, 적은 글자로도 다 적을 수 있어요."),
("ko", "일본 수도가 어디예요?", "도쿄예요.",
"언제부터?", "1868년부터예요. 그 전에는 교토가 천 년 넘게 수도였어요."),
("ko", "만리장성은 얼마나 길어요?", "모든 갈래를 합치면 2만 킬로미터가 넘어요.",
"우주에서 보여?", "아니요, 그건 잘못 알려진 얘기예요. 폭이 좁아서 맨눈으로는 안 보여요."),
("ko", "치타는 얼마나 빨라?", "짧게는 시속 100킬로미터 넘게 달려요.",
"얼마나 오래?", "몇백 미터밖에 못 가고, 그 다음엔 쉬어야 해요."),
("ko", "토마토는 과일이야?", "식물학으로는 과일이에요. 꽃에서 자라고 씨가 들어 있거든요.",
"무슨 뜻이야?", "식물학에서는 씨를 품은 부분을 열매라고 해서, 요리할 땐 채소처럼 써도 과일로 쳐요."),
("ko", "배는 어떻게 물에 떠요?", "자기 무게만큼의 물을 밀어내서 떠요.",
"어떻게?", "배 안은 거의 공기라서, 가라앉을 만큼 무거워지기 전에 물을 많이 밀어낼 수 있어요."),
# speech levels and dialect
("ko", "훈민정음은 언제 반포됐습니까?", "1446년에 반포됐습니다.",
"만든 건 언제입니까?", "1443년에 만들고, 3년 뒤에 반포했습니다."),
("ko", "부산 인구 얼마나 되노?", "약 330만 명이에요.",
"와 그래 많노?", "한국에서 서울 다음으로 큰 도시라서 그래요."),
("ko", "지구에서 제일 깊은 바다가 어디예요?", "태평양의 마리아나 해구예요.",
"얼마나 깊은데예?", "가장 깊은 곳이 약 1만 1천 미터예요."),
("ko", "우주는 몇 살이에요?", "약 138억 살이에요.",
"그걸 어떻게 알아?", "은하들이 멀어지는 속도와, 빅뱅 때 남은 가장 오래된 빛을 재서 알아요."),
("ko", "금성은 왜 그렇게 뜨거워요?", "두꺼운 이산화탄소 대기가 열을 가둬서 그래요.",
"누가 그래?", "옛 소련의 베네라 탐사선이 표면에서 460도쯤을 쟀어요."),
("ko", "제일 매운 고추가 뭐야?", "페퍼 X예요. 스코빌 지수가 약 270만이에요.",
"실화야?", "네, 실화예요. 할라피뇨보다 수백 배 매워요."),
("ko", "플라밍고는 왜 한 발로 서?", "체온과 힘을 아끼려는 거라고 봐요.",
"레알?", "네, 정말이에요. 한 발을 품으면 열을 덜 잃고, 그렇게 선 채로 졸기도 해요."),
("ko", "전구는 누가 발명했어요?", "1879년에 토머스 에디슨이 실용적인 전구를 만들었어요.",
"처음 만든 거야?", "맨 처음은 아니에요. 그 전에도 빛나는 전구는 있었지만, 오래가서 쓸 만한 건 에디슨 것이었어요."),
# mixed
("ko", "What's the tallest building?", "The Burj Khalifa in Dubai, 828 metres.",
"그거 언제 지었어요?", "2010년에 문을 열었어요."),
("ko", "김치 영어로 뭐야?", "영어로도 그냥 kimchi라고 해요.",
"why 그냥 kimchi?", "영어에 딱 맞는 말이 없어서, 한국어 이름을 그대로 써요."),
("ko", "블랙홀 사진 진짜 있어요?", "네, 2019년에 처음 찍었어요.",
"진짜 really?", "네, 정말이에요. 2019년에 사건지평선 망원경으로 블랙홀 그림자를 찍었어요."),
("ko", "Who invented Hangul?", "King Sejong, in 1443.",
"왜요?", "한자가 너무 어려워서 백성이 쉽게 배울 글자를 만들고 싶으셨어요."),
# ---------- Korean: Lumi itself ----------
("ko", "계단 올라갈 수 있어?", "아니요, 못 올라가요.",
"왜?", "저는 바퀴로 다녀서 다리가 없어요. 그래서 계단은 못 가요."),
("ko", "배터리 얼마나 가요?", "한 번 충전하면 10시간쯤 가요.",
"진짜?", "네, 10시간쯤이요. 24볼트 45암페어시 배터리가 들어 있어요."),
("ko", "주방으로 갈 수 있어?", "그곳은 제 지도에 없어요.",
"와 모르노?", "저는 지도에 있는 곳으로만 가는데, 주방은 지도에 없어서요."),
("ko", "키가 몇이야?", "146센티미터예요. 리프트를 올리면 186센티미터까지 돼요.",
"에이, 거짓말", "정말이에요. 146센티미터, 리프트를 올리면 186센티미터예요."),
("ko", "얼마나 빨라요?", "보통 초속 0.6미터, 최대 1.2미터예요.",
"왜 그렇게 느려?", "사람들 사이를 다니니까 안전하려고 천천히 다녀요."),
("ko", "누가 만들었어?", "쿳션에서 만들었어요.",
"거기 어디 있는데?", "서울에 있어요."),
("ko", "손 흔들어 줘", "지금 컵을 들고 있어서 손은 흔들지 않을게요.",
"왜 안 돼?", "컵을 든 채로 흔들면 떨어지거나 쏟아질 수 있어서요."),
("ko", "몇 킬로까지 들 수 있어요?", "손으로는 1킬로그램쯤이에요.",
"그것밖에?", "네, 1킬로그램쯤이에요. 팔이 그리퍼까지 합쳐 2킬로그램을 드는데, 그리퍼 무게가 빠져서요."),
("ko", "어두운 데서도 보여요?", "그건 잘 모르겠어요.",
"왜 몰라?", "어두울 때 제 카메라가 얼마나 보이는지 들은 적이 없어서, 짐작으로 말하지 않을게요."),
("ko", "위치는 어떻게 알아요?", "라이다로 본 것을 지도와 비교해서 알아요.",
"얼마나 정확해?", "5센티미터 안쪽으로 맞아요."), # ---------- more: examples, amounts, chains ----------
("en", "What can robots do in factories?", "Weld, paint, pack boxes and move heavy parts.",
"Like what?", "Car factories use robot arms to weld whole car bodies, thousands of welds each."),
("en", "What are the healthiest foods?", "Vegetables, fruit, beans, whole grains and fish are near the top.",
"Which one is best?", "No single food is best; a mix of them matters more than any one."),
("en", "How many countries are there?", "195: 193 UN members plus two observers.",
"Which two?", "The Vatican and Palestine."),
("en", "What's the most expensive spice?", "Saffron.",
"How much?", "Often several thousand dollars a kilo."),
("en", "Saffron costs thousands a kilo?", "Yes, often several thousand dollars a kilo.",
"Why so expensive?", "Each flower gives only three tiny threads, picked by hand: it takes well over 100,000 flowers for a kilo."),
("en", "How long does light from the Sun take to reach us?", "About eight minutes.",
"Is that a lot?", "For light it is: it crosses about 150 million kilometres in that time."),
("en", "Why do we have time zones?", "The Sun is overhead at different times around the world.",
"How many are there?", "About 24 main ones, but with half-hour zones there are close to 40."),
("en", "What language has the most words?", "English is often named, with hundreds of thousands of words.",
"Why?", "It borrowed from many languages: Latin, French, Norse, Greek and more."),
("en", "Who discovered penicillin?", "Alexander Fleming, in 1928.",
"How?", "He noticed mould on a forgotten dish had killed the bacteria around it."),
("en", "Who discovered penicillin?", "Alexander Fleming, in 1928.",
"By accident?", "Yes, mostly: a mould grew on a dish he'd left out, and it killed the bacteria near it."),
("en", "Why do bees make honey?", "It's their food store for winter.",
"How much does one bee make?", "Only about a twelfth of a teaspoon in its whole life."),
("en", "Why do bees make honey?", "It's their food store for winter.",
"And then?", "Beekeepers take the extra and leave the bees enough to get through the cold."),
("en", "How deep is the ocean?", "About 3.7 kilometres on average.",
"And the deepest part?", "The Mariana Trench, about 11 kilometres down."),
("en", "Why is Mars red?", "Its dust is full of iron oxide, which is rust.",
"Rust?", "Yes, the same reddish compound you see on old iron."),
("en", "Who invented the internet?", "Many people; its basic rules came from Vint Cerf and Bob Kahn in the 1970s.",
"And the web?", "Tim Berners-Lee invented the World Wide Web in 1989."),
("en", "Who invented the World Wide Web?", "Tim Berners-Lee, in 1989.",
"Where?", "At CERN, the physics lab near Geneva."),
("en", "What's the hardest natural material?", "Diamond.",
"Why?", "Its carbon atoms are bonded tightly in all directions."),
("en", "How old are the oldest trees?", "Some bristlecone pines are over 4,800 years old.",
"Where?", "In the White Mountains of California."),
("en", "Why do we get goosebumps?", "Tiny muscles pull the hairs up when we're cold or scared.",
"What's the point?", "For furry animals it traps warm air or makes them look bigger; for us it's mostly left over."),
("en", "What's the smallest country?", "Vatican City.",
"How small?", "About 0.44 square kilometres, smaller than many parks."),
("en", "How do planes stay up?", "Their wings push air down, and the air pushes the wings up.",
"Even when they're that heavy?", "Yes, at take-off speed the wings move enough air to lift hundreds of tonnes."),
("en", "Why do we dream?", "Nobody knows for sure; it may help sort memories and feelings.",
"Do animals dream?", "It seems so: dogs and rats show the same sleep stage as our dreaming."),
("en", "What's the population of Korea?", "About 51 million in South Korea.",
"Is it growing?", "No, it has started to shrink: Korea has one of the lowest birth rates in the world."),
("en", "Why is Korea's birth rate so low?", "Mostly costs: housing, education and long working hours.",
"Is anything being done?", "The government gives money for children and parental leave, but so far the rate is still very low."),
("en", "What's the oldest university?", "Al-Qarawiyyin in Morocco, founded in 859, is often called the oldest still running.",
"And in Europe?", "The University of Bologna, from 1088."),
("en", "What is DNA?", "The molecule that carries the instructions for building a living thing.",
"How long is it?", "Stretched out, the DNA in one of your cells is about two metres long."),
("en", "What is DNA?", "The molecule that carries the instructions for building a living thing.",
"What do you mean, instructions?", "Its order of four chemical letters spells out how to make every protein your body needs."),
("en", "How fast does the Earth spin?", "About 1,670 km/h at the equator.",
"Then why don't we feel it?", "Because everything around us, air included, moves with us at the same steady speed."),
# Lumi: nested
("en", "What can you see?", "I see two people and a table.",
"How do you know?", "From my cameras: they see people and objects up to about 10 metres away."),
("en", "Why do you only speak two languages?", "I was built to understand English and Korean.",
"Why those two?", "I work in Korea, with visitors from everywhere, so Korean and English cover most people."),
("en", "How do you understand me?", "I turn your speech into text with Whisper, then a language model answers.",
"Which language model?", "Gemma 4, running on my own computer."),
("en", "Do you use the internet?", "Only to look things up, like news or the weather.",
"Why not for everything?", "My speech and my answers run on my own computer, so I work without the cloud."),
("en", "How far can you see?", "About 10 metres with my cameras.",
"And behind you?", "My lidar sees 240 degrees around my base, up to 10 metres."),
# Korean
("ko", "공장에서 로봇은 뭐 해요?", "용접하고, 칠하고, 상자를 포장하고, 무거운 부품을 옮겨요.",
"예를 들면?", "자동차 공장에선 로봇 팔이 차체 하나에 수천 군데를 용접해요."),
("ko", "나라가 몇 개예요?", "195개예요. 유엔 회원국 193개에 옵서버 국가 두 곳이에요.",
"그 두 곳은?", "바티칸과 팔레스타인이에요."),
("ko", "제일 비싼 향신료가 뭐야?", "사프란이에요.",
"얼마나?", "1킬로그램에 몇천 달러씩 하기도 해요."),
("ko", "사프란은 왜 그렇게 비싸?", "꽃 한 송이에서 실 같은 암술 세 가닥만 손으로 따거든요.",
"그럼 1킬로 만들려면?", "꽃이 10만 송이 넘게 필요해요."),
("ko", "햇빛이 지구까지 오는 데 얼마나 걸려요?", "8분쯤 걸려요.",
"그게 오래 걸리는 거야?", "빛한테는 먼 길이에요. 그 사이에 1억 5천만 킬로미터를 와요."),
("ko", "페니실린은 누가 발견했어요?", "1928년에 알렉산더 플레밍이 발견했어요.",
"어떻게?", "깜빡 둔 접시에 핀 곰팡이 주변의 세균이 죽은 걸 보고 알았어요."),
("ko", "페니실린은 어떻게 발견했어요?", "접시에 핀 곰팡이 주변의 세균이 죽은 걸 보고 알았어요.",
"우연이었어?", "네, 거의 우연이었어요. 치우지 않은 접시에 곰팡이가 자랐거든요."),
("ko", "꿀벌은 왜 꿀을 만들어요?", "겨울에 먹을 식량을 모아 두려고요.",
"한 마리가 얼마나 만들어?", "평생 동안 티스푼의 12분의 1 정도만 만들어요."),
("ko", "바다는 얼마나 깊어요?", "평균 3.7킬로미터쯤이에요.",
"제일 깊은 데는?", "마리아나 해구로, 11킬로미터쯤이에요."),
("ko", "화성은 왜 빨개요?", "흙에 산화철, 그러니까 녹이 많아서요.",
"녹?", "네, 오래된 쇠에 생기는 그 붉은 녹과 같은 성분이에요."),
("ko", "월드와이드웹은 누가 만들었어요?", "1989년에 팀 버너스리가 만들었어요.",
"어디서?", "제네바 근처의 물리학 연구소 CERN에서요."),
("ko", "제일 단단한 물질이 뭐야?", "다이아몬드예요.",
"왜?", "탄소 원자들이 모든 방향으로 단단하게 붙어 있어서요."),
("ko", "소름은 왜 돋아요?", "춥거나 무서울 때 작은 근육이 털을 세워서요.",
"그게 무슨 소용이야?", "털이 많은 동물은 따뜻한 공기를 가두거나 커 보이게 해요. 사람한테는 거의 흔적이에요."),
("ko", "제일 작은 나라가 어디예요?", "바티칸 시국이에요.",
"얼마나 작아?", "0.44제곱킬로미터쯤이라, 웬만한 공원보다 작아요."),
("ko", "비행기는 어떻게 떠요?", "날개가 공기를 아래로 밀어서, 그 힘으로 위로 떠요.",
"그렇게 무거운데도?", "네, 이륙 속도에선 날개가 공기를 충분히 밀어서 수백 톤도 들어 올려요."),
("ko", "꿈은 왜 꿔요?", "정확히는 몰라요. 기억과 감정을 정리하는 거라는 설이 있어요.",
"동물도 꿈 꿔?", "그런 것 같아요. 개나 쥐도 사람이 꿈꿀 때와 같은 잠 단계를 보여요."),
("ko", "한국 인구는 얼마예요?", "남한은 약 5,100만 명이에요.",
"늘고 있어?", "아니요, 줄기 시작했어요. 출생률이 세계에서 가장 낮은 편이에요."),
("ko", "한국 출생률은 왜 낮아요?", "집값, 교육비, 긴 근무 시간 같은 부담이 커서요.",
"그럼 그건 어떻게 해?", "정부가 아이 수당과 육아휴직을 늘리고 있지만, 아직은 많이 낮아요."),
("ko", "DNA가 뭐예요?", "생물을 만드는 설계도를 담은 분자예요.",
"설계도라니?", "네 가지 화학 글자의 순서가 몸에 필요한 단백질을 어떻게 만들지 적고 있다는 뜻이에요."),
("ko", "지구는 얼마나 빨리 돌아요?", "적도에서 시속 1,670킬로미터쯤이에요.",
"근데 왜 못 느껴?", "공기를 포함해 주변 모든 게 같은 속도로 함께 돌아서요."),
("ko", "벌은 왜 꿀을 모읍니까?", "겨울을 나기 위한 식량입니다.",
"그 다음에는 어떻게 됩니까?", "양봉가가 남는 꿀을 거두고, 벌이 겨울을 날 만큼은 남겨 둡니다."),
("ko", "가장 오래된 대학이 어디입니까?", "859년에 세워진 모로코의 알카라윈 대학이 지금도 운영되는 가장 오래된 대학으로 꼽힙니다.",
"유럽에서는요?", "1088년에 세워진 이탈리아 볼로냐 대학입니다."),
("ko", "시간대는 왜 있어요?", "세계 곳곳마다 해가 머리 위에 오는 시간이 달라서요.",
"몇 개나 돼?", "기본은 24개쯤인데, 30분 단위까지 치면 40개 가까이 돼요."),
("ko", "비행기 날개는 왜 저렇게 생겼노?", "위가 볼록해서 공기를 아래로 밀어 주기 좋게 생겼어요.",
"그라믄?", "그 힘으로 비행기가 위로 떠요."),
# Lumi, Korean
("ko", "뭐가 보여?", "사람 두 명이랑 테이블이 보여요.",
"어떻게 알아?", "제 카메라로 봐요. 10미터쯤까지 사람과 물건을 알아볼 수 있어요."),
("ko", "왜 두 개 언어만 해요?", "영어와 한국어를 알아듣도록 만들어졌어요.",
"왜 그 두 개야?", "한국에서 일하고, 외국 손님도 많아서 그 두 언어면 대부분 이야기할 수 있어요."),
("ko", "어떻게 내 말을 알아들어?", "위스퍼로 말소리를 글로 바꾸고, 언어 모델이 대답해요.",
"무슨 언어 모델?", "젬마 4예요. 제 안의 컴퓨터에서 돌아가요."),
("ko", "인터넷 써요?", "뉴스나 날씨 같은 걸 찾아볼 때만 써요.",
"왜 다른 건 안 써?", "말을 알아듣고 대답하는 건 전부 제 컴퓨터에서 해서, 클라우드 없이도 일해요."),
("ko", "뒤도 보여요?", "라이다로 바닥 근처를 240도까지 봐요.",
"얼마나 멀리?", "10미터쯤까지요."),
("ko", "충전은 얼마나 걸려요?", "그건 잘 모르겠어요. 직원분께 여쭤봐 주세요.",
"왜 몰라?", "충전 시간은 저에게 알려진 적이 없어서, 짐작으로 말씀드리지 않을게요."), # ---------- a part of the last answer ("the second half?"), a yes / no to Lumi's own question ----------
("en", "Why are you called Lumi?", "It comes from Lux, Latin for light.",
"What about the second half?", "That's from mini: small and agile."),
("en", "Where does the word robot come from?", "From the Czech word robota, forced work, in a 1920 play by Karel Čapek.",
"What was the play called?", "R.U.R., Rossum's Universal Robots."),
("en", "What does NASA stand for?", "National Aeronautics and Space Administration.",
"And the last part?", "Administration: it's a government agency."),
("en", "What can you do?", "I talk with you in English and Korean and answer questions. Shall I tell you more?",
"Yes.", "I can also pick things up and bring them to you, go to places on my map, follow you and wave."),
("en", "Do you know any songs?", "I know four songs. Would you like to hear the titles?",
"Sure.", "BAD, Fantastic Baby, Did I Become the Adult I Dreamed Of, and Love Attack."),
("en", "Where are you from?", "I was made in Seoul. Have you been to Seoul?",
"No.", "Then I hope you get to visit one day; it's a lively city."),
("ko", "이름이 왜 루미예요?", "빛을 뜻하는 라틴어 룩스에서 왔어요.",
"그 다음 부분은요?", "뒷부분은 작고 날렵하다는 뜻의 미니에서 왔어요."),
("ko", "로봇이라는 말은 어디서 왔어요?", "1920년 카렐 차페크의 희곡에서, 강제 노동을 뜻하는 체코어 로보타에서 왔어요.",
"그 희곡 이름은?", "로숨의 유니버설 로봇, R.U.R.이에요."),
("ko", "뭐 할 수 있어요?", "영어와 한국어로 대화하고 질문에 답해요. 더 알려 드릴까요?",
"네", "물건을 집어서 가져다드리고, 지도에 있는 곳으로 가고, 따라가거나 손을 흔들 수도 있어요."),
("ko", "노래 알아?", "네 곡을 알아요. 제목 알려 드릴까요?",
"응", "배드, 판타스틱 베이비, 꿈꾸던 어른이 되었나요, 러브 어택이에요."),
("ko", "어디서 왔어요?", "서울에서 만들어졌어요. 서울에 가 보셨어요?",
"아니요", "언젠가 꼭 가 보세요. 볼 게 많은 도시예요."),
("ko", "쿳션은 뭐 하는 회사예요?", "바리스타 로봇 같은 서비스 로봇을 만드는 서울의 회사예요. 더 궁금한 거 있으세요?",
"네, 그 다음은요?", "드로잉, 요리, 아이스크림, 용접, 팔레타이징, 교육용 로봇도 만들어요."), # ---------- doubt against its own answer: the fact stays ----------
("en", "How long does an octopus live?", "Most octopuses live only one to two years.",
"You said five years before.", "I said one to two years: most octopuses don't live longer than that."),
("en", "How high is Mount Everest?", "8,849 metres.",
"Earlier you said 9,000.", "It's 8,849 metres, just under nine thousand."),
("ko", "문어는 얼마나 살아요?", "대부분 1년에서 2년밖에 못 살아요.",
"아까는 5년이라며?", "1년에서 2년이라고 말씀드렸어요. 대부분의 문어는 그보다 오래 못 살아요."),
("ko", "한글은 언제 만들었어요?", "1443년에 만들었어요.",
"아까는 다르게 말했잖아.", "1443년이 맞아요. 반포는 3년 뒤인 1446년이었어요."),
]
def pick_followup(said, before_q, before_a, lang, k=2):
"""Up to k FOLLOWUPS closest to this follow-up: the follow-up's own words count most (a "why?" shows a "why?"),
then the talk before it; same language first."""
s, ctx = _norm(said), _norm(f"{before_q} {before_a}")
ranked = sorted(FOLLOWUPS, key=lambda e: (e[0] != lang, -(0.7 * _score(s, _norm(e[3])) +
0.3 * _score(ctx, _norm(f"{e[1]} {e[2]}")))))
out = []
for ex in ranked:
if all(ex[1] != o[1] for o in out):
out.append(ex)
if len(out) == k:
break
return out
def polite(text):
"""True when every Korean sentence of `text` ends politely (POLITE_ENDINGS); sentences without Hangul pass.
@@ -1028,4 +1540,12 @@ if __name__ == "__main__":
assert len(got) == PICK_K, (text, got)
assert all(e[1] == lang for e in got), (text, got)
assert len({e[3] for e in got}) == PICK_K, (text, got)
assert len(FOLLOWUPS) >= 200, len(FOLLOWUPS)
assert all(lang in ("en", "ko") and q and a and f and r for lang, q, a, f, r in FOLLOWUPS)
rude = [e[4] for e in FOLLOWUPS if e[0] == "ko" and not polite(e[4])]
assert not rude, rude
assert all(re.search("[가-힣]", e[4]) for e in FOLLOWUPS if e[0] == "ko")
assert not any(re.search("[가-힣]", e[4]) for e in FOLLOWUPS if e[0] == "en"), "an English follow-up answered in Korean"
assert pick_followup("why?", "Why is the sky blue?", "Blue light scatters most.", "en")[0][3].lower().startswith("why")
assert pick_followup("진짜?", "키가 몇이야?", "146센티미터예요.", "ko")[0][0] == "ko"
print("ok")
+28
View File
@@ -49,6 +49,30 @@ AT_LIMIT = {("volume", 1): ("This is as loud as I can speak.", "이게 제일
("speed", 1): ("I can't speak any faster than this.", "이보다 더 빨리는 말할 수 없어요.")}
NOT_NOW = re.compile(r"(?:^|\s)(?:쟤|걔|저 사람|그 사람|저분|그분)(?:는|가|도|은)?\s|\b(?:he|she|they|his|her|their)\b|"
r"(?:할|될|볼)걸\W*$|겠지\W*$|\bwhenever\b|끝나(?:고|면)|고 ?나서|(?:다음|후|뒤)에\s", re.I)
# someone else ("쟤 좀 작게 얘기하는 거 못 할걸"), a guess, a rule for later ("whenever I whistle, speed up")
def _not_now(t):
"""Words that name a voice change but ask none now: a later time / condition, someone else, a take-back."""
from assistant import brain, intent_bank
if NOT_NOW.search(t) or intent_bank.told_ko(t) or brain.held_back(t) or re.search(r"[\"“”]|라고|래서|하래", t):
return True # a quote: "게임에서 자꾸 말 천천히 하라고 나와"
if intent_bank.NEGATION.search(t) and not re.search(r"\bso (?:fast|loud|quiet|slow)|\btoo\b|너무", t, re.I):
return True # "don't talk louder" (not "don't speak so fast")
if re.search(r"\b(?:are you able|able to|know how to|how (?:do|can|could) you|is it possible|can you even|capable of|"
r"built to|made to|designed to)\b|할 ?줄|줄 ?알|가능(?:해|한|하)|어떻게", t, re.I) or \
intent_bank.SELF_TALK.search(t) or intent_bank.PAST_EN.search(t) or intent_bank.past_ko(t):
return True # "were you built to ...", "you were too loud yesterday"
name = intent_bank.NAME_CALL.match(t)
if name and name.group(1).lower() not in intent_bank.NOT_A_NAME or brain.to_someone_else(t):
return True # "Jake, talk quieter"
if intent_bank.LATER.search(t) and not re.search(r"\bif you (?:can|could|don'?t mind|please|would)\b|\bso i can\b", t, re.I):
return True # "쉬는 시간 끝나고 목소리 좀 크게 해"
return brain.self_correct(t) == "" # "볼륨 up 해 줄 수 있어, 아 cancel"
def read(text, last=""):
"""("volume" | "speed", +1 | -1) when the words ask Lumi to speak louder / quieter / faster / slower, else None.
`last` is the assistant's answer just before (brain history): after "ACTION: voice volume +1" a bare "more" /
@@ -57,8 +81,12 @@ def read(text, last=""):
again = re.match(r"ACTION: voice (volume|speed) ([+-]1)\b", last or "")
if again and driving.AGAIN.search(driving.clean(t)):
return again.group(1), int(again.group(2))
if re.search(r"(?:^|\s)(?:키|몸|리프트)(?:를|좀|\s)*(?:크게|작게|높게|낮게)", t):
return None # "키 크게 해 줘": the lift, not the voice
if DRIVE.search(t) and not VOICE.search(t) or driving.move(t):
return None # "go faster", "천천히 가", "turn it up 30 degrees"
if (LOUDER.search(t) or QUIETER.search(t) or SLOW.search(t) or FAST.search(t)) and _not_now(t):
return None
up, down = bool(LOUDER.search(t)), bool(QUIETER.search(t))
if up != down:
return "volume", 1 if up else -1