Conversation
Signed-off-by: Jim O'Regan <joregan@kth.se>
Signed-off-by: Jim O'Regan <joregan@kth.se>
Signed-off-by: Jim O'Regan <joregan@kth.se> Signed-off-by: "Christina Tånnander" <christina.tannander@mtm.se>
Signed-off-by: Jim O'Regan <joregan@kth.se>
for more information, see https://pre-commit.ci
Signed-off-by: Jim O'Regan <joregan@kth.se>
Signed-off-by: Jim O'Regan <joregan@kth.se>
for more information, see https://pre-commit.ci
Signed-off-by: Jim O'Regan <joregan@kth.se>
…ssing into swedish-updates Signed-off-by: Jim O'Regan <joregan@kth.se>
e4f7d5a to
bc1c02c
Compare
|
This PR is stale because it has been open for 14 days with no activity. Remove stale label or comment or update or this will be closed in 7 days. |
Signed-off-by: Jim O'Regan <joregan@kth.se>
Signed-off-by: Jim O'Regan <joregan@kth.se>
|
@jimregan Thanks for the contributions. Will be reviewing over next week, just sourcing language speakers to evaluate the test cases (you'll see additional reviewer beyond myself, they'll be going over the test cases). |
There was a problem hiding this comment.
The spoken expansion looks correct. Can we also cover the standard spelling e.Kr. (capital K and final period) if it isn't tested already?
| ~kl. 3 | ||
| klockan tre | ||
| klass tre | ||
| ~3 kl. |
There was a problem hiding this comment.
It may be worth considering an extra test case here. "3:e kl." is commonly used similarly to 3 kl.
| cwt centner | ||
| da atommassenhet | ||
| db decibel | ||
| dba decibel |
There was a problem hiding this comment.
Is dropping "A-vägd" for the trailing "a" intentional?
There was a problem hiding this comment.
It was inherited from Sardin (the open source version of MTM's normalisation system), fixed now
j-l-thorsson
left a comment
There was a problem hiding this comment.
Reviewed the Swedish test cases for language correctness, with TTS in mind. Left a few comments on written conventions and additional examples.
Signed-off-by: Jim O'Regan <joregan@kth.se>
|
@jimregan doing technical review aspect, please let me know if any conflict with ongoing language changes. |
tbartley94
left a comment
There was a problem hiding this comment.
Stylistic changes and implementation discussion. Need use of aliases instead of relying on f-string formatting in order to aid maintenance.
| @@ -11,8 +11,8 @@ mån måndag | |||
| mån månad | |||
| ons ons | |||
| ons onsdag | |||
| AB AB | |||
There was a problem hiding this comment.
why wouldn't this be in abbreviations alternatives?
also can include the upper case variations.
| @@ -22,4 +22,3 @@ | |||
| Χ chi | |||
There was a problem hiding this comment.
Honestly would just generate the unicode codepoints instead of adding file churn. Ditto for lower.
There was a problem hiding this comment.
It's mapping the characters to the Swedish version of their names. I don't see how generating unicode codepoints can achieve that.
| @@ -9,6 +9,9 @@ celsiusgrad celsiusgrader | |||
| centimeter | |||
There was a problem hiding this comment.
sanity confirm: aware this transforms everything in the file to an fst mapping?
| ₧ peseta | ||
| ptas peseta | ||
| usd amerikansk dollar | ||
| us$ amerikansk dollar |
There was a problem hiding this comment.
hmm, swedes add spacing at all after the currency or firmly non-delineated?
| optional_minus_graph = pynini.closure(pynutil.insert("negative: ") + pynini.cross("-", "\"true\" "), 0, 1) | ||
|
|
||
| final_graph = optional_minus_graph + pynutil.insert("integer: \"") + self.graph + pynutil.insert("\"") | ||
| reference_graph = pynini.Fst() |
There was a problem hiding this comment.
rationale for building an empty fst? backend autocasts
|
|
||
| graph_unit = pynini.string_file(get_abs_path("data/measure/unit.tsv")) | ||
| graph_unit_optional_dot = pynini.string_file(get_abs_path("data/measure/unit_optional_dot.tsv")) | ||
| graph_unit |= graph_unit_optional_dot + pynini.closure(pynutil.delete("."), 0, 1) |
There was a problem hiding this comment.
wouldn't this just be two instances of the optional dot?
There was a problem hiding this comment.
I've renamed that to 'graph_optionally_dotted_units'
| final_graph = (graph_integer_only + optional_delete_fractional_zeros) | graph_decimal | ||
|
|
||
| currency_quantity = pynini.string_file(get_abs_path("data/money/currency_quantity.tsv")) | ||
| amount = pynini.closure(NEMO_DIGIT | pynini.union(",", ".", "-", " "), 1) |
There was a problem hiding this comment.
I'd just alias the strings as "PUNCTUATION" and NEMO_SPACE in the graph_utils. Avoids editing errors.
| self.bare_ordinals = cleaned_graph | ||
| kapitlet_word = pynini.union("kapitlet", pynini.cross("kap", "kapitlet")) | ||
| kapitlet = cleaned_graph + NEMO_SPACE + kapitlet_word | ||
| reference_graph = pynini.Fst() |
There was a problem hiding this comment.
curious about the reference_graph decision
| optional_dot = pynini.closure(pynutil.delete("."), 0, 1) if written.isalpha() else pynini.accep("") | ||
| unit = pynutil.delete(written) + optional_dot | ||
| reference = reference_number + delete_space + unit | ||
| reference_graph |= reference + pynutil.insert(f" {definite}") |
There was a problem hiding this comment.
NEMO_SPACE with definite would be cleaner
Signed-off-by: Jim O'Regan <joregan@kth.se>
Signed-off-by: Jim O'Regan <joregan@kth.se>
Signed-off-by: Jim O'Regan <joregan@kth.se>
Signed-off-by: Jim O'Regan <joregan@kth.se>
…ssing into swedish-updates Signed-off-by: Jim O'Regan <joregan@kth.se>
Signed-off-by: Jim O'Regan <joregan@kth.se>
Signed-off-by: Jim O'Regan <joregan@kth.se>
Signed-off-by: Jim O'Regan <joregan@kth.se>
Signed-off-by: Jim O'Regan <joregan@kth.se>
What does this PR do ?
Add a one line overview of what this PR aims to accomplish.
This incorporates additional items imported from Sardin, the open source version of the internal phonetisation system from MTM (Myndigheten för tillgängliga medier/Swedish Agency for Accessible Media)
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.