playcat's picture
Upload app.py with huggingface_hub
eb3f915 verified
Raw History Blame Contribute Delete
26.6 kB
"""
Cat Enrichment Advisor - ๊ณ ์–‘์ด ํ™˜๊ฒฝ ํ’๋ถ€ํ™” ์–ด๋“œ๋ฐ”์ด์ €
A bilingual (Korean/English) Q&A tool for cat behavioral enrichment.
Built by PlayCat (https://playcat.xyz)
Data source: https://huggingface.co/datasets/playcat/playcat-cat-behavior-new-data-set
"""
import gradio as gr
# Pre-defined FAQ: research-backed answers about cat behavioral enrichment
FAQ_DATA = [
{
"q_ko": "๊ณ ์–‘์ด์—๊ฒŒ ํ™˜๊ฒฝ ํ’๋ถ€ํ™”๊ฐ€ ์™œ ์ค‘์š”ํ•œ๊ฐ€์š”?",
"q_en": "Why is environmental enrichment important for cats?",
"a_ko": "ํ™˜๊ฒฝ ํ’๋ถ€ํ™”๋Š” ๊ณ ์–‘์ด์˜ ์ž์—ฐ์  ๋ณธ๋Šฅ(์‚ฌ๋ƒฅ, ํƒ์ƒ‰, ์€์‹ , ๊ธ๊ธฐ ๋“ฑ)์„ ์‹ค๋‚ด์—์„œ๋„ ๋ฐœํ˜„ํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ด์ค๋‹ˆ๋‹ค. ์ด๋Š” ์ŠคํŠธ๋ ˆ์Šค ๊ฐ์†Œ, ๋น„๋งŒ ์˜ˆ๋ฐฉ, ๋ฌธ์ œ ํ–‰๋™(๋ถ€์ ์ ˆํ•œ ๋ฐฐ๋ณ€, ๊ณผ๋„ํ•œ ๊ทธ๋ฃจ๋ฐ, ๊ณต๊ฒฉ์„ฑ) ์˜ˆ๋ฐฉ์— ํ•ต์‹ฌ์  ์—ญํ• ์„ ํ•ฉ๋‹ˆ๋‹ค. ์—ฐ๊ตฌ์— ๋”ฐ๋ฅด๋ฉด ์ ์ ˆํ•œ ํ™˜๊ฒฝ ํ’๋ถ€ํ™”๋ฅผ ์ œ๊ณต๋ฐ›์€ ์‹ค๋‚ด ๊ณ ์–‘์ด๋Š” ์ฝ”๋ฅดํ‹ฐ์†”(์ŠคํŠธ๋ ˆ์Šค ํ˜ธ๋ฅด๋ชฌ) ์ˆ˜์น˜๊ฐ€ ์œ ์˜๋ฏธํ•˜๊ฒŒ ๋‚ฎ์•˜์Šต๋‹ˆ๋‹ค.",
"a_en": "Environmental enrichment allows cats to express their natural instincts (hunting, exploring, hiding, scratching) even indoors. It plays a key role in reducing stress, preventing obesity, and avoiding problem behaviors (inappropriate elimination, excessive grooming, aggression). Research shows indoor cats provided with adequate enrichment have significantly lower cortisol (stress hormone) levels.",
"category": "general"
},
{
"q_ko": "์บฃํƒ€์›Œ(์บฃํŠธ๋ฆฌ)๋Š” ์–ด๋–ค ํšจ๊ณผ๊ฐ€ ์žˆ๋‚˜์š”?",
"q_en": "What are the benefits of cat trees?",
"a_ko": "์บฃํƒ€์›Œ๋Š” ๊ณ ์–‘์ด์˜ ์ˆ˜์ง ๊ณต๊ฐ„ ์š•๊ตฌ๋ฅผ ์ถฉ์กฑ์‹œํ‚ต๋‹ˆ๋‹ค. ๊ณ ์–‘์ด๋Š” ๋†’์€ ๊ณณ์—์„œ ์ฃผ๋ณ€์„ ๊ด€์ฐฐํ•˜๋Š” ๊ฒƒ์œผ๋กœ ์•ˆ์ •๊ฐ์„ ๋А๋ผ๋ฉฐ, ์ด๋Š” ์•ผ์ƒ์—์„œ ํฌ์‹์ž๋ฅผ ๊ฐ์‹œํ•˜๋˜ ๋ณธ๋Šฅ์— ๊ธฐ๋ฐ˜ํ•ฉ๋‹ˆ๋‹ค. ๋‹ค๋ฌ˜ ๊ฐ€์ •์—์„œ๋Š” ์ˆ˜์ง ๊ณต๊ฐ„์ด ์˜์—ญ ๋ถ„์Ÿ์„ ์ค„์ด๋Š” ๋ฐ ํŠนํžˆ ํšจ๊ณผ์ ์ž…๋‹ˆ๋‹ค. ์ตœ์†Œ ๊ณ ์–‘์ด ์ˆ˜ +1๊ฐœ์˜ ๋†’์€ ์žฅ์†Œ๋ฅผ ์ œ๊ณตํ•˜๋Š” ๊ฒƒ์ด ๊ถŒ์žฅ๋ฉ๋‹ˆ๋‹ค.",
"a_en": "Cat trees fulfill cats' need for vertical space. Cats feel secure observing their surroundings from height, an instinct rooted in monitoring for predators in the wild. In multi-cat households, vertical space is particularly effective at reducing territorial disputes. Providing at least N+1 elevated spots (where N is the number of cats) is recommended.",
"category": "vertical_space"
},
{
"q_ko": "๊ณ ์–‘์ด ์Šคํฌ๋ž˜์ฒ˜๋Š” ์–ด๋–ค ๊ฒƒ์ด ์ข‹์€๊ฐ€์š”?",
"q_en": "What type of scratching post is best for cats?",
"a_ko": "์Šคํฌ๋ž˜์ฒ˜ ์„ ํƒ ์‹œ ๊ณ ๋ คํ•  ์š”์†Œ: 1) ์žฌ์งˆ - ์‚ฌ์ด์ž˜(sisal) ๋กœํ”„๊ฐ€ ๊ฐ€์žฅ ์„ ํ˜ธ๋จ, ๊ณจํŒ์ง€๋„ ์ธ๊ธฐ 2) ๋ฐฉํ–ฅ - ์ˆ˜์งํ˜•๊ณผ ์ˆ˜ํ‰ํ˜•์„ ๋ชจ๋‘ ์ œ๊ณต (๊ฐœ์ฒด๋งˆ๋‹ค ์„ ํ˜ธ๊ฐ€ ๋‹ค๋ฆ„) 3) ์•ˆ์ •์„ฑ - ํ”๋“ค๋ฆฌ์ง€ ์•Š์•„์•ผ ํ•จ 4) ๋†’์ด - ๊ณ ์–‘์ด๊ฐ€ ์™„์ „ํžˆ ๋ชธ์„ ํŽด๊ณ  ๊ธ์„ ์ˆ˜ ์žˆ์–ด์•ผ ํ•จ. ์Šคํฌ๋ž˜์นญ์€ ์˜์—ญ ํ‘œ์‹œ, ๋ฐœํ†ฑ ๊ด€๋ฆฌ, ์ŠคํŠธ๋ ˆ์นญ์˜ ๊ธฐ๋Šฅ์„ ๋™์‹œ์— ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค.",
"a_en": "Key factors for scratching posts: 1) Material - sisal rope is most preferred, corrugated cardboard is also popular 2) Orientation - provide both vertical and horizontal options (preferences vary by individual) 3) Stability - must not wobble 4) Height - cats should be able to fully stretch while scratching. Scratching simultaneously serves territorial marking, claw maintenance, and stretching functions.",
"category": "scratching"
},
{
"q_ko": "์ˆจ์„ ์ˆ˜ ์žˆ๋Š” ๊ณต๊ฐ„์ด ์™œ ํ•„์š”ํ•œ๊ฐ€์š”?",
"q_en": "Why do cats need hiding spaces?",
"a_ko": "์€์‹ ์ฒ˜๋Š” ๊ณ ์–‘์ด์˜ ์ŠคํŠธ๋ ˆ์Šค ๊ด€๋ฆฌ์— ํ•„์ˆ˜์ ์ž…๋‹ˆ๋‹ค. ์ƒˆ๋กœ์šด ํ™˜๊ฒฝ์— ์ ์‘ํ•˜๋Š” ๊ณ ์–‘์ด์—๊ฒŒ ์ˆจ์„ ์žฅ์†Œ๋ฅผ ์ œ๊ณตํ•˜๋ฉด ์ ์‘ ๊ธฐ๊ฐ„์ด ํฌ๊ฒŒ ๋‹จ์ถ•๋ฉ๋‹ˆ๋‹ค. ๋ณดํ˜ธ์†Œ ์—ฐ๊ตฌ์—์„œ ์€์‹  ์ƒ์ž๋ฅผ ์ œ๊ณต๋ฐ›์€ ๊ณ ์–‘์ด๋“ค์ด ๊ทธ๋ ‡์ง€ ์•Š์€ ๊ณ ์–‘์ด๋“ค๋ณด๋‹ค ์ŠคํŠธ๋ ˆ์Šค ์ˆ˜์ค€์ด ๋น ๋ฅด๊ฒŒ ๊ฐ์†Œํ–ˆ์Šต๋‹ˆ๋‹ค. ์ƒ์ž, ์บฃํ„ฐ๋„, ์บฃํ•˜์šฐ์Šค ๋“ฑ ๋‹ค์–‘ํ•œ ํ˜•ํƒœ๊ฐ€ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.",
"a_en": "Hiding spots are essential for cat stress management. Providing hiding places for cats adapting to new environments significantly shortens the adjustment period. Shelter studies showed cats given hiding boxes had faster stress reduction than those without. Boxes, cat tunnels, and cat houses are all suitable options.",
"category": "hiding"
},
{
"q_ko": "๊ณ ์–‘์ด์™€ ์–ด๋–ป๊ฒŒ ๋†€์•„์ฃผ๋Š” ๊ฒƒ์ด ์ข‹์€๊ฐ€์š”?",
"q_en": "What's the best way to play with cats?",
"a_ko": "๊ณ ์–‘์ด ๋†€์ด์˜ ํ•ต์‹ฌ์€ '์‚ฌ๋ƒฅ ์‹œ๋ฎฌ๋ ˆ์ด์…˜'์ž…๋‹ˆ๋‹ค. ๋‚š์‹ฏ๋Œ€ ์žฅ๋‚œ๊ฐ์œผ๋กœ ๋จน์ž‡๊ฐ์˜ ์›€์ง์ž„์„ ๋ชจ๋ฐฉํ•˜์„ธ์š”: ๋ถˆ๊ทœ์น™ํ•œ ์›€์ง์ž„, ์ˆจ๊ธฐ, ๋„๋ง์น˜๊ธฐ. ๋†€์ด ์„ธ์…˜์€ ํ•˜๋ฃจ 2-3ํšŒ, ๊ฐ 10-15๋ถ„์ด ์ด์ƒ์ ์ž…๋‹ˆ๋‹ค. ๋†€์ด ๋์—๋Š” '์žก๊ธฐ ์„ฑ๊ณต'์œผ๋กœ ๋งˆ๋ฌด๋ฆฌํ•˜๊ณ  ๊ฐ„์‹์„ ์ œ๊ณตํ•˜์—ฌ ์™„์ „ํ•œ ์‚ฌ๋ƒฅ ์‚ฌ์ดํด(ํƒ์ƒ‰โ†’์ถ”์ โ†’ํฌํšโ†’์„ญ์ทจ)์„ ์™„์„ฑ์‹œํ‚ค์„ธ์š”.",
"a_en": "The key to cat play is 'hunt simulation.' Use wand toys to mimic prey movement: irregular motion, hiding, fleeing. Ideal play sessions are 2-3 times daily, 10-15 minutes each. End each session with a successful 'catch' followed by a treat to complete the full hunting cycle (search โ†’ stalk โ†’ capture โ†’ consume).",
"category": "play"
},
{
"q_ko": "ํผ์ฆ ํ”ผ๋”(๊ธ‰์‹ ํผ์ฆ)์˜ ํšจ๊ณผ๋Š” ๋ฌด์—‡์ธ๊ฐ€์š”?",
"q_en": "What are the benefits of puzzle feeders?",
"a_ko": "ํผ์ฆ ํ”ผ๋”๋Š” ๊ณ ์–‘์ด์˜ ์Œ์‹ ํš๋“ ๊ณผ์ •์— ์ธ์ง€์  ์ž๊ทน์„ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค. ์•ผ์ƒ ๊ณ ์–‘์ด๋Š” ํ•˜๋ฃจ ์‚ฌ๋ƒฅ ์‹œ๊ฐ„์˜ ์•ฝ 80%๋ฅผ ํƒ์ƒ‰๊ณผ ์ถ”์ ์— ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ํผ์ฆ ํ”ผ๋”๋Š” ์ด ๋ณธ๋Šฅ์„ ์ถฉ์กฑ์‹œ์ผœ ๊ณผ์‹ ๋ฐฉ์ง€, ์ฒด์ค‘ ๊ด€๋ฆฌ, ์ง€๋ฃจํ•จ ํ•ด์†Œ์— ํšจ๊ณผ์ ์ž…๋‹ˆ๋‹ค. ๋‚œ์ด๋„๋ฅผ ์ ์ง„์ ์œผ๋กœ ๋†’์—ฌ๊ฐ€๋Š” ๊ฒƒ์ด ์ค‘์š”ํ•˜๋ฉฐ, ์ฒ˜์Œ์—๋Š” ์‰ฌ์šด ๊ฒƒ๋ถ€ํ„ฐ ์‹œ์ž‘ํ•˜์„ธ์š”.",
"a_en": "Puzzle feeders add cognitive stimulation to the food acquisition process. Wild cats spend about 80% of their hunting time on searching and stalking. Puzzle feeders fulfill this instinct, effectively preventing overeating, managing weight, and alleviating boredom. It's important to gradually increase difficulty, starting with easy puzzles first.",
"category": "feeding_puzzle"
},
{
"q_ko": "์ฐฝ๋ฌธ ๋ฐ–์„ ๋ณผ ์ˆ˜ ์žˆ๋Š” ํ™˜๊ฒฝ์€ ์ค‘์š”ํ•œ๊ฐ€์š”?",
"q_en": "Is window access important for indoor cats?",
"a_ko": "๋„ค, ๋งค์šฐ ์ค‘์š”ํ•ฉ๋‹ˆ๋‹ค. ์ฐฝ๋ฌธ์„ ํ†ตํ•œ ์™ธ๋ถ€ ๊ด€์ฐฐ์€ ์‹ค๋‚ด ๊ณ ์–‘์ด์—๊ฒŒ '๊ณ ์–‘์ด TV' ์—ญํ• ์„ ํ•ฉ๋‹ˆ๋‹ค. ์ƒˆ, ๋‹ค๋žŒ์ฅ, ์ง€๋‚˜๊ฐ€๋Š” ์‚ฌ๋žŒ ๋“ฑ์„ ๊ด€์ฐฐํ•˜๋ฉฐ ์‹œ๊ฐ์  ์ž๊ทน์„ ๋ฐ›์Šต๋‹ˆ๋‹ค. ์ฐฝ๋ฌธ ์„ ๋ฐ˜์ด๋‚˜ ํ•ด๋จน์„ ์„ค์น˜ํ•˜๋ฉด ๋”์šฑ ํšจ๊ณผ์ ์ž…๋‹ˆ๋‹ค. ๋‹จ, ์ผ๋ถ€ ๊ณ ์–‘์ด๋Š” ์™ธ๋ถ€ ๊ณ ์–‘์ด๋ฅผ ๋ณด๋ฉด ์ŠคํŠธ๋ ˆ์Šค๋ฅผ ๋ฐ›์„ ์ˆ˜ ์žˆ์œผ๋ฏ€๋กœ ๊ฐœ์ฒด๋ณ„ ๋ฐ˜์‘์„ ๊ด€์ฐฐํ•˜์„ธ์š”.",
"a_en": "Yes, very important. Window observation serves as 'cat TV' for indoor cats. They receive visual stimulation by watching birds, squirrels, and passersby. Installing window perches or hammocks enhances this. However, some cats may become stressed seeing outdoor cats, so monitor individual reactions.",
"category": "observation"
},
{
"q_ko": "์บฃ๋‹™(๊ฐœ๋ฐ•ํ•˜)์€ ์•ˆ์ „ํ•œ๊ฐ€์š”?",
"q_en": "Is catnip safe for cats?",
"a_ko": "๋„ค, ์บฃ๋‹™(๊ฐœ๋ฐ•ํ•˜, Nepeta cataria)์€ ๊ณ ์–‘์ด์—๊ฒŒ ์™„์ „ํžˆ ์•ˆ์ „ํ•ฉ๋‹ˆ๋‹ค. ์บฃ๋‹™์— ๋ฐ˜์‘ํ•˜๋Š” ์œ ์ „์ž๋Š” ์•ฝ 60-70%์˜ ๊ณ ์–‘์ด๊ฐ€ ๊ฐ€์ง€๊ณ  ์žˆ์œผ๋ฉฐ, ๋ฐ˜์‘์ด ์—†๋Š” ๊ณ ์–‘์ด๋„ ์žˆ์Šต๋‹ˆ๋‹ค. ํšจ๊ณผ๋Š” ๋ณดํ†ต 5-15๋ถ„ ์ง€์†๋˜๋ฉฐ ๋‚ด์„ฑ์ด ์ƒ๊ธฐ์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์žฅ๋‚œ๊ฐ, ์Šคํฌ๋ž˜์ฒ˜์— ๋ฟŒ๋ฆฌ๊ฑฐ๋‚˜ ์บฃ๋‹™ ์žฅ๋‚œ๊ฐ์„ ์ œ๊ณตํ•˜๋ฉด ์ข‹์€ ํ™˜๊ฒฝ ํ’๋ถ€ํ™”๊ฐ€ ๋ฉ๋‹ˆ๋‹ค. ์‹ค๋ฒ„๋ฐ”์ธ(๋งˆํƒ€ํƒ€๋น„)์€ ์บฃ๋‹™์— ๋ฐ˜์‘ํ•˜์ง€ ์•Š๋Š” ๊ณ ์–‘์ด์—๊ฒŒ๋„ ํšจ๊ณผ์ ์ธ ๋Œ€์•ˆ์ž…๋‹ˆ๋‹ค.",
"a_en": "Yes, catnip (Nepeta cataria) is completely safe for cats. About 60-70% of cats carry the gene that responds to catnip; some cats show no reaction. Effects typically last 5-15 minutes with no tolerance buildup. Sprinkling on toys or scratchers, or providing catnip toys, offers great enrichment. Silver vine (matatabi) is an effective alternative for cats unresponsive to catnip.",
"category": "play"
},
{
"q_ko": "๋‹ค๋ฌ˜ ๊ฐ€์ •์—์„œ ํ™˜๊ฒฝ ํ’๋ถ€ํ™” ์‹œ ์ฃผ์˜ํ•  ์ ์€?",
"q_en": "What enrichment considerations are important for multi-cat households?",
"a_ko": "๋‹ค๋ฌ˜ ๊ฐ€์ •์˜ ํ•ต์‹ฌ ์›์น™์€ '์ž์›์€ ๊ณ ์–‘์ด ์ˆ˜ +1' ์ž…๋‹ˆ๋‹ค. ํ™”์žฅ์‹ค, ๊ธ‰์ˆ˜๋Œ€, ๋ฐฅ๊ทธ๋ฆ‡, ๋†’์€ ์žฅ์†Œ ๋ชจ๋‘ ํ•ด๋‹น๋ฉ๋‹ˆ๋‹ค. ๊ฐ ๊ณ ์–‘์ด๊ฐ€ ๋‹ค๋ฅธ ๊ณ ์–‘์ด์™€ ๋งˆ์ฃผ์น˜์ง€ ์•Š๊ณ  ์ž์›์— ์ ‘๊ทผํ•  ์ˆ˜ ์žˆ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์ˆ˜์ง ๊ณต๊ฐ„์„ ์ถฉ๋ถ„ํžˆ ํ™•๋ณดํ•˜๊ณ , ์‹œ์•ผ๊ฐ€ ์ฐจ๋‹จ๋˜๋Š” ๊ตฌ์—ญ์„ ๋งŒ๋“ค์–ด '์‹œ๊ฐ„ ๊ณต์œ '(time-sharing)๊ฐ€ ๊ฐ€๋Šฅํ•˜๊ฒŒ ํ•˜์„ธ์š”. ๊ณ ์–‘์ด ๊ฐ„ ๊ด€๊ณ„๋ฅผ ๊ด€์ฐฐํ•˜์—ฌ ์ƒ์„ฑ์ด ๋งž์ง€ ์•Š๋Š” ๊ณ ์–‘์ด๋“ค์˜ ์ž์›์„ ๋ถ„๋ฆฌ ๋ฐฐ์น˜ํ•˜๋Š” ๊ฒƒ๋„ ์ค‘์š”ํ•ฉ๋‹ˆ๋‹ค.",
"a_en": "The key principle for multi-cat homes is 'resources = number of cats + 1.' This applies to litter boxes, water stations, food bowls, and elevated spots. Each cat should access resources without encountering others. Provide ample vertical space and create sight-blocked zones for 'time-sharing.' Observing relationships between cats and separating resources for incompatible pairs is also important.",
"category": "general"
},
{
"q_ko": "๊ณ ์–‘์ด ํ™”์žฅ์‹ค ํ™˜๊ฒฝ์€ ํ’๋ถ€ํ™”์™€ ๊ด€๋ จ์ด ์žˆ๋‚˜์š”?",
"q_en": "Is litter box setup related to environmental enrichment?",
"a_ko": "๋„ค, ํ™”์žฅ์‹ค ํ™˜๊ฒฝ์€ ๊ณ ์–‘์ด ๋ณต์ง€์˜ ๊ธฐ๋ณธ์ž…๋‹ˆ๋‹ค. ๊ถŒ์žฅ์‚ฌํ•ญ: 1) ๊ฐœ์ˆ˜ - ๊ณ ์–‘์ด ์ˆ˜ +1 2) ํฌ๊ธฐ - ๊ณ ์–‘์ด ๋ชธ๊ธธ์ด์˜ 1.5๋ฐฐ ์ด์ƒ 3) ์œ„์น˜ - ์กฐ์šฉํ•˜๊ณ  ํƒˆ์ถœ ๊ฒฝ๋กœ๊ฐ€ ์žˆ๋Š” ๊ณณ 4) ๋ชจ๋ž˜ ๊นŠ์ด - 5cm ์ด์ƒ 5) ์ฒญ์†Œ - ๋งค์ผ ํผ๋‚ด๊ธฐ, ์ฃผ 1ํšŒ ์ „์ฒด ๊ต์ฒด. ๋ถ€์ ์ ˆํ•œ ํ™”์žฅ์‹ค ํ™˜๊ฒฝ์€ ์ŠคํŠธ๋ ˆ์Šค์˜ ์ฃผ์š” ์›์ธ์ด๋ฉฐ ๋ฌธ์ œ ํ–‰๋™์œผ๋กœ ์ด์–ด์งˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.",
"a_en": "Yes, litter box setup is fundamental to cat welfare. Recommendations: 1) Number: cats + 1 2) Size: at least 1.5x the cat's body length 3) Location: quiet area with escape routes 4) Litter depth: 5cm+ 5) Cleaning: scoop daily, full change weekly. Poor litter box setup is a major stress source and can lead to behavioral problems.",
"category": "general"
},
{
"q_ko": "๊ณ ์–‘์ด ํ’€(์บฃ๊ทธ๋ผ์Šค)์€ ์–ด๋–ค ๋„์›€์ด ๋˜๋‚˜์š”?",
"q_en": "How does cat grass benefit cats?",
"a_ko": "์บฃ๊ทธ๋ผ์Šค(๋ณด๋ฆฌ์‹น, ๋ฐ€์‹น, ๊ท€๋ฆฌ์‹น ๋“ฑ)๋Š” ์‹ค๋‚ด ๊ณ ์–‘์ด์—๊ฒŒ ์•ˆ์ „ํ•œ ์‹๋ฌผ ๊ฒฝํ—˜์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์„ฌ์œ ์งˆ ์„ญ์ทจ๋ฅผ ํ†ตํ•œ ์†Œํ™” ์ด‰์ง„, ํ—ค์–ด๋ณผ ๋ฐฐ์ถœ ๋ณด์กฐ, ๊ทธ๋ฆฌ๊ณ  ํ’€์„ ์”น๋Š” ํ–‰๋™ ์ž์ฒด๊ฐ€ ํ™˜๊ฒฝ ํ’๋ถ€ํ™”๊ฐ€ ๋ฉ๋‹ˆ๋‹ค. ๋…์„ฑ์ด ์—†์–ด ์•ˆ์ „ํ•˜๋ฉฐ, ์‹ค๋‚ด์—์„œ ์‰ฝ๊ฒŒ ์žฌ๋ฐฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์œ ํ•ด์‹๋ฌผ์„ ๋Œ€์ฒดํ•˜๋Š” ์•ˆ์ „ํ•œ ๋Œ€์•ˆ์ด๊ธฐ๋„ ํ•ฉ๋‹ˆ๋‹ค.",
"a_en": "Cat grass (barley, wheat, oat sprouts) provides a safe plant experience for indoor cats. It aids digestion through fiber intake, helps with hairball expulsion, and the act of chewing grass itself serves as enrichment. It's non-toxic, easy to grow indoors, and serves as a safe alternative to potentially harmful houseplants.",
"category": "feeding_puzzle"
},
{
"q_ko": "๊ณ ์–‘์ด ํ›ˆ๋ จ(ํด๋ฆฌ์ปค ํŠธ๋ ˆ์ด๋‹)์€ ํ’๋ถ€ํ™”๊ฐ€ ๋˜๋‚˜์š”?",
"q_en": "Can clicker training serve as enrichment for cats?",
"a_ko": "ํด๋ฆฌ์ปค ํŠธ๋ ˆ์ด๋‹์€ ํ›Œ๋ฅญํ•œ ์ธ์ง€์  ํ’๋ถ€ํ™”์ž…๋‹ˆ๋‹ค. ๊ณ ์–‘์ด๋Š” ๊ฐœ๋งŒํผ์ด๋‚˜ ํ›ˆ๋ จ์ด ๊ฐ€๋Šฅํ•˜๋ฉฐ, '์•‰์•„', 'ํ•˜์ดํŒŒ์ด๋ธŒ', '๋Œ์•„' ๋“ฑ์˜ ํŠธ๋ฆญ์„ ๋ฐฐ์šธ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํ›ˆ๋ จ ๊ณผ์ • ์ž์ฒด๊ฐ€ ์ •์‹ ์  ์ž๊ทน์„ ์ œ๊ณตํ•˜๊ณ , ๋ณดํ˜ธ์ž์™€์˜ ์œ ๋Œ€๋ฅผ ๊ฐ•ํ™”ํ•ฉ๋‹ˆ๋‹ค. ํ•˜๋ฃจ 5๋ถ„ ์ด๋‚ด์˜ ์งง์€ ์„ธ์…˜์œผ๋กœ ์‹œ์ž‘ํ•˜๋ฉฐ, ์–‘์„ฑ ๊ฐ•ํ™”(๊ฐ„์‹, ์นญ์ฐฌ)๋งŒ ์‚ฌ์šฉํ•˜์„ธ์š”. ์ฒ˜๋ฒŒ์€ ์ ˆ๋Œ€ ์‚ฌ์šฉํ•˜์ง€ ๋งˆ์„ธ์š”.",
"a_en": "Clicker training is excellent cognitive enrichment. Cats are just as trainable as dogs and can learn tricks like 'sit,' 'high five,' and 'spin.' The training process itself provides mental stimulation and strengthens the bond with caregivers. Start with short sessions under 5 minutes daily, using only positive reinforcement (treats, praise). Never use punishment.",
"category": "play"
},
{
"q_ko": "๋…ธ๋ น ๊ณ ์–‘์ด๋ฅผ ์œ„ํ•œ ํ’๋ถ€ํ™”๋Š” ์–ด๋–ป๊ฒŒ ๋‹ค๋ฅธ๊ฐ€์š”?",
"q_en": "How should enrichment differ for senior cats?",
"a_ko": "๋…ธ๋ น ๊ณ ์–‘์ด(7์„ธ ์ด์ƒ)๋Š” ๊ด€์ ˆ ๊ฑด๊ฐ•์„ ๊ณ ๋ คํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค: 1) ์บฃํƒ€์›Œ ๊ณ„๋‹จ/๊ฒฝ์‚ฌ๋กœ ์ถ”๊ฐ€ 2) ๋‚ฎ์€ ํ™”์žฅ์‹ค ์ถœ์ž…๊ตฌ 3) ๋ถ€๋“œ๋Ÿฌ์šด ํ‘œ๋ฉด์˜ ํœด์‹ ์žฅ์†Œ 4) ์งง์ง€๋งŒ ๋นˆ๋ฒˆํ•œ ๋†€์ด ์„ธ์…˜ 5) ํ–ฅ๊ธฐ ํ’๋ถ€ํ™”(์บฃ๋‹™, ์‹ค๋ฒ„๋ฐ”์ธ)๋กœ ์ €๊ฐ•๋„ ์ž๊ทน ์ œ๊ณต. ์ธ์ง€ ๊ธฐ๋Šฅ ์ €ํ•˜๋ฅผ ๋Šฆ์ถ”๊ธฐ ์œ„ํ•ด ํผ์ฆ ํ”ผ๋”๋ฅผ ์‰ฌ์šด ๋‚œ์ด๋„๋กœ ์ง€์† ์ œ๊ณตํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค.",
"a_en": "Senior cats (7+ years) need joint-friendly adjustments: 1) Add stairs/ramps to cat trees 2) Low-entry litter boxes 3) Soft resting surfaces 4) Short but frequent play sessions 5) Scent enrichment (catnip, silver vine) for low-intensity stimulation. Continue providing puzzle feeders at easy difficulty to help slow cognitive decline.",
"category": "general"
},
{
"q_ko": "์‹ค๋‚ด ๊ณ ์–‘์ด์˜ ์ŠคํŠธ๋ ˆ์Šค ์ง•ํ›„๋Š” ๋ฌด์—‡์ธ๊ฐ€์š”?",
"q_en": "What are signs of stress in indoor cats?",
"a_ko": "ํ’๋ถ€ํ™” ๋ถ€์กฑ์œผ๋กœ ์ธํ•œ ์ŠคํŠธ๋ ˆ์Šค ์ง•ํ›„: 1) ๊ณผ๋„ํ•œ ๊ทธ๋ฃจ๋ฐ(ํƒˆ๋ชจ ๋ฐœ์ƒ) 2) ๋ถ€์ ์ ˆํ•œ ์žฅ์†Œ์—์„œ์˜ ๋ฐฐ๋ณ€ 3) ์‹์š• ๋ณ€ํ™”(๊ณผ์‹ ๋˜๋Š” ๊ฑฐ์‹) 4) ๊ณผ๋„ํ•œ ๋ฐœ์„ฑ 5) ๊ณต๊ฒฉ์„ฑ ์ฆ๊ฐ€ 6) ์€๋‘” ํ–‰๋™ 7) ๊ณผ๋„ํ•œ ์ˆ˜๋ฉด 8) ๋ฐ˜๋ณต์  ํ–‰๋™(pacing). ์ด๋Ÿฌํ•œ ์ง•ํ›„๊ฐ€ ๋ณด์ด๋ฉด ํ™˜๊ฒฝ ํ’๋ถ€ํ™”๋ฅผ ์ ๊ฒ€ํ•˜๊ณ  ์ˆ˜์˜์‚ฌ ์ƒ๋‹ด์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.",
"a_en": "Stress signs from inadequate enrichment: 1) Excessive grooming (causing hair loss) 2) Inappropriate elimination 3) Appetite changes (overeating or anorexia) 4) Excessive vocalization 5) Increased aggression 6) Withdrawal 7) Excessive sleeping 8) Repetitive behavior (pacing). If these signs appear, review environmental enrichment and consult a veterinarian.",
"category": "general"
},
{
"q_ko": "๊ณ ์–‘์ด์—๊ฒŒ ์•ˆ์ „ํ•œ DIY ์žฅ๋‚œ๊ฐ์€ ๋ฌด์—‡์ด ์žˆ๋‚˜์š”?",
"q_en": "What safe DIY toys can I make for my cat?",
"a_ko": "์•ˆ์ „ํ•œ DIY ์žฅ๋‚œ๊ฐ: 1) ์ข…์ด ๋ด‰ํˆฌ(์†์žก์ด ์ œ๊ฑฐ) - ๋ฐ”์Šค๋ฝ ์†Œ๋ฆฌ ํƒ์ƒ‰ 2) ๊ณจํŒ์ง€ ์ƒ์ž ๋ฏธ๋กœ - ์ƒ์ž ์—ฐ๊ฒฐํ•˜์—ฌ ํ„ฐ๋„ ์ œ์ž‘ 3) ์–‘๋ง + ์บฃ๋‹™ - ๊ฐ„๋‹จํ•œ ํ‚ฅ์ปค ํ† ์ด 4) ํ™”์žฅ์ง€ ์‹ฌ + ๊ฐ„์‹ - ๊ฐ„๋‹จํ•œ ํผ์ฆ ํ”ผ๋” 5) ๊นƒํ„ธ + ๋ง‰๋Œ€ - ๋‚š์‹ฏ๋Œ€ ์žฅ๋‚œ๊ฐ. ์ฃผ์˜: ์‹ค, ๊ณ ๋ฌด์ค„, ์ž‘์€ ๋ถ€ํ’ˆ์€ ์‚ผํ‚ด ์œ„ํ—˜์ด ์žˆ์œผ๋ฏ€๋กœ ํ”ผํ•˜์„ธ์š”. ํ•ญ์ƒ ๊ฐ๋… ํ•˜์— ์‚ฌ์šฉํ•˜์„ธ์š”.",
"a_en": "Safe DIY toys: 1) Paper bags (handles removed) - crinkle exploration 2) Cardboard box maze - connect boxes for tunnels 3) Sock + catnip - simple kicker toy 4) Toilet paper roll + treats - simple puzzle feeder 5) Feather + stick - wand toy. Caution: avoid string, rubber bands, and small parts (choking hazard). Always supervise play.",
"category": "play"
},
{
"q_ko": "๊ณ ์–‘์ด์—๊ฒŒ ์Œ์•…์ด๋‚˜ ์†Œ๋ฆฌ ์ž๊ทน์€ ํšจ๊ณผ๊ฐ€ ์žˆ๋‚˜์š”?",
"q_en": "Does auditory stimulation (music/sounds) benefit cats?",
"a_ko": "์—ฐ๊ตฌ์— ๋”ฐ๋ฅด๋ฉด ๊ณ ์–‘์ด ์ „์šฉ์œผ๋กœ ์ž‘๊ณก๋œ ์Œ์•…(๊ณ ์–‘์ด์˜ ๋ฐœ์„ฑ ์ฃผํŒŒ์ˆ˜์™€ ํ…œํฌ์— ๋งž์ถ˜)์€ ๊ณ ์–‘์ด์˜ ์ด์™„์„ ์ด‰์ง„ํ•ฉ๋‹ˆ๋‹ค. ์ƒˆ ์†Œ๋ฆฌ, ์ž์—ฐ ์†Œ๋ฆฌ๋„ ์ผ๋ถ€ ๊ณ ์–‘์ด์—๊ฒŒ ํฅ๋ฏธ๋ฅผ ์œ ๋ฐœํ•ฉ๋‹ˆ๋‹ค. ์ผ๋ฐ˜ ์Œ์•…์€ ํฐ ์˜ํ–ฅ์ด ์—†์ง€๋งŒ, ํฐ ์†Œ๋ฆฌ๋‚˜ ๊ฐ‘์ž‘์Šค๋Ÿฌ์šด ์†Œ๋ฆฌ๋Š” ์ŠคํŠธ๋ ˆ์Šค๋ฅผ ์ค„ ์ˆ˜ ์žˆ์œผ๋ฏ€๋กœ ์ฃผ์˜ํ•˜์„ธ์š”. ๊ณ ์–‘์ด ์ „์šฉ ์Œ์•… ์•ฑ์ด๋‚˜ ์œ ํŠœ๋ธŒ ์ฑ„๋„์„ ํ™œ์šฉํ•ด๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.",
"a_en": "Research shows music specifically composed for cats (matched to feline vocal frequency ranges and tempo) promotes relaxation. Bird sounds and nature sounds also interest some cats. Regular music has minimal impact, but loud or sudden sounds can cause stress. Consider cat-specific music apps or YouTube channels.",
"category": "observation"
},
{
"q_ko": "๊ณ ์–‘์ด ๋ฒฝ ์„ ๋ฐ˜(์บฃ์›Œํฌ)์€ ์–ด๋–ป๊ฒŒ ์„ค์น˜ํ•˜๋‚˜์š”?",
"q_en": "How should I set up cat wall shelves (catwalks)?",
"a_ko": "์บฃ์›Œํฌ ์„ค์น˜ ์›์น™: 1) ๊ฐ„๊ฒฉ - ์„ ๋ฐ˜ ๊ฐ„ 30-45cm (์ˆ˜์ง), ์ˆ˜ํ‰ ๊ฐ„๊ฒฉ 45-60cm 2) ๋„ˆ๋น„ - ์ตœ์†Œ 25cm (๊ณ ์–‘์ด๊ฐ€ ํŽธํ•˜๊ฒŒ ์•‰์„ ์ˆ˜ ์žˆ๋Š” ํญ) 3) ํ•˜์ค‘ - ๊ณ ์–‘์ด ์ฒด์ค‘์˜ 3๋ฐฐ ์ด์ƒ ์ง€์ง€ 4) ๋™์„  - ์ˆœํ™˜ํ˜• ์ฝ”์Šค ์ œ๊ณต(๋ง‰๋‹ค๋ฅธ ๊ธธ ์ตœ์†Œํ™”) 5) ๋ฏธ๋„๋Ÿผ ๋ฐฉ์ง€ - ์นดํŽซ์ด๋‚˜ ์ฝ”๋ฅดํฌ ๋ถ€์ฐฉ. ๋ฒฝ๋ฉด์„ ํ™œ์šฉํ•œ ์ˆ˜์ง ๊ณต๊ฐ„์€ ๋ฐ”๋‹ฅ ๋ฉด์ ์„ ์ฐจ์ง€ํ•˜์ง€ ์•Š์œผ๋ฉด์„œ ๊ณ ์–‘์ด์˜ ์˜์—ญ์„ ํฌ๊ฒŒ ํ™•์žฅํ•ฉ๋‹ˆ๋‹ค.",
"a_en": "Catwalk installation principles: 1) Spacing: 30-45cm vertical, 45-60cm horizontal between shelves 2) Width: minimum 25cm 3) Weight capacity: support 3x the cat's weight 4) Route: provide circular paths (minimize dead ends) 5) Anti-slip: attach carpet or cork. Wall-mounted vertical spaces significantly expand territory without taking floor space.",
"category": "vertical_space"
},
{
"q_ko": "๊ณ ์–‘์ด์™€ ํ•จ๊ป˜ํ•˜๋Š” ์‚ฐ์ฑ…(ํ•˜๋„ค์Šค ํ›ˆ๋ จ)์€ ํ’๋ถ€ํ™”๊ฐ€ ๋˜๋‚˜์š”?",
"q_en": "Can harness walking serve as enrichment for cats?",
"a_ko": "ํ•˜๋„ค์Šค ์‚ฐ์ฑ…์€ ์‹ค๋‚ด ๊ณ ์–‘์ด์—๊ฒŒ ํ›Œ๋ฅญํ•œ ํ’๋ถ€ํ™”๊ฐ€ ๋  ์ˆ˜ ์žˆ์ง€๋งŒ, ๋ชจ๋“  ๊ณ ์–‘์ด์—๊ฒŒ ์ ํ•ฉํ•˜์ง€๋Š” ์•Š์Šต๋‹ˆ๋‹ค. ์žฅ์ : ์ƒˆ๋กœ์šด ๋ƒ„์ƒˆ, ์†Œ๋ฆฌ, ์‹œ๊ฐ ์ž๊ทน. ์„ฑ๊ณต ํŒ: 1) ์–ด๋ฆด ๋•Œ๋ถ€ํ„ฐ ์ ์ง„์ ์œผ๋กœ ์‹œ์ž‘ 2) ์ง‘ ์•ˆ์—์„œ ํ•˜๋„ค์Šค ์ ์‘ ๋จผ์ € 3) ์กฐ์šฉํ•œ ํ™˜๊ฒฝ๋ถ€ํ„ฐ ์‹œ์ž‘ 4) ๊ณ ์–‘์ด๊ฐ€ ์ฃผ๋„ํ•˜๊ฒŒ ํ•˜๊ธฐ 5) ํƒˆ์ถœ ๋ฐฉ์ง€ ํ•˜๋„ค์Šค(Hํ˜•) ์‚ฌ์šฉ. ๋‘๋ ค์›Œํ•˜๋Š” ๊ณ ์–‘์ด์—๊ฒŒ ๊ฐ•์š”ํ•˜์ง€ ๋งˆ์„ธ์š”.",
"a_en": "Harness walking can be excellent enrichment for indoor cats, but isn't suitable for all. Benefits: new smells, sounds, visual stimulation. Tips: 1) Start gradually from a young age 2) First adapt to the harness indoors 3) Begin in quiet environments 4) Let the cat lead 5) Use escape-proof (H-type) harnesses. Never force a fearful cat.",
"category": "play"
},
{
"q_ko": "๊ณ„์ ˆ๋ณ„๋กœ ํ™˜๊ฒฝ ํ’๋ถ€ํ™”๋ฅผ ๋ฐ”๊ฟ”์ค˜์•ผ ํ•˜๋‚˜์š”?",
"q_en": "Should enrichment change with the seasons?",
"a_ko": "๊ณ„์ ˆ์— ๋”ฐ๋ฅธ ํ’๋ถ€ํ™” ์กฐ์ •์ด ๋„์›€์ด ๋ฉ๋‹ˆ๋‹ค: ๋ด„/์—ฌ๋ฆ„ - ์ฐฝ๋ฌธ ์—ด๊ธฐ(๋ฐฉ์ถฉ๋ง ํ•„์ˆ˜), ์บฃ๊ทธ๋ผ์Šค ์žฌ๋ฐฐ, ํ–‡๋ณ• ์ฌ๊ธฐ ๊ณต๊ฐ„ ํ™•๋ณด. ๊ฐ€์„/๊ฒจ์šธ - ๋”ฐ๋œปํ•œ ์€์‹ ์ฒ˜ ์ œ๊ณต, ์˜จ์—ด ํŒจ๋“œ, ์‹ค๋‚ด ๋†€์ด ์‹œ๊ฐ„ ์ฆ๊ฐ€. ์žฅ๋‚œ๊ฐ๋„ ์ •๊ธฐ์ ์œผ๋กœ ๊ต์ฒด(๋กœํ…Œ์ด์…˜)ํ•˜๋ฉด ์ƒˆ๋กœ์›€์„ ์œ ์ง€ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. 2-3์ฃผ๋งˆ๋‹ค ์žฅ๋‚œ๊ฐ ์„ธํŠธ๋ฅผ ๋ฐ”๊ฟ”์ฃผ๋ฉด ํšจ๊ณผ์ ์ž…๋‹ˆ๋‹ค.",
"a_en": "Seasonal enrichment adjustments help: Spring/Summer - open windows (screen required), grow cat grass, provide sunbathing spots. Fall/Winter - warm hiding spots, heating pads, increase indoor play time. Rotating toys regularly maintains novelty. Swapping toy sets every 2-3 weeks is effective.",
"category": "general"
},
{
"q_ko": "PlayCat์˜ ๊ณ ์–‘์ด ํ–‰๋™ ๋ฐ์ดํ„ฐ์…‹์€ ์–ด๋–ป๊ฒŒ ํ™œ์šฉํ•  ์ˆ˜ ์žˆ๋‚˜์š”?",
"q_en": "How can I use PlayCat's cat behavior dataset?",
"a_ko": "PlayCat์˜ ๊ณ ์–‘์ด ํ–‰๋™ ๋ฐ์ดํ„ฐ์…‹(12,262๊ฐœ ๋ ˆ์ฝ”๋“œ)์€ HuggingFace์—์„œ ๋ฌด๋ฃŒ๋กœ ์ ‘๊ทผ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค. ์ด ๋ฐ์ดํ„ฐ์…‹์€ ๊ณ ์–‘์ด ํ–‰๋™ ๋ถ„์„, ํ™˜๊ฒฝ ํ’๋ถ€ํ™” ์—ฐ๊ตฌ, ๋ฐ˜๋ ค๋™๋ฌผ ์ผ€์–ด AI ๋ชจ๋ธ ํ•™์Šต ๋“ฑ์— ํ™œ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋ฐ์ดํ„ฐ์…‹: https://huggingface.co/datasets/playcat/playcat-cat-behavior-new-data-set ๋” ๋งŽ์€ ๊ณ ์–‘์ด ์ผ€์–ด ์ •๋ณด๋Š” PlayCat ์›น์‚ฌ์ดํŠธ(https://playcat.xyz)์—์„œ ํ™•์ธํ•˜์„ธ์š”.",
"a_en": "PlayCat's cat behavior dataset (12,262 records) is freely accessible on HuggingFace. It can be used for cat behavior analysis, environmental enrichment research, and pet care AI model training. Dataset: https://huggingface.co/datasets/playcat/playcat-cat-behavior-new-data-set Visit PlayCat (https://playcat.xyz) for more cat care information.",
"category": "general"
},
]
def search_faq(query, language):
"""Search FAQ entries and return relevant answers."""
if not query.strip():
if language == "ํ•œ๊ตญ์–ด (Korean)":
return "์งˆ๋ฌธ์„ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”! ๊ณ ์–‘์ด ํ™˜๊ฒฝ ํ’๋ถ€ํ™”์— ๋Œ€ํ•ด ๋ฌด์—‡์ด๋“  ๋ฌผ์–ด๋ณด์„ธ์š”."
else:
return "Please enter a question! Ask anything about cat environmental enrichment."
query_lower = query.lower()
is_korean = language == "ํ•œ๊ตญ์–ด (Korean)"
# Score each FAQ entry by keyword matching
scored = []
for faq in FAQ_DATA:
q_field = faq["q_ko"] if is_korean else faq["q_en"]
a_field = faq["a_ko"] if is_korean else faq["a_en"]
combined = (q_field + " " + a_field).lower()
# Simple keyword matching
words = query_lower.split()
score = sum(1 for w in words if w in combined)
# Boost for exact phrase match
if query_lower in combined:
score += 5
if score > 0:
scored.append((score, q_field, a_field))
scored.sort(key=lambda x: -x[0])
if not scored:
if is_korean:
return ("๊ด€๋ จ ๋‹ต๋ณ€์„ ์ฐพ์ง€ ๋ชปํ–ˆ์Šต๋‹ˆ๋‹ค. ๋‹ค๋ฅธ ํ‚ค์›Œ๋“œ๋กœ ๊ฒ€์ƒ‰ํ•ด๋ณด์„ธ์š”.\n\n"
"๊ฒ€์ƒ‰ ๊ฐ€๋Šฅํ•œ ์ฃผ์ œ: ์บฃํƒ€์›Œ, ์Šคํฌ๋ž˜์ฒ˜, ์ˆจ๊ธฐ, ๋†€์ด, ํผ์ฆ ํ”ผ๋”, "
"์ฐฝ๋ฌธ, ์บฃ๋‹™, ๋‹ค๋ฌ˜, ํ™”์žฅ์‹ค, ๋…ธ๋ น ๊ณ ์–‘์ด, ์ŠคํŠธ๋ ˆ์Šค, DIY, ์Œ์•…, "
"์บฃ์›Œํฌ, ํ•˜๋„ค์Šค, ๊ณ„์ ˆ, ํด๋ฆฌ์ปค ํ›ˆ๋ จ, ์บฃ๊ทธ๋ผ์Šค ๋“ฑ\n\n"
"๋” ๋งŽ์€ ์ •๋ณด: https://playcat.xyz")
else:
return ("No matching answer found. Try different keywords.\n\n"
"Searchable topics: cat tree, scratching, hiding, play, puzzle feeder, "
"window, catnip, multi-cat, litter box, senior cats, stress, DIY, music, "
"catwalk, harness, seasonal, clicker training, cat grass, etc.\n\n"
"More info: https://playcat.xyz")
# Return top 3 results
results = []
for i, (score, q, a) in enumerate(scored[:3]):
prefix = f"**Q{i+1}: {q}**\n\n" if len(scored) > 1 else f"**{q}**\n\n"
results.append(prefix + a)
separator = "\n\n---\n\n"
response = separator.join(results)
if is_korean:
response += ("\n\n---\n*PlayCat ๊ณ ์–‘์ด ํ–‰๋™ ๋ฐ์ดํ„ฐ์…‹ ๊ธฐ๋ฐ˜ | "
"[์›น์‚ฌ์ดํŠธ](https://playcat.xyz) | "
"[๋ฐ์ดํ„ฐ์…‹](https://huggingface.co/datasets/playcat/playcat-cat-behavior-new-data-set)*")
else:
response += ("\n\n---\n*Based on PlayCat Cat Behavior Dataset | "
"[Website](https://playcat.xyz) | "
"[Dataset](https://huggingface.co/datasets/playcat/playcat-cat-behavior-new-data-set)*")
return response
def list_all_topics(language):
"""List all available topics."""
is_korean = language == "ํ•œ๊ตญ์–ด (Korean)"
topics = []
for i, faq in enumerate(FAQ_DATA, 1):
q = faq["q_ko"] if is_korean else faq["q_en"]
topics.append(f"{i}. {q}")
header = "## ์ „์ฒด ์งˆ๋ฌธ ๋ชฉ๋ก\n\n" if is_korean else "## All Available Questions\n\n"
return header + "\n".join(topics)
# Build the Gradio interface
with gr.Blocks(
title="Cat Enrichment Advisor | ๊ณ ์–‘์ด ํ™˜๊ฒฝ ํ’๋ถ€ํ™” ์–ด๋“œ๋ฐ”์ด์ €",
theme=gr.themes.Soft(primary_hue="orange", secondary_hue="yellow"),
) as demo:
gr.Markdown("""
# ๐Ÿฑ Cat Enrichment Advisor | ๊ณ ์–‘์ด ํ™˜๊ฒฝ ํ’๋ถ€ํ™” ์–ด๋“œ๋ฐ”์ด์ €
Research-backed answers about cat environmental enrichment.
๊ณ ์–‘์ด ํ™˜๊ฒฝ ํ’๋ถ€ํ™”์— ๋Œ€ํ•œ ์—ฐ๊ตฌ ๊ธฐ๋ฐ˜ ๋‹ต๋ณ€์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.
**By [PlayCat](https://playcat.xyz)** | Data: [Cat Behavior Dataset (12,262 records)](https://huggingface.co/datasets/playcat/playcat-cat-behavior-new-data-set)
""")
with gr.Row():
with gr.Column(scale=3):
language = gr.Radio(
choices=["ํ•œ๊ตญ์–ด (Korean)", "English"],
value="ํ•œ๊ตญ์–ด (Korean)",
label="Language / ์–ธ์–ด",
)
query = gr.Textbox(
label="Ask about cat enrichment / ๊ณ ์–‘์ด ํ’๋ถ€ํ™”์— ๋Œ€ํ•ด ์งˆ๋ฌธํ•˜์„ธ์š”",
placeholder="์˜ˆ: ์บฃํƒ€์›Œ, ํผ์ฆ ํ”ผ๋”, ๋†€์ด ๋ฐฉ๋ฒ•... / e.g., cat tree, puzzle feeder, play...",
lines=2,
)
with gr.Row():
search_btn = gr.Button("๐Ÿ” Search / ๊ฒ€์ƒ‰", variant="primary")
topics_btn = gr.Button("๐Ÿ“‹ All Topics / ์ „์ฒด ๋ชฉ๋ก")
with gr.Column(scale=4):
output = gr.Markdown(
label="Answer / ๋‹ต๋ณ€",
value="์งˆ๋ฌธ์„ ์ž…๋ ฅํ•˜๊ณ  ๊ฒ€์ƒ‰ ๋ฒ„ํŠผ์„ ๋ˆŒ๋Ÿฌ์ฃผ์„ธ์š”!\nEnter a question and click Search!",
)
# Example queries
gr.Examples(
examples=[
["์บฃํƒ€์›Œ๋Š” ์–ด๋–ค ํšจ๊ณผ๊ฐ€ ์žˆ๋‚˜์š”?", "ํ•œ๊ตญ์–ด (Korean)"],
["๊ณ ์–‘์ด์™€ ์–ด๋–ป๊ฒŒ ๋†€์•„์ฃผ๋‚˜์š”?", "ํ•œ๊ตญ์–ด (Korean)"],
["ํผ์ฆ ํ”ผ๋”", "ํ•œ๊ตญ์–ด (Korean)"],
["What type of scratching post is best?", "English"],
["How to play with cats?", "English"],
["senior cat enrichment", "English"],
],
inputs=[query, language],
)
search_btn.click(fn=search_faq, inputs=[query, language], outputs=output)
query.submit(fn=search_faq, inputs=[query, language], outputs=output)
topics_btn.click(fn=list_all_topics, inputs=[language], outputs=output)
gr.Markdown("""
---
### About PlayCat
PlayCat is dedicated to improving feline welfare through data-driven insights and environmental enrichment research.
- ๐ŸŒ Website: [playcat.xyz](https://playcat.xyz)
- ๐Ÿ“Š Dataset: [Cat Behavior Dataset](https://huggingface.co/datasets/playcat/playcat-cat-behavior-new-data-set)
- ๐Ÿ”ฌ Enrichment Methods: [Cat Enrichment Methods](https://huggingface.co/datasets/playcat/cat-enrichment-methods)
- ๐Ÿ’ป GitHub: [playcatkorea](https://github.com/playcatkorea/cat-behavior-enrichment)
*This tool provides general educational information. Always consult a veterinarian for specific health concerns.*
""")
if __name__ == "__main__":
demo.launch()