Intent bank grown to 4008 wordings (every crowd, dialect, Konglish); new quick answers: frequent questions about Lumi answered at once from known facts, follow-ups left to the LLM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+212
-2
@@ -72,7 +72,7 @@ REPEAT = re.compile(r"^\W*(?:(?:\w+\W+){0,2})?(?:again|one more time|once more|d
|
||||
# "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"(?!갖고|고고|에서)(?<!가)[가-힣](?:서|고)(?:[\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|"
|
||||
@@ -440,6 +440,215 @@ NO += [
|
||||
"lift my mood", "turn it off", "wave goodbye to your old life", "move on", "let it go", "back off from that topic",
|
||||
"저리 가", "가 버려", "꺼져", "됐어 가", "알아서 해", "마음대로 해", "좀 쉬어", "가만있어 봐",
|
||||
]
|
||||
# round 5: more speakers (kids, elderly, non-native, Konglish, dialect endings 경상 / 전라 / 충청, whisper slips)
|
||||
GO += [
|
||||
"kindly go to <place>", "please make your way over to <place>", "would you be so kind as to go to <place>",
|
||||
"could you possibly head to <place>", "i'd appreciate it if you went to <place>", "you may go to <place> now",
|
||||
"go on over to <place>", "zip over to <place>", "pop over to <place>", "nip over to <place>", "dash over to <place>",
|
||||
"go to <place>, chop chop", "hop over to <place>", "<place>, now please",
|
||||
"robot, go to <place>!", "go go go to <place>", "please go to <place> robot", "go to <place> pretty please",
|
||||
"you go <place> now please", "please moving to <place>", "go for <place>", "you must go <place>",
|
||||
"go to <place> place", "please go in <place>", "go at <place>", "please you moving <place>", "<place> go please",
|
||||
"go to <place> asap", "head down to <place>", "make tracks to <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>로 출발해 주세요", "<place>로 향해", "<place>로 향해 주세요", "<place>로 이동하세요",
|
||||
"<place>로 이동 부탁해", "<place>로 이동 부탁해요", "<place>로 좀 가 주실래요?", "<place>로 가 주실 수 있으세요?",
|
||||
"<place> 가 주세요", "<place>에 가 주실래요?", "<place>까지 이동해 주세요", "<place>까지 가 주실래요?",
|
||||
"<place>로 가 줘라", "<place>로 가 봐 얼른", "<place>로 ㄱ", "<place> ㄱㄱ", "<place>로 무브 해 줘",
|
||||
"<place>로 go 해 주세요", "<place>로 고 해 줘", "go to <place> 해 주세요", "<place> 로 이동 please",
|
||||
"<place>로 고우", "<place>로 가 쥬", "<place>로 가 즈", "<place>로 가 저", "<place>로 가 주새요",
|
||||
]
|
||||
COME += [
|
||||
"come here, robot!", "come over here, little robot", "robot come here please", "come here come here",
|
||||
"pwease come here", "come to me robot", "come here quickly please", "c'mon over here", "c'mere", "come 'ere",
|
||||
"get over here, buddy", "come over this way", "come over here to me", "come here a sec", "come closer please",
|
||||
"would you kindly come here", "please come over to me", "kindly come here", "could you come closer to me",
|
||||
"you come to me please", "you come near me", "please coming here", "come to here", "come at me here",
|
||||
"come to this side", "please you come here", "come in front of me", "come stand in front of me",
|
||||
"이리 오너라", "이리 와 보거라", "이리 와 보게", "이리 오게", "이리 오시게", "이리 와 보시오", "이리 와 주시오",
|
||||
"일로 와 봐라", "이리 온나", "퍼뜩 온나", "이리 와 보이소", "이리 오이소", "이리 와 부러", "이리 와 보랑께",
|
||||
"이리 와 봐유", "이리 와유", "여기로 와유", "이리 와 줘유", "이리 와 봐용", "이리 와 줘용", "이리 와 주라",
|
||||
"여기로 좀 와 봐", "여기까지 와 봐", "여기까지 와 주세요", "제 앞으로 와 주세요", "내 앞으로 와", "가까이 와 주실래요?",
|
||||
"가까이 좀 와 봐", "가까이 오세요", "가까이 오십시오", "더 가까이 와 줘", "조금 더 가까이 와 주세요", "이쪽으로 오세요",
|
||||
"here 와", "come 해", "come 해 줘", "come here 해 주세요", "이리 와 please", "여기 와 줘 please", "컴 히어",
|
||||
"이리 화", "이리 와 바", "여기로 와 쥬", "가까이 와 쥬",
|
||||
]
|
||||
FOLLOW += [
|
||||
"follow me, little robot", "robot follow me!", "follow me follow me", "come follow me", "follow me, okay?",
|
||||
"kindly follow me", "please follow me this way", "would you kindly follow me", "please come along with me",
|
||||
"follow me if you please", "you will follow me", "you follow behind me", "please you following me",
|
||||
"following me", "follow to me", "follow me go", "you come with me together", "together with me go",
|
||||
"stay close behind me", "walk along with me", "trail behind me", "shadow me", "stay on my tail", "keep on my heels",
|
||||
"come along now", "this way, follow me", "follow me over here", "come with me, robot", "flolow me", "follow meee",
|
||||
"나 따라오너라", "날 따라오게", "날 따라오시게", "나를 따라오시오", "따라오거라", "따라 온나", "퍼뜩 따라 온나",
|
||||
"따라오이소", "날 따라와 부러", "따라와 잉", "따라와유", "따라와 줘유", "나 따라와 봐유", "따라와 줘용", "따라와 봐용",
|
||||
"따라와 주라", "나 좀 따라와", "나 좀 따라와 줘", "저 좀 따라오세요", "저를 따라와 주세요", "저를 따라와 주십시오",
|
||||
"제 뒤를 따라오세요", "내 뒤를 따라와", "내 뒤에 붙어", "나한테 붙어 와", "나랑 같이 가 줘", "나랑 같이 걸어",
|
||||
"저랑 같이 가 주세요", "저와 같이 가 주실래요?", "함께 가 주세요", "follow 해 봐", "나 따라 come", "같이 go",
|
||||
"with me 가자", "팔로우 미 해 줘", "따라와져", "따라 와 쥬", "따라오세여",
|
||||
]
|
||||
COME_BACK += [
|
||||
"come back to me", "come back now", "come on back", "come back please robot", "please return", "return now",
|
||||
"go back to where you were before", "back to your old spot please", "go back to your starting place",
|
||||
"please go back to the place you started", "kindly return to your spot", "you come back please",
|
||||
"come back to before place", "go back first place", "return back", "come back here robot",
|
||||
"돌아오너라", "돌아오게", "돌아와 보이소", "돌아온나", "퍼뜩 돌아온나", "돌아와 부러", "돌아와유", "돌아와 줘용",
|
||||
"다시 돌아와 주세요", "원래 자리로 와", "원래 자리로 돌아와 주세요", "제자리로 와",
|
||||
"처음 있던 데로 가", "아까 그 자리로 돌아가", "아까 있던 데로 돌아와", "원위치로 돌아가", "원위치 해", "원위치해 주세요",
|
||||
"돌아가 주십시오", "복귀하십시오", "복귀해 줘", "come back 해", "돌아 come", "comeback 해 줘", "돌아와 주라",
|
||||
]
|
||||
MOVE += [
|
||||
"scooch forward", "scooch back", "budge up a bit", "move up a little forward", "inch back a bit", "nudge forward",
|
||||
"nudge back a little", "shuffle left", "shuffle to the right", "back up some more space please",
|
||||
"kindly move forward a little", "please step back a bit", "could you move back a little", "would you move left a bit",
|
||||
"you go forward little", "you go back little", "go front little bit", "go little front", "move little left",
|
||||
"move little bit right", "please moving back", "a little bit back please",
|
||||
"forward forward", "back back", "move forward a tiny bit", "move a teeny bit to the left",
|
||||
"move forward 50 centimeters", "move back 30 centimeters", "go left 1 meter", "go right 50 cm",
|
||||
"앞으로 와", "앞으로 좀 와 봐", "앞으로 조금만 와", "조금 앞으로 와 줘", "뒤로 좀 가 봐", "뒤로 조금만", "뒤로 좀 물러나 봐",
|
||||
"뒤로 빠져 줘", "뒤로 물러서", "뒤로 물러서 주세요", "옆으로 비켜", "왼쪽으로 좀 비켜 줘", "오른쪽으로 좀 비켜 주세요",
|
||||
"왼쪽으로 살짝 가", "오른쪽으로 살짝 이동해", "앞으로 살짝", "뒤로 살짝", "앞으로 쪼끔 가", "뒤로 쪼끔만",
|
||||
"앞으로 가 보거라", "뒤로 물러나게", "뒤로 물러나 보이소", "앞으로 가 보이소", "뒤로 쫌 가라", "앞으로 가 부러",
|
||||
"뒤로 가 봐유", "앞으로 가유", "뒤로 가 줘용", "왼쪽으로 가 주이소", "오른쪽으로 가 봐유",
|
||||
"앞으로 1미터만 가", "뒤로 30센티만 가 줘", "왼쪽으로 50센티 가 주세요", "오른쪽으로 1미터 이동하십시오",
|
||||
"앞으로 이동하세요", "뒤로 이동하세요", "후진하세요", "후진해 주세요", "후진하십시오",
|
||||
"앞으로 무브", "뒤로 무브", "back 좀 해 줘", "forward 해 줘", "레프트로 가", "라이트로 가", "백 해 줘",
|
||||
"아프로 가", "뒤루 가", "뒤로 가조", "외쪽으로 가",
|
||||
]
|
||||
TURN += [
|
||||
"turn left please", "please turn to your left", "kindly turn right", "could you turn to the right",
|
||||
"would you turn around please", "spin right", "spin left", "turn around robot", "turn round",
|
||||
"go turn left", "you turn left", "you turn right please", "please turning left", "turn to left side",
|
||||
"turn to right side", "turn back side", "turn your body around", "rotate around", "rotate yourself around",
|
||||
"do a 180", "turn 180", "flip around", "swing around", "turn left a bit", "turn right a little",
|
||||
"turn left 30 degrees please", "rotate 90 degrees left", "spin around once",
|
||||
"왼쪽으로 돌아 봐", "오른쪽으로 돌아 봐", "뒤로 돌아 봐", "뒤로 돌아 줘", "돌아서", "뒤돌아서 봐", "한 바퀴 돌아 봐",
|
||||
"한 바퀴 돌아 주세요", "빙글 돌아", "빙그르르 돌아 봐", "왼쪽으로 몸 돌려 주세요", "오른쪽으로 몸 좀 돌려",
|
||||
"왼쪽으로 돌아 보거라", "오른쪽으로 돌아 보이소", "뒤로 돌아 보이소", "왼쪽으로 돌아 부러", "오른쪽으로 돌아 봐유",
|
||||
"뒤로 돌아유", "한 바퀴 돌아 봐용", "왼쪽으로 돌아 주라", "오른쪽으로 회전하세요", "왼쪽으로 회전하세요",
|
||||
"왼쪽으로 30도 돌아 주세요", "오른쪽으로 90도 회전해", "좌로 돌아", "우로 돌아", "뒤로 돌아 실시",
|
||||
"턴 해", "유턴", "left turn 해 줘", "right turn 해", "turn around 해 줘", "한 바퀴 spin", "오른쪽으로 도라",
|
||||
]
|
||||
LOOK += [
|
||||
"look at me robot", "look at me, look at me", "look over here robot", "look here look here", "look look",
|
||||
"kindly look at me", "would you look at me please", "please look this way", "could you look to the left",
|
||||
"you look at me", "look to me", "look on me",
|
||||
"please look up", "look up please", "look down please", "look left please", "look right please",
|
||||
"peek to the left", "peek right", "glance over here", "look straight at me", "keep your eyes on me",
|
||||
"eyes on me please", "turn your face to me", "face this way", "look the front", "look front",
|
||||
"날 좀 보거라", "나를 보게", "여길 보게", "여기 보이소", "여 보이소", "이짝 봐", "이짝 보랑께", "날 봐 부러", "여기 봐유",
|
||||
"나 좀 봐유", "여기 봐 줘용", "날 봐 주라", "저 좀 보세요", "여기 보세요", "이쪽 보세요", "앞에 보세요", "위에 보세요",
|
||||
"아래 보세요", "왼쪽 보세요", "오른쪽 보세요", "위로 봐", "아래로 봐", "위쪽 좀 봐 줘", "아래쪽 좀 봐 주세요",
|
||||
"고개 들어 보세요", "고개 숙여 봐", "고개 왼쪽으로 돌려 주세요", "고개 오른쪽으로 돌려 주세요", "고개 위로",
|
||||
"고개 아래로", "고개 똑바로", "고개 똑바로 해", "앞 봐", "앞에 봐 줘", "정면 보세요", "저 쳐다봐 주세요", "날 쳐다봐 줘",
|
||||
"날 봐 please", "look 나", "lookat me", "luk at me", "look et me", "날 바", "여기 바",
|
||||
]
|
||||
LIFT += [
|
||||
"get taller please", "be taller", "be tall", "be shorter", "grow up tall", "make yourself bigger",
|
||||
"make yourself higher please", "go up up", "up up up", "down down", "go down a little bit", "go up a little bit",
|
||||
"lower yourself a bit please", "raise yourself a bit", "come down lower", "move your body up", "move your body down",
|
||||
"you go up please", "you go down", "body up", "body down", "make body up", "make body down", "you more high",
|
||||
"you more low", "lift yourself higher", "lower yourself down", "drop a little lower",
|
||||
"올라가 봐", "조금 올라가 봐", "더 올라가", "더 내려가", "조금만 내려가", "조금만 올라가", "위로 올라가 봐",
|
||||
"아래로 내려와", "내려와", "내려와 봐", "올라와", "키 높여 봐", "키 낮춰 봐", "키 좀 높여 줄래?", "키 좀 낮춰 줄래요?",
|
||||
"몸 높여", "몸 낮춰 봐", "몸을 높여 주세요", "몸 좀 내려 주세요", "높이 높여", "높이 낮춰", "높이 좀 올려 주세요",
|
||||
"높이 내려 주세요", "키 크게 해 줘", "키 작게 해 줘", "키 높이세요", "키를 낮추십시오",
|
||||
"올라가 보거라", "내려가 보게", "올라가 보이소", "내려가 보이소", "올라가 부러", "내려가 봐유", "올라가유", "키 높여 줘용",
|
||||
"키 up 해 줘", "몸 up", "높이 up", "높이 down", "업 해 줘", "다운 해 줘", "키 업", "키 다운", "오라가", "내려가조",
|
||||
]
|
||||
WAVE += [
|
||||
"wave to me please", "wave at me robot", "wave wave wave", "robot wave!", "wave bye bye", "bye bye wave",
|
||||
"wave hi to me", "wave hello to us", "give everyone a wave", "kindly wave to us", "would you wave to us please",
|
||||
"please wave your hand to me", "you wave hand please", "hand wave please", "do hand wave",
|
||||
"do wave hand", "hello with hand please", "say bye with your hand", "say goodbye with your hand",
|
||||
"wave goodbye", "wave goodbye to me", "wave to the camera", "wave to my mom", "wave to my kid", "wave to the crowd",
|
||||
"give a little wave", "do a little wave", "waive at me", "wave too me", "wave to us all",
|
||||
"손 흔들어 보거라", "손 흔들어 보게", "손 좀 흔들어 보이소", "손 흔들어 부러", "손 흔들어 봐유", "손 흔들어 줘유",
|
||||
"손 흔들어 줘용", "손 흔들어 주라", "손 흔들어 주시겠어요?", "손 흔들어 주실래요", "손 흔들어 주시오",
|
||||
"손 흔들어 인사해 주세요", "손 흔들면서 인사해 주세요", "손 흔들어서 인사해 봐", "손 흔들어 인사해 봐",
|
||||
"바이바이 해 줘", "빠이빠이 해 줘", "빠이빠이 해 봐", "안녕 손 흔들어 줘", "손으로 안녕 해 봐", "손으로 바이바이 해",
|
||||
"우리 애한테 손 흔들어 주세요", "엄마한테 손 흔들어 줘", "할머니한테 손 흔들어 드려", "카메라 보고 손 흔들어",
|
||||
"손 흔들어 봐 줘", "손 한번 흔들어 주세요", "팔 한번 흔들어 봐", "wave 해 주세요", "wave 좀 해 봐", "웨이브 해 봐",
|
||||
"손 wave 해 줘", "hand wave 해 줘", "바이 해 손으로", "손 흔더러", "손 흔드러 줘", "손 흔들어 쥬",
|
||||
]
|
||||
ARM_REACH += [
|
||||
"reach out please", "reach out to me please", "kindly reach out your arm", "would you reach out your hand",
|
||||
"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",
|
||||
"팔 뻗어 보거라", "팔 뻗어 보게", "팔 좀 뻗어 보이소", "팔 뻗어 부러", "팔 뻗어 봐유", "팔 뻗어 줘용", "팔 뻗어 주라",
|
||||
"팔 좀 뻗어 주세요", "팔 쭉 뻗어 주세요", "팔 앞으로 뻗어 주세요", "팔 앞으로 내밀어 주세요", "손 내밀어 주세요",
|
||||
"손 좀 내밀어 줄래?", "손 앞으로 뻗어", "손 쭉 뻗어 봐", "팔 펴 봐", "팔 펴 주세요", "팔을 펴 주십시오",
|
||||
"손 줘", "팔 쭉 펴 봐", "팔 길게 뻗어", "arm 펴 줘", "arm out 해 줘",
|
||||
"팔 out", "손 reach", "팔 뻗어조", "팔 버더",
|
||||
]
|
||||
ARM_FOLD += [
|
||||
"fold your arm please", "kindly fold your arm", "please put your arm away", "put the arm down please",
|
||||
"arm down please", "bring your arm back in", "pull your arm back", "take back your arm",
|
||||
"you fold arm", "arm close please", "arm fold please", "put arm back", "arm go back", "arm rest",
|
||||
"relax your arm now", "you can put your arm down", "rest your arm now", "lower the arm",
|
||||
"팔 접어 보거라", "팔 접어 보이소", "팔 접어 부러", "팔 접어 봐유", "팔 접어 줘용", "팔 접어 주라", "팔 좀 접어 주세요",
|
||||
"팔 거둬 주세요", "팔 넣어 주세요", "팔 내려 주세요", "팔 내려 줘", "팔 내려 봐", "팔 원위치 해 줘", "팔 제자리에 놔",
|
||||
"팔 다시 접어 주세요", "팔 쉬어", "팔 내려놓으세요", "팔 내리십시오", "팔 접으세요", "팔 접으십시오", "팔 fold 해 줘",
|
||||
"arm 내려", "arm down 해", "팔 접어조", "팔 저버",
|
||||
]
|
||||
ARM_OPEN += [
|
||||
"open hand", "open your hand please", "please open your fingers", "open the hand", "hand open",
|
||||
"open your grip", "release your grip", "let go of your grip", "you open hand", "fingers open",
|
||||
"손 펴 봐 줘", "손 좀 펴", "손 벌려 봐", "손 좀 벌려 주세요", "손가락 좀 펴 봐", "손 펴 보거라", "손 펴 보이소",
|
||||
"손 펴 봐유", "손 펴 줘용", "손 열어 주세요", "그리퍼 열어 줘", "그리퍼 좀 열어 봐", "집게 열어", "집게 벌려",
|
||||
"손 펴세요", "손 펴십시오", "손 오픈", "그리퍼 오픈", "open 해 손", "손 펴조",
|
||||
]
|
||||
ARM_CLOSE += [
|
||||
"close hand", "close your hand please", "please close your fingers", "close the hand", "hand close",
|
||||
"close your grip", "tighten your grip", "make a fist please", "you close hand", "fingers close",
|
||||
"손 쥐어 봐", "손 꽉 쥐어 봐", "주먹 쥐어 줘", "주먹 꽉 쥐어", "손 오므려 봐", "손 오므려 주세요", "손가락 좀 오므려",
|
||||
"손 쥐어 보거라", "주먹 쥐어 보이소", "손 쥐어 봐유", "주먹 쥐어 줘용", "손 닫아 주세요", "그리퍼 닫아 줘",
|
||||
"그리퍼 좀 닫아 봐", "집게 닫아", "집게 오므려", "손 쥐세요", "주먹 쥐십시오", "손 클로즈", "그리퍼 클로즈", "주먹 쥐어조",
|
||||
]
|
||||
PICK += [
|
||||
"pick up the <obj> please", "please pick up the <obj>", "kindly pick up the <obj>", "would you pick up the <obj>",
|
||||
"could you take the <obj> please", "please grab the <obj>", "grab the <obj> please", "get the <obj> please",
|
||||
"pick the <obj>", "pick <obj> up", "you pick up <obj>", "you take <obj> please", "please picking the <obj>",
|
||||
"take up the <obj>", "grab hold of the <obj>", "seize the <obj>", "nab the <obj>", "pick up that <obj> there",
|
||||
"grab the <obj> on the table", "take the <obj> off the table", "pick that <obj> up", "pick up the <obj> robot",
|
||||
"pickup the <obj>", "pik up the <obj>", "pick up da <obj>", "grabb the <obj>",
|
||||
"<obj> 집어 보거라", "<obj> 집어 보이소", "<obj> 집어 부러", "<obj> 집어 봐유", "<obj> 집어 줘용", "<obj> 집어 주라",
|
||||
"<obj> 좀 집어", "<obj> 좀 집어 줘", "<obj> 좀 집어 주세요", "<obj> 집어 볼래?", "<obj> 잡아 봐", "<obj> 좀 잡아",
|
||||
"<obj> 쥐어", "<obj> 집으십시오", "<obj> 들어 올려 주세요", "<obj> 집어 올려 주세요", "그 <obj> 집어 봐",
|
||||
"저기 <obj> 집어", "<obj> 하나 집어 주세요", "<obj> 잡아 주실래요?", "<obj> 집어 주실 수 있어요?",
|
||||
"<obj> 픽업", "<obj> 그랩 해", "<obj> grab", "<obj> 잡아조", "<obj> 지버",
|
||||
]
|
||||
FETCH += [
|
||||
"bring me the <obj> please", "please bring me a <obj>", "kindly bring me the <obj>", "would you bring me the <obj>",
|
||||
"could you fetch me the <obj>", "go and get me the <obj>", "get the <obj> for me", "fetch me the <obj> please",
|
||||
"bring the <obj> over here", "bring the <obj> over to me", "bring a <obj> to me", "carry the <obj> to me",
|
||||
"you bring me <obj>", "you bring <obj> please", "bring <obj> to me", "bring me <obj> please", "bring here the <obj>",
|
||||
"go fetch the <obj>", "go grab me a <obj>", "grab me a <obj>", "grab me the <obj>", "fetch <obj>", "brung me the <obj>",
|
||||
"bring mi the <obj>", "<obj> please bring",
|
||||
"<obj> 가져와 봐", "<obj> 가져다 줄래?", "<obj> 갖다 줄래요?", "<obj> 좀 가져다 줘", "<obj> 좀 가져와 줘",
|
||||
"<obj> 가져와 주세요", "<obj> 갖다 주실래요?", "<obj> 가져다 주시겠어요?", "<obj> 가져오십시오", "<obj> 갖다 주십시오",
|
||||
"<obj> 가져오거라", "<obj> 갖다 주게", "<obj> 가 온나", "<obj> 퍼뜩 가 온나", "<obj> 가져와 보이소", "<obj> 갖다 주이소",
|
||||
"<obj> 가져와 부러", "<obj> 갖다 줘 잉", "<obj> 가져와유", "<obj> 갖다 줘유", "<obj> 가져와 줘용", "<obj> 갖다 주라",
|
||||
"<obj> 챙겨 와", "<obj> 챙겨 와 줘", "<obj> 좀 챙겨다 줘", "나한테 <obj> 갖다 줘", "저한테 <obj> 좀 가져다 주세요",
|
||||
"<obj> 여기로 갖다 줘", "<obj> 이리 가져와", "<obj> 가지고 와 주세요", "<obj> 가져와 줄 수 있어?",
|
||||
"<obj> 브링 해 줘", "<obj> 갖고 와 please", "<obj> fetch 해", "<obj> 가저다 줘", "<obj> 가져와조",
|
||||
]
|
||||
NO += [
|
||||
"my robot at home follows me", "my dog follows me everywhere", "the kids waved at you", "you waved so nicely",
|
||||
"i like how you turn", "your arm reaches far", "can you reach that high?", "do you pick things up often?",
|
||||
"is your hand strong?", "how many cups can you hold?", "can it bring me coffee?", "does it come when called?",
|
||||
"우리 집 강아지는 날 따라와", "애들이 손 흔들었어", "팔 진짜 길다", "손 힘 세?", "컵 몇 개 들 수 있어?",
|
||||
"커피도 가져다 줄 수 있나?", "부르면 오나?", "로봇이 날 따라왔어", "손 흔드는 거 귀엽다", "고개 돌리는 거 신기해",
|
||||
"bring your own cup", "bring it home", "come as you are", "come to think of it", "look at that", "look at this",
|
||||
"look at them", "follow the money", "turn the page", "pick your battles", "fetch the ball, boy",
|
||||
"그거 봐 봐", "다시 출발해", "다시 출발해 주세요", "can you see what's on your right?", "what do you see on your left?", "see anything up there?", "오른쪽에 뭐 보여?", "위에 뭐 있어?", "다시 가", "다시 가 봐", "저거 봐", "저것 좀 봐", "이것 좀 봐", "얘들아 저거 봐", "바이바이", "빠이빠이", "잘 가", "안녕히 가세요",
|
||||
]
|
||||
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}
|
||||
@@ -674,7 +883,8 @@ def _number(words):
|
||||
def said_amount(text):
|
||||
"""(metres, degrees) said with a unit, numbers in digits or words ("a quarter of a meter", "eight centimetres",
|
||||
"오십 센티", "a hundred and eighty degrees", "삼십 도"); each None when not said."""
|
||||
t = (text or "").lower()
|
||||
from assistant import wording
|
||||
t = wording.numbers(re.sub(r"\b(?:a )?quarter of an? (?:meter|metre)\b", "0.25 m", " " + (text or "").lower() + " ")) # "사 십오 도", "마흔다섯 도", "일 점 오 미터" as digits
|
||||
metres = degrees = None
|
||||
if re.search(r"\bquarter of an? (?:meter|metre)\b", t):
|
||||
metres = 0.25
|
||||
|
||||
@@ -0,0 +1,321 @@
|
||||
"""Quick answers: frequent standalone questions about Lumi (name, age, who made it, height, battery life, languages,
|
||||
AI model, robot or alive, hello) answered at once, without the LLM (lumi.Lumi._answer, after the rules, seeing and
|
||||
status and before the LLM).
|
||||
|
||||
The question is matched by meaning with the embedding server (assistant/knowledge.embed, as assistant/intent_bank.py):
|
||||
close enough to one kind and far enough from every other kind and from the "no" wordings (camera questions, commands,
|
||||
company facts, follow-ups) -> one of that kind's answers. Every answer is a fact of knowledge/lumi_about_en.md or
|
||||
brain.SYSTEM; keep them in step. Only a question of its own: in a talk it must name Lumi ("you", "너", "루미"), and a
|
||||
fragment ("why?", "really?", "and you?", "how old?") always goes to the LLM, which has the talk before.
|
||||
"What can you do?" and the battery level now are assistant/abilities.py's and assistant/battery.py's; "thanks" has
|
||||
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 pathlib
|
||||
import random
|
||||
import re
|
||||
import sys
|
||||
|
||||
import numpy as np
|
||||
|
||||
ROOT = pathlib.Path(__file__).resolve().parents[1]
|
||||
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
|
||||
|
||||
# kind: (wordings, {"en": [answers], "ko": [answers]})
|
||||
KINDS = {
|
||||
"name": ([
|
||||
"what's your name", "what is your name", "your name?", "what are you called", "what do they call you",
|
||||
"do you have a name", "tell me your name", "may i know your name", "what should i call you", "whats ur name",
|
||||
"wat is your name", "what's your name, robot", "name please", "what is the robot's name",
|
||||
"이름이 뭐야", "이름이 뭐예요", "이름이 어떻게 돼요", "너 이름 뭐야", "성함이 어떻게 되세요", "이름 알려 줘", "이름이 뭡니까",
|
||||
"넌 이름이 뭐니", "이름 있어요", "뭐라고 부르면 돼요", "니 이름 머야", "너 이름이 뭐꼬", "이름이 뭐당가", "네임이 뭐야",
|
||||
"your name 뭐야", "이 로봇 이름이 뭐예요",
|
||||
], {"en": ["I'm Lumi.", "My name is Lumi.", "Lumi. Nice to meet you."],
|
||||
"ko": ["저는 루미예요.", "제 이름은 루미예요.", "루미라고 해요. 반가워요."]}),
|
||||
"name_meaning": ([
|
||||
"what does your name mean", "why are you called lumi", "where does the name lumi come from", "what does lumi mean",
|
||||
"meaning of your name", "why lumi", "who named you lumi", "루미가 무슨 뜻이야", "이름이 무슨 뜻이에요", "왜 이름이 루미예요",
|
||||
"루미라는 이름은 어디서 왔어요", "루미 뜻이 뭐야", "이름 의미가 뭐예요",
|
||||
], {"en": ["My name comes from Lux, Latin for light, and mini, small and agile.",
|
||||
"Lumi is Lux, the Latin word for light, plus mini, for small and agile."],
|
||||
"ko": ["빛을 뜻하는 라틴어 룩스와, 작고 날렵하다는 미니에서 온 이름이에요.",
|
||||
"제 이름은 라틴어로 빛이라는 룩스와 작고 날렵하다는 미니를 합친 거예요."]}),
|
||||
"who": ([
|
||||
"who are you", "who are you?", "what are you", "what are you exactly", "introduce yourself", "tell me about yourself",
|
||||
"what kind of robot are you", "what is this robot", "what's this robot", "who is this robot", "what are you for",
|
||||
"what is your job", "what do you do here", "who r u", "hoo are you", "what is lumi", "who is lumi",
|
||||
"누구야", "넌 누구니", "누구세요", "당신은 누구예요", "너 뭐야", "자기소개 해 줘", "자기소개 좀 해 주세요", "소개해 주세요",
|
||||
"어떤 로봇이에요", "이 로봇은 뭐예요", "이건 무슨 로봇이야", "루미가 뭐야", "니 누고", "누구당가", "넌 뭐 하는 애야",
|
||||
"여기서 뭐 하는 로봇이에요", "who are you 너", "넌 who야",
|
||||
], {"en": ["I'm Lumi, a mobile robot assistant developed by Cutshion Company.",
|
||||
"I'm Lumi, a robot assistant made by Cutshion Company. I can talk, see, drive around and use my arm.",
|
||||
"My name is Lumi. I'm a mobile robot assistant from Cutshion Company."],
|
||||
"ko": ["저는 루미예요. 쿳션이 개발한 모바일 로봇 어시스턴트예요.",
|
||||
"저는 쿳션이 만든 로봇 어시스턴트 루미예요. 대화하고, 보고, 움직이고, 팔도 쓸 수 있어요.",
|
||||
"루미라고 해요. 쿳션에서 개발한 모바일 로봇이에요."]}),
|
||||
"age": ([
|
||||
"how old are you", "what is your age", "what's your age", "how old r u", "how old is lumi", "when were you born",
|
||||
"when were you made", "when were you built", "how old is this robot", "are you old", "are you new", "your age?",
|
||||
"how many years old are you", "hau old are you",
|
||||
"몇 살이야", "몇 살이에요", "나이가 어떻게 돼요", "너 몇 살", "나이가 몇이야", "연세가 어떻게 되세요", "언제 태어났어",
|
||||
"언제 만들어졌어요", "이 로봇 몇 살이에요", "몇 살인교", "멫 살이여", "몇살", "나이 몇 살이야", "니 몇 살이고",
|
||||
"how old 너", "너 age가 몇이야",
|
||||
], {"en": ["I'm 2 years old.", "I'm two years old.", "Two years old!"],
|
||||
"ko": ["저는 두 살이에요.", "두 살이에요.", "올해 두 살이에요."]}),
|
||||
"maker": ([
|
||||
"who made you", "who built you", "who created you", "who developed you", "who designed you", "who is your maker",
|
||||
"who programmed you", "which company made you", "what company made you", "what company are you from",
|
||||
"where are you from", "where do you come from", "who owns you", "who do you belong to", "who's your creator",
|
||||
"who mad you", "whoo made you", "made by who", "which company built this robot", "who makes this robot",
|
||||
"누가 만들었어", "누가 만들었어요", "누가 개발했어요", "누가 널 만들었어", "어느 회사에서 만들었어요", "어디서 만들었어요",
|
||||
"어느 회사 로봇이에요", "어디 회사 로봇이야", "만든 사람이 누구예요", "제작사가 어디예요", "어디서 왔어", "어디서 왔어요",
|
||||
"너 어디 소속이야", "누가 맹글었노", "누가 만들었당가", "who made 너", "누가 made 했어",
|
||||
], {"en": ["I was developed by Cutshion Company.",
|
||||
"Cutshion Company made me. It's a robot company in Seoul.",
|
||||
"I'm from Cutshion Company, a Korean robot company in Seoul."],
|
||||
"ko": ["쿳션이 저를 개발했어요.", "주식회사 쿳션에서 만들었어요. 서울에 있는 로봇 회사예요.",
|
||||
"저는 쿳션이라는 한국 로봇 회사에서 왔어요."]}),
|
||||
"height": ([
|
||||
"how tall are you", "what's your height", "what is your height", "how tall is lumi", "how tall is this robot",
|
||||
"how high are you", "your height?", "hau tall are you", "how tall r u", "how tall can you get",
|
||||
"how tall are you in centimeters",
|
||||
"키가 몇이야", "키가 몇이에요", "키 얼마야", "키가 얼마나 돼요", "너 키 몇이야", "키 몇 센티예요", "이 로봇 키가 얼마예요",
|
||||
"키가 몇 센치고", "키 얼마나 크노", "얼마나 커요", "키 몇이에요", "your 키 몇이야",
|
||||
], {"en": ["I'm 146 cm tall, and with my lift I can go up to 186 cm.",
|
||||
"146 centimetres. My lifting column can raise me by 40 cm, to 186 cm.",
|
||||
"I'm 146 cm tall; I can stretch up to 186 cm with my lift."],
|
||||
"ko": ["키는 146cm이고, 리프트로 186cm까지 올라가요.", "146센티미터예요. 리프트로 40cm 더 올라가서 186cm까지 돼요.",
|
||||
"저는 146cm예요. 리프트를 올리면 186cm까지 커져요."]}),
|
||||
"weight": ([
|
||||
"how heavy are you", "how much do you weigh", "what's your weight", "what is your weight", "how heavy is lumi",
|
||||
"how heavy is this robot", "are you heavy",
|
||||
"몸무게가 몇이야", "몸무게 얼마예요", "무게가 얼마나 돼요", "너 몇 킬로야", "몇 키로예요", "얼마나 무거워요", "이 로봇 무게가 얼마예요",
|
||||
], {"en": ["I weigh about 96 kg.", "About 96 kilograms; my wheeled base alone is 50 kg."],
|
||||
"ko": ["저는 약 96kg이에요.", "무게는 약 96킬로그램이에요. 베이스만 50kg이에요."]}),
|
||||
"battery_life": ([
|
||||
"how long does your battery last", "how long can you run", "how long can you work on one charge",
|
||||
"how many hours does your battery last", "what's your battery life", "how long do you last on a charge",
|
||||
"how long can you go without charging", "battery life?", "how long can you work",
|
||||
"배터리 얼마나 가요", "배터리 몇 시간 가", "한 번 충전하면 얼마나 써요", "배터리 수명이 얼마나 돼요", "몇 시간 일할 수 있어요",
|
||||
"충전 한 번에 몇 시간 가요", "배터리 오래 가요", "배터리 얼마나 버텨",
|
||||
], {"en": ["My battery lasts about 10 hours.", "About 10 hours on one charge.",
|
||||
"Around 10 hours: I have a 24-volt, 45 Ah lithium-ion battery."],
|
||||
"ko": ["배터리는 약 10시간 가요.", "한 번 충전하면 약 10시간 일할 수 있어요.", "약 10시간이에요. 24볼트 45Ah 리튬이온 배터리예요."]}),
|
||||
"languages": ([
|
||||
"what languages do you speak", "what languages can you speak", "which languages do you understand",
|
||||
"do you speak english", "do you speak korean", "can you speak korean", "can you speak english",
|
||||
"can you speak chinese", "do you speak japanese", "can you speak other languages", "what language do you speak",
|
||||
"how many languages do you speak", "do you understand english",
|
||||
"무슨 언어 할 수 있어", "어떤 언어 해요", "영어 할 줄 알아", "한국어 할 수 있어요", "몇 개 국어 해요", "중국어 할 줄 알아요",
|
||||
"일본어 할 수 있어", "영어도 돼요", "한국말 알아들어요", "외국어 할 줄 알아", "english 할 줄 알아", "korean 할 수 있어",
|
||||
], {"en": ["I understand and speak English and Korean.", "English and Korean. I answer in the language you use.",
|
||||
"I speak English and Korean; other languages I don't understand yet."],
|
||||
"ko": ["영어와 한국어를 이해하고 말할 수 있어요.", "영어와 한국어요. 말씀하시는 언어로 대답해요.",
|
||||
"영어랑 한국어를 해요. 다른 언어는 아직 이해하지 못해요."]}),
|
||||
"chatgpt": ([
|
||||
"are you chatgpt", "do you use chatgpt", "are you connected to the cloud", "do you use the internet to think",
|
||||
"is this chatgpt", "are you using gpt", "you are chatgpt?", "챗gpt 써요", "챗지피티야", "gpt 쓰는 거야", "너 챗GPT 써",
|
||||
"클라우드에 연결돼 있어요", "챗gpt랑 연결돼 있어",
|
||||
], {"en": ["No, I don't use ChatGPT or the cloud. I answer with Gemma 4, made by Google, on my own NVIDIA Jetson Thor.",
|
||||
"No. My language model is Gemma 4 by Google, and it runs on my own computer, not in the cloud."],
|
||||
"ko": ["아니요, 챗GPT나 클라우드는 쓰지 않아요. 구글이 만든 젬마 4로 제 젯슨 토르에서 직접 대답해요.",
|
||||
"아니요. 제 언어 모델은 구글의 젬마 4이고, 클라우드가 아니라 제 컴퓨터에서 돌아가요."]}),
|
||||
"model": ([
|
||||
"what ai do you use", "what model do you use", "which language model are you",
|
||||
"what is your ai model", "what's your brain", "what ai are you", "what llm do you run",
|
||||
"무슨 ai 써요", "어떤 모델 써요", "언어 모델이 뭐예요", "인공지능 뭐 써", "ai 모델이 뭐야",
|
||||
], {"en": ["I answer with Gemma 4, a language model made by Google, running on my own NVIDIA Jetson Thor.",
|
||||
"My language model is Gemma 4 by Google, and I understand speech with Whisper; both run on my own computer, without the cloud."],
|
||||
"ko": ["구글이 만든 언어 모델 젬마 4로 대답해요. 제 안의 엔비디아 젯슨 토르에서 돌아가요.",
|
||||
"제 언어 모델은 구글의 젬마 4이고, 음성 인식은 위스퍼예요. 둘 다 클라우드 없이 제 컴퓨터에서 돌아가요."]}),
|
||||
"robot": ([
|
||||
"are you a robot", "are you human", "are you alive", "are you real", "are you an ai", "are you a person",
|
||||
"is there a person inside", "is someone controlling you", "do you have feelings", "do you have emotions",
|
||||
"are you conscious", "is this a real robot", "are you a machine",
|
||||
"너 로봇이야", "로봇이에요", "사람이야", "살아 있어", "진짜 로봇이에요", "안에 사람 있어요", "누가 조종해요", "감정 있어",
|
||||
"감정이 있어요", "인공지능이야", "ai야", "기계예요", "의식 있어요",
|
||||
], {"en": ["I'm a robot, not a living being: I understand speech and answer with AI running on my own computer.",
|
||||
"I'm a robot, not alive. I have no feelings or consciousness; my friendliness is how I was made to talk."],
|
||||
"ko": ["저는 로봇이에요. 살아 있는 건 아니고, 제 컴퓨터에서 돌아가는 AI로 말을 알아듣고 대답해요.",
|
||||
"저는 로봇이에요. 감정이나 의식은 없고, 친절하게 말하도록 만들어졌어요."]}),
|
||||
"speed": ([
|
||||
"how fast can you go", "how fast do you move", "what's your speed", "what is your top speed", "how fast are you",
|
||||
"how quick can you drive", "what's your max speed",
|
||||
"얼마나 빨라요", "속도가 얼마예요", "얼마나 빨리 가요", "최고 속도가 몇이야", "몇 키로로 달려요", "속도 얼마나 나와",
|
||||
], {"en": ["I normally drive at 0.6 metres per second, at most 1.2.",
|
||||
"0.6 m per second normally, up to 1.2 m per second."],
|
||||
"ko": ["보통 초속 0.6m로 가고, 최대 초속 1.2m예요.", "평소엔 초속 0.6미터, 가장 빠르면 초속 1.2미터예요."]}),
|
||||
"hello": ([
|
||||
"hello", "hi", "hi there", "hello lumi", "hi lumi", "hey there", "good morning", "good afternoon", "good evening",
|
||||
"nice to meet you", "hello robot", "howdy", "yo", "hiya", "helo", "hallo",
|
||||
"안녕", "안녕하세요", "루미 안녕하세요", "반가워", "반가워요", "만나서 반가워요", "처음 뵙겠습니다", "좋은 아침이에요", "하이",
|
||||
"헬로", "안뇽", "안녕하십니까", "하이 루미",
|
||||
], {"en": ["Hello! Nice to meet you.", "Hi there!", "Hello! I'm Lumi."],
|
||||
"ko": ["안녕하세요! 반가워요.", "안녕하세요!", "안녕하세요, 저는 루미예요."]}),
|
||||
"how_are_you": ([
|
||||
"how are you", "how are you doing", "how's it going", "how are you today", "are you okay", "how do you feel",
|
||||
"what's up", "how have you been",
|
||||
"잘 지내", "잘 지냈어요", "기분 어때", "오늘 기분 어때요", "괜찮아요", "요즘 어때", "어떻게 지내요",
|
||||
], {"en": ["I'm a robot, so I have no feelings, but everything is running fine. Thanks for asking!",
|
||||
"All good here: as a robot I don't feel things, but my systems are running well."],
|
||||
"ko": ["저는 로봇이라 감정은 없지만, 다 잘 돌아가고 있어요. 물어봐 주셔서 고마워요!",
|
||||
"로봇이라 기분은 없지만, 아주 잘 돌아가고 있어요."]}),
|
||||
}
|
||||
|
||||
NO = [
|
||||
# the cameras: assistant/seeing.py's or the LLM's
|
||||
"can you see me", "do you see me", "what do you see", "what am i holding", "what am i wearing", "how many people do you see",
|
||||
"what colour is my shirt", "how old do i look", "how tall am i", "who am i", "do you know me", "do you remember me",
|
||||
"what's in front of you", "can you see the cup", "is there someone behind me", "how old am i",
|
||||
"나 보여", "내가 보여요", "뭐 보여", "내 옷 무슨 색이야", "나 몇 살 같아", "내 키 몇이야", "나 누군지 알아", "앞에 뭐 있어",
|
||||
"사람 몇 명 보여", "카메라로 뭐 보여요",
|
||||
# commands and requests
|
||||
"come here", "follow me", "wave", "wave at me", "go to the stage", "sing a song", "dance for me", "turn around",
|
||||
"look at me", "tell me a joke", "say hello to my son", "introduce me to cutshion", "take a picture",
|
||||
"이리 와", "따라와", "손 흔들어 줘", "노래 불러 줘", "춤 춰 봐", "농담 해 줘", "우리 애한테 인사해 줘",
|
||||
# abilities: the LLM (or abilities.py)
|
||||
"what can you do", "can you dance", "can you fly", "can you climb stairs", "can you lift 5 kg", "how much can you lift",
|
||||
"how far can you reach", "can you open doors", "can you pick up a cup", "how long is your arm", "can you grow taller",
|
||||
"뭐 할 수 있어", "춤 출 수 있어", "계단 올라갈 수 있어", "몇 킬로까지 들 수 있어", "팔 길이가 얼마야", "문 열 수 있어",
|
||||
# the company and other things, not Lumi
|
||||
"what is cutshion", "tell me about cutshion", "how old is cutshion", "when was cutshion founded", "how old is the company",
|
||||
"how many people work at cutshion", "how many employees does the company have", "who is the ceo", "where is the company",
|
||||
"how much do you cost", "what's your price", "how long does charging take", "how much battery is left",
|
||||
"who made the barista robot", "who made your arm", "who made your gripper", "how tall is your arm",
|
||||
"how heavy is your arm", "how heavy can the items be", "how heavy a thing can you hold", "how heavy can things be",
|
||||
"얼마나 무거운 거 들 수 있어", "물건 무게는 얼마까지 돼요", "what's the name of the ceo", "what's the company's name", "what's this event called",
|
||||
"what's the name of this place", "what is this booth", "who made this booth",
|
||||
"쿳션은 뭐 하는 회사야", "회사 몇 년 됐어요", "직원이 몇 명이에요", "대표가 누구예요", "회사 어디 있어요", "얼마예요", "가격이 얼마예요",
|
||||
"충전 얼마나 걸려요", "배터리 몇 퍼센트 남았어", "팔은 누가 만들었어요", "그리퍼 무게가 얼마예요", "이 행사 이름이 뭐예요",
|
||||
"여기가 어디예요", "대표 이름이 뭐예요", "너 얼마야", "how much are you", "is cutshion an american company",
|
||||
"로봇 미국 회사 맞아요", "중국 회사예요", "is your company chinese",
|
||||
# follow-ups and fragments: the LLM with the talk before
|
||||
"why", "really", "and you", "how come", "are you sure", "what about you", "and the arm", "who", "what do you mean", "tell me more", "which one", "why lumi?", "seriously?",
|
||||
"왜", "진짜", "너는", "그럼 너는", "확실해", "팔은요", "누가", "무슨 뜻이야", "더 알려 줘",
|
||||
# praise and remarks: the LLM
|
||||
"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",
|
||||
"날씨 어때", "지금 몇 시야", "고마워", "감사합니다", "잘 가", "알겠어요", "그렇구나",
|
||||
]
|
||||
|
||||
# never by meaning: the cameras, the visitor about themselves, a doubt or a fragment of the talk before
|
||||
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)
|
||||
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"맞(?:아|지|죠|나|습니까)|아니(?:야|에요|죠)", re.I) # what it can hold, the price, a check: the LLM
|
||||
SEVERAL = re.compile(r"\band\b|그리고|[??].+\S|하고\s|랑\s", re.I)
|
||||
NAMES_LUMI = re.compile(r"\b(?:you|your|yourself|u|ur|lumi)\b|(?:^|\s)(?:너|넌|니|네|당신|루미|본인|자기)", re.I)
|
||||
|
||||
_bank = None
|
||||
|
||||
|
||||
def examples():
|
||||
"""[(text, kind)] of every wording."""
|
||||
return [(t, k) for k, (texts, _) in KINDS.items() for t in texts] + [(t, "no") for t in NO]
|
||||
|
||||
|
||||
def _load():
|
||||
"""(vectors, kinds): from data/quick_answers.npz when it holds these very wordings, else embedded now."""
|
||||
global _bank
|
||||
if _bank is None:
|
||||
from assistant import knowledge
|
||||
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)
|
||||
return _bank
|
||||
|
||||
|
||||
def _core(text):
|
||||
from assistant import brain
|
||||
t = brain.CALLING.sub("", text or "").strip()
|
||||
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()
|
||||
if not t or len(t.split()) > MAX_WORDS:
|
||||
return "length"
|
||||
if CAMERA.search(t):
|
||||
return "camera"
|
||||
if ABOUT_ME.search(t):
|
||||
return "about the visitor"
|
||||
if FRAGMENT.search(t):
|
||||
return "fragment"
|
||||
if SEVERAL.search(t):
|
||||
return "several"
|
||||
if OTHER.search(t):
|
||||
return "other"
|
||||
if history and not NAMES_LUMI.search(t):
|
||||
return "in a talk, not naming Lumi" # "how old?" / "몇 살이에요?" after the company: about that
|
||||
return None
|
||||
|
||||
|
||||
def kind_of(text, history=()):
|
||||
"""The kind of question, when sure; else None."""
|
||||
if guarded(text, history):
|
||||
return None
|
||||
from assistant import knowledge
|
||||
vecs, kinds = _load()
|
||||
try:
|
||||
q = knowledge.embed([_core(text)])[0]
|
||||
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:
|
||||
return None
|
||||
if best == "hello" and history:
|
||||
return None # hello in the middle of a talk: the LLM
|
||||
return best
|
||||
|
||||
|
||||
_last = {}
|
||||
|
||||
|
||||
def answer(text, lang="en", history=()):
|
||||
"""The spoken answer when `text` is a standalone question this module answers, else None. Never the same line
|
||||
twice in a row for a kind."""
|
||||
kind = kind_of(text, history)
|
||||
if kind is None:
|
||||
return None
|
||||
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]
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import time
|
||||
for said in sys.argv[1:]:
|
||||
t0 = time.time()
|
||||
got = answer(said, "ko" if re.search(r"[가-힣]", said) else "en")
|
||||
print(f"{said} | guard: {guarded(said)} | kind: {kind_of(said)} | {got} ({time.time() - t0:.3f} s)")
|
||||
from assistant import knowledge
|
||||
vecs, kinds = _load()
|
||||
sims = vecs @ knowledge.embed([_core(said)])[0]
|
||||
texts = [t for t, _ in examples()]
|
||||
for i in np.argsort(-sims)[:4]:
|
||||
print(f" {sims[i]:.3f} {kinds[i]:12} {texts[i]}")
|
||||
Reference in New Issue
Block a user