Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translations: Bugfix, drop columns, new defaults #1019

Merged
merged 5 commits into from
Mar 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion odk/odk.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,12 @@ class BabelonTranslationProduct(Product):
include_not_translated: str = "false"
"""if include_not_translated is 'false' NOT_TRANSLATED values are removed during preprocessing."""

update_translation_status: str = "false"
update_translation_status: str = "true"
matentzn marked this conversation as resolved.
Show resolved Hide resolved
"""if update_translation_status is 'true', translations where the source_value has changed are relegated to CANDIDATE status."""

drop_unknown_columns: str = "true"
matentzn marked this conversation as resolved.
Show resolved Hide resolved
"""if drop_unknown_columns is 'true' columns that are not part of the babelon standard are removed during preprocessing."""

auto_translate: bool = False
"""if auto_translate is true, missing values are being translated using the babelon toolkit during preprocessing. By default, the toolkit employs LLM-mediated translations using the OpenAI API. This default may change at any time."""

Expand Down
3 changes: 2 additions & 1 deletion template/src/ontology/Makefile.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,7 @@ $(TRANSLATIONSDIR)/{{ translation.id }}-preprocessed.babelon.tsv: $(TRANSLATIONS
--output-not-translated $(TRANSLATIONSDIR)/{{ translation.id }}-not-translated.babelon.tsv \
--include-not-translated {{ translation.include_not_translated|default('false') }} \
--update-translation-status {{ translation.update_translation_status|default('true') }} \
--drop-unknown-columns {{ translation.drop_unknown_columns|default('true') }} \
matentzn marked this conversation as resolved.
Show resolved Hide resolved
-o $@{% if translation.auto_translate %}
echo "Warning: By default, the toolkit employs LLM-mediated translations using the OpenAI API. This default may change at any time"
echo "Warning: Never store API keys or other secrets in Makefiles or scripts you have in version control."
Expand All @@ -983,7 +984,7 @@ $(TRANSLATIONSDIR)/%.synonyms.owl: $(TRANSLATIONSDIR)/%.synonyms.tsv
.PRECIOUS: $(TRANSLATIONSDIR)/%.synonyms.owl

$(TRANSLATIONSDIR)/%.babelon.owl: $(TRANSLATIONSDIR)/%-preprocessed.babelon.tsv
$(BABELONPY) convert $(TMPDIR)/$*.babelon.tsv --output-format owl -o [email protected]
$(BABELONPY) convert $< --output-format owl -o [email protected]
$(ROBOT) merge -i [email protected] \
annotate \
--ontology-iri $(ONTBASE)/translations/$*.babelon.owl \
Expand Down
Loading