| # Priority ํ์ฒ๋ฆฌ ๊ท์น | |
| ๋ชจ๋ธ์ ์์ ์ ์์ ํค์๋ ๊ธฐ๋ฐ ๊ท์น์ ์ ์ฉํ์ฌ ์ฐ์ ์์๋ฅผ ์กฐ์ ํ๋ ํ์ฒ๋ฆฌ ์์คํ ์ ๋๋ค. | |
| ## ๊ฐ์ | |
| ์ด ๋ชจ๋ธ์ ํ๊ท ๋ชจ๋ธ๋ก ์ ์๋ฅผ ์์ธกํ์ง๋ง, ์ค์ ์ฌ์ฉ ์์๋ ๋ค์๊ณผ ๊ฐ์ ํ์ฒ๋ฆฌ ๊ท์น์ ์ ์ฉํ๋ ๊ฒ์ ๊ถ์ฅํฉ๋๋ค: | |
| 1. **ํค์๋ ๊ธฐ๋ฐ ๊ท์น ์ ์ฉ**: ํน์ ํค์๋์ ๋ฐ๋ผ ์ฐ์ ์์๋ฅผ ๊ฐ์ ์กฐ์ | |
| 2. **๋ฐฐ์น ๋ด ์๋ ์ ๊ทํ**: ์ฌ๋ฌ ์ด์๋ฅผ ํจ๊ป ๋น๊ตํ ๋ ๋ฐฐ์น ๋ด์์ ์ ๊ทํ | |
| 3. **์๋์ ๋ถ๋ฅ**: ๋ฐฐ์น ๋ด ์์/ํ์ ํผ์ผํ์ผ ๊ธฐ์ค์ผ๋ก HIGH/MED/LOW ๋ถ๋ฅ | |
| ## ๊ท์น ์ข ๋ฅ | |
| ### 1. LOW ๊ฐ์ ํค์๋ | |
| `low_forced_keywords`์ ํฌํจ๋ ํค์๋๊ฐ ์์ผ๋ฉด ๋ฌด์กฐ๊ฑด LOW ์ฐ์ ์์๋ก ๋ถ๋ฅ๋ฉ๋๋ค. | |
| ์์: | |
| - "README ์คํ ์์ " โ LOW | |
| - "๋ฌธ์ ์ ๋ฐ์ดํธ" โ LOW | |
| - "typo fix" โ LOW | |
| ### 2. ์ต์ MED ๋ณด์ฅ ํค์๋ | |
| `min_med_keywords`์ ํฌํจ๋ ํค์๋๊ฐ ์์ผ๋ฉด ์ต์ํ MED ์ด์์ ์ฐ์ ์์๋ฅผ ๋ณด์ฅํฉ๋๋ค. | |
| ์์: | |
| - "๋ก๊ทธ์ธ ์๋ฌ ๋ฐ์" โ ์ต์ MED | |
| - "์๋ฒ ๋ค์ด ๋ฌธ์ " โ ์ต์ MED | |
| - "๊ฒฐ์ ์ค๋ฅ" โ ์ต์ MED | |
| ### 3. HIGH ๋ถ์คํธ ํค์๋ | |
| `high_boost_keywords`์ ํฌํจ๋ ํค์๋๊ฐ ์์ผ๋ฉด HIGH ์ฐ์ ์์๋ก ๋ถ์คํธ๋ฉ๋๋ค. | |
| ์์: | |
| - "๋ฐ์ดํฐ ์์ค ๋ฐ์" โ HIGH | |
| - "๋ฌดํ ๋ฃจํ ์ฌ๋ฐ" โ HIGH | |
| - "critical security issue" โ HIGH | |
| ## ์ฌ์ฉ๋ฒ | |
| ### Python ์์ | |
| ```python | |
| import yaml | |
| import json | |
| # ๊ท์น ๋ก๋ | |
| with open("postprocess/priority_rules.yaml", "r", encoding="utf-8") as f: | |
| rules = yaml.safe_load(f) | |
| # ์ด์ ํ ์คํธ | |
| issue_text = "๋ก๊ทธ์ธ ์๋ฌ ๋ฐ์, ์ฌ์ฉ์ ์ ๊ทผ ๋ถ๊ฐ" | |
| # ํค์๋ ์ฒดํฌ | |
| text_lower = issue_text.lower() | |
| # LOW ๊ฐ์ ์ฒดํฌ | |
| if any(kw in text_lower for kw in rules["low_forced_keywords"]): | |
| priority = "LOW" | |
| elif any(kw in text_lower for kw in rules["high_boost_keywords"]): | |
| priority = "HIGH" | |
| elif any(kw in text_lower for kw in rules["min_med_keywords"]): | |
| # ๋ชจ๋ธ ์ ์๊ฐ ๋ฎ์๋ ์ต์ MED ๋ณด์ฅ | |
| priority = max(model_priority, "MED") | |
| else: | |
| priority = model_priority # ๋ชจ๋ธ ์์ธก ๊ทธ๋๋ก ์ฌ์ฉ | |
| ``` | |
| ### ๋ฐฐ์น ์ฒ๋ฆฌ ์์ | |
| ```python | |
| import numpy as np | |
| from scipy.stats import rankdata | |
| def apply_postprocessing(issues, scores, rules): | |
| """ | |
| ๋ฐฐ์น ๋ด์์ ํ์ฒ๋ฆฌ ๊ท์น ์ ์ฉ | |
| """ | |
| # 1. ํค์๋ ๊ธฐ๋ฐ ๊ท์น ์ ์ฉ | |
| adjusted_scores = apply_keyword_rules(issues, scores, rules) | |
| # 2. ์ ๊ทํ (quantile) | |
| if rules["normalize_method"] == "quantile": | |
| normalized_scores = rankdata(adjusted_scores, method='average') / len(adjusted_scores) | |
| else: | |
| normalized_scores = adjusted_scores | |
| # 3. ์๋์ ๋ถ๋ฅ | |
| q_high = np.percentile(normalized_scores, rules["high_percentile"] * 100) | |
| q_low = np.percentile(normalized_scores, rules["low_percentile"] * 100) | |
| priorities = [] | |
| for score in normalized_scores: | |
| if score >= q_high: | |
| priorities.append("HIGH") | |
| elif score <= q_low: | |
| priorities.append("LOW") | |
| else: | |
| priorities.append("MED") | |
| return priorities, normalized_scores | |
| ``` | |
| ## ๊ท์น ์ปค์คํฐ๋ง์ด์ง | |
| `priority_rules.yaml` ํ์ผ์ ์์ ํ์ฌ ํ๋ก์ ํธ์ ๋ง๋ ํค์๋๋ฅผ ์ถ๊ฐ/์ ๊ฑฐํ ์ ์์ต๋๋ค. | |
| ์์: | |
| ```yaml | |
| # ํ๋ก์ ํธ ํนํ ํค์๋ ์ถ๊ฐ | |
| min_med_keywords: | |
| - ์ฐ๋ฆฌํ์ฌํนํํค์๋ | |
| - critical-path | |
| - production-issue | |
| ``` | |
| ## ์ฃผ์์ฌํญ | |
| - ํค์๋ ๋งค์นญ์ ๋์๋ฌธ์๋ฅผ ๊ตฌ๋ถํ์ง ์์ต๋๋ค (์๋ฌธ์๋ก ๋ณํ ํ ๋น๊ต) | |
| - LOW ๊ฐ์ ํค์๋๊ฐ ์ต์ฐ์ ์ผ๋ก ์ ์ฉ๋ฉ๋๋ค | |
| - HIGH ๋ถ์คํธ ํค์๋๊ฐ ์์ผ๋ฉด ์๋์ผ๋ก ์ต์ MED๋ ๋ณด์ฅ๋ฉ๋๋ค | |
| - ๋ฐฐ์น ๋ด ์ ๊ทํ๋ ์ฌ๋ฌ ์ด์๋ฅผ ํจ๊ป ๋น๊ตํ ๋๋ง ์๋ฏธ๊ฐ ์์ต๋๋ค | |