Conversation
|
Please attach with root cause analysis and the explanation of the fix |
|
Root cause: entitySection(and newEntitySection) are child rules of both paragraph and simpleIntentSection, and simpleIntentSection is child rule of paragraph, that means each entitySection following an intent will first be identified as entitySection in paragraph and then look back to search bigger scope to match simpleIntentSection. When there are a large number of entities, this knid of back search will be very expensive. Why this fix works: To fix this, we can remove entitySection(and newEntitySection) from either paragraph or simpleIntentSection to avoid this kind of back search. We choose removing it from paragraph. But to keep our logic that entitySection can be standalone, we optimize the simpleIntentSection rule to make it able to match standalone entitySection. Below simpleIntentSection rule will match standalone intent, standalone entity, intent with entities. And then we adjusted the code in luParser.js to consume the new standalone entity context. This fix solve our issue and reduce the paring time signally. |
|
@vishwacsena @munozemilio I merged this minor fix of parser rules, please let me know if you have concerns. |
fix issue #676. Before the fix, the lu parser takes unreasonable time to parse lu content with a large number of entity definitions under an intent. e.g. 100 entities will cost 4000+ milliseconds. After the fix, it takes 200-300 milliseconds.