chore: 2차년도 성능평가 측정 구성 초기 업로드
data(train 520·holdout 120), server(발화 생성 서버), eval(grounding_eval), run_eval.py·run_test.sh. logs/ 는 실행 때마다 생기는 기록이라 README.md 만 올리고 나머지는 .gitignore 로 뺀다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
13ab9dee84
70 files changed
+17141
No files matched your search
@@ -0,0 +1,43 @@
|
||||
import pytest
|
||||
|
||||
from grounding_eval.tokenize import normalize, tokenize
|
||||
|
||||
|
||||
@pytest.mark.parametrize("text, expected", [
|
||||
("4,900원을 제안드립니다", "4900원을 제안드립니다"),
|
||||
("1,234,567원", "1234567원"),
|
||||
(" 연간 400개 ", "연간 400개"),
|
||||
("3,5%", "3,5%"), # 천 단위가 아닌 쉼표는 그대로
|
||||
(None, ""),
|
||||
])
|
||||
def test_normalize(text, expected):
|
||||
assert normalize(text) == expected
|
||||
|
||||
|
||||
def test_kiwi_tokens_are_morphemes_without_punctuation():
|
||||
tokens = tokenize("연간 400개 거래를 감안해 4,900원을 제안드립니다.")
|
||||
|
||||
assert tokens[:4] == ["연간", "400", "개", "거래"]
|
||||
assert "4900" in tokens
|
||||
assert "." not in tokens
|
||||
|
||||
|
||||
def test_kiwi_keeps_punctuation_when_asked():
|
||||
assert "." in tokenize("제안드립니다.", drop_punct=False)
|
||||
|
||||
|
||||
def test_number_formats_tokenize_the_same():
|
||||
assert tokenize("4,900원") == tokenize("4900원")
|
||||
|
||||
|
||||
def test_eojeol_tokens():
|
||||
assert tokenize("4,900원을 제안드립니다.", method="eojeol") == ["4900원을", "제안드립니다"]
|
||||
|
||||
|
||||
def test_empty_text():
|
||||
assert tokenize(" ") == []
|
||||
|
||||
|
||||
def test_unknown_tokenizer_raises():
|
||||
with pytest.raises(ValueError):
|
||||
tokenize("가", method="mecab")
|
||||
Reference in new issue
Block a user