Ko TN: Add serial grammar and review fixes - #457
Conversation
…handling Signed-off-by: Jinwoo Bae <bbae7050@gmail.com>
for more information, see https://pre-commit.ci
Signed-off-by: Jinwoo Bae <bbae7050@gmail.com>
…move post_processing dependency Signed-off-by: Jinwoo Bae <bbae7050@gmail.com>
for more information, see https://pre-commit.ci
Signed-off-by: Jinwoo Bae <bbae7050@gmail.com>
for more information, see https://pre-commit.ci
Signed-off-by: Jinwoo Bae <bbae7050@gmail.com>
for more information, see https://pre-commit.ci
tbartley94
left a comment
There was a problem hiding this comment.
Serial appears more appropriate as part of the cardinal class no? What's the rationale for a standalone class?
| @@ -1,4 +1,4 @@ | |||
| # Copyright (c) 2026, NVIDIA CORPORATION. All rights reserved. | |||
| # Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. | |||
| """ | ||
|
|
||
| def __init__(self, deterministic: bool = True): | ||
| super().__init__(name="serial", kind="classify", deterministic=deterministic) |
There was a problem hiding this comment.
don't believe serial is sparrowhawk compliant no?
There was a problem hiding this comment.
from what i'm seeing is that this is just replacing a single korean character. couldn't you compress the three together for simplicity?
There was a problem hiding this comment.
I combined those three rules into a single one.
I made it standalone because the digit-by-digit reading is triggered by context such as 번호 or 연락처, while regular numbers should remain standard cardinal readings. I agree the numeric logic is closer to cardinal, though. Would you prefer that I move it into CardinalFst and remove the standalone class? |
Take a gander if it's feasible to just make it in Cardinals and work from there. If it's too messy then we can keep it. I'm just trying to limit semiotic spread |
Sounds good. I’ll see if I can integrate it into the cardinal class cleanly and push the update. If it gets too messy, I’ll let you know. |
Signed-off-by: Jinwoo Bae <bbae7050@gmail.com>
Signed-off-by: Jinwoo Bae <bbae7050@gmail.com>
for more information, see https://pre-commit.ci
Signed-off-by: Jinwoo Bae <bbae7050@gmail.com>
for more information, see https://pre-commit.ci
tbartley94
left a comment
There was a problem hiding this comment.
Minor formatting changes. GTG but please see question on serial weights
| # Require at least three digits. | ||
| serial_body = ( | ||
| serial_digit | ||
| + pynini.closure(serial_separator, 0, 1) |
There was a problem hiding this comment.
(serial_digit + pynini.closure(serial_separator, 0, 1) ** 2 . Cleaner. Don't need to add more lines to cardinal class.
Signed-off-by: Jinwoo Bae <bbae7050@gmail.com>
for more information, see https://pre-commit.ci
* Ko TN: Add serial grammar and review fixes (#457) * Add Korean TN post-processing rules for particle agreement and month handling Signed-off-by: Jinwoo Bae <bbae7050@gmail.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add Korean TN fraction test cases for particle agreement Signed-off-by: Jinwoo Bae <bbae7050@gmail.com> * Fix Korean fraction verbalization with particle-aware handling and remove post_processing dependency Signed-off-by: Jinwoo Bae <bbae7050@gmail.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix date and fraction normalization issues based on review feedback Signed-off-by: Jinwoo Bae <bbae7050@gmail.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add Korean TN serial and review fixes Signed-off-by: Jinwoo Bae <bbae7050@gmail.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Address Korean TN review feedback Signed-off-by: Jinwoo Bae <bbae7050@gmail.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Resolve Korean telephone conflict and remove serial references Signed-off-by: Jinwoo Bae <bbae7050@gmail.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Address serial and telephone review comments Signed-off-by: Jinwoo Bae <bbae7050@gmail.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: Jinwoo Bae <bbae7050@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * KO TN: Update Jenkins cache (#467) * Add Korean TN post-processing rules for particle agreement and month handling Signed-off-by: Jinwoo Bae <bbae7050@gmail.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add Korean TN fraction test cases for particle agreement Signed-off-by: Jinwoo Bae <bbae7050@gmail.com> * Fix Korean fraction verbalization with particle-aware handling and remove post_processing dependency Signed-off-by: Jinwoo Bae <bbae7050@gmail.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix date and fraction normalization issues based on review feedback Signed-off-by: Jinwoo Bae <bbae7050@gmail.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add Korean TN serial and review fixes Signed-off-by: Jinwoo Bae <bbae7050@gmail.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Address Korean TN review feedback Signed-off-by: Jinwoo Bae <bbae7050@gmail.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Resolve Korean telephone conflict and remove serial references Signed-off-by: Jinwoo Bae <bbae7050@gmail.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Address serial and telephone review comments Signed-off-by: Jinwoo Bae <bbae7050@gmail.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update Korean TN Jenkins cache Signed-off-by: Jinwoo Bae <bbae7050@gmail.com> --------- Signed-off-by: Jinwoo Bae <bbae7050@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --------- Signed-off-by: Jinwoo Bae <bbae7050@gmail.com> Signed-off-by: Mariana <47233618+mgrafu@users.noreply.github.com> Co-authored-by: Jinwoo Bae <bbae7050@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Mariana <47233618+mgrafu@users.noreply.github.com>
What does this PR do ?
Adds Korean TN serial grammar support for number-like strings with clear context signals such as 번호 and 연락처.
Before your PR is "Ready for review"
Pre checks:
git commit -sto sign.pytestor (if your machine does not have GPU)pytest --cpufrom the root folder (given you marked your test cases accordingly@pytest.mark.run_only_on('CPU')).bash tools/text_processing_deployment/export_grammars.sh --MODE=test ...pytestand Sparrowhawk here.__init__.pyfor every folder and subfolder, includingdatafolder which has .TSV files?Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.to all newly added Python files?Copyright 2015 and onwards Google, Inc.. See an example here.try import: ... except: ...) if not already done.PR Type:
If you haven't finished some of the above items you can still open "Draft" PR.