Skip to content

The ontology agent writes labels and definitions in the documents' language, since an empty ontology has none to follow - #1468

Open
Schro-code wants to merge 1 commit into
deeplethe:devfrom
Schro-code:fix/ontology-agent-language
Open

Schro-code wants to merge 1 commit into
deeplethe:devfrom
Schro-code:fix/ontology-agent-language

Conversation

@Schro-code

Copy link
Copy Markdown
Contributor

Why

Refs #1467. #1129 retired Suggest, and with it the only prompt that named a language for generated label/description. The 0061 agent asks for "the language of the ontology", and that fails in two cases:

Labels had no language rule at all. On one Spanish base, a single round left 183 class proposals, and about two thirds of them had English definitions.

What changes

One rule in the agent's system prompt (crates/utopia-extract/src/ontology_agent.rs): labels and definitions are written in the language of the documents, meaning the phrases, kind words and quotes the prompt already carries, even where the ontology or the instructions use another.

This is the rule question_agent.rs:53 already gives competency questions, which came out in Spanish on the same base. 0004 decision 3 says the description follows the corpus; this rule reads the corpus directly, so it holds for any language, including ones ontology_lang cannot store.

Not in this PR:

How it was checked

Before review

  • Every commit is signed off (git commit -s)
  • cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings and cargo test --workspace pass

…nguage, since an empty ontology has none to follow

Signed-off-by: Schro-code <78734653+Schro-code@users.noreply.github.com>

@WaylandYang WaylandYang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for finding this. 0004 decisions 3 and 5 make `kb.ontology_lang` the language of generated labels and descriptions, and the caller states it. The documents' language would ignore that setting on a base set to `zh` with English documents. Please take the alternative from #1467: pass the base's `ontology_lang` into the prompt, for labels and definitions, with keys staying ASCII. The stale `lang_name()` mention in 0004 decision 5 should be updated in the same PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants