-
Notifications
You must be signed in to change notification settings - Fork 486
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
Fix bug that whether an Orchestrator object can extract entities or n… #5749
Fix bug that whether an Orchestrator object can extract entities or n… #5749
Conversation
…ot should not depend on a member variable ScoreEntities.
Pull Request Test Coverage Report for Build 255773
💛 - Coveralls |
@tsuwandy, the removed ScoreEntities flag is renamed IsEntityReady and placed in an OrchestratorDictionaryEntry and associated with a static Orchestrator object. If there is no need for the ScoreEntities flag, then we can remove that IsEntityReady flag and remove the whole OrchestratorDictionaryEntry abstraction as well. |
Seems like the current code and this fix are equivalent (?). The difference is the new code, you have available the Orchestrator more readily available in the Recognizer instance (but I don't see it being used). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello! Some of the general comments I added are me just catching up and asking questions about this codebase and not issues with this PR in particular. I did find 2 things that we should fix before merging as I was learning by reading it, which I wanted to call out:
1- We cannot remove public properties that shipped
2- We should minimize visibility of classes wherever possible. I'm not sure that OrchestratorDictionaryEntry needs to be protected, since as such we'd need to maintain backward compat until V5 at least
Happy to help with these, and we can chat about the other comments offline and not block this PR on them.
The easiest way to fix the 2 most blocking issues is 1) do not remove the public property, instead mark it obsolete with a reasonable explanation of what to do moving forward for developers and 2) make the new entry class private instead of protected
libraries/Microsoft.Bot.Builder.AI.Orchestrator/OrchestratorRecognizer.cs
Show resolved
Hide resolved
recognizerResult.Entities = new JObject(); | ||
} | ||
var results = _resolver.Score(text, LabelType.Entity); | ||
recognizerResult.Properties.Add(EntitiesProperty, results); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are visiting this codebase and adding some restructuring, it would be nice, if possible, to add some comments and explain what is the json format, what we are trying to extract, and other decisions that are not obvious in the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libraries/Microsoft.Bot.Builder.AI.Orchestrator/OrchestratorRecognizer.cs
Show resolved
Hide resolved
libraries/Microsoft.Bot.Builder.AI.Orchestrator/OrchestratorRecognizer.cs
Outdated
Show resolved
Hide resolved
libraries/Microsoft.Bot.Builder.AI.Orchestrator/OrchestratorRecognizer.cs
Show resolved
Hide resolved
libraries/Microsoft.Bot.Builder.AI.Orchestrator/OrchestratorRecognizer.cs
Outdated
Show resolved
Hide resolved
libraries/Microsoft.Bot.Builder.AI.Orchestrator/OrchestratorRecognizer.cs
Outdated
Show resolved
Hide resolved
libraries/Microsoft.Bot.Builder.AI.Orchestrator/OrchestratorRecognizer.cs
Show resolved
Hide resolved
libraries/Microsoft.Bot.Builder.AI.Orchestrator/OrchestratorRecognizer.cs
Outdated
Show resolved
Hide resolved
Hung-chih and I chatted. The Entry class is going away, and we're discussing the backward compat issue. The rest of the comments from pre-existing code can be addressed / analyzed outside of the scope of this PR. |
@carlosscastro, after consulting with @daveta, we decided to bring the DictionaryEntry class back, but make it a private class per your suggeston. |
libraries/Microsoft.Bot.Builder.AI.Orchestrator/OrchestratorRecognizer.cs
Outdated
Show resolved
Hide resolved
|
||
var orchestrator = orchestratorMap.GetOrAdd(fullModelFolder, path => | ||
_orchestrator = orchestratorMap.GetOrAdd(fullModelFolder, path => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the latency of this method on moderate sized models?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The latency for that is just seconds. Loading the models are quick even though they can be up to 1GB. The actual time consuming part is building the resolver consuming some big snapshot file. Perhaps that's the reason the InitializeModel() function is called once inside RecognizeAsync(), which is async.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the latency of the entire initializeModel?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Asking because 1) this will get run on the first turn and not when the app service starts. This means that the first turn of the first conversation will be really slow, i.e. as long as this method takes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we'd want to transfer this time to application load somehow in the future. We don't need to resolve this now, but it is importnat. I'll create an issue for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the iteration @hcyang !!!
…ot should not depend on a member variable ScoreEntities.
Fixes #5750
Description
Specific Changes
Testing