Skip to content

Latest commit

ย 

History

History
378 lines (283 loc) ยท 19.2 KB

README.md

File metadata and controls

378 lines (283 loc) ยท 19.2 KB

๋ชฉ์ 

ํ…์ŠคํŠธ๋กœ๋ถ€ํ„ฐ slot ํ˜•ํƒœ์˜ ์ž„์˜์˜ ์ •๋ณด๋ฅผ ์ถ”์ถœํ•˜๋Š” ๊ทœ์น™ ๊ธฐ๋ฐ˜ ๋„๊ตฌ๋กœ์„œ, ์•„๋ž˜์˜ ๋ชฉ์ ์— ํ™œ์šฉ ๊ฐ€๋Šฅํ•˜๋‹ค. ํ•œ๊ตญ์–ด๋ฅผ ๊ฒจ๋ƒฅํ•ด์„œ ์„ค๊ณ„๋˜์—ˆ์œผ๋‚˜, ๋ณธ ํ”„๋กœ์ ํŠธ์˜ ๊ทผ๊ฐ„์ด ๋˜๋Š” ๊ทœ์น™ ํŒŒ์ผ์€ ์–ธ์–ด์™€ ๋…๋ฆฝ์ ์ด๋ฏ€๋กœ, ์„ธ๊ณ„ ์–ด๋–ค ์–ธ์–ด์ด๋“ ๊ฐ„์— ๊ตฌ๋ถ„์—†์ด ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•˜๋‹ค.

  • ์งˆ์˜์‘๋‹ต ์‹œ์Šคํ…œ
  • ๋Œ€ํ™”์‹œ์Šคํ…œ (์ฑ—๋ด‡)
  • ํ…์ŠคํŠธ ์ „์ฒ˜๋ฆฌ ๋ฐ ์Šฌ๋กฏ(slot) ์ถ”์ถœ
  • ์‚ฌ์ „ ๊ธฐ๋ฐ˜์˜ ๋Œ€์šฉ๋Ÿ‰ NER ์ถ”์ถœ

์„ค์น˜ ๋ฐฉ๋ฒ•

๋ณธ ํ”„๋กœ์ ํŠธ๋ฅผ ํด๋ก ๋ฐ›๊ณ  ํ™˜๊ฒฝ๋ณ€์ˆ˜ ์„ค์ •

(์˜ˆ์‹œ) ๋งŒ์•ฝ bash ์‚ฌ์šฉ ์ค‘์ด๋ผ๋ฉด, ~/.bashrc ํŒŒ์ผ์— ๋Œ€ํ•˜์—ฌ ์•„๋ž˜์™€ ๊ฐ™์ด ํ™˜๊ฒฝ์„ค์ • 

~$ cat >> ~/.bashrc
PYTHON_PATH=$PYTHON_PATH:/home/your_id/
(์ปจํŠธ๋กคํ‚ค ๋ˆ„๋ฅธ์ฑ„๋กœ d ๋ˆŒ๋Ÿฌ์„œ ํŽธ์ง‘ ์ข…๋ฃŒํ•˜๊ธฐ)
~$ source ~/.bashrc
~$ 

์˜์กด์„ฑ (dependency)

  • python 3.x

ํ…Œ์ŠคํŠธ ์‹คํ–‰ ๋ฐฉ๋ฒ•

์•„๋ž˜์™€ ๊ฐ™์ด ์‰˜์ฐฝ์—์„œ ํ…Œ์ŠคํŠธ๋ฅผ ์‹คํ–‰ ๊ฐ€๋Šฅํ•˜๋‹ค. ์‚ฌ์šฉ์ž๊ฐ€ ์ง์ ‘ ๊ทœ์น™ ํŒŒ์ผ์„ ์ž‘์„ฑํ•œ ํ›„, test.py ๋‚ด์šฉ์„ ์ฐธ๊ณ ํ•˜์—ฌ ๋‹ค๋ฅธ ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋˜๋Š” ์„œ๋น„์Šค์— ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค. ํ…์ŠคํŠธ์— ๋Œ€ํ•˜์—ฌ ๊ทœ์น™์„ ์ฒดํฌํ•  ๋•Œ, Tree(ํŠธ๋ฆฌ) ๊ธฐ๋ฐ˜์œผ๋กœ recursive call์œผ๋กœ์จ ๊ทœ์น™์„ ์ฒดํฌํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๋„ˆ๋ฌด ๊ธด ํ…์ŠคํŠธ์— ๋Œ€ํ•ด์„œ๋Š” '์ฝœ์Šคํƒ ์˜ค๋ฒ„ํ”Œ๋กœ์šฐ' ๋“ฑ์˜ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ์œผ๋ฏ€๋กœ ์œ ์˜ํ•ด์•ผ ํ•œ๋‹ค. ๋”ฐ๋ผ์„œ, test.py ๋‚ด์šฉ์„ ์ฐธ๊ณ ํ•˜์—ฌ ๋„ˆ๋ฌด ๊ธด ํ…์ŠคํŠธ๋Š” ์ ๋‹นํ•œ ๊ธธ์ด(์˜ˆ: 100~500๊ธ€์ž ์‚ฌ์ด)๋กœ ์ž˜๋ผ์„œ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์„ ๊ถŒ์žฅํ•œ๋‹ค. ๋˜ํ•œ, ์˜์–ด ์•ŒํŒŒ๋ฒณ ํ…์ŠคํŠธ์— ์ ์šฉํ•  ๊ฒฝ์šฐ์—๋Š” ์†Œ๋ฌธ์žํ™”ํ•˜์—ฌ ๊ทœ์น™์„ ์ฒดํฌํ•˜๋„๋ก ํ•œ๋‹ค.

(1) ๊ทœ์น™ ๊ธฐ๋ฐ˜์˜ slot ์ •๊ทœํ™” ๊ธฐ๋Šฅ ํ…Œ์ŠคํŠธ

~/slotminer$ python3 test.py

(2) ์‚ฌ์ „ ๊ธฐ๋ฐ˜์˜ NER ์ถ”์ถœ ๊ธฐ๋Šฅ ํ…Œ์ŠคํŠธ

~/slotminer$ python3 test_trie.py

๊ธฐ๋Šฅ

๊ธฐ๋ณธ์ ์œผ๋กœ๋Š” ๋‹ค์–‘ํ•œ ํ˜•ํƒœ์˜ slot์„ ์ถ”์ถœํ•˜๋„๋ก ์„ค๊ณ„๋˜์—ˆ์œผ๋ฉฐ, slot์€ ์ˆ˜์น˜ํ‘œํ˜„(์˜ˆ: ๊ฐœ์ˆ˜, ์ˆ˜์น˜, ๋‚ ์งœ, ์‹œ๊ฐ„ ๋“ฑ)๊ณผ Named entity (NE)๋ฅผ ํฌํ•จํ•˜๋Š” ๊ฐœ๋…์ด๋ผ๊ณ  ์ •์˜ํ•œ๋‹ค. ๋ณธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์‚ฌ์šฉํ•  ๋•Œ ํฌ๊ฒŒ 2๊ฐ€์ง€ ๋ฐฉ์‹์„ ํ†ตํ•ด slot ์ถ”์ถœ ๊ธฐ๋Šฅ์„ ๊ตฌํ˜„ํ•  ์ˆ˜ ์žˆ๋‹ค. ์ฒซ ๋ฒˆ์งธ ๋ฐฉ์‹์€ ๋ณธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์—์„œ ์ •์˜ํ•œ ๊ทœ์น™ ๋ฌธ๋ฒ•์— ๊ธฐ๋ฐ˜ํ•˜์—ฌ ๊ทœ์น™ ํŒŒ์ผ(json ํฌ๋งท)์„ ์ž‘์„ฑํ•˜๋Š” ๊ฒƒ์ด๊ณ , ๋‘ ๋ฒˆ์งธ ๋ฐฉ์‹์€ ๋™์˜์–ด ๊ธฐ๋ฐ˜์œผ๋กœ ์‚ฌ์ „ ํŒŒ์ผ(json ํฌ๋งท)์„ ์ž‘์„ฑํ•˜๋Š” ๊ฒƒ์ด๋‹ค. ๊ทœ์น™ ํŒŒ์ผ๊ณผ ์‚ฌ์ „ ํŒŒ์ผ์„ ์ž‘์„ฑํ•˜๋Š” ๋ฐฉ๋ฒ•์€ ์•„๋ž˜ ๋ถ€๋ถ„์— ์ž์„ธํžˆ ๊ธฐ์žฌ๋˜์–ด ์žˆ๋‹ค.

๊ฐœ๋ฐœ์ž๋Š” slotminer ์˜ ์†Œ์Šค์ฝ”๋“œ์— ๊ธฐ์—ฌํ•  ์ˆ˜๋„ ์žˆ๊ณ , ํŠน์ • slot์„ ์ถ”์ถœํ•˜๋Š” ๊ทœ์น™ ํŒŒ์ผ ๋˜๋Š” ์‚ฌ์ „ ํŒŒ์ผ์„ ์ƒ์„ฑ/๊ฐœ์„ ํ•จ์œผ๋กœ์จ ๊ธฐ์—ฌ๊ฐ€ ๊ฐ€๋Šฅํ•˜๋‹ค. ํŠน์ง•์œผ๋กœ๋Š” white-space (์ŠคํŽ˜์ด์Šค๋ฐ”)์€ ํ…์ŠคํŠธ ๋งค์นญ ๋Œ€์ƒ์—์„œ ๊ธฐ๋ณธ์ ์œผ๋กœ ๋ฌด์‹œ๋˜๋ฏ€๋กœ, ๊ทœ์น™์ด "๊ธฐ์›์ „"์ผ ๊ฒฝ์šฐ, "๊ธฐ ์› ์ „", "๊ธฐ์› ์ „" ๋“ฑ๊ณผ ๊ฐ™์€ ํ…์ŠคํŠธ๋“ค์ด ๋ชจ๋‘ ๊ทœ์น™/์‚ฌ์ „ ๋งค์นญ์— ํ†ต๊ณผ๋œ๋‹ค.

์ฒซ ๋ฒˆ์งธ ๋ฐฉ์‹(๊ทœ์น™ ๊ธฐ๋ฐ˜)์„ ์‚ฌ์šฉํ•  ๊ฒฝ์šฐ, white-space ๋ฅผ ๋Œ€๊ด„ํ˜ธ๋กœ ๋‘˜๋Ÿฌ์‹ผ ํ˜•ํƒœ(์˜ˆ: [ ])๋ฅผ ์‚ฌ์šฉํ•จ์œผ๋กœ์จ ๋ช…์‹œ์ ์œผ๋กœ ๊ทœ์น™์—์„œ white-space ๋ฅผ ์ฒดํฌํ•˜๋„๋ก ํ•˜๋Š” ๊ฒƒ์ด ๊ฐ€๋Šฅํ•˜๋‹ค. ๋‘ ๋ฒˆ์งธ ๋ฐฉ์‹(์‚ฌ์ „ ๊ธฐ๋ฐ˜)์„ ์‚ฌ์šฉํ•  ๊ฒฝ์šฐ, white-space ๋ฅผ ๋ฌด์‹œํ•˜๋Š” ๊ธฐ๋Šฅ์€ ๊ธฐ๋ณธ์ ์œผ๋กœ ์ œ๊ณต๋˜์ง€ ์•Š๋Š”๋‹ค.

๊ธฐ๋Šฅ1: ์‹œ๊ฐ„์ •๋ณด์ถ”์ถœ (๊ทœ์น™ ๊ธฐ๋ฐ˜)

์ตœ๊ทผ, ๊ธฐ๊ณ„ํ•™์Šต๊ณผ ๋”ฅ๋Ÿฌ๋‹ ๋“ฑ์„ ํ†ตํ•ด ์‹œ๊ฐ„์ •๋ณด์— ๋Œ€ํ•œ '์ •๊ทœํ™”'๋ฅผ ์ž๋™ํ™”ํ•˜๋ ค๋Š” ์—ฐ๊ตฌ๋“ค์ด ์žˆ์œผ๋‚˜, ์‹ค์ œ ์„œ๋น„์Šค์— ์ ์šฉ๋˜๊ธฐ์—๋Š” ๊ฐˆ ๊ธธ์ด ๋งค์šฐ ๋ฉ€๋‹ค. ํŠนํžˆ, 1999๋…„, ๋‹ค์Œ์ฃผ ์ˆ˜์š”์ผ๊ณผ ๊ฐ™์€ ํ‘œํ˜„(์ด๋ฅผ TIMEX3 slot ์ด๋ผ๊ณ  ๋ถ€๋ฅธ๋‹ค)์— ๋Œ€ํ•œ ์ถ”์ถœ ๋ฐ ์ •๊ทœํ™”๋Š” ๊ทœ์น™์„ ๊ธฐ๋ฐ˜์œผ๋กœ ์ถ”์ถœํ•˜๋Š” ๊ฒƒ์ด ๋” ํšจ๊ณผ์ ์ด๋ผ ํ•  ์ˆ˜ ์žˆ๋‹ค. ๊ธฐ๋ณธ์ ์œผ๋กœ๋Š” ISO-8601๊ณผ ISO-TimeML ํ‘œ์ค€์„ ๋”ฐ๋ฅด์ง€๋งŒ, Y.S. Jeong et al., 2016 ๋…ผ๋ฌธ์—์„œ ์–ธ๊ธ‰ํ•˜๋“ฏ์ด, ์‹ค์ œ ํ”„๋กœ๊ทธ๋žจ ์ƒ์—์„œ๋Š” ์œ„ ๋‘๊ฐœ์˜ ํ‘œ์ค€์„ ๊ทธ๋Œ€๋กœ ๋”ฐ๋ฅด๊ฒŒ ๋˜๋ฉด ๋งค์šฐ ๋น„ํšจ์œจ์ ์ด๊ฑฐ๋‚˜ ํ‘œํ˜„ํ•˜์ง€ ๋ชปํ•˜๋Š” ์‹œ๊ฐ„ ์ •๋ณด๋“ค์ด ์กด์žฌํ•œ๋‹ค. ๋”ฐ๋ผ์„œ, Y.S. Jeong et al., 2016 ๋…ผ๋ฌธ๊ณผ C.G. Lim et al., 2018 ๋…ผ๋ฌธ์—์„œ ์ œ์‹œํ•˜๋Š” ์ƒˆ๋กœ์šด Korean TimeML์„ ๋ฐ˜์˜ํ•˜์—ฌ ์‹œ๊ฐ„์ •๋ณด๋ฅผ ์ถ”์ถœํ•œ๋‹ค. ์ด ๊ธฐ๋Šฅ์„ ์œ„ํ•œ ๊ทœ์น™ํŒŒ์ผ์€ rule/timex3.rule ์ด๋‹ค.

