Language Studio Entity Heirarchy

Paul Bradley 20 Reputation points
2025-01-18T14:24:55.11+00:00

Hello everyone,

I am currently working on a project using Language Studio, and I am facing challenges with labelling nested entities and conditions. Specifically, I am trying to create a hierarchy where conditions can contain fields, values, and operators. However, the current labelling approach in Language Studio does not seem to support this hierarchy.

For example, when I label the condition (firstname is Kyle or email is kyle@example.com), the system labels the entire bracketed section as a condition and then separates the individual components, which results in mislabelling such as is being marked as a condition.

Here’s a more detailed breakdown of my issue:

Utterance:

Find customer where firstname is Alice and (county is Antrim or PostCode is BT28 1TT)  

Expected Labels:

  1. Action: Find customer
  2. Field: firstname
  3. Value: Alice
  4. Operator: and
  5. Condition: (county is Antrim or PostCode is BT28 1TT)

5.1) Field: county

5.2) Value: Antrim

5.3) Operator: or

5.4) Field: PostCode

5.5) Value: BT28 1TT

What actually happens is that the entire bracketed section is labelled as a condition, and the individual components are not correctly nested. This results in parts like is and parentheses being mislabelled as conditions.

Given this, it’s clear that the system isn’t handling nested entities as expected, leading to incorrect labelling.
Could anyone provide guidance or best practices for labelling nested entities and conditions in Language Studio. Is there a way to achieve the desired hierarchical structure, or are there any alternative approaches or tools that you recommend for handling complex conditions?

Any assistance or insights would be greatly appreciated.

Thank you!

Azure AI Language
Azure AI Language
An Azure service that provides natural language capabilities including sentiment analysis, entity extraction, and automated question answering.
440 questions
{count} votes

Accepted answer
  1. SriLakshmi C 2,325 Reputation points Microsoft Vendor
    2025-01-20T21:07:17.7166667+00:00

    Hello Paul Bradley,

    Greetings and Welcome to Microsoft Q&A! Thanks for posting the question.

    I understand that you're dealing with a complex scenario in Language Studio. Here are some best practices effectively label nested entities and conditions in Language Studio,

    • Breaking down complex conditions into components. Instead of treating an entire condition as a single entity, label each part individually, such as labeling county as the Field, is as the Operator, and Antrim as the Value. This approach ensures precise labeling of smaller units.
    • Leverage custom preprocessing to flatten the hierarchical structure before labeling. For instance, split (county is Antrim or PostCode is BT28 1TT) into smaller subconditions like county is Antrim and PostCode is BT28 1TT, enabling easier identification of fields, operators, and values.
    • Use hierarchical labeling strategies to differentiate levels of conditions, such as tagging top-level and nested conditions separately with labels like Condition_Level1 and Condition_Level2.
    • Adopt sequential labeling by training the model to recognize simpler entities like Field and Value first, and then progressively introducing more complex relationships such as nested conditions.

    Kindly refer this Label your utterances in Language Studio.

    I hope you understand. And, if you have any further query do let us know.

    Thank you!

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.