question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Restrict the scope of a synonym to a specific entity

See original GitHub issue

Description of Problem:

When a word’s synonyms are defined in the NLU training data, any occurrence of the synonyms are replaced by that word with no regard to what entity it has been recognized as. Essentially, two words that are synonyms in the context of one entity need not necessarily be synonyms in the context of another entity. This can especially be a problem when the volume of NLU training data is large and such conflicts are not easily visible.

Overview of the Solution:

There are currently two ways to define synonyms.

<!-- First -->
## intent:mention_expertise
- [machine learning](expertise:ML)

<!-- Second -->
## intent:mention_expertise
- machine learning

## synonym:ML
- machine learning

While defining synonyms using the first syntax, the current behavior is completely unintuitive since there’s nothing to indicate that it might apply outside the entity to which it has been attached to. With the second syntax, however, the global nature of synonym-mapping is more obvious.

Proposed solution 1: If syntax 1 is used, perform synonym mapping just for that entity. If syntax 2 is used, perform global synonym mapping.

Proposed solution 2: Another alternative could be to list the synonyms to use under an entity in the domain file.

Examples:

Example 1:

## intent:inform
- My name is [Indiana](fname) Jones
- I am from [Indiana](state:IN)
- i come from [indiana](state:IN)
- The name's Jones. [Indiana](fname) Jones.
- My state is [IN](state)

With the above snippet in the training data, if you type in "My name is Indiana Jones", the slot value for fname would be set to "IN".

Example 2:

## intent:find_a_professional
- find a [doctor](professional) for me
- get me a [doctor](professional)
- pls find me a [dr](professional:doctor)

## intent:inform_salutation
- [Mrs](salutation)
- Preferred one is [Dr](salutation)
- Use [Mr](salutation)

Similarly, there’ll be an unintended replacement of “Dr” in the second case.

Blockers (if relevant): Might be a breaking change for cases where syntax 1 is deliberately used for global definitions of synonyms.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
kormoczicommented, Mar 17, 2022

I would like to re-open this issue, because I think this is still a problem (at least I do not know how to solve it). Is there any solution for / progress on this issue?

1reaction
TyDunncommented, Oct 22, 2019

@wochinge I think we have leave it as unplanned for now until we get some more feedback on this problem

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is it possible to limit the scope of a SYNONYM in SQL Server?
I have a series of scheduled stored procedures that need to be run against different databases that have identical schemas (think multiple ...
Read more >
41 Synonyms & Antonyms for ENTITY - Thesaurus.com
Find 41 ways to say ENTITY, along with antonyms, related words, and example sentences at Thesaurus.com, the world's most trusted free thesaurus.
Read more >
using statement - C# Reference | Microsoft Learn
The using statement causes the object itself to go out of scope as soon as Dispose is called. Within the using block, the...
Read more >
Scope (computer science) - Wikipedia
Scope helps prevent name collisions by allowing the same name to refer to different objects – as long as the names have separate...
Read more >
124 Synonyms & Antonyms of ELEMENT - Merriam-Webster
The words ingredient and element can be used in similar contexts, but ingredient applies to any of the substances which when combined form...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found