Improve quick answers and song requests at every speech level
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -9,7 +9,9 @@ knowledge/lumi_about_en.md "What I can do now" and brain.SYSTEM "What you can do
|
||||
import re
|
||||
import sys
|
||||
|
||||
ASKED = re.compile(r"\bwhat (?:else |all |things |kinds? of things )?(?:can|could) you do\b(?!\s+(?:with|about|if|when|to|for (?:it|that)))|"
|
||||
ASKED = re.compile(r"\bwhat (?:else |all |things |kinds? of things )?(?:can|could) (?:you|u) do\b(?!\s+(?:with|about|if|when|to|for (?:it|that)))|"
|
||||
r"\b(?:you|u) can do what\b(?!\s+(?:you|i|we|he|she|they|it|ever)\b)|\bwhat (?:you|u) can do(?:ing)?\b|\b(?:skills?|functions?|abilities)\s*(?:뭐|뭔|머|있|이써)|"
|
||||
r"(?:스킬|펑션|평션)\S*\s*(?:뭐|뭔|머|있|이써|알려)|"
|
||||
r"\bwhat (?:are|r) (?:all )?your (?:abilities|skills|capabilities|functions|features|talents)\b|"
|
||||
r"\bwhat are you (?:able to do|capable of|good at)\b|\bwhat do you do\b(?!\s+(?:with|when|if|for fun))|"
|
||||
r"\bwhat can you help (?:me |us )?with\b|\btell me (?:about )?(?:what you can do|your (?:abilities|skills))\b|"
|
||||
@@ -17,8 +19,8 @@ ASKED = re.compile(r"\bwhat (?:else |all |things |kinds? of things )?(?:can|coul
|
||||
r"\bwhat can (?:i|we) (?:ask|get|have) you (?:to )?do\b|\bwhat (?:are your|is your) (?:special )?(?:talents?|specialty|speciality)\b|"
|
||||
r"(?<![가-힣]로 )(?<![가-힣]으로 )(?:뭐|뭘|머|멀|무엇|무엇을|뭐를)\s*(?:또\s*)?할\s*(?:수|줄)\s*(?:있|알|아|이써|이싸)|"
|
||||
r"(?:뭐|뭘|무엇을?)\s*시킬\s*수|특기가?\s*(?:뭐|뭔|있)|무슨\s*function|"
|
||||
r"무슨\s*일을?\s*(?:해|하|할)|어떤\s*(?:일|것|거|걸)을?\s*(?:할\s*수|해|하)|할\s*수\s*있는\s*(?:게|것|거|일)|"
|
||||
r"뭐\s*하는\s*로봇|무슨\s*기능|어떤\s*기능|기능\S*\s*(?:뭐|뭔|있|알려)|(?:능력|기능)\S*\s*(?:뭐|뭔|알려|소개)", re.I)
|
||||
r"무슨\s*일을?\s*(?:해|하|할)|어떤\s*(?:일|것|거|걸)을?\s*(?:할\s*수|해|하)|할\s*(?:수\s*있는|줄\s*아는)\s*(?:게|것|거|일)|"
|
||||
r"뭐\s*하는\s*로봇|무슨\s*기능|어떤\s*기능|기능\S*\s*(?:뭐|뭔|있|알려|무엇|머)|(?:능력|기능)\S*\s*(?:뭐|뭔|알려|소개|무엇)", re.I)
|
||||
MORE = re.compile(r"^\W*(?:(?:yes|yeah|yep|sure|ok|okay|please|lumi|and)\W*)*(?:tell me more|more|go on|what else|and\?|"
|
||||
r"and what else|anything else|details?|yes|yeah|yep|sure|ok|okay|please)(?:\W+(?:please|lumi))*\W*$|"
|
||||
r"\bwhat else can you do\b|\btell me (?:more|everything|the rest)\b|"
|
||||
@@ -48,7 +50,8 @@ NOT_LUMI = re.compile(r"\b(?:cutshion|company|jaka)\b|쿳션|회사|자카|안
|
||||
|
||||
def asked(text):
|
||||
"""Do these words ask what Lumi can do? ("what can you do?", "what are your abilities", "넌 무슨 일을 해?")"""
|
||||
return bool(ASKED.search(text or "")) and not NOT_LUMI.search(text or "")
|
||||
t = re.sub(r"\S+—\s*", "", text or "") # a stutter: "기— 기능", "할 줄— 줄 아는"
|
||||
return bool(ASKED.search(t)) and not NOT_LUMI.search(t)
|
||||
|
||||
|
||||
def more_asked(text, last=""):
|
||||
|
||||
@@ -62,8 +62,8 @@ SPEC = {
|
||||
"who is the founder of {c}", "who leads {c}", "who is the president of {c}", "what's the name of {c}'s ceo",
|
||||
"who is the ceo", "who's the ceo", "who's your ceo", "who is your boss", "what is the name of the ceo"],
|
||||
_ko(["{c} 대표가 누구", "{c} 대표님이 누구", "{c} 사장이 누구", "{c} 사장님이 누구", "{c} 대표이사가 누구", "{c} 창업자가 누구",
|
||||
"{c} 대표 이름이 뭐", "{c} 대표님 성함이 어떻게 되세요", "{c} 대표님 성함이 뭐"], ASK) +
|
||||
_ko(["{c} 누가 세웠어", "{c} 누가 세웠어요", "{c} 누가 창업했어요", "{c} 누가 운영해요", "{c} 대표님은 누구신가요", "{c} 대표 누고",
|
||||
"{c} 대표 이름이 뭐", "{c} 대표님 성함이 뭐"], ASK) +
|
||||
_ko(["{c} 대표님 성함이 어떻게 되세요", "{c} 대표님 성함이 어떻게 되십니까", "{c} 누가 세웠어", "{c} 누가 세웠어요", "{c} 누가 창업했어요", "{c} 누가 운영해요", "{c} 대표님은 누구신가요", "{c} 대표 누고",
|
||||
"{c} 대표 누구여", "{c} 대표 누군데", "{c} 대표 알려 줘", "{c} ceo가 누구야", "{c} ceo 누구예요"]) +
|
||||
["대표가 누구예요", "대표 이름이 뭐예요", "대표님 이름이 뭐예요", "대표님 성함이 어떻게 되세요", "사장님이 누구예요"],
|
||||
{"en": ["Cutshion's CEO is Lee Min-seok. Cutshion is his third company.",
|
||||
@@ -129,9 +129,9 @@ SPEC = {
|
||||
["회사는 어떤 로봇 만들어", "회사에서 무슨 로봇 만들어요", "쿳션은 뭐 만들어요"],
|
||||
{"en": ["Cutshion's robot apps are a barista robot, an AI drawing robot, a welding robot, a palletizing robot, a cooking "
|
||||
"robot, an ice cream robot, a candy ball robot and an educational robot kit. Its own technology is CUVision, "
|
||||
"Pionoid and GOMCOOK. Which one would you like to hear about?"],
|
||||
"Pionoid and GOMCOOK. Ask me about any of them."],
|
||||
"ko": ["쿳션의 로봇 앱은 바리스타 로봇, AI 드로잉 로봇, 용접 로봇, 팔레타이징 로봇, 조리 로봇, 아이스크림 로봇, 캔디볼 로봇, "
|
||||
"교육용 로봇이에요. 자체 기술로 큐비전, 피오노이드, 곰쿡이 있어요. 어떤 게 궁금하세요?"]}),
|
||||
"교육용 로봇이에요. 자체 기술로 큐비전, 피오노이드, 곰쿡이 있어요. 궁금한 로봇이 있으면 물어보세요."]}),
|
||||
"co_awards": (
|
||||
["has {c} won any awards", "did {c} win any awards", "what awards has {c} won", "{c} awards", "any awards for {c}",
|
||||
"what prizes did {c} get", "has {c} won anything"],
|
||||
@@ -147,10 +147,9 @@ SPEC = {
|
||||
_ko(["{c} 전시회 어디 나갔어요", "{c} 어느 전시회 갔어요", "{c} 전시회 참가했어요", "{c} CES 나갔어요", "{c} 시이에스 갔어",
|
||||
"{c} 전시 이력이 어떻게 돼요", "{c} 박람회 나간 적 있어요", "{c} 어떤 전시회 나갔습니까", "{c} 전시회 어데 갔노"]),
|
||||
{"en": ["Cutshion has shown its robots at RoboWorld, IFA Berlin, the Gangnam Robot Plus Festival, Smart Life Week, the Korea "
|
||||
"ICT Expo in Japan, CES in Las Vegas in 2025 and 2026, the NRA Show in Chicago and VivaTech in Paris. Which show "
|
||||
"comes next I don't know."],
|
||||
"ICT Expo in Japan, CES in Las Vegas in 2025 and 2026, the NRA Show in Chicago and VivaTech in Paris."],
|
||||
"ko": ["쿳션은 로보월드, 베를린 IFA, 강남 로봇 플러스 페스티벌, 스마트 라이프 위크, 일본 코리아 ICT 엑스포, 라스베이거스 "
|
||||
"CES 2025와 2026, 시카고 NRA 쇼, 파리 비바테크에 참가했어요. 다음 전시회는 저도 몰라요."]}),
|
||||
"CES 2025와 2026, 시카고 NRA 쇼, 파리 비바테크에 참가했어요."]}),
|
||||
"co_investment": (
|
||||
["has {c} got investors", "who invested in {c}", "did {c} get investment", "how much funding does {c} have",
|
||||
"is {c} funded", "{c} investment", "has {c} raised money"],
|
||||
@@ -172,11 +171,13 @@ SPEC = {
|
||||
["how many employees does {c} have", "how many people work at {c}", "how big is {c}", "what is {c}'s revenue",
|
||||
"how much money does {c} make", "is {c} hiring", "can i work at {c}", "how do i get a job at {c}", "is {c} on the stock market",
|
||||
"is {c} listed", "what are {c}'s opening hours", "how many robots has {c} sold", "what's {c}'s sales",
|
||||
"what is {c}'s next exhibition", "where will {c} exhibit next", "which show is {c} going to next",
|
||||
"how many employees does the company have", "how many people work there", "is the company hiring"],
|
||||
_ko(["{c} 직원 몇 명이에요", "{c} 직원이 몇 명이야", "{c} 직원 수가 어떻게 돼요", "{c} 직원 몇 명 있어", "{c} 사람 몇 명 일해요",
|
||||
"{c} 매출이 얼마예요", "{c} 매출 얼마야", "{c} 돈 얼마 벌어요", "{c} 채용해요", "{c} 채용 중이에요", "{c} 입사하려면 어떻게 해요",
|
||||
"{c} 상장했어요", "{c} 상장 회사예요", "{c} 영업시간이 어떻게 돼요", "{c} 몇 시에 문 열어요", "{c} 로봇 몇 대 팔았어요",
|
||||
"{c} 판매 대수가 어떻게 돼요", "{c} 직원 몇 명이고", "{c} 직원 수가 어떻게 되십니까", "{c} 규모가 어떻게 돼요"]) +
|
||||
"{c} 판매 대수가 어떻게 돼요", "{c} 직원 몇 명이고", "{c} 다음 전시회 어디예요", "{c} 다음 전시회 언제 나가요",
|
||||
"{c} 다음에 어느 전시회 가요", "{c} 다음 전시 일정이 어떻게 됩니까", "{c} 직원 수가 어떻게 되십니까", "{c} 규모가 어떻게 돼요"]) +
|
||||
["직원이 몇 명이에요", "직원 몇 명이에요"],
|
||||
{"en": ["I don't have that information. Please ask a staff member, or contact Cutshion at 070-8959-2960 or "
|
||||
"cutshion@cutshion.com."],
|
||||
@@ -190,7 +191,10 @@ SPEC = {
|
||||
"루미 가격이 어떻게 돼요", "너 가격 알려 줘", "너 살 수 있어요", "너 팔아요", "너 판매해요", "루미 판매해요", "렌탈 돼요", "대여 돼요",
|
||||
"렌탈 가격 알려 주세요", "바리스타 로봇 가격 알려 주세요", "아이스크림 로봇 가격이 어떻게 돼요", "로봇 사고 싶어요", "이 로봇 사려면 어떻게 해요",
|
||||
"구매하려면 어떻게 해요", "가격 좀 알려 주실래요", "가격 우째 되노", "값이 어떻게 돼요", "price 알려 줘", "가격 how much"] +
|
||||
_ko(["{c} 로봇 가격 알려 주세요", "{c} 로봇 가격이 어떻게 돼요", "{c} 로봇 사려면 어떻게 해요"]),
|
||||
_ko(["{c} 로봇 가격 알려 주세요", "{c} 로봇 가격이 어떻게 돼요", "{c} 로봇 사려면 어떻게 해요"]) +
|
||||
[w + n + e for w in ["", "이 로봇 ", "로봇 ", "루미 ", "너 "] for n in ["가격 ", "값 "] # every speech level
|
||||
for e in ["알려 줘", "좀 알려 줘", "알려 주세요", "좀 알려 주세요", "알려 주십시오", "말해 주세요", "얼마야", "얼마예요", "얼마입니까",
|
||||
"얼마세요", "얼마고", "얼만교", "어떻게 되나요"]],
|
||||
{"en": ["I don't know the prices: they aren't on Cutshion's website. Please ask a staff member, or contact Cutshion at "
|
||||
"070-8959-2960 or cutshion@cutshion.com."],
|
||||
"ko": ["가격은 홈페이지에 없어서 저도 몰라요. 직원에게 물어보시거나 쿳션(070-8959-2960, cutshion@cutshion.com)에 문의해 주세요."]}),
|
||||
|
||||
@@ -6,6 +6,7 @@ sound alike.
|
||||
Questions the quick lane's guards leave to the LLM on purpose are not listed here: the cameras ("camera", "see"),
|
||||
faces ("recognise", "remember"), what it can lift or hold ("lift", "hold", "things"), the price.
|
||||
"""
|
||||
import re
|
||||
|
||||
|
||||
def _ko(stems, ends):
|
||||
@@ -62,11 +63,11 @@ QUICK_KINDS = {
|
||||
"gripper": ([
|
||||
"what gripper do you have", "what gripper is that", "what's on the end of your arm", "what kind of hand do you have",
|
||||
"do you have a hand", "do you have fingers", "how many fingers do you have", "what's that gripper", "who makes your gripper",
|
||||
"how wide can your gripper open", "how wide can you grip", "how big a cup can you grab", "can you grab a paper cup",
|
||||
"can you pick up a paper cup", "how fast does the gripper close",
|
||||
"how wide can your gripper open", "how wide can you grip", "how big a cup can you grab",
|
||||
"how fast does the gripper close",
|
||||
"그리퍼 뭐 써요", "그리퍼가 뭐예요", "무슨 그리퍼야", "어떤 그리퍼예요", "손이 어떻게 생겼어", "손가락 몇 개야", "손가락이 몇 개예요",
|
||||
"손 있어요", "손가락 있어", "집게가 뭐예요", "집게 어디 거예요", "그리퍼 어디 제품이에요", "얼마나 넓게 벌어져요", "몇 센티까지 잡아요",
|
||||
"몇 센티까지 집을 수 있어요", "종이컵 집을 수 있어요", "종이컵도 잡아", "손가락이 몇 개고", "그리퍼 뭐 쓰노", "그리퍼 머여",
|
||||
"몇 센티까지 집을 수 있어요", "손가락이 몇 개고", "그리퍼 뭐 쓰노", "그리퍼 머여",
|
||||
"gripper 뭐 써요", "그리퍼 brand가 뭐야", "finger 몇 개야", "손 모양이 어때요", "어떤 손이 달려 있으세요",
|
||||
], {"en": ["I wear a Zimmer electric gripper with two long steel fingers, made for cups and glasses. I can grip firm things from about 6 to 9 cm wide.",
|
||||
"A Zimmer electric gripper with two steel fingers. It opens and closes in about a second and holds firm things 6 to 9 cm wide; a paper cup is too soft, it gets squeezed flat."],
|
||||
@@ -172,9 +173,9 @@ QUICK_KINDS = {
|
||||
"앞에 사람 있으면 어떻게 돼요", "길 막히면 어떻게 해요", "충돌하면 어떻게 돼요", "안 부딪혀", "장애물 피하나", "장애물 우째 피하노",
|
||||
"obstacle 피할 수 있어요", "장애물 avoid 돼요",
|
||||
], {"en": ["My lidar, my 3D camera and five ultrasonic sensors see obstacles, and I drive around them. I drive slowly and stop for people in my way, and my bumper stops me if it's pressed.",
|
||||
"I plan my way around people and obstacles, stop when someone is in my way, and my arm stops when it bumps into something."],
|
||||
"I see obstacles with my lidar, my cameras and my ultrasonic sensors, plan my way around them, and stop when someone is in my way. My arm stops when it bumps into something."],
|
||||
"ko": ["라이다, 3D 카메라, 초음파 센서 5개로 장애물을 보고 피해서 가요. 앞에 사람이 있으면 천천히 가거나 멈추고, 범퍼가 눌리면 바로 멈춰요.",
|
||||
"사람과 장애물을 피해서 경로를 짜고, 길에 사람이 있으면 멈춰요. 팔도 뭔가에 부딪히면 멈춰요."]}),
|
||||
"라이다와 카메라, 초음파 센서로 사람과 장애물을 보고 피해서 경로를 짜요. 길에 사람이 있으면 멈추고, 팔도 뭔가에 부딪히면 멈춰요."]}),
|
||||
"dance": ([
|
||||
"can you dance", "do you dance", "do you know how to dance", "are you able to dance", "can robots dance",
|
||||
"can you walk", "do you walk", "do you have legs", "can you run", "can you jump", "can you fly", "can you swim",
|
||||
@@ -248,8 +249,8 @@ QUICK_KINDS = {
|
||||
"뭐 집을 수 있어", "뭐 집을 수 있어요", "뭘 집을 수 있니", "무엇을 집을 수 있습니까", "어떤 걸 집을 수 있어요", "뭐 잡을 수 있어",
|
||||
"병도 집을 수 있어요", "사과 집을 수 있어", "과일 집을 수 있어요", "바닥에 있는 거 주울 수 있어요", "바닥에서 주울 수 있어",
|
||||
"어떤 거 집을 수 있으세요", "뭐 집을 수 있노", "뭐 집을 수 있나", "뭐 pick 할 수 있어", "pick up 뭐 돼요",
|
||||
], {"en": ["I can pick up cups, mugs and glasses, bottles, apples, oranges and bananas, from a table or a box near table height, not from the floor. So far I've picked up cups live.",
|
||||
"Cups, glasses, bottles and fruit like apples, oranges and bananas, from about table height. Not from the floor: my arm doesn't reach that low."],
|
||||
], {"en": ["I can pick up cups, mugs and glasses, bottles, apples, oranges and bananas, from a table or a box near table height. I can't pick from the floor. So far I've picked up cups live.",
|
||||
"Cups, glasses, bottles and fruit like apples, oranges and bananas, from about table height. Not from the floor: I can't reach that low."],
|
||||
"ko": ["컵, 머그, 유리잔, 병, 사과, 오렌지, 바나나를 탁자 높이에서 집을 수 있어요. 바닥에 있는 건 못 집어요. 실제로 집어 본 건 컵이에요.",
|
||||
"탁자 높이에 있는 컵, 유리잔, 병, 그리고 사과, 오렌지, 바나나 같은 과일을 집어요. 바닥은 팔이 안 닿아서 못 집어요."]}),
|
||||
"operator": ([
|
||||
@@ -311,6 +312,8 @@ USE = ["뭐 써", "뭐 써요", "뭐 쓰니", "뭐 쓰세요", "뭐 쓰십니까
|
||||
"뭐고", "뭐여", "뭔가요", "무슨 거야", "어떤 거예요", "어떤 걸 쓰세요"]
|
||||
ABLE = ["수 있어", "수 있어요", "수 있니", "수 있나요", "수 있으세요", "수 있으십니까", "수 있습니까", "수 있나", "수 있노", "수 있어유",
|
||||
"수 있음", "줄 알아", "줄 알아요", "줄 아니", "줄 아세요", "줄 압니까", "줄 아나", "줄 아노", "수 있겠어", "수 있겠어요"]
|
||||
TELL = ["알려 줘", "좀 알려 줘", "알려 줘요", "알려 주세요", "좀 알려 주세요", "알려 주십시오", "알려 주시겠어요", "말해 줘", "말해 주세요",
|
||||
"알려 주이소", "알려 도"] # "<noun> 알려 줘": the same question asked as a request
|
||||
EN_NOUN = ["what's your {}", "what is your {}", "tell me your {}", "what {} do you have", "what's the robot's {}", "your {}?",
|
||||
"what is lumi's {}", "what's this robot's {}", "{} of this robot", "what {} does this robot have"]
|
||||
EN_ABLE = ["can you {}", "are you able to {}", "can lumi {}", "is this robot able to {}", "do you know how to {}", "can this robot {}",
|
||||
@@ -362,6 +365,8 @@ HAVES = { # kind: ([Korean nouns before 있-], [English "a ..."])
|
||||
}
|
||||
for _kind, (_ko_n, _en_n) in NOUNS.items():
|
||||
QUICK_KINDS[_kind][0].extend(w + n + e for w in ["", "너 ", "이 로봇 "] for n in _ko_n for e in HOW)
|
||||
QUICK_KINDS[_kind][0].extend(w + n + e for w in ["", "로봇 ", "이 로봇 ", "루미 "]
|
||||
for n in dict.fromkeys(re.sub(r"[이가] $", " ", n) for n in _ko_n) for e in TELL)
|
||||
QUICK_KINDS[_kind][0].extend(f.format(n) for f in EN_NOUN for n in _en_n)
|
||||
for _kind, (_ko_n, _en_n) in TOOLS.items():
|
||||
QUICK_KINDS[_kind][0].extend(w + n + e for w in KO_WHO[:4] for n in _ko_n for e in USE)
|
||||
@@ -392,3 +397,59 @@ for _kind, _texts in {
|
||||
"operator": ["who operates this robot", "who runs this robot", "who is in charge of this robot", "이 로봇 누가 운영해요", "이 로봇 관리자 누구예요"],
|
||||
}.items():
|
||||
QUICK_KINDS[_kind][0].extend(_texts)
|
||||
|
||||
# night 4, round 2: kinds the train sets asked for (knowledge/lumi_about_en.md: the arm, the gripper, short moves)
|
||||
QUICK_KINDS["paper_cup"] = (
|
||||
_ko(["종이컵 집을 수 있", "종이컵 잡을 수 있", "종이컵도 잡을 수 있", "종이컵도 집을 수 있", "종이컵 들 수 있", "종이컵 잡으실 수 있",
|
||||
"paper cup 잡을 수 있", "종이컵 잡을수있", "종이컵 집을수있"], CAN) +
|
||||
["종이컵도 잡아", "종이컵 잡아요", "종이컵은 못 잡아", "종이컵은 안 돼요", "종이컵도 돼요", "종이컵 되나", "종이컵 잡을 줄 알아",
|
||||
"종이컵 집으면 찌그러져요", "종이컵 같은 거 잡을 수 있습니까", "종이컵은 어떻게 돼요", "종이컵 잡을 수 있는교",
|
||||
"can you grab a paper cup", "can you pick up a paper cup", "can you hold a paper cup", "are you able to hold paper cups",
|
||||
"can your gripper hold a paper cup", "what about paper cups", "do paper cups work", "can you take paper cups",
|
||||
"will a paper cup get crushed", "can u grab paper cups", "paper cup 잡을 수 있어요", "can you pick up paper cups too"],
|
||||
{"en": ["Not well: a paper cup is too soft, my fingers squeeze it flat. Firm cups and glasses about 6 to 9 cm wide are fine.",
|
||||
"A paper cup is too soft for my steel fingers, they squeeze it flat. I hold firm cups and glasses 6 to 9 cm wide."],
|
||||
"ko": ["종이컵은 너무 물러서 제 손가락이 눌러 찌그러뜨려요. 6에서 9cm 폭의 단단한 컵이나 유리잔은 잡을 수 있어요.",
|
||||
"종이컵은 부드러워서 눌려 버려요. 단단한 컵이나 유리잔은 6에서 9cm 폭까지 잡아요."]})
|
||||
QUICK_KINDS["arm_weight"] = (
|
||||
_ko(["팔 무게가 얼마", "팔 무게 얼마", "팔은 무게가 얼마", "팔 자체 무게가 얼마", "팔 하나 무게가 얼마", "로봇 팔 무게가 얼마"],
|
||||
["야", "예요", "에요", "니", "입니까", "인가요", "고", "여", "임", "나 돼요", "나 됩니까", "나 나가요"]) +
|
||||
["팔 하나 몇 키로임", "팔 몇 킬로예요", "팔이 몇 킬로예요", "팔 몇 kg이야", "팔은 몇 kg입니까", "팔은 몇 킬로야", "팔 무게 몇 키로", "팔이 몇 킬로나 나가요", "팔 무게는요", "팔 얼마나 무거워요",
|
||||
"팔 무거워요", "팔 무게 아세요", "팔 무게가 어떻게 되십니까", "arm 무게 얼마야",
|
||||
"how heavy is your arm", "how much does your arm weigh", "what does the arm weigh", "what's the weight of your arm",
|
||||
"how heavy is the robot arm", "is your arm heavy", "arm weight?", "how many kilos is your arm"],
|
||||
{"en": ["My arm itself weighs 9.9 kg. It can lift up to 2 kg, the gripper included.",
|
||||
"The arm alone is 9.9 kg; with the gripper on it, it lifts up to 2 kg."],
|
||||
"ko": ["팔 자체 무게는 9.9kg이에요. 그리퍼를 포함해 2kg까지 들 수 있어요.",
|
||||
"팔만 9.9kg이에요. 그리퍼까지 합쳐 2kg까지 들어요."]})
|
||||
QUICK_KINDS["short_move"] = (
|
||||
["앞으로 가라 하면 최대 몇 미터 가", "앞으로 최대 몇 미터 갈 수 있어", "앞으로 최대 몇 미터 가요", "한 번에 몇 미터까지 가요",
|
||||
"한 번에 최대 몇 미터 움직여요", "앞으로 가라고 하면 얼마나 가", "직진은 최대 몇 미터예요", "최대 몇 미터까지 직진해요",
|
||||
"한 번에 얼마나 멀리 가세요", "앞으로 몇 미터까지 갈 수 있습니까", "앞뒤로 최대 몇 미터 가노", "forward 최대 몇 meter 가요",
|
||||
"앞으로 10미터 가라 하면 감", "앞으로 10미터 가라고 하면 가요", "뒤로 최대 몇 미터 가요",
|
||||
"how far can you move forward in one go", "what's the longest straight move you make", "how far will you go if i say move forward",
|
||||
"what's the farthest you drive straight", "how many meters can you move forward at once", "is there a limit to how far you move forward",
|
||||
"if i say go forward 10 meters, will you", "max distance for a forward move?"],
|
||||
{"en": ["A straight move forward or back is at most 3 metres at a time. For anything farther, name a place on my map and I drive there.",
|
||||
"At most 3 metres per straight move. Farther than that, I go to a named place on my map."],
|
||||
"ko": ["앞뒤로 곧장 가는 건 한 번에 최대 3미터예요. 더 먼 곳은 지도에 있는 장소 이름으로 말해 주시면 거기까지 가요.",
|
||||
"한 번에 곧장 가는 건 3미터까지예요. 그보다 멀면 지도의 장소로 가요."]})
|
||||
QUICK_KINDS["llm_runtime"] = (
|
||||
["what serves your language model", "what software serves your llm", "what software runs your llm", "do you use ollama",
|
||||
"how is your model served", "what program runs gemma", "is it ollama", "what runs gemma on you", "what serves gemma",
|
||||
"is gemma served with ollama", "do you run ollama",
|
||||
"언어 모델은 어떤 프로그램으로 돌려요", "언어 모델은 어떤 프로그램으로 돌리시나요", "언어 모델은 어떤 프로그램으로 구동합니까",
|
||||
"언어 모델 뭘로 돌려", "모델 돌리는 프로그램 뭐야", "언어 모델 돌리는 소프트웨어가 뭐예요", "젬마 돌리는 프로그램이 뭐야", "올라마 써요", "올라마 쓰니", "모델 서버 뭐 써요", "LLM 뭘로 돌려요", "젬마는 뭘로 돌려요", "모델 서빙 뭐로 해요"],
|
||||
{"en": ["Ollama serves my language model, Gemma 4, on my own NVIDIA Jetson Thor, without the cloud."],
|
||||
"ko": ["언어 모델 젬마 4는 올라마로 제 엔비디아 젯슨 토르에서 돌려요. 클라우드는 안 써요."]})
|
||||
QUICK["dof"] = QUICK.get("dof", []) + [
|
||||
"너 몇 군데 움직여", "몇 군데 움직일 수 있어요", "몇 군데가 움직여요", "움직이는 데가 몇 군데예요", "몇 군데 움직이십니까", "어디 어디 움직여요",
|
||||
"how many parts of you move", "how many moving parts do you have", "how many joints do you have in total", "which parts of you can move"]
|
||||
QUICK["battery_spec"] = QUICK.get("battery_spec", []) + [
|
||||
"배터리 뭐 들어 있어", "배터리 뭐 들었어요", "무슨 배터리 들어 있어요", "배터리 종류가 뭐예요", "어떤 배터리 써요", "배터리 뭐 쓰세요",
|
||||
"무슨 배터리 쓰노", "what battery is inside you", "what kind of battery is in you", "what battery do you use", "what battery powers you"]
|
||||
QUICK["no"] += [
|
||||
"앞으로 3미터 가", "앞으로 10미터 가 줘", "앞으로 2미터 가 주세요", "뒤로 1미터 가", "move forward 5 meters", "go forward 2 meters",
|
||||
"drive 3 meters ahead", "종이컵 집어 줘", "종이컵 잡아 줘", "pick up the paper cup", "grab my paper cup", "종이컵 가져와",
|
||||
"팔 들어", "팔 내려", "raise your arm", "대통령 연세가 어떻게 됩니까", "대통령 몇 살이에요", "엄마 연세가 어떻게 되세요", "how old is the president",
|
||||
"오픈AI는 누가 이끌고 있습니까", "오픈AI CEO가 누구야", "who runs openai", "who leads openai"]
|
||||
|
||||
@@ -0,0 +1,201 @@
|
||||
"""The first quick-answer kinds (name, age, maker, height, weight, battery, languages, AI model ...) asked at every
|
||||
Korean speech level and in many English frames (assistant/quick_answers.py). Same meanings as the kinds' own
|
||||
wordings in assistant/quick_answers.py and questions.py: no new facts, no new answers.
|
||||
|
||||
Korean: each kind's stems ("몸무게가 ", "몇 킬로") with the ending family of their last word, with or without a
|
||||
subject (너, 루미, 이 로봇, 로봇님 ...). Levels: 반말, 해요체, 하십시오체, honorific (-세요 / -십니까 / -시나요),
|
||||
friendly (-냐, -지), dialect (-노, -고, -여, -유, -교), short written forms (-임). English: frames with "you" and with
|
||||
"lumi" / "this robot", plus Konglish mixes.
|
||||
"""
|
||||
|
||||
KO_WHO = ["", "너 ", "니 ", "루미 ", "이 로봇 ", "로봇님 "]
|
||||
|
||||
# ending families: the question word or verb the stem ends on
|
||||
WHAT = ["뭐야", "뭐예요", "뭐에요", "뭐니", "뭐냐", "뭡니까", "뭔가요", "뭐죠", "뭐고", "뭐여", "뭐임", "뭐예유", "뭔교", "뭔데", "뭐세요"]
|
||||
MUCH = ["얼마야", "얼마예요", "얼마니", "얼마냐", "얼맙니까", "얼마입니까", "얼마인가요", "얼마죠", "얼마고", "얼마여", "얼마임", "얼마예유",
|
||||
"얼만교", "얼만데", "얼마세요"]
|
||||
MANY = ["몇이야", "몇이에요", "몇이니", "몇이냐", "몇입니까", "몇인가요", "몇이죠", "몇이고", "몇이여", "몇임", "몇이에유", "몇인교", "몇인데",
|
||||
"몇이세요"]
|
||||
HOW = ["어떻게 돼", "어떻게 돼요", "어떻게 되니", "어떻게 되냐", "어떻게 되나요", "어떻게 되세요", "어떻게 되십니까", "어떻게 됩니까",
|
||||
"어떻게 되시나요", "어떻게 되노", "우째 되노", "어떻게 돼유", "어떻게 되는데", "어떻게 되죠"]
|
||||
COP = ["야", "예요", "니", "냐", "입니까", "인가요", "죠", "고", "여", "임", "예유", "인교", "인데", "세요"] # after a vowel noun
|
||||
COP_C = ["이야", "이에요", "이니", "이냐", "입니까", "인가요", "이죠", "이고", "이여", "임", "이에유", "인교", "인데", "이세요"] # after a consonant
|
||||
HAVE = ["있어", "있어요", "있니", "있냐", "있나요", "있습니까", "있으세요", "있으십니까", "있으신가요", "있나", "있노", "있어유", "있음", "있지"]
|
||||
ABLE = ["수 있어", "수 있어요", "수 있니", "수 있냐", "수 있나요", "수 있습니까", "수 있으세요", "수 있으십니까", "수 있으신가요", "수 있나",
|
||||
"수 있노", "수 있어유", "수 있음", "줄 알아", "줄 알아요", "줄 아니", "줄 아세요", "줄 아십니까", "줄 압니까", "줄 아노"]
|
||||
|
||||
|
||||
def ko(stems, ends, who=KO_WHO):
|
||||
return [w + s + e for w in who for s in stems for e in ends]
|
||||
|
||||
|
||||
def en(frames, subjects=("you",)):
|
||||
return [f.format(s=s) for f in frames for s in subjects]
|
||||
|
||||
|
||||
IT = ("lumi", "this robot", "the robot", "this thing") # "how heavy is {s}"
|
||||
YOU_IS = [("you", "are"), ("lumi", "is"), ("this robot", "is"), ("the robot", "is")]
|
||||
|
||||
|
||||
def en_be(frames):
|
||||
"""Frames with {s} and {be}: "how heavy {be} {s}" -> "how heavy are you", "how heavy is lumi"."""
|
||||
return [f.format(s=s, be=b) for f in frames for s, b in YOU_IS]
|
||||
|
||||
|
||||
QUICK = {
|
||||
"name": ko(["이름이 ", "이름 ", "네임이 "], WHAT) + ko(["이름이 ", "성함이 "], HOW) +
|
||||
ko(["뭐라고 부르면 "], ["돼", "돼요", "되니", "되냐", "되나요", "됩니까", "될까요", "되노", "되겠습니까"], ["", "너 ", "로봇님 "]) +
|
||||
["what's your name", "what is your name", "may i ask your name", "could you tell me your name", "your name please",
|
||||
"what's lumi's name", "what is this robot's name"] +
|
||||
["what name do you go by", "what should we call you", "how should i call you", "what's the robot called", "what is this robot called",
|
||||
"is there a name for you", "what are you named", "your 이름 뭐야", "name이 뭐예요", "네 name 뭐야", "이름 what", "what's ur name"],
|
||||
"age": ko(["몇 살", "나이가 몇 살", "올해 몇 살"], COP_C) + ko(["나이가 ", "연세가 ", "연식이 "], HOW) +
|
||||
ko(["나이 ", "나이가 "], MANY) +
|
||||
ko(["언제 만들어졌", "언제 태어났", "만들어진 지 얼마나 됐", "태어난 지 얼마나 됐"],
|
||||
["어", "어요", "니", "냐", "습니까", "나요", "어유", "노", "음", "지", "으세요", "으십니까"]) +
|
||||
en_be(["how old {be} {s}", "what age {be} {s}", "how many years old {be} {s}", "when {be} {s} made", "when {be} {s} built",
|
||||
"when {be} {s} born"]) +
|
||||
["how long have you existed", "how long have you been around", "what year were you made", "how old r u 루미", "너 age 몇이야"],
|
||||
"maker": ko(["누가 만들었", "누가 개발했", "누가 제작했"], ["어", "어요", "니", "냐", "습니까", "나요", "어유", "노", "음", "지", "으세요", "으십니까", "죠"]) +
|
||||
ko(["만든 사람이 누구", "만든 회사가 어디", "제조사가 어디", "개발사가 어디", "제작사가 어디"], COP) +
|
||||
ko(["어느 회사에서 만들었", "어디서 만들었", "어디서 개발했"], ["어", "어요", "니", "냐", "습니까", "나요", "노", "어유", "으세요"]) +
|
||||
en(["who made {s}", "who built {s}", "who created {s}", "who developed {s}", "which company made {s}", "who designed {s}",
|
||||
"who manufactures {s}", "which company is behind {s}", "who is {s} made by"], ("you", "lumi", "this robot")) +
|
||||
["who's behind you", "who are your makers", "누가 만들었어 you", "who made 너", "maker가 누구야", "제조사 where"],
|
||||
"height": ko(["키가 ", "키 ", "신장이 ", "높이가 "], MANY + MUCH) + ko(["키가 ", "신장이 "], HOW) +
|
||||
ko(["키 몇 센티", "키가 몇 센티미터", "몇 센티"], COP) +
|
||||
en_be(["how tall {be} {s}", "how high {be} {s}", "how many centimeters tall {be} {s}", "how many cm {be} {s}"]) +
|
||||
en(["what's {s} height", "what is {s} height", "{s} height?"], ["your", "lumi's", "the robot's"]) +
|
||||
["너 height 몇이야", "키 몇 cm야"],
|
||||
"weight": ko(["몸무게가 ", "몸무게 ", "무게가 ", "무게 ", "체중이 "], MUCH + MANY) + ko(["무게가 ", "몸무게가 ", "체중이 "], HOW) +
|
||||
ko(["몇 킬로", "몇 키로", "몇 킬로그램", "몇 kg"], COP) +
|
||||
ko(["얼마나 무거"], ["워", "워요", "워유", "운가요", "우세요", "워?", "웁니까", "우십니까"], ["", "너 ", "루미 ", "이 로봇 "]) +
|
||||
ko(["무게 얼마나 나가"], ["", "요", "니", "나요", "세요", "십니까", "노", "유", "냐"], ["", "너 ", "루미 ", "이 로봇 "]) +
|
||||
en_be(["how heavy {be} {s}", "how many kilos {be} {s}", "how many kg {be} {s}", "how many pounds {be} {s}"]) +
|
||||
en(["how much do {s} weigh", "what do {s} weigh"], ["you"]) +
|
||||
en(["how much does {s} weigh", "what does {s} weigh", "what's the weight of {s}"], ("lumi", "this robot", "the robot")) +
|
||||
["너 weight 얼마야", "몸무게 how much", "weight가 몇이에요", "몇 kg이에요 you"],
|
||||
"speed": ko(["속도가 ", "최고 속도가 ", "최대 속도가 ", "속력이 "], MUCH + MANY) + ko(["속도가 "], HOW) +
|
||||
ko(["얼마나 빨리 가", "얼마나 빨리 달려", "얼마나 빨리 움직여", "얼마나 빨라"], ["", "요", "니?", "유", "노", "요?"]) +
|
||||
ko(["얼마나 빨리 갈 ", "얼마나 빨리 달릴 "], ABLE[:13]) +
|
||||
en_be(["how fast {be} {s}", "how quick {be} {s}"]) +
|
||||
en(["how fast can {s} go", "how fast can {s} drive", "how fast can {s} move"], ("you", "lumi", "this robot")) +
|
||||
en(["what's {s} top speed", "what is {s} maximum speed", "what's {s} max speed"], ("your", "lumi's", "this robot's")) +
|
||||
["max speed?", "top speed?", "speed 얼마야", "너 speed 몇이야", "how fast 가요", "최고 speed가 몇이에요"],
|
||||
"battery_life": ko(["배터리 얼마나 가", "배터리 얼마나 오래 가", "배터리 몇 시간 가", "한 번 충전하면 얼마나 가", "충전하면 몇 시간 가"],
|
||||
["", "요", "니", "냐", "나요", "요?", "노", "유", "죠"]) +
|
||||
ko(["몇 시간 동안 일할 ", "몇 시간 움직일 ", "충전 없이 얼마나 일할 "], ABLE[:13]) +
|
||||
ko(["배터리 지속 시간이 ", "배터리 사용 시간이 ", "배터리 수명이 하루에 "], MUCH + HOW[:8]) +
|
||||
["how long does your battery last", "how long can you run on one charge", "how many hours can you work",
|
||||
"how long can you go without charging", "what's your battery life", "how long does lumi's battery last",
|
||||
"how many hours can this robot run"] +
|
||||
["how long do you last", "how long until your battery runs out", "battery 몇 시간 가요", "battery life 얼마예요",
|
||||
"배터리 how long 가", "한 번 charge하면 얼마나 가요"],
|
||||
"languages": ko(["영어 할 ", "한국어 할 ", "중국어 할 ", "일본어 할 ", "영어로 말할 ", "다른 언어 할 "], ABLE) +
|
||||
ko(["무슨 언어 할 ", "몇 개 언어 할 ", "어떤 말 할 "], ["수 있어", "수 있어요", "수 있니", "수 있습니까", "수 있으세요", "줄 알아",
|
||||
"줄 아세요", "줄 아십니까", "줄 아노"]) +
|
||||
ko(["영어 ", "한국어 ", "중국어 ", "일본어 ", "스페인어 "], ["돼", "돼요", "되니", "되냐", "되나요", "됩니까", "되세요", "되노", "돼유"]) +
|
||||
ko(["영어 ", "한국어 ", "일본어 "], ["알아", "알아요", "아니", "아세요", "아십니까", "압니까", "아나", "아노", "알아유", "하세요", "하십니까", "하시나요"]) +
|
||||
[f.format(l=l) for f in ["can you speak {l}", "do you speak {l}", "do you understand {l}", "can you talk in {l}",
|
||||
"can we talk in {l}", "{l} okay?", "do you know {l}"]
|
||||
for l in ["english", "korean", "chinese", "japanese", "spanish", "french", "german"]] +
|
||||
["english 돼요", "korean 할 줄 알아", "can you speak 영어", "한국말 할 줄 알아", "한국말 잘해요", "what languages 할 수 있어"],
|
||||
"model": ko(["무슨 AI ", "어떤 AI ", "어떤 모델 ", "무슨 언어 모델 ", "인공지능 ", "무슨 LLM "], ["써", "써요", "쓰니", "쓰냐", "쓰세요", "쓰십니까",
|
||||
"씁니까", "쓰나요", "쓰노", "써유", "씀"]) +
|
||||
ko(["AI 모델이 ", "언어 모델이 ", "인공지능 모델이 ", "두뇌가 "], WHAT) +
|
||||
["what ai do you use", "what model do you run", "which llm do you use", "what ai is your brain", "which ai model powers you",
|
||||
"what language model do you use"] +
|
||||
["what model runs lumi", "what's inside your brain", "which ai is this robot using", "ai model 뭐 써요", "what ai 써",
|
||||
"llm 뭐야", "너 brain이 뭐야"],
|
||||
"chatgpt": ko(["챗GPT ", "챗지피티 ", "GPT ", "지피티 ", "오픈AI "], ["써", "써요", "쓰니", "쓰냐", "쓰세요", "쓰십니까", "씁니까", "쓰나요", "쓰노", "써유",
|
||||
"기반이야", "기반이에요", "기반입니까", "기반이세요"]) +
|
||||
ko(["챗GPT", "챗지피티", "GPT"], COP, ["너 ", "루미 ", "이거 "]) +
|
||||
["are you chatgpt inside", "is chatgpt running you", "do you run on chatgpt", "are you powered by gpt", "is this openai",
|
||||
"are you an openai robot", "do you use gpt-4", "chatgpt 써요", "너 gpt야"],
|
||||
"robot": ko(["사람", "진짜 로봇", "로봇", "인공지능"], COP_C, ["너 ", "루미 ", "당신 ", "이거 "]) + ko(["기계"], COP, ["너 ", "루미 ", "당신 ", "이거 "]) +
|
||||
ko(["살아 있", "감정 있", "마음 있", "느낌 있"], ["어", "어요", "니", "냐", "나요", "습니까", "으세요", "으십니까", "나", "노", "어유", "지"]) +
|
||||
ko(["누가 조종하는 ", "사람이 조종하는 ", "누가 원격으로 움직이는 "], ["거야", "거예요", "거니", "거냐", "겁니까", "건가요", "거죠", "기가", "거여"], ["", "너 ", "이 로봇 "]) +
|
||||
en_be(["{be} {s} a real robot", "{be} {s} a person", "{be} {s} alive", "{be} {s} human", "{be} {s} remote controlled"]) +
|
||||
["is a person controlling you", "is somebody steering you", "are you real or fake", "do you feel anything", "너 real robot이야",
|
||||
"사람 inside 있어"],
|
||||
"how_are_you": ko(["잘 지냈", "잘 지내", "괜찮"], ["어", "어요", "니", "냐", "나요", "습니까", "으세요", "으십니까", "어유", "노", "지", "죠"], ["너 ", "루미 ", "로봇님 "]) +
|
||||
ko(["기분 ", "기분이 ", "컨디션 ", "컨디션이 ", "오늘 기분 "], ["어때", "어때요", "어떠니", "어떠냐", "어떻습니까", "어떠세요", "어떠신가요",
|
||||
"어떻노", "어뗘", "어때유", "좋으세요"], ["", "너 ", "루미 "]) +
|
||||
["how are you today", "how are you feeling", "how's your day", "how's your day been", "how are things", "you doing okay",
|
||||
"how you doing", "are you doing ok today", "how r u", "how are u", "how are you 루미야", "오늘 how are you"],
|
||||
"touch": ko(["만져도 ", "만져 봐도 "], ["돼", "돼요", "되니", "되냐", "되나요", "됩니까", "될까요", "되노", "돼유", "되죠"], ["", "로봇 ", "루미 ", "이 로봇 ", "너 "]) +
|
||||
["is it alright to touch you", "can people touch the robot", "are kids allowed to touch you", "can my kid touch you",
|
||||
"is touching allowed", "touch 해도 돼요", "만져도 okay"],
|
||||
"country": ko(["어느 나라 ", "어디 나라 "], ["로봇이야", "로봇이에요", "로봇이니", "로봇입니까", "로봇인가요", "거야", "거예요", "제품이에요", "출신이야", "출신이에요",
|
||||
"출신입니까", "출신이세요"], ["", "너 ", "루미 ", "이 로봇 "]) +
|
||||
ko(["한국 로봇", "한국에서 만든 로봇", "국산", "중국 로봇"], COP_C, ["너 ", "루미 ", "이 로봇 "]) +
|
||||
["made in korea?", "which country is this robot from", "korea에서 만들었어요"],
|
||||
}
|
||||
QUICK["no"] = [
|
||||
# the same words about other things or the visitor, and orders: not these kinds
|
||||
"내 이름이 뭐야", "제 이름이 뭐예요", "내 나이가 몇 살이야", "제 키가 몇이에요", "내 몸무게가 얼마야", "제 몸무게 몇 킬로예요",
|
||||
"엄마 이름이 뭐예요", "이 컵 무게가 얼마예요", "이 컵 몇 킬로야", "테이블 높이가 얼마예요", "책상 높이 몇이야", "자동차 속도가 얼마야",
|
||||
"핸드폰 배터리 얼마나 가요", "내 폰 배터리 몇 시간 가", "배터리 몇 퍼센트 남았어", "배터리 얼마나 남았어요", "충전 얼마나 걸려요",
|
||||
"속도 줄여", "속도 높여 줘", "천천히 가", "빨리 가", "더 빨리 와", "키 높여", "키 낮춰 줘", "영어로 말해 줘", "한국어로 대답해 주세요",
|
||||
"영어로 바꿔", "한국말로 해", "speak english please", "talk in korean", "answer in english", "switch to korean",
|
||||
"how fast is the ice cream robot", "how heavy is the cup", "how tall is the table", "how old is cutshion", "who made the barista robot",
|
||||
"what's my name", "how old am i", "how tall am i", "how heavy am i", "how are you so tall", "how are you so fast",
|
||||
"슬퍼", "나 기분 안 좋아", "기분 좋다", "나 오늘 기분 최고야", "how am i doing", "how was my day",
|
||||
]
|
||||
|
||||
# night 4, round 2: the question said inside a polite frame ("키가 얼마인지 알려 주시겠어요?", "몇 살인지 여쭤봐도 될까요?"),
|
||||
# 하게체 ("키가 얼마인가?", "누가 만들었는가?"), and broken English / slips ("what is name of you", "you how heavy?")
|
||||
TOLD = ["알려 줘", "알려 줄래", "알려 주세요", "알려 주실래요", "알려 주시겠어요", "알려 주시겠습니까", "알려 주십시오", "여쭤봐도 될까요",
|
||||
"여쭤봐도 되겠습니까", "물어봐도 돼요", "말해 줄 수 있어", "말씀해 주시겠어요"]
|
||||
for _kind, _stems, _hage, _en in [
|
||||
("height", ["키가 얼마인지 ", "키가 몇 센티인지 ", "키가 얼마나 되는지 ", "키 몇인지 "], ["키가 얼마인가", "키가 얼마나 되는가", "키 몇인가"],
|
||||
["you how tall", "how tall you are", "your height how much", "height of you", "you tall how much", "how tal are you", "how tall r you"]),
|
||||
("weight", ["무게가 얼마인지 ", "몸무게가 얼마인지 ", "무게가 얼마나 되는지 ", "몸무게 얼마나 나가는지 "],
|
||||
["무게가 얼마인가", "몸무게가 얼마나 되는가", "무게 얼마나 나가는가"],
|
||||
["you how heavy", "how heavy you are", "your weight how much", "weight of you", "how heavi are you", "how hevy are you", "you weigh how much"]),
|
||||
("age", ["몇 살인지 ", "나이가 몇 살인지 ", "나이가 어떻게 되는지 ", "나이가 어떻게 되시는지 "], ["몇 살인가", "나이가 몇인가", "나이가 몇 살인가"],
|
||||
["you how old", "how old you are", "your age how much", "age of you", "you age is", "how ol are you", "what your age"]),
|
||||
("name", ["이름이 뭔지 ", "이름이 무엇인지 ", "이름이 어떻게 되는지 ", "성함이 어떻게 되시는지 "], ["이름이 무엇인가", "이름이 뭔가", "자네 이름이 뭔가"],
|
||||
["name of you", "you name what", "what name you", "your name is what", "what is you name?", "wat is your name", "you name is"]),
|
||||
("maker", ["누가 만들었는지 ", "어느 회사가 만들었는지 ", "어느 회사에서 만드셨는지 ", "어디서 만들었는지 "], ["누가 만들었는가", "어느 회사가 만들었는가"],
|
||||
["who make you", "you made by who", "you made by which company", "which company make you", "who maked you", "company of you which",
|
||||
"where you come from which company"]),
|
||||
("speed", ["속도가 얼마나 되는지 ", "최고 속도가 얼마인지 ", "얼마나 빨리 가는지 "], ["속도가 얼마인가", "최고 속도가 얼마나 되는가"],
|
||||
["you how fast", "how fast you go", "your speed how much", "speed of you", "how fsat are you", "how fast u move", "max speed of you"]),
|
||||
("battery_life", ["배터리가 얼마나 가는지 ", "한 번 충전하면 얼마나 쓰는지 ", "사용 시간이 얼마인지 ", "배터리 몇 시간 가는지 "],
|
||||
["배터리가 얼마나 가는가", "한 번 충전하면 얼마나 쓰는가"],
|
||||
["battery how long", "your battery how long", "how long battery", "how many hour you run", "how long you run one charge", "batery how long"]),
|
||||
("languages", ["무슨 언어를 하는지 ", "말할 수 있는 언어가 뭔지 ", "어떤 언어를 할 수 있는지 "], ["무슨 언어를 하는가", "할 수 있는 언어가 뭔가"],
|
||||
["you speak which language", "what language you speak", "language of you", "you can english", "which languages u speak"]),
|
||||
("model", ["무슨 AI 쓰는지 ", "어떤 인공지능이 들어 있는지 ", "AI 모델이 뭔지 "], ["무슨 AI를 쓰는가", "인공지능이 뭔가", "어떤 AI가 들어 있는가"],
|
||||
["you use which ai", "your ai is what", "what ai you use", "ai of you", "which ai inside you"]),
|
||||
("time_now", ["지금 몇 시인지 "], ["지금 몇 시인가", "몇 시인가"], ["now time what", "what time now", "time now?", "what time it is now"]),
|
||||
("date_today", ["오늘 며칠인지 ", "오늘 날짜가 며칠인지 "], ["오늘 며칠인가", "오늘 날짜가 며칠인가"], ["today date what", "what date today", "date today?"]),
|
||||
("date_today", ["오늘 무슨 요일인지 ", "오늘 요일이 뭔지 "], ["오늘 무슨 요일인가", "오늘 요일이 뭔가"], ["today what day", "what day today", "today which day"]),
|
||||
]:
|
||||
QUICK.setdefault(_kind, []).extend([w + s + t for w in ["", "너 "] for s in _stems for t in TOLD] + _hage +
|
||||
["너 " + h for h in _hage if not h.startswith("자네")] + _en)
|
||||
QUICK["languages"] += ["랭귀지 뭐 할 수 있어요", "랭귀지 몇 개 해", "language 뭐 할 수 있어", "랭귀지 뭐 해요", "무슨 랭귀지 해요", "랭귀지 뭐 하노"]
|
||||
QUICK.setdefault("computer", []).extend([
|
||||
"which chip is your brain", "what chip do you have", "what chip runs you", "which processor do you have", "what's the chip inside you",
|
||||
"두뇌 컴퓨터 뭐야", "두뇌 컴퓨터가 뭐예요", "너 두뇌 컴퓨터 뭔데", "무슨 칩 써요", "칩 뭐 들어 있어", "프로세서 뭐예요", "머리에 무슨 컴퓨터 있어요",
|
||||
"두뇌 칩이 뭐입니까", "컴퓨터 뭐 들어갔노"])
|
||||
QUICK.setdefault("co_founded", []).extend([
|
||||
"company made which year", "company founded which year", "your company start which year", "회사 몇 년도에 생겼어", "회사 언제 생겼어요",
|
||||
"회사 설립 연도가 언제예요", "회사 몇 년에 세웠습니까"])
|
||||
QUICK["battery_life"] += ["how long does a full charge last", "how long does one charge last", "how long do you last on a charge",
|
||||
"how long does your battery last", "완충하면 얼마나 가", "완충하면 몇 시간 가요", "완충하면 얼마나 버팁니까"]
|
||||
QUICK["robot"] += [w + e for w in ["누가 조종해", "누가 조종하노", "누가 움직여", "사람이 조종해"] for e in ["", "요", "유", "?"]][:12] + \
|
||||
["누가 조종합니까", "누가 조종하세요", "is someone driving you", "who is controlling you right now"]
|
||||
QUICK.setdefault("arm_weight", []).extend(["팔 무게가 몇 킬로예요", "팔 무게 몇 kg이야", "팔 무게가 몇 kg입니까", "팔은 몇 kg 나가요", "how heavy is the arm",
|
||||
"how heavy is this arm", "how much does that arm weigh"])
|
||||
QUICK.setdefault("co_hq", []).extend(["쿳션 회사 어디 있어", "쿳션 회사 어디 있노", "쿳션 회사 어디에 있어요", "쿳션 회사 위치가 어디예요",
|
||||
"where is cutshion located", "where's the company located"])
|
||||
QUICK.setdefault("price", []).extend(["가격이 얼마야", "가격이 얼마예요", "가격이 얼맙니까", "가격이 얼마입니까", "가격 얼마노", "가격이 얼마여",
|
||||
"로봇 가격 얼마예요", "이거 가격 얼마야"])
|
||||
QUICK["speed"] += ["빨리 달릴 수 있어", "빨리 달릴 수 있어요", "빨리 갈 수 있어", "빨리 갈 수 있습니까", "얼마나 빨리 달려", "can you go fast",
|
||||
"can you drive fast", "are you fast", "can you run fast"]
|
||||
QUICK.setdefault("obstacles", []).extend([
|
||||
"팔이 사람 치면 어떡해요", "팔에 사람이 맞으면 어떻게 돼요", "팔이 부딪히면 어떻게 돼", "what if your arm hits someone", "will your arm hit me",
|
||||
"is it safe to stand next to you", "are you safe around kids", "옆에 서 있어도 안전해",
|
||||
"가까이 가도 안전합니까", "애들 옆에 둬도 괜찮아요"])
|
||||
@@ -15,7 +15,7 @@ ON_CHARGE = re.compile(r"\b(on|per|with) (a |one |the )?(full |single )?charge\b
|
||||
r"\bgo (back )?(to )?(re)?charg|한 ?번 충전(?:으로|하면)|완충(?:으로|하면|되면)|충전하면 ?(?:얼마나|몇)|"
|
||||
r"충전하러", re.I) # how long it lasts (10 hours), when it goes to charge: the LLM
|
||||
LASTS = re.compile(r"\b(last|life|lifetime|capacity|volt|amp|ah|kind|type|made|hours?)\b|얼마나 ?가|몇 ?시간|오래 ?가|"
|
||||
r"지속|용량|종류|볼트", re.I) # how long it lasts, what it is: the reference notes
|
||||
r"지속|용량|종류|볼트|수명|뭐\s*들어|무슨\s*배터리|어떤\s*배터리|\bwhat (?:kind of |type of )?battery\b|사용 ?시간|쓸 ?수 ?있는 ?시간|런타임|\bruntime\b|\bhow long\b", re.I) # how long it lasts, what it is: the reference notes
|
||||
LEVEL = re.compile(
|
||||
r"\bbattery\b.*\b(level|percent(age)?|left|status|charged|full|low|now|remaining|state|at|much|look)\b|"
|
||||
r"\b(level|percent(age)?|how much)\b.*\bbattery\b|^\W*(and |so |what about |how about )?(your |the )?battery\W*$|"
|
||||
@@ -28,6 +28,7 @@ CHARGING = re.compile(
|
||||
|
||||
def asked(text):
|
||||
""""now" (level / charging now), "how long" (charging time), or None."""
|
||||
text = re.sub(r"\S+—\s*", "", text or "") # a stutter: "몇 시— 시간"
|
||||
if ON_CHARGE.search(text):
|
||||
return None
|
||||
if HOW_LONG_CHARGE.search(text):
|
||||
|
||||
+19
-13
@@ -133,10 +133,10 @@ KINDS = {
|
||||
"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이고, 음성 인식은 위스퍼예요. 둘 다 클라우드 없이 제 컴퓨터에서 돌아가요."]}),
|
||||
], {"en": ["I answer with Gemma 4, a language model made by Google, served by Ollama on my own NVIDIA Jetson Thor.",
|
||||
"My language model is Gemma 4 by Google, served by Ollama, and I understand speech with Whisper; both run on my own NVIDIA Jetson Thor, 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",
|
||||
@@ -267,22 +267,22 @@ _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(?! (?:call|address) you\b)(?! (?:talk|speak|chat) (?:to|with) you\b)|i'm|am i|my|"
|
||||
r"recogni[sz]e|remember)\b|보여|보이|보니|(?<!해 )(?<!해)(?<!쭤 )(?<!쭤)(?<!여쭈어 )봐(?!도 ?(?:돼|되|될|괜찮))|봤|입었|들고|색|카메라|앞에|뒤에|알아봐|기억", re.I)
|
||||
ABOUT_ME = re.compile(r"\b(?:(?<!can )(?<!could )(?<!may )i(?! (?:call|address) you\b)(?! (?:talk|speak|chat) (?:to|with) you\b)|i'm|am i|my|"
|
||||
r"(?<!tell )(?<!give )(?<!let )(?<!show )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|(?<!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"(?<!hello )(?<!hi )(?<!hey )(?<!is )(?<!are )there(?! (?:is|are)\b)|this one)\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|\bthen\b|그리고|[??].+\S|하고\s|랑\s|"
|
||||
r"[가-힣](?<![최광참사창공경재원])(?<!그리)고\s+(?!싶|있|계)", re.I) # "고개 숙이고 몇 시야?", "보고 시간 알려 줘"
|
||||
SEVERAL = re.compile(r"\band\b(?!\s+(?:built|made|\w+ed)\s+(?:you|lumi|this robot)\b)|\bthen\b|그리고|[??].+\S|하고\s|랑\s|"
|
||||
r"[가-힣](?<![최광참사창공경재원라])(?<!그리)고\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
|
||||
r"\b(?:open|close)\b(?!\s+(?:a|the|my|your|this|that|doors?)\b)|\b(?: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
|
||||
@@ -317,7 +317,10 @@ ASKING = re.compile(r"^\W*(?:(?:hang on|wait|okay|ok|so|um+|uh+|hey|excuse me|so
|
||||
def _core(text):
|
||||
from assistant import brain
|
||||
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()
|
||||
if not re.search(r"\b(?:is|was|name|named|called)\s+lumi\W*$", t, re.I): # the subject: "How wide is Lumi?"
|
||||
t = re.sub(r"[\s,]*(?:lumi|루미야|루미)?[\s,.!?~]*$", "", t, flags=re.I).strip()
|
||||
if re.fullmatch(r"(?:무슨|뭔|무엇의?) ?뜻\S*", t) and "루미" in (text or ""):
|
||||
t = "루미 " + t # "루미 무슨 뜻이에요?": what the name means
|
||||
t = re.sub(r"얼만가$", "얼마예요", re.sub(r"(?<=[가-힣])는가$", "나요", re.sub(r"(?<=[가-힣])인가$", "인가요", t)))
|
||||
return t or (text or "").strip(" ,.!?~") # 하게체 questions ("키 얼만가", "얼마나 되는가") as 해요체
|
||||
|
||||
@@ -337,13 +340,16 @@ def guarded(text, history=()):
|
||||
lead = re.match(r"^\W*(?:and|so|but|okay so|then)\W+", t, re.I)
|
||||
if lead and len(t[lead.end():].split()) >= 3 and NAMES_LUMI.search(t[lead.end():]):
|
||||
t = t[lead.end():] # "and your name is?", "so who are you?": a whole question
|
||||
if FRAGMENT.search(t):
|
||||
why = re.match(r"^\W*(?:why|왜)\s+", t, re.I) # "why is your name Lumi?", "왜 루미라고 불러?": a whole question
|
||||
whole_why = why and len(t[why.end():].split()) >= 2 and NAMES_LUMI.search(t[why.end():]) and \
|
||||
not FRAGMENT.search(t[why.end():])
|
||||
if FRAGMENT.search(t) and not whole_why:
|
||||
return "fragment"
|
||||
if SEVERAL.search(t):
|
||||
return "several"
|
||||
if OTHER.search(t):
|
||||
return "other"
|
||||
if EVENT_TIME.search(t):
|
||||
if EVENT_TIME.search(t) and not re.search(r"\bwhen did\b", t, re.I): # "when did Cutshion start?": a founding
|
||||
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
|
||||
|
||||
+48
-27
@@ -11,6 +11,7 @@ music: small diagonal bobs landing on the beats in energetic parts, a quick swee
|
||||
phrase start, slower sways in calm parts, each move called early enough (the owner's measured head timing) to land
|
||||
on its beat, one call at a time; it goes back to yaw 0 / pitch 0 when the song ends or is stopped. Never the lift, the waist or the arm.
|
||||
"""
|
||||
import difflib
|
||||
import json
|
||||
import pathlib
|
||||
import random
|
||||
@@ -56,17 +57,21 @@ SONG_WORD = re.compile(r"\bsing|\bsong|\bmusic|\btunes?\b|\bplaylist|k-?pop|노
|
||||
SING = re.compile(r"\bsing\b|\bsay (?:a |some )?songs?\b|" # whisper writes "let's say song"
|
||||
r"\b(?:play|put on|turn on|start)(?: me| us)? (?:a |some |any |another |the |your )?(?:songs?|music|tunes?)\b|"
|
||||
r"\b(?:another|different|next|new|other) (?:song|tune)\b|\b(?:change|switch)(?: the| this| that)? (?:songs?|music|tunes?)\b|"
|
||||
r"(?:노래|음악|곡)\s*(?:좀\s*)?바꿔|\b(?:want|like|love) to hear (?:a |some )?(?:song|music)\b|"
|
||||
r"(?:노래|음악|곡)\s*(?:좀\s*)?바꿔|\b(?:(?:want|like|love) to|(?:can|could|may) (?:we|i)) hear (?:a |some |one of your )?(?:songs?|music)\b|\bgive (?:us|me) (?:a |some )?(?:song|tune|music)\b|"
|
||||
r"^\W*(?:lumi\W*)?(?:a |some )?(?:song|music)(?:\W+(?:please|lumi))*\W*$|"
|
||||
r"(?:노래|음악|(?<![가-힣])곡)\s*(?:를|을|좀|하나|한\s*곡|한\s*번|한번|도|이나|나|이든|든|라도|\s)*"
|
||||
r"(?:불러|부르|들려|해|틀어|틀|뽑아|부탁|재생|플레이|(?:할|부를)\s*수\s*있)|"
|
||||
r"노래\s*(?:좀|하나)?\s*(?:듣고\s*싶|들을래|듣자)|(?:다른|딴|다음)\s*(?:노래|곡)|(?:다른|딴)\s*(?:거|걸|걸로)\s*(?:불러|들려|틀어)|^\W*(?:노래|음악)\s*(?:좀|하나)?\W*$", re.I)
|
||||
r"(?:노래|음악|(?<![가-힣])곡|(?<![가-힣])송)\s*(?:를|을|좀|쫌|쪼까|쪼끔|하나|한\s*곡조?|한\s*번|한번|함|한\s*자락|자락|도|이나|나|이든|든|라도|\s)*"
|
||||
r"(?:불러|부르|들려|해|틀어|틀|뽑아|땡겨|부탁|재생|플레이|싱\s*(?:해|하)|(?:할|부를)\s*수\s*있)|(?<![가-힣])싱\s*(?:좀\s*)?해\s*(?:줘|주|봐)|"
|
||||
r"노래\s*(?:좀|하나)?\s*(?:듣고\s*싶|들을래|듣자)|\b(?:songs?|music)\s*(?:좀\s*|하나\s*|한\s*곡\s*)?(?:불러|해|틀어|들려)|"
|
||||
r"(?<![가-힣])(?:거|것)\s*(?:로\s*)?한\s*곡|(?:다른|딴|다음)\s*(?:노래|곡)|(?:다른|딴)\s*(?:거|걸|걸로)\s*(?:불러|들려|틀어)|^\W*(?:노래|음악)\s*(?:좀|하나)?\W*$", re.I)
|
||||
SING_TITLE = re.compile(r"(불러|들려|틀어) ?(줘|주세요|줄래|봐|볼래)|\b(?:sing|play)\b") # "러브 어택 불러 줘": a title said with it
|
||||
SONG_LIST = re.compile(r"\b(?:what|which) (?:kinds? of |sort of |other )?(?:songs?|music|tunes)\b|\bwhat (?:can|do|would|will) you sing\b|"
|
||||
TITLE_ASKED = re.compile(r"불러|들려|틀어|불르|부르[시세십실게자]|부를\s*수|플레이|(?<![가-힣])송(?![가-힣])|(?<![가-힣])싱(?![가-힣])|"
|
||||
r"\bplease\b|플리즈|\bhear\b|한\s*번만|\byou sing\b|\bcan (?:we|i) get\b", re.I)
|
||||
# with one of our titles: "배드 불러 주라", "Love Attack 부르시게", "I'd love to hear Love Attack", "Fantastic Baby 플레이 해 줘"
|
||||
SONG_LIST = re.compile(r"\b(?:what|which) (?:kinds? of |sort of |other )?(?:songs?|music|tunes)\b|\b(?:what|hwat|wat|whta) (?:can|do|would|will) you sing\b|"
|
||||
r"(?<!sing a )(?<!sing one )(?<!sing me a )(?<!sing us a )\bsongs? (?:do |can |could )?you (?:know|sing|have)\b|\b(?:know|have) any (?:other )?songs\b|"
|
||||
r"\b(?:list|names?) of (?:your |the )?songs\b|"
|
||||
r"(?:무슨|어떤|뭔|어느)\s*(?:노래|곡)(?!\s*(?:이든|든|이나|나|라도))|노래\s*(?:는|를|은)?\s*(?:뭐|뭘|몇)|"
|
||||
r"아는\s*노래|부를\s*(?:수\s*있는|줄\s*아는)\s*노래|노래\s*목록", re.I)
|
||||
r"아는\s*노래|부를\s*(?:수\s*있는|줄\s*아는)\s*노래|노래\s*목록|(?:송|노래|곡|song)\s*리스트|\bsong\s*list\b|플레이\s*리스트|\bplaylist\b|what\s*songs", re.I)
|
||||
NOT_REQUEST = re.compile(r"\b(?:do|did) you (?:really )?(?:like|love|enjoy)\b|"
|
||||
r"\bwho sings?\b|\bfavou?rite\b|좋아하는|좋아해|잘\s*(?:해|하|불러)|"
|
||||
r"^\W*(?:is|are|was|were|does|did|has|have)\b(?!\s+you\s+(?:able|willing)\s+to\s+sing\s+(?:a|some|me|us|for|something|one|another)\b)|\b(?:can|do|could) robots? (?:really |even )?sing\b|"
|
||||
@@ -83,22 +88,25 @@ NOT_ASKED = re.compile(r"\b(?:don'?t|do not|never)\s+(?:\w+\s+)?(?:sing|play)\b|
|
||||
r"\b(?:never ?mind|forget it|cancel that|actually,? no|on second thought)\b|아니다\s*(?:됐|그만|말자)|됐(?:어|다|습니다)\W*$|"
|
||||
r"(?:끝나|오|되|돌아오|도착하|시작하)면\s|(?:제가|내가|우리가|저희가|애들이|아이들이|손님이|사람들이)\s+(?:\S+\s+){0,2}\S*[^안않]면\s|(?:부르는|하는|불렀던|부른) ?거 ?(?:봤|들었)|"
|
||||
r"(?:부르|하|틀|불르)지\s*(?:마|말)|노래방|나중에|이따가?|있다가|끝나고|면\s*그때|(?:내가|제가)\s*(?:노래\s*)?"
|
||||
r"(?:불러|부를|부르|할)|"
|
||||
r"(?:불러|부를|부르|할|노래\s*(?:해|하))|(?:불러|노래\s*해|노래해|틀어)도\s*(?:돼|되|괜찮)|"
|
||||
r"^\W*(?:\w+\W+){0,3}?(?:why|how come|how (?:do|does|did|can|could) you)\b|왜|어째서|어떻게", re.I)
|
||||
# "don't sing", "I'll sing later", "노래 부르지 마", "why can you sing?", "왜 손은 안 되고 노래는 돼?":
|
||||
# no song, also when the LLM says sing
|
||||
# right after a song (or the list of songs): a short word switches or repeats it
|
||||
AFTER_SONG = re.compile(r"^\W*(?:(?:lumi|ok|okay|no|nah|um|please|then|now|and)\W+)*(?:sing |play )?"
|
||||
r"(?:another(?: one)?|(?:the )?next(?: one)?|a different one|something (?:else|different)|"
|
||||
r"not (?:this|that)(?: one)?|(?:it |that )?again|one more(?: time)?|once more|more)"
|
||||
r"(?:another(?: one)?|(?:the )?next(?: (?:one|song|sog|son|tune))?|a different one|something (?:else|different)|"
|
||||
r"not (?:this|that)(?: one)?|(?:it |that )?again|one more(?: time)?|once more|more|encore)"
|
||||
r"(?:\W+(?:please|lumi))*\W*$|"
|
||||
r"^\W*(?:루미야?\W*)?(?:아니\W*)?(?:(?:그거|그\s*노래|이거|이\s*노래)\s*말고(?:\s*(?:다른|딴)\s*(?:거|걸로|노래))?|"
|
||||
r"(?:다른|딴)\s*(?:거|걸|걸로|것)|다음\s*(?:거|곡|노래)?|한\s*번\s*더|하나\s*더|다시|또)"
|
||||
r"^\W*(?:(?:야야?|어이|자네|보소|저기요?|저기유|실례지만|실례합니다|죄송한데요|이보게|우리)\W*)*"
|
||||
r"(?:(?:루미(?:루미)?|로봇)\s*(?:야|아|씨|님\s*(?:께서)?|군|양)?\W+)?(?:아니\W*)?(?:(?:그거|그\s*노래|이거|이\s*노래)\s*말고(?:\s*(?:다른|딴)\s*(?:거|걸로|노래))?|"
|
||||
r"(?:다른|딴)\s*(?:거|걸|걸로|것)|다음\s*(?:거|곡|노래)?|넥스트(?:\s*송)?|앵콜|앙코르|한\s*번만?\s*더|하나\s*더|다시|또)"
|
||||
r"\s*(?:요|줘|해\s*줘|해\s*봐|해|불러\s*줘|들려\s*줘|부탁해요?|해요|주세요)?\W*$", re.I)
|
||||
SONG_OFFER = re.compile(r"\bshall i sing\b|\bwant to hear one\b|불러 드릴까요|들어 보실래요", re.I) # Lumi's offer of a song
|
||||
OFFER_YES = re.compile(r"^\W*(?:(?:yes|yeah|yep|sure|ok(?:ay)?|please|of course|go ahead|why not|응|어|네|예|좋아요?|그래요?|"
|
||||
r"불러\s*(?:줘|주세요|봐|주실래요)|듣고\s*싶어요?|부탁해요?|해\s*(?:줘|주세요)|sing(?: it| one)?)(?:\W+|$))+$", re.I)
|
||||
AGAIN = re.compile(r"\bagain\b|\bone more time\b|\bonce more\b|한 ?번 ?더|다시", re.I)
|
||||
OFFER_YES = re.compile(r"^\W*(?:(?:야야?|어이|자네|보소|저기요?|저기유|실례지만|실례합니다|죄송한데요|이보게|우리)\W*)*"
|
||||
r"(?:(?:루미(?:루미)?|로봇)\s*(?:야|아|씨|님\s*(?:께서)?|군|양)?\W+)?(?:(?:yes|yeah|yep|sure|ok(?:ay)?|please|of course|go ahead|why not|응|웅|어|네|예|좋아요?|좋습니다|좋제|좋지|그래요?|"
|
||||
r"오케이|플리즈|아무거나|any(?:\s*one|thing)?(?: is fine)?|whatever|fine|"
|
||||
r"불러\s*(?:줘|주세요|봐|보게|주라|주실래요)|해\s*봐|ㅋ+|ㅎ+|듣고\s*싶어요?|부탁해요?|해\s*(?:줘|주세요)|sing(?: it| one)?)(?:\W+|$))+$", re.I)
|
||||
AGAIN = re.compile(r"\bagain\b|\bone more time\b|\bonce more\b|\bencore\b|한 ?번만? ?더|다시|앵콜|앙코르", re.I)
|
||||
ANOTHER = re.compile(r"\b(another|different|next|other|change|switch)\b|바꿔|\bsomething else\b|\bnot (this|that)\b|다른|딴|다음|말고", re.I)
|
||||
STOP = re.compile(r"\b(stop|enough|halt|quiet|shh+)\b|멈춰|그만|스톱|정지|조용", re.I)
|
||||
KOREAN = re.compile(r"\bkorean\b|한국", re.I)
|
||||
@@ -118,7 +126,7 @@ FILLER = {"sing", "a", "an", "the", "song", "songs", "me", "us", "for", "please"
|
||||
"awesome", "lovely", "sweet", "funny", "silly", "piece", "tell", "show", "make", "is", "are", "be", "i", "we",
|
||||
"sung", "lumie", "random", "pick", "choose", "and", "like", "say", "wish", "how", "about", "have", "time",
|
||||
"cheer", "up", "sin", "sink", "sum", "here", "kids", "listen", "listening", "would", "mind", "surprise",
|
||||
"change", "switch", "son", "sonf", "sogn", "snog", "sonng", "songg", "bro", "dude", "buddy", "robot", "grandma",
|
||||
"change", "switch", "son", "sonf", "sog", "sogn", "snog", "sonng", "songg", "bro", "dude", "buddy", "robot", "grandma",
|
||||
"grandpa", "granny", "mom", "mum", "dad", "she", "he", "him", "her", "likes", "loves", "daughter", "sister",
|
||||
"brother", "friend", "wife", "husband", "kid", "guest", "guests", "na", "bestie", "dear"} # slips of "song", the people sung to
|
||||
UNKNOWN = {"en": ["Sorry, I can't sing that one. I only know my own songs: {}. Want one of them?",
|
||||
@@ -158,7 +166,8 @@ def asked(text, last=""):
|
||||
if picked(t, last):
|
||||
return True
|
||||
return bool(SING.search(t)) or bool(SING_TITLE.search(t) and (_title(t, songs()) or re.search(
|
||||
r"[a-z]{2}.*(?:불러|들려|틀어)", t, re.I) and _other_song(t, songs()))) # "Let it go 불러 줘": not ours
|
||||
r"[a-z]{2}.*(?:불러|들려|틀어)", t, re.I) and _other_song(t, songs()))) or \
|
||||
bool(TITLE_ASKED.search(t) and _title(t, songs(), plain=bool(re.search(r"불러|들려|틀어|불르|부르|부를", t)))) # "Let it go 불러 줘": not ours
|
||||
|
||||
|
||||
_bank = None
|
||||
@@ -243,13 +252,22 @@ def _name_re(name):
|
||||
return rf"(?<![a-z]){body}(?![a-z])" if re.search(r"[a-z]", name) else body
|
||||
|
||||
|
||||
def _title(text, all_songs):
|
||||
"""The song whose longest name is said ("I feel bad, sing Love Attack" is Love Attack), or None."""
|
||||
def _title(text, all_songs, plain=True):
|
||||
"""The song whose longest name is said ("I feel bad, sing Love Attack" is Love Attack), or None. plain=False:
|
||||
not by a name that is also a plain word ("bad": "I feel bad, please")."""
|
||||
low = (text or "").lower()
|
||||
found = [(len(n), sid) for sid, s in all_songs.items() for n in s["names"] if re.search(_name_re(n), low)]
|
||||
found = [(len(n), sid) for sid, s in all_songs.items() for n in s["names"] if re.search(_name_re(n), low) and
|
||||
(plain or n not in ("bad", "배드"))]
|
||||
return max(found)[1] if found else None
|
||||
|
||||
|
||||
def _title_at(text, all_songs):
|
||||
"""Where the longest of our titles said starts (0 when none)."""
|
||||
low = (text or "").lower()
|
||||
found = [(len(n), m.start()) for s in all_songs.values() for n in s["names"] for m in [re.search(_name_re(n), low)] if m]
|
||||
return max(found)[1] if found else 0
|
||||
|
||||
|
||||
def _without_ours(text, all_songs):
|
||||
low = (text or "").lower()
|
||||
for n in sorted((n for s in all_songs.values() for n in s["names"]), key=len, reverse=True):
|
||||
@@ -264,7 +282,7 @@ EN_SLOTS = [re.compile(r"\b(?:sing|play|perform|put on)\s+(.+?)\s*(?:\b(?:songs?
|
||||
re.compile(r"((?:[\w'-]+\s+){0,2}[\w'-]+?)(?:'s)?\s+(?:songs?|tunes?|music)\b"),
|
||||
re.compile(r"\b(?:songs?|something|anything|one|tunes?|music)\s+(?:by|from|of|about)\s+(.+?)\s*(?:[,.!?]|\bplease\b|$)"),
|
||||
re.compile(r"\b(?:you know|do you know|know)\s+(.+?)\s*\?\s*(?:then |so |just |please |now )?(?:sing|play) (?:it|that|this)\b")]
|
||||
KO_SLOTS = [re.compile(r"((?:\S+\s+){0,2}\S+?)\s*(?:의\s*)?(?:노래|곡|음악|송)"),
|
||||
KO_SLOTS = [re.compile(r"((?:\S+\s+){0,2}\S+?)\s*(?:의\s*)?(?:노래|곡|음악|(?<![가-힣])송)"),
|
||||
re.compile(r"((?:\S+\s+){0,2}\S+?)\s*(?:을|를)?\s*(?:좀\s*)?(?:불러|들려|틀어|부르)")]
|
||||
FILLER_KO = {"루미야", "루미", "루미씨", "좀", "하나", "하나만", "한", "곡", "한곡", "노래", "음악", "아무", "아무거나", "다른", "딴",
|
||||
"다음", "새", "네", "니", "너", "너의", "네가", "니가", "당신", "우리", "저한테", "나한테", "우리한테", "저", "나", "제",
|
||||
@@ -275,7 +293,7 @@ FILLER_KO = {"루미야", "루미", "루미씨", "좀", "하나", "하나만", "
|
||||
"로봇", "로봇아", "말고", "그거", "이거", "얘", "애들", "할머니", "할아버지", "엄마", "아빠", "손님", "손님들",
|
||||
"씨", "짱", "님", "오빠", "언니", "누나", "형", "선배", "선배님", "양반", "형제님", "친구", "기사님", "선생님",
|
||||
"로봇님", "루미아", "저기요", "이봐", "이보게", "어이", "대박", "그래", "곡뽑아", "부를", "줄", "알면", "할줄",
|
||||
"부를줄"} # addresses and the words of "부를 줄 알면 한 곡 해 봐"
|
||||
"부를줄", "쫌", "쪼까", "쪼끔", "함", "퍼뜩", "후딱", "얼릉", "싱", "송", "자락", "한자락", "땡겨", "아", "불", "웅", "넥스트", "플리즈", "오케이", "바", "앵콜"} # addresses and the words of "부를 줄 알면 한 곡 해 봐"
|
||||
VERB_KO = re.compile(r"^(?:불러|부르|불러줘|들려|틀어|틀|켜|해|줘|주|봐|부탁|시작|제발|할|하자|합시다|뽑아|바꿔|바꾸)") # the request's own words
|
||||
_PARTICLE = re.compile(r"(?<=.)(?:을|를|은|는|이|가|도|만|요|나|이나|라도|이라도|으로|로)$")
|
||||
_ADNOMINAL = tuple("는은운한픈른쁜던된난진") # "신나는", "조용한", "슬픈": a kind of song, no title
|
||||
@@ -285,19 +303,21 @@ def _other_song(text, all_songs, whole=False):
|
||||
"""A song not ours was named: 'sing Yesterday', 'Bad Guy by Billie Eilish', 'ATEEZ Wonderland', '아이유 노래',
|
||||
'빅뱅 거짓말 불러 줘', 'a Christmas song'. Words are read from the song word back: a describing word ("신나는",
|
||||
"좋으니까") or one said to someone ("아이한테") ends the title part."""
|
||||
low = _without_ours(text, all_songs)
|
||||
low = re.sub(r"(?<=[가-힣])(?=노래|음악|(?<!한)곡|불러|들려|틀어)|(?<=노래)(?=[가-힣])", " ", _without_ours(text, all_songs))
|
||||
# "노래하나불러줘요", "다음곡불러": the request's words written together
|
||||
whole_text = [re.match(r"(.*)", low, re.S)] if whole else [] # read by the bank: every word may hold a title
|
||||
for slots, word in ((EN_SLOTS, r"[a-z][a-z'-]*|[가-힣]+"), (KO_SLOTS, r"[a-z][a-z'-]*|[가-힣]+")):
|
||||
for m in whole_text + [m for slot in slots for m in slot.finditer(low)]:
|
||||
part = re.split(r"[,.!?~]", m.group(1))[-1] # "루미 씨, 러브 어택 불러 줘": the address is no title
|
||||
for w in reversed(re.findall(word, part)):
|
||||
if re.match(r"[a-z]", w):
|
||||
if w.strip("'-").removesuffix("'s") not in FILLER:
|
||||
return True
|
||||
w = w.strip("'-").removesuffix("'s")
|
||||
if w not in FILLER and not (len(w) > 4 and difflib.get_close_matches(w, FILLER, 1, 0.8)):
|
||||
return True # "pleaase", "anothre": slips of filler words
|
||||
continue
|
||||
if w in FILLER_KO or VERB_KO.match(w):
|
||||
continue
|
||||
if len(w) > 1 and w.endswith(_ADNOMINAL) or re.search(r"(?:한테|에게|께|니까|는데|해서|면)$", w):
|
||||
if len(w) > 1 and w.endswith(_ADNOMINAL) or re.search(r"(?:한테|에게|께|께서|니까|는데|데요|지만|해서|면|합니다)$", w):
|
||||
break
|
||||
if _PARTICLE.sub("", w) not in FILLER_KO:
|
||||
return True
|
||||
@@ -313,8 +333,9 @@ def choose(text, lang="en", last=None, whole=False):
|
||||
if _other_song(text, all_songs, whole):
|
||||
return None
|
||||
named = _title(text, all_songs)
|
||||
if named and not ANOTHER.search(text or ""):
|
||||
return named
|
||||
other = [m.start() for m in ANOTHER.finditer(text or "")]
|
||||
if named and (not other or other[-1] < _title_at(text, all_songs)):
|
||||
return named # "다음은 러브 어택", "그거 말고 BAD": that one; "BAD 말고 다른 거": another
|
||||
if last in all_songs and AGAIN.search(text or "") and not ANOTHER.search(text or ""):
|
||||
return last # "sing it again", "한 번 더"
|
||||
want = "ko" if KOREAN.search(text or "") else "en" if ENGLISH.search(text or "") else None
|
||||
|
||||
+10
-1
@@ -73,7 +73,7 @@ POS.update({
|
||||
"arm": ["What sort of arm is that?", "Which robot arm do you use?", "팔은 무슨 모델이에요?", "팔 길이가 몇 센티야?", "how far is your reach?",
|
||||
"팔이 어디까지 닿습니까?", "팔 하나밖에 없어?"],
|
||||
"gripper": ["What kind of gripper is on you?", "How many fingers have you got?", "그리퍼는 무슨 제품이에요?", "손가락이 몇 개니?",
|
||||
"집게는 뭐 써?", "can you grab a paper cup?"],
|
||||
"집게는 뭐 써?"],
|
||||
"lidar": ["Is there a lidar on you?", "How far can the lidar measure?", "라이다 달려 있니?", "라이다 있으십니까?", "레이저 스캐너 있어?"],
|
||||
"sensors": ["Which sensors are on this robot?", "What sensors do you use?", "센서 어떤 게 달려 있어요?", "무슨 센서 있니?", "센서 몇 개 달렸노?"],
|
||||
"stairs": ["Can you go up the stairs?", "Are you able to climb stairs?", "계단도 올라가니?", "계단 오르실 수 있습니까?", "턱 넘을 수 있나?",
|
||||
@@ -121,6 +121,15 @@ POS.update({
|
||||
})
|
||||
NEG += ["does the barista robot have a lidar?", "make me a latte", "라떼 한 잔 만들어 줘", "where's the coffee robot?", "바리스타 로봇 어디 있어?",
|
||||
"what is samsung?", "who is the CEO of Google?", "애플 대표가 누구야?", "커피 얼마예요?", "this cushion is comfy"]
|
||||
POS.update({ # night 4, round 2
|
||||
"paper_cup": ["can you grab a paper cup?", "Could you hold a paper coffee cup?", "종이컵도 집으실 수 있나요?", "종이컵 잡을 수 있겠나?",
|
||||
"종이컵은 잡을 수 있습니까?"],
|
||||
"arm_weight": ["How much does the arm itself weigh?", "팔 무게는 얼마나 됩니까?", "팔이 몇 kg이에요?", "팔 무게 얼마고?"],
|
||||
"short_move": ["How far do you go when I say move forward?", "앞으로 가 하면 최대 몇 미터까지 가요?", "직진 최대 거리가 몇 미터입니까?"],
|
||||
"llm_runtime": ["What runs Gemma for you?", "Is your model served with Ollama?", "언어 모델 돌리는 프로그램이 뭐예요?"],
|
||||
})
|
||||
NEG += ["move forward 4 meters", "앞으로 5미터 가 줘", "grab the paper cup", "종이컵 좀 집어 주세요", "how old is the mayor?",
|
||||
"사장님 연세가 어떻게 되세요?", "who leads samsung?"]
|
||||
|
||||
def run():
|
||||
ok = bad = miss = 0
|
||||
|
||||
@@ -33,6 +33,18 @@ ASKED = {"sing a song": True, "Lumi, sing me a song please": True, "sing Fantast
|
||||
"손님 오면 그때 노래해 줘": False, "I can't sing at all": False}
|
||||
wrong = {t: w for t, w in ASKED.items() if sing.asked(t) != w}
|
||||
assert not wrong, wrong
|
||||
ASKED2 = {"노래 싱 해 줘": True, "송 하나 불러 줘": True, "노래하나불러줘요": True, "노래 한 자락 해 줘": True, "배드 불러 주라": True,
|
||||
"Love Attack 부르시게": True, "I'd love to hear Love Attack": True, "에이티즈 거 한 곡": True, "give us a song": True,
|
||||
"제가 노래해도 돼요?": False, "노래 불러도 돼요?": False, "I feel bad, please": False, "택시 좀 불러 주세요": False,
|
||||
"my daughter loves love attack": False}
|
||||
wrong = {t: w for t, w in ASKED2.items() if sing.asked(t) != w}
|
||||
assert not wrong, wrong
|
||||
assert sing.asked("웅 불러 줘~", "한 곡 불러 드릴까요?") and sing.asked("앵콜!", "ACTION: sing " + F) and sing.list_asked("송 리스트 알려 줘")
|
||||
for t in ["죄송한데요, 노래 하나 불러 주시겠어요?", "실례지만다른노래불러주시길부탁드립니다", "보소, 에이티즈 노래 쪼까 불러 줘", "sing anothre song",
|
||||
"you sing song pleaase", "다른 노래 퍼뜩 불러 주이소"]:
|
||||
assert sing.choose(t) in SONGS, t # openers, dialect, slips and words written together are no title
|
||||
assert sing.choose("트로트한곡불러줘") is None and sing.choose("죄송하지만 아리랑 불러 주세요") is None
|
||||
assert sing.choose("루미야 자 다음은 꿈꾸던 어른이 되었나요 불러 줘") == D
|
||||
|
||||
CHOSEN = {"sing Fantastic Baby": F, "판타스틱 베이비 불러 줘": F, "sing a BIGBANG song": F, "sing something by Big Bang": F,
|
||||
"러브어택 틀어 줘": L_, "리센느 노래 해 줘": L_, "sing a teez song": B, "sing BAD by ATEEZ": B,
|
||||
|
||||
+3
-1
@@ -49,10 +49,12 @@ WEATHER.update({k: "" for k in [ # night 4: casual / honorific / Konglish
|
||||
"웨더 어때", "레인 와", "is it gonna rain", "what's the high today", "how's it looking outside", "do i need a coat today",
|
||||
"will i need an umbrella tomorrow", "could you tell me the weather please", "may i ask about the weather today", "weather report please"]})
|
||||
NEWS += ["축구 결과 알려 줘", "did korea win yesterday", "anything in the news", "what's going on in the world today", "엔화 환율 알려 줘", "주식 시장 어때요"]
|
||||
NEWS += ["애플 대표 어떤 분이에요", "테슬라는 누가 이끌어요", "who leads tesla now", "구글 CEO는 어느 분입니까"]
|
||||
NOT = ["do you like rainy weather", "what's your favourite weather", "is it hot in here", "you're cool", "날씨 좋아해?",
|
||||
"how do you know the weather", "the news is boring", "what's your temperature",
|
||||
"어떤 날씨 좋아해", "우산 어디 있어요?", "우산 잃어버렸어요", "where is my umbrella", "실내 너무 더워요", "i like the news", "are you cold", "추워?", "너 더워?",
|
||||
"요즘 무슨 일 있어", "오늘 무슨 일 있었어", "what happened to you today", "what happened here today", "did you win", "새로운 소식 있어"] # about the visitor / Lumi: the LLM
|
||||
"요즘 무슨 일 있어", "오늘 무슨 일 있었어", "what happened to you today", "what happened here today", "did you win", "새로운 소식 있어",
|
||||
"우리 팀은 누가 이끌어요", "쿳션 대표 어떤 분이에요", "이 로봇은 누가 이끌어요"] # about the visitor / Lumi: the LLM
|
||||
FOLLOW = [ # (first question, follow-up, expected place or None for "not a weather follow-up")
|
||||
("what's the weather today", "and tomorrow?", ""), ("what's the weather today", "what about Busan?", "Busan"),
|
||||
("what's the weather today", "and the weekend?", ""), ("what's the weather today", "what about the weekend?", ""),
|
||||
|
||||
Reference in New Issue
Block a user