ํŠนํžˆ, ์‹œ๊ฐ„์ •๋ณด ์ค‘์—์„œ EVENT, MAKEINSTANCE, TLINK ๋“ฑ์€ ์ œ์™ธํ•˜๊ณ , TIMEX3 ์—์„œ๋„ ์ฃผ๋กœ ์‚ฌ์šฉ๋˜๋Š” ํ‘œํ˜„ ์™ธ์—๋Š” ๊ณผ๊ฐํžˆ ์ œ์™ธํ•˜์˜€๋‹ค. ์˜ˆ๋ฅผ ๋“ค๋ฉด, ์ถ”์ถœ๋˜๋Š” ์ •๋ณด๋ฅผ ๋ถˆํ•„์š”ํ•˜๊ฒŒ ๋ฒˆ์žกํ•˜๊ฒŒ ๋งŒ๋“œ๋Š” 'SET' ํƒ€์ž… TIMEX3๋Š” ์ œ์™ธ๋˜์—ˆ๋‹ค. ์ถ”์ถœ๋˜๋Š” TIMEX3 ์ •๋ณด์— ๋Œ€ํ•œ ์ •์˜๋Š” ์•„๋ž˜์™€ ๊ฐ™๋‹ค. ๋งŒ์•ฝ ๊ธฐ์—…/๊ธฐ๊ด€์—์„œ ์‚ฌ์šฉํ•˜๋ ค๋Š” ๋ณ„๋„์˜ ์‹œ๊ฐ„์ •๋ณด๋ฅผ ์ถ”๊ฐ€ํ•˜๋Š” ์ž‘์—…์„ ์˜๋ขฐํ•˜๊ณ  ์‹ถ๋‹ค๋ฉด ๋ณธ๋ฌธ ๋งจ ๋ฐ‘์— ์ ํ˜€์žˆ๋Š” ์ œํœด๋ฌธ์˜๋ฅผ ์ฐธ๊ณ ๋ฐ”๋ž€๋‹ค.

attributes ::= type text extent calendar [year] [month] [day] [week] [week_day] [mod] 
type ::= 'DATE' | 'TIME' | 'DURATION'
text ::= CDATA
extent ::= [(begin, end), ...]
begin ::= CDATA {begin ::= <integer>}
end ::= CDATA {end ::= <integer>}
calendar ::= 'GREGORIAN' | 'LUNAR' | 'JULIAN'
year ::= mark CDATA
month ::= mark CDATA
day ::= mark CDATA
hour ::= mark CDATA
minute ::= mark CDATA
second ::= mark CDATA
week ::= mark CDATA
week_day ::= 0 | 1 | 2 | 3 | 4 | 5 | 6
mark ::= 'P' | '+' | '-' | '_' (Note: '_'๋Š” '๊ธฐ์›์ „' ํ‘œํ˜„ ์ „์šฉ)
mod ::= 'START' | 'MID' | 'END' | 'START_MID' | 'MID_END'

์‹คํ–‰ ์˜ˆ์‹œ

์›๋ณธ: 3๋…„ 5๊ฐœ์›”๋™์•ˆ
๊ฒฐ๊ณผ:
{'year': 'P3', 'type': 'DURATION', 'month': 'P5', 'calendar': 'GREGORIAN', 'text': '3๋…„ 5๊ฐœ์›”', 'name': 'slot_timex3', 'extent': [(0, 6)]}

์›๋ณธ: ์—ฌ์ž์นœ๊ตฌ์™€ ๋‹ค์Œ์ฃผ ์ˆ˜์š”์ผ์— ๋งŒ๋‚˜๊ธฐ๋กœ ํ–ˆ๋‹ค.
๊ฒฐ๊ณผ:
{'name': 'slot_timex3', 'week_day': '3', 'extent': [(6, 13)], 'calendar': 'GREGORIAN', 'type': 'DATE', 'text': '๋‹ค์Œ์ฃผ ์ˆ˜์š”์ผ', 'week': '+1'}

๊ทœ์น™ ์˜ˆ์‹œ

        "Rweek_day": {
                "name": "slot_timex3",
                "result": {"week_day": "[$s]", "type": "DATE", "calendar": "GREGORIAN"},
                "condition": [
                        {"ext": "(์›”[$s=1]|ํ™”[$s=2]|์ˆ˜[$s=3]|๋ชฉ[$s=4]|๊ธˆ[$s=5]|ํ† [$s=6]|์ผ[$s=0])์š”์ผ"}
                ]
        },

๊ธฐ๋Šฅ2: ๋ณ‘์› ๋งˆ์ทจ์ „ ํ‰๊ฐ€์„œ ํ…์ŠคํŠธ๋กœ๋ถ€ํ„ฐ ์ •ํ˜•ํ™”๋œ ์ •๋ณด ์ถ”์ถœ (๊ทœ์น™ ๊ธฐ๋ฐ˜)

๋ณ‘์›์—์„œ ์ˆ˜์ˆ ์„ ์•ž๋‘” ์‹œ์ ์— 'ํ‰๊ฐ€์„œ'๋ฅผ ์ž‘์„ฑํ•˜๋Š”๋ฐ, ์ด ํ‰๊ฐ€์„œ์—๋Š” ํ™˜์ž์˜ ์ƒํƒœ, ํŠน์ง• ๋“ฑ์˜ ์ •๋ณด๋ฅผ ๋‹ด๊ณ  ์žˆ์œผ๋ฏ€๋กœ ์—ฌ๋Ÿฌ๊ฐ€์ง€๋กœ ํ™œ์šฉ(์˜ˆ: ํ™˜์ž์˜ ์ˆ˜์ˆ ํ›„ ์˜ˆํ›„ ์˜ˆ์ธก ๋“ฑ)์ด ๊ฐ€๋Šฅํ•˜๋‹ค. ํ•˜์ง€๋งŒ, ์ด ํ‰๊ฐ€์„œ๋Š” ์ž์—ฐ์–ด ๋ฌธ์žฅ์˜ ๋‚˜์—ด๋กœ์จ ์ž‘์„ฑ๋˜๊ธฐ ๋•Œ๋ฌธ์— ํ‰๊ฐ€์„œ๋กœ๋ถ€ํ„ฐ ์ •ํ˜•ํ™”๋œ ์ •๋ณด๋ฅผ ์ถ”์ถœํ•˜๋Š” ์ž‘์—…์ด ํ•„์š”ํ•˜๋‹ค. ์ด ๊ธฐ๋Šฅ์€ ์ž„์ƒ ์˜๋ฃŒ์ธ์ด ์ˆ˜์ˆ ์ „์— ์ž‘์„ฑํ•˜๋Š” ํ‰๊ฐ€์„œ ํ…์ŠคํŠธ๋กœ๋ถ€ํ„ฐ ์ •ํ˜•ํ™”๋œ ์ •๋ณด๋ฅผ ์ถ”์ถœํ•ด์ค€๋‹ค.

attributes ::= name feature text extent 
name ::= 'slot_param1'
feature ::= CDATA
text ::= CDATA
extent ::= [(begin, end), ...]
begin ::= CDATA {begin ::= <integer>}
end ::= CDATA {end ::= <integer>}

๊ธฐ๋ณธ์ ์œผ๋กœ๋Š” ์ˆœ์ฒœํ–ฅ๋Œ€ํ•™๊ต ์„œ์šธ๋ณ‘์›(https://www.schmc.ac.kr/seoul/index.do)์—์„œ ์‚ฌ์šฉ๋˜๋Š” ์ „๋ฌธ์šฉ์–ด/์•ฝ์–ด๋ฅผ ๊ธฐ์ค€์œผ๋กœ ๊ทœ์น™์ด ์ž‘์„ฑ๋˜์—ˆ์œผ๋ฉฐ, ๋‹ค๋ฅธ ๋ณ‘์› ๋ฐ ๊ธฐ๊ด€์—์„œ๋Š” ๋‹ค์†Œ์˜ ์šฉ์–ด ์ฐจ์ด๊ฐ€ ์กด์žฌํ•  ์ˆ˜ ์žˆ๋‹ค. ๊ทœ์น™ํŒŒ์ผ ๊ฒฝ๋กœ๋Š” rule/sch_seoul.rule ์ด๋‹ค.

๊ฒฐ๊ณผ๋ฌผ๋กœ ์ƒ์„ฑ๋˜๋Š” slot๋“ค ์ค‘์— 'name'๊ฐ’์ด 'slot_number'๋กœ์จ ์ƒ์„ฑ๋˜๋Š” slot๋“ค์€ ๋‹จ์ˆœ์ˆซ์žํ‘œํ˜„๋งŒ์„ ์ธ์ง€ํ•˜๋ฏ€๋กœ ๋ฌด์‹œํ•˜๋„๋ก ํ•œ๋‹ค. ์ˆซ์žํ‘œํ˜„์„ ์ธ์‹ํ•˜๋Š” ์ด์œ ๋Š” glucose, TFT ๋“ฑ๊ณผ ๊ฐ™์ด ์ˆ˜์น˜๊ฐ’์„ ์ถ”์ถœํ•˜๋Š” ์šฉ์–ด์— ๋Œ€ํ•œ ์ฒ˜๋ฆฌ๋ฅผ ์œ„ํ•จ์ด๋‹ค.

๋”ฐ๋ผ์„œ 'name'๊ฐ’์ด 'slot_param1'์ธ slot์— ๋Œ€ํ•˜์—ฌ, featureํ•ญ๋ชฉ์˜ ๊ฐ’์€ ์•ฝ 50๊ฐ€์ง€ ์ด์ƒ์˜ ์ „๋ฌธ์šฉ์–ด/์•ฝ์–ด์— ๋Œ€ํ•œ ์ •๋ณด๋ฅผ ๋‹ด๊ฒŒ ๋œ๋‹ค. ์ด ์ •๋ณด๋Š” ํŠน์ • ์šฉ์–ด/์•ฝ์–ด๊ฐ€ ํ‰๊ฐ€์„œ์— ์กด์žฌํ•˜๋Š”์ง€ ์—ฌ๋ถ€๋ฅผ ๋‚˜ํƒ€๋‚ด๋ฉฐ, ๋•Œ๋•Œ๋กœ ์ˆ˜์น˜๊ฐ’(์˜ˆ: glucose:50)์„ ์ถ”์ถœํ•ด์ฃผ๊ธฐ๋„ ํ•œ๋‹ค.

์ถ”์ถœ๋˜๋Š” ์šฉ์–ด/์•ฝ์–ด๋“ค์— ๋Œ€ํ•œ ๋ชฉ๋ก์€ ์•„๋ž˜์™€ ๊ฐ™๋‹ค. ๋งŒ์•ฝ ๋ณ‘์›/๊ธฐ๊ด€์—์„œ ์‚ฌ์šฉํ•˜๋Š” ๋ณ„๋„์˜ ์šฉ์–ด๋“ค์„ ์ถ”๊ฐ€ํ•˜๋Š” ์ž‘์—…์„ ์˜๋ขฐํ•˜๊ณ  ์‹ถ๋‹ค๋ฉด ๋ณธ๋ฌธ ๋งจ ๋ฐ‘์— ์ ํ˜€์žˆ๋Š” ์ œํœด๋ฌธ์˜๋ฅผ ์ฐธ๊ณ ๋ฐ”๋ž€๋‹ค.

  • COPD, Bedridden, CPR, Alcoholic hepatitis, Alcoholic LC, IPF, Anemia, Myocardial infarction, PCI, Atherosclerosis, DVT, Carotid artery stenosis, Cerebral atherosclerosis, ESRD KT, Hyperparathyroidism, CAD, Fatty liver, Angina, VPC, APC, CHF, MR, MS, HTN, Pulmonary hypertension, Pulmonary embolism, TR, DM, Diastolic dysfunction, Concentric LVH, Eccentric LVH, HCMP, LAE, RAE, LVE, RVE, Ischemic heart disease, Regional wall motion abnormality, LV systolic dysfunction, RV dysfunction, A.fib, DCMP, AS, AR, Uremic CMP, IVC plethora, Pericardial effusion, Pleural effusion, Depression, Cancer, Glucose, aBGA, EGFR, CAG, TFT

์‹คํ–‰ ์˜ˆ์‹œ

์›๋ณธ:  TFT : TSH/fT4/T3 3.66(N)/1.26(N)/60.03(L)
๊ฒฐ๊ณผ:
{'text': 'fT4/T33.66(N)/1.26(N)/60.03', 'name': 'slot_param1', 'feature': 'ft4:1.26:t3:60.03', 'extent': [(10, 37)]}

์›๋ณธ:  Chest CT :. Diffuse tubular bronchiectasis and multiple small subsolid/solid 
๊ฒฐ๊ณผ: 
{'text': 'bronchiectasis', 'name': 'slot_param1', 'feature': 'copd', 'extent': [(60, 74)]}

๊ทœ์น™ ์˜ˆ์‹œ

        "Rtft": {
                "name": "slot_param1",
                "result": {"feature": "ft4:[$s0]:t3:[$s1]"},
                "condition": [
                        {"ext": "(ft4/t3)([ ])?[$s=([@Rnumber.value])]([.]){3}/[$s0=([@Rnumber.value])]([.]){3}/[$s1=([@Rnumber.value])]"}
                ]
        }

๊ทœ์น™ ์ž‘์„ฑ ๋ฐฉ๋ฒ•

  1. ๊ทœ์น™์€ ๋ณธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์ด์šฉํ•˜๋Š” ์ฒซ ๋ฒˆ์งธ ๋ฐฉ๋ฒ•์œผ๋กœ์„œ, ์ •๊ทœ์‹๊ณผ ์œ ์‚ฌํ•œ ๋ฌธ๋ฒ•์„ ์ด์šฉํ•˜์—ฌ ๊ทœ์น™์„ ์ •์˜ํ•˜๊ณ  ์ด ๊ทœ์น™์— ๋งค์นญ๋˜๋Š” slot ๋“ค์„ ์ถ”์ถœํ•จ๊ณผ ๋™์‹œ์— ๊ทธ ๊ฐ’์„ ์ •๊ทœํ™”ํ•˜์—ฌ ์–ป์„ ์ˆ˜ ์žˆ๋‹ค.

  2. ๊ทœ์น™ํŒŒ์ผ: ๊ทœ์น™ํŒŒ์ผ์€ 1๊ฐœ ์ด์ƒ์˜ ๊ทœ์น™๋“ค์˜ ๋ชจ์Œ์ด๋ฉฐ, ๊ทœ์น™์€ json ์–‘์‹์œผ๋กœ ๊ธฐ์ˆ ๋œ๋‹ค. ๊ทœ์น™ํŒŒ์ผ์—๋Š” ๋‹ค์Œ์˜ ๊ฒƒ๋“ค์ด ํฌํ•จ๋œ๋‹ค.

    • ์ „/ํ›„์ฒ˜๋ฆฌ ์ •๋ณด
    • ๊ทœ์น™๋“ค
  3. ๊ทœ์น™: ๊ทœ์น™์€ ๊ธฐ๋ณธ์ ์œผ๋กœ ํ…์ŠคํŠธ ๋งค์นญ์„ ํ†ตํ•ด ๊ฒฐ๊ณผ๋ฌผ(์Šฌ๋กฏ ๋˜๋Š” ํƒœ๊ทธ)์„ ์ƒ์„ฑํ•œ๋‹ค. ๊ทœ์น™ํŒŒ์ผ์—์„œ ๊ธฐ์ˆ ๋˜๋Š” ๊ฐ๊ฐ์˜ ๊ทœ์น™์€ ์•„๋ž˜ ์‚ฌํ•ญ์„ ํฌํ•จํ•œ๋‹ค.

    • ๊ทœ์น™ ์ด๋ฆ„ (์ฃผ์˜: ๊ทœ์น™์ด๋ฆ„์€ ์ค‘๋ณต๋  ์ˆ˜ ์—†๋‹ค. ์ค‘๋ณต๋˜๋ฉด ๋‚˜์ค‘์— ์ •์˜๋œ ๊ทœ์น™์ด ์•ž์„  ๊ทœ์น™์„ ๋ฎ์–ด์“ด๋‹ค.)
    • ์ƒ์„ฑ๋  ๊ฒฐ๊ณผ๋ฌผ์˜ ์ด๋ฆ„, ํ‚ค-๊ฐ’์˜ ์Œ, ์กฐ๊ฑด๋“ค
      • ์ฐธ๊ณ : ๊ฒฐ๊ณผ๋ฌผ์€ ์ตœ์†Œํ•œ 3๊ฐ€์ง€(name, text, extent)์˜ ํ‚ค-๊ฐ’ ์Œ์„ ํฌํ•จํ•œ๋‹ค.
  4. ๊ทœ์น™ ์ž‘์„ฑ ๋ฐฉ๋ฒ• (๊ธฐ์ดˆ๋ ˆ๋ฒจ I)

    ์•„๋ž˜ ๊ทœ์น™์„ ์ฐธ๊ณ ํ•˜์ž. ์ด ๊ทœ์น™์—์„œ๋Š”, ๊ทœ์น™์˜ ์ด๋ฆ„์€ Rule ์ด๊ณ , ๊ฒฐ๊ณผ๋ฌผ์˜ ์ด๋ฆ„์€ slot_sample, ํ‚ค-๊ฐ’์˜ ์Œ์€ value: 100 ์ด๋ฉฐ, ์กฐ๊ฑด๋“ค์€ condition ์— ํ•ด๋‹นํ•œ๋‹ค.

    "Rule" : {
      "name": "slot_sample",
      "result": {"value": "100"},
      "condition": [
         {"ext": "hundred"}
      ]
    }

์ด ๊ทœ์น™์„ ํ…์ŠคํŠธ "one hundred"์— ์ ์šฉํ•˜๋ฉด, ์•„๋ž˜์™€ ๊ฐ™์€ ๊ฒฐ๊ณผ๋ฌผ์ด ์ƒ์„ฑ๋œ๋‹ค.

{'name': 'slot_sample', 'extent': [(4, 11)], 'text': 'hundred', 'value': '100'}
  1. ๊ทœ์น™ ์ž‘์„ฑ ๋ฐฉ๋ฒ• (๊ธฐ์ดˆ๋ ˆ๋ฒจ II)

    ์•„๋ž˜ ๊ทœ์น™์„ ์ฐธ๊ณ ํ•˜์ž. condition ๋ถ€๋ถ„์—์„œ ๋งค์นญํ•˜๋ ค๋Š” ํ…์ŠคํŠธ ๋ถ€๋ถ„์„ ๊ด€์ฐฐํ•ด๋ณด๋ฉด, ์ •๊ทœ์‹ ๋ฌธ๋ฒ•๊ณผ ์œ ์‚ฌํ•˜๊ฒŒ ์ž‘์„ฑ๋œ ๊ฒƒ์„ ๋ณผ ์ˆ˜ ์žˆ๋‹ค. ์‚ฌ์šฉ๊ฐ€๋Šฅํ•œ ํ‘œํ˜„๋“ค์€ +, ?, | ์ด๋‹ค. ์ด ํ‘œํ˜„๋“ค์€ ์†Œ๊ด„ํ˜ธ์™€ ํ•ญ์ƒ ํ•จ๊ป˜ ์จ์•ผ ํ•œ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, (a)+ ์ด๋ผ๊ณ  ํ•˜๋ฉด, a ๋ฌธ์ž 1๊ฐœ ์ด์ƒ์„ ์˜๋ฏธํ•œ๋‹ค. ๊ธฐ๋ณธ์ ์œผ๋กœ ๊ณต๋ฐฑ์€ ๋ฌด์‹œํ•˜๋„๋ก ๋˜์–ด์žˆ๋Š”๋ฐ, ๋งŒ์•ฝ ๊ณต๋ฐฑ์„ ์ฒดํฌํ•˜๊ณ  ์‹ถ์„ ๊ฒฝ์šฐ์—๋Š” [ ] ์ด๋ผ๊ณ  ๊ธฐ์ˆ ํ•˜๋ฉด ๋œ๋‹ค. ๋ฌธ์žฅ์˜ ๋งจ ์ฒ˜์Œ์ด๊ฑฐ๋‚˜ white-space(' ', '\t' ๋“ฑ)์ธ ๊ฒฝ์šฐ๋Š” [<] ์ด๋ผ๊ณ  ๊ธฐ์ˆ ํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ, ๋ฌธ์žฅ์˜ ๋งจ ๋์ด๊ฑฐ๋‚˜ white-space์ธ ๊ฒฝ์šฐ๋Š” [>]์ด๋ผ๊ณ  ๊ธฐ์ˆ ํ•œ๋‹ค.

    "Rule" : {
      "name": "slot_sample",
      "result": {"value": "pet"},
      "condition": [
         {"ext": "(dog|cat)"}
      ]
    }

์ด ๊ทœ์น™์„ ํ…์ŠคํŠธ "I have a dog and a cat"์— ์ ์šฉํ•˜๋ฉด, ์•„๋ž˜์™€ ๊ฐ™์€ ๊ฒฐ๊ณผ๋ฌผ์ด ์ƒ์„ฑ๋œ๋‹ค.

{'extent': [(9, 12)], 'value': 'pet', 'text': 'dog', 'name': 'slot_sample'}
{'extent': [(19, 22)], 'value': 'pet', 'text': 'cat', 'name': 'slot_sample'}

์ฃผ์˜ํ•  ์ ์œผ๋กœ, | ํ‘œํ˜„์„ ์‚ฌ์šฉํ•  ๋•Œ์—๋Š” ํ•ญ๋ชฉ๋“ค์„ ์™ผ์ชฝ๋ถ€ํ„ฐ ๊ณ ๋ คํ•œ๋‹ค๋Š” ์ ์— ์œ ์˜ํ•ด์•ผ ํ•œ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, (dog|doggie) ๋ผ๋Š” ๊ธฐ์ˆ ํ•  ๊ฒฝ์šฐ, "It's a doggie" ๋ฌธ์žฅ์— ๋Œ€ํ•ด ์ ์šฉํ–ˆ์„ ๋•Œ "dog" ๋ถ€๋ถ„์ด ๋งค์นญ๋  ๊ฒƒ์ด๋‹ค. ๊ทœ์น™์— dog ๋˜๋Š” doggie ๋ฅผ ๊ฒ€์ถœํ•˜๋„๋ก ๊ธฐ์ˆ ํ–ˆ์Œ์—๋„ ๋ถˆ๊ตฌํ•˜๊ณ , dog ๊ฐ€ doggie ๋ณด๋‹ค ์™ผ์ชฝ์— ์žˆ์œผ๋ฏ€๋กœ, dog๊ฐ€ ๋งค์นญ๋˜์—ˆ์„ ๋•Œ doggie๋Š” ๋”์ด์ƒ ๊ณ ๋ ค๋˜์ง€ ์•Š๋Š” ๊ฒƒ์ด๋‹ค. ์ด๋Ÿฐ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๊ณ  ์‹ถ๋‹ค๋ฉด, (doggie|dog) ๋˜๋Š” (dog(gie)?) ์™€ ๊ฐ™์ด ๊ธฐ์ˆ ํ•  ์ˆ˜ ์žˆ๋‹ค.

  1. ๊ทœ์น™ ์ž‘์„ฑ ๋ฐฉ๋ฒ• (๊ธฐ์ดˆ๋ ˆ๋ฒจ III)

    ์•„๋ž˜ ๊ทœ์น™์„ ์ฐธ๊ณ ํ•˜์ž. ๋จผ์ € condition ๋ถ€๋ถ„์„ ์ž˜ ๊ด€์ฐฐํ•ด๋ณด์ž. ๋Œ€๊ด„ํ˜ธ๋กœ ๋‘˜๋Ÿฌ์‹ธ์ธ ๋ถ€๋ถ„์˜ ๋™์ž‘์€ s ๋ผ๋Š” ์ด๋ฆ„์˜ ๋ณ€์ˆ˜๋ฅผ ๋งŒ๋“ค๊ณ , ๊ทธ ๋ณ€์ˆ˜์— 3์ด๋ผ๋Š” ๊ฐ’์„ ๋„ฃ๋Š” ๊ฒƒ์ด๋‹ค. ๊ทธ ๋‹ค์Œ์€ result ๋ถ€๋ถ„์„ ์‚ดํŽด๋ณด๋ฉด, value ํ‚ค์˜ ๊ฐ’์— ๋ณ€์ˆ˜ s๊ฐ€ ์‚ฌ์šฉ๋˜์—ˆ๋‹ค. ์ฆ‰, condition ๋ถ€๋ถ„์—์„œ ์ƒ์„ฑํ•œ ๋ณ€์ˆ˜์˜ ๊ฐ’์„ ๊ฒฐ๊ณผ๋ฌผ์˜ ํ‚ค-๊ฐ’์—์„œ ์‚ฌ์šฉ์ด ๊ฐ€๋Šฅํ•œ ๊ฒƒ์ด๋‹ค.

    "Rule" : {
      "name": "slot_sample",
      "result": {"value": "[$s]"},
      "condition": [
         {"ext": "three[$s=3]"}
      ]
    }

    ์ด ๊ทœ์น™์„ ํ…์ŠคํŠธ "I am three years old"์— ์ ์šฉํ•˜๋ฉด, ์•„๋ž˜์™€ ๊ฐ™์€ ๊ฒฐ๊ณผ๋ฌผ์ด ์ƒ์„ฑ๋œ๋‹ค.

    {'text': 'three', 'extent': [(5, 10)], 'value': '3', 'name': 'slot_sample'}
  2. ๊ทœ์น™ ์ž‘์„ฑ ๋ฐฉ๋ฒ• (์ค‘๊ธ‰๋ ˆ๋ฒจ I)

    ์•„๋ž˜ ๊ทœ์น™์„ ์ฐธ๊ณ ํ•˜์ž. condition ์—์„œ ๋ณ€์ˆ˜๋ฅผ ์ƒ์„ฑํ•˜๊ณ  ์žˆ๋Š”๋ฐ, ๋ณ€์ˆ˜์˜ ๊ฐ’์— ํ•ด๋‹นํ•˜๋Š” ๋ถ€๋ถ„์„ ์†Œ๊ด„ํ˜ธ๋กœ ๋‘˜๋Ÿฌ์‹ธ์„œ or ์—ฐ์‚ฐ(|)์œผ๋กœ ๊ธฐ์ˆ ํ•˜๋Š” ๊ฒฝ์šฐ, ์ด ๋ถ€๋ถ„์ด ์ง์ ‘ ๋ณ€์ˆ˜์˜ ๊ฐ’์— ๋“ค์–ด๊ฐ€๊ฒŒ ๋œ๋‹ค.

    "Rule" : {
      "name": "slot_sample",
      "result": {"value": "[$s]"},
      "condition": [
         {"ext": "[$s=(dog|cat)]"}
      ]
    }

    ์ด ๊ทœ์น™์„ ํ…์ŠคํŠธ "I have a dog and a cat"์— ์ ์šฉํ•˜๋ฉด, ์•„๋ž˜์™€ ๊ฐ™์€ ๊ฒฐ๊ณผ๋ฌผ์ด ์ƒ์„ฑ๋œ๋‹ค.

    {'text': 'dog', 'value': 'dog', 'name': 'slot_sample', 'extent': [(9, 12)]}
    {'text': 'cat', 'value': 'cat', 'name': 'slot_sample', 'extent': [(19, 22)]}

    ์œ„ ๊ทœ์น™ ์˜ˆ์‹œ์—์„œ๋Š” ๋ณ€์ˆ˜์˜ ๊ฐ’์— ์†Œ๊ด„ํ˜ธ๊ฐ€ ๋“ฑ์žฅํ•˜์˜€๋Š”๋ฐ, ๋ฐ˜๋Œ€๋กœ ์†Œ๊ด„ํ˜ธ์™€ |(or) ์—ฐ์‚ฐ์˜ ์•ˆ์ชฝ์— ๋ณ€์ˆ˜ ๊ฐ’์„ ์ง€์ •ํ•˜๋Š” ๊ฒƒ๋„ ๊ฐ€๋Šฅํ•˜๋‹ค. ๋ฌผ๋ก , ์ด ๋‘ ๊ฐ€์ง€๋ฅผ ์„ž์–ด์„œ ์“ฐ๋Š” ๊ฒƒ๋„ ๊ฐ€๋Šฅํ•˜๋‹ค. ์•„๋ž˜ ์˜ˆ์‹œ๋ฅผ ๊ด€์ฐฐํ•ด๋ณด์ž. ๊ฐ€์žฅ ๋ฐ”๊นฅ์ชฝ | ํ‘œํ˜„์˜ ์™ผ์ชฝ ๋ถ€๋ถ„์€ (dog|puppy) ๋ฅผ ๋งŒ์กฑํ•  ๊ฒฝ์šฐ $s ๋ณ€์ˆ˜์— ๊ฐ•์•„์ง€ ๊ฐ’์„ ๋„ฃ๋Š”๋‹ค๋Š” ๋‚ด์šฉ์ด๋ฉฐ, ์˜ค๋ฅธ์ชฝ ๋ถ€๋ถ„์€ (cat|kitten) ์„ ๋งŒ์กฑํ•  ๊ฒฝ์šฐ ๊ทธ ํ…์ŠคํŠธ ์ž์ฒด๋ฅผ $s ๋ณ€์ˆ˜์— ๋„ฃ๋Š”๋‹ค๋Š” ๋‚ด์šฉ์ด๋‹ค.

    "Rule" : {
      "name": "slot_sample",
      "result": {"value": "[$s]"},
      "condition": [
         {"ext": "((dog|puppy)[$s=๊ฐ•์•„์ง€]|[$s=(cat|kitten)])"}
      ]
    }

    ์ด ๊ทœ์น™์„ ํ…์ŠคํŠธ "I have a dog and a kitten."์— ์ ์šฉํ•˜๋ฉด, ์•„๋ž˜์™€ ๊ฐ™์€ ๊ฒฐ๊ณผ๋ฌผ์ด ์ƒ์„ฑ๋œ๋‹ค.

    {'text': 'dog', 'name': 'slot_sample', 'value': '๊ฐ•์•„์ง€', 'extent': [(9, 12)]}
    {'text': 'kitten', 'name': 'slot_sample', 'value': 'kitten', 'extent': [(17, 23)]}
  3. ๊ทœ์น™ ์ž‘์„ฑ ๋ฐฉ๋ฒ• (์ค‘๊ธ‰๋ ˆ๋ฒจ II)

    ์ง€๊ธˆ๊นŒ์ง€๋Š” condition ๋ถ€๋ถ„์— 1๊ฐœ์˜ ์กฐ๊ฑด๋งŒ ํฌํ•จ์‹œ์ผฐ์œผ๋‚˜, 2๊ฐœ ์ด์ƒ์˜ ์กฐ๊ฑด์„ ํฌํ•จ์‹œํ‚ฌ ์ˆ˜ ์žˆ๋‹ค. ์•„๋ž˜ ์˜ˆ์‹œ๋ฅผ ๋ณด์ž.

    "Rule" : {
      "name": "slot_sample",
      "result": {"value": "[$s]"},
      "condition": [
         {"ext": "(one[$s=1]|two[$s=2])"},
         {"ext": "dollar"}
      ]
    }

    ์ด ๊ทœ์น™์„ ํ…์ŠคํŠธ "I have two dollars!"์— ์ ์šฉํ•˜๋ฉด, ์•„๋ž˜์™€ ๊ฐ™์€ ๊ฒฐ๊ณผ๋ฌผ์ด ์ƒ์„ฑ๋œ๋‹ค.

    {'extent': [(7, 10), (11, 17)], 'name': 'slot_sample', 'text': 'twodollar', 'value': '2'}

    ๊ธฐ์ˆ ํ•˜์˜€๋˜ ์กฐ๊ฑด๋“ค๊ณผ ๊ฒฐ๊ณผ๋ฌผ์„ ๊ด€์ฐฐํ•ด๋ณด๋ฉด, ๊ฒฐ๊ตญ 2๊ฐœ์˜ ์กฐ๊ฑด๋“ค์„ (one[$s=1]|two[$s=2])dolloar๋กœ์จ 1๊ฐœ์˜ ์กฐ๊ฑด์œผ๋กœ ํ•ฉ์น  ์ˆ˜ ์žˆ๋‹ค๋Š” ๊ฒƒ์„ ์•Œ ์ˆ˜ ์žˆ๋‹ค. ์ด๋ ‡๋“ฏ ์—ฌ๋Ÿฌ ๊ฐœ์˜ ์กฐ๊ฑด๋“ค์„ 1๊ฐœ์˜ ์กฐ๊ฑด์œผ๋กœ ์‰ฝ๊ฒŒ ํ•ฉ์น  ์ˆ˜ ์žˆ์Œ์—๋„ ๋ถˆ๊ตฌํ•˜๊ณ , condition ๋ถ€๋ถ„์—์„œ ์—ฌ๋Ÿฌ ์กฐ๊ฑด๋“ค์„ ๋‘˜ ์ˆ˜ ์žˆ๋„๋ก ํ•œ ๊ฒƒ์€ ์•„๋ž˜์™€ ๊ทœ์น™์„ ๋ณด๋ฉด ์•Œ ์ˆ˜ ์žˆ๋‹ค. ์ด ๊ทœ์น™์€ ์–ธ๋œป ๋ณด๋ฉด ์œ„ ๊ทœ์น™๊ณผ ๋™์ผํ•ด ๋ณด์ด์ง€๋งŒ, ์ฒซ ๋ฒˆ์งธ ์กฐ๊ฑด์˜ ํ‚ค๊ฐ€ ext๊ฐ€ ์•„๋‹Œ next๋ผ๋Š” ์ ์„ ์•Œ ์ˆ˜ ์žˆ๋‹ค. ์กฐ๊ฑด์˜ ํ‚ค๊ฐ€ ext์ธ ๊ฒƒ์€ ๊ฒฐ๊ณผ๋ฌผ ํ…์ŠคํŠธ extent(๋ฒ”์œ„)์— ํฌํ•จ์ด ๋œ๋‹ค๋Š” ์˜๋ฏธ์ด๋ฉฐ, next๋Š” ํฌํ•จ๋˜์ง€ ์•Š๋Š”๋‹ค๋Š” ๋œป์ด๋‹ค.

    "Rule" : {
      "name": "slot_sample",
      "result": {"value": "[$s]"},
      "condition": [
         {"next": "(one[$s=1]|two[$s=2])"},
         {"ext": "dollar"}
      ]
    }

    ์ด ๊ทœ์น™์„ ํ…์ŠคํŠธ "I have two dollars!"์— ์ ์šฉํ•˜๋ฉด, ์•„๋ž˜์™€ ๊ฐ™์€ ๊ฒฐ๊ณผ๋ฌผ์ด ์ƒ์„ฑ๋œ๋‹ค.

    {'extent': [(11, 17)], 'name': 'slot_sample', 'text': 'dollar', 'value': '2'}

    ๊ฐ ์กฐ๊ฑด์˜ ํ‚ค๋Š” ext ๋˜๋Š” next์ค‘์— ํ•˜๋‚˜๋งŒ์„ ๊ฐ€์งˆ ์ˆ˜ ์žˆ์œผ๋ฉฐ, ์กฐ๊ฑด์„ ์ฒดํฌํ•˜๋ฉด์„œ๋„ ์›ํ•˜๋Š” ๋ถ€๋ถ„๋งŒ ๊ฒฐ๊ณผ๋ฌผ ํ…์ŠคํŠธ ๋ฒ”์œ„์— ํฌํ•จํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋œ๋‹ค.

์‚ฌ์ „ ์ž‘์„ฑ ๋ฐฉ๋ฒ•

  1. ์‚ฌ์ „(dictionary)์€ ์ถ”์ถœํ•˜๊ณ ์ž ํ•˜๋Š” ๋Œ€์ƒ์ด Named entity (NE)๋ผ๊ณ  ๊ฐ€์ •ํ•˜๋ฉฐ, NE tag (์˜ˆ: Person(์‚ฌ๋žŒ์ด๋ฆ„), Book(์ฑ…์ œ๋ชฉ) ๋“ฑ)์— ๋Œ€ํ•œ ์‚ฌ์ „์„ ๋‚˜์—ดํ•˜๋ฉด ์ด ์‚ฌ์ „์„ ๊ธฐ๋ฐ˜์œผ๋กœ ๋งค์นญ๋˜๋Š” NE tag๊ฐ€ ์ถ”์ถœ๋œ๋‹ค. ๊ทœ์น™ ๊ธฐ๋ฐ˜ ๋ฐฉ์‹๊ณผ๋Š” ๋‹ฌ๋ฆฌ, ๊ทธ ๊ฐ’์ด ์ •๊ทœํ™”(์˜ˆ: 21์„ธ๊ธฐ --> ์ˆซ์ž21๋กœ ์ธ์‹)๋˜์ง€๋Š” ์•Š๋Š”๋‹ค.

  2. ์ž‘์„ฑ๋ฒ• ์ถ”๊ฐ€๋  ์˜ˆ์ • (To be continued..)

๋ผ์ด์„ผ์Šค, ์ œํœด

LICENSE ๋ฌธ์„œ๋ฅผ ์ฐธ๊ณ ํ•˜๋˜, ๋ณธ ํ”„๋กœ์ ํŠธ๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ์‚ฌ์—… ๋˜๋Š” ์—ฐ๊ตฌ๋…ผ๋ฌธ์— ์•„๋ž˜์˜ ํ•ญ๋ชฉ๋“ค ์ค‘์— ์ ์–ด๋„ 1๊ฐœ๋ฅผ reference ๋กœ citation ํ•˜๋„๋ก ํ•œ๋‹ค.

๊ธฐ๋Šฅ1: ์‹œ๊ฐ„์ •๋ณด์ถ”์ถœ

๊ธฐ๋Šฅ2: ๋ณ‘์› ๋งˆ์ทจ์ „ ํ‰๊ฐ€์„œ ํ…์ŠคํŠธ๋กœ๋ถ€ํ„ฐ ์ •ํ˜•ํ™”๋œ ์ •๋ณด ์ถ”์ถœ

ํŠนํžˆ, ์•„๋ž˜ ๋‘ ๊ฐ€์ง€์— ํ•ด๋‹น๋˜๋Š” ๊ฒฝ์šฐ์—๋Š” ๋ณธ ํ”„๋กœ์ ํŠธ ์ฑ…์ž„์ž( pinodewaider_at_gmail.com )์—๊ฒŒ ์—ฐ๋ฝํ•˜์—ฌ ์ œํœด/์ œ์•ˆ์„ ๋…ผ์˜ํ•  ์ˆ˜ ์žˆ๋‹ค.

  1. slotminer ํ”„๋กœ์ ํŠธ๋ฅผ ์˜๋ฆฌ ์‚ฌ์—…์— ํ™œ์šฉํ•˜๊ณ ์ž ํ•˜๋Š” ๊ฒฝ์šฐ
    • ์—ฐ๊ตฌ, ๋น„์˜๋ฆฌ ์‚ฌ์—…์—๋Š” ๋ฌด๋ฃŒ๋กœ ์‚ฌ์šฉ ๊ฐ€๋Šฅ(๋‹จ, ์œ„์˜ ๊ฐ ๊ธฐ๋Šฅ ๋ณ„๋กœ 1๊ฐœ ์ด์ƒ์˜ reference ๋ช…์‹œ)
  2. ํ–ฅ์ƒ๋œ ๋ฒ„์ „(์˜ˆ: ์‹œ๊ฐ„์ •๋ณด ์ถ”์ถœ ๊ทœ์น™ํŒŒ์ผ ๊ณต๊ฐœ๋ฒ„์ „๋ณด๋‹ค ํ–ฅ์ƒ๋œ ๋ฒ„์ „)์„ ํ•„์š”๋กœ ํ•˜๋Š” ๊ฒฝ์šฐ
    • ๋ณธํ”„๋กœ์ ํŠธ์—์„œ ์ œ๊ณต๋˜๋Š” ๊ธฐ๋Šฅ์€ ๋ˆ„๊ตฌ๋‚˜ ์ด์šฉ ๊ฐ€๋Šฅํ•˜์ง€๋งŒ, ์ฑ…์ž„์ž๊ฐ€ ์ง์ ‘ ๊ด€๋ฆฌํ•˜๋Š” ํ–ฅ์ƒ๋œ ๋ฒ„์ „์˜ ๊ทœ์น™ ํŒŒ์ผ์€ open ๋˜์–ด์žˆ์ง€ ์•Š์œผ๋ฉฐ, ์ด ํŒŒ์ผ์„ ์–ป๊ณ  ์‹ถ์€ ๊ฒฝ์šฐ