升级到我们的 Platinum 服务和获得自己的设计定制的3D头像
Bot Libre Dev

Use of state diagrams with self

通过 eavinash1983 发布 Mar 8 2017, 9:13

I understand that if you upload a self file using loadSelfFile or an aiml file using loadAimlFile it create a state diagram from that file.

So if there is a pattern matching a state in the aiml or self script it navigates to next step and on an on till it finds the correct pattern.

Once the pattern is found it responds with the template response.

Now if I correct the bot by setting the correction mode and learn mode true and provide the new response then the bot doesn't responds back with the new learnt response for the same pattern but still responds with the template response from AIML.

Is this the expected behaviour ?

In such condition how we can correct the bot.


by admin posted Mar 8 2017, 10:40
You can import AIML either as a script, or as a response list. When loaded as a script the AIML is converted to a set of states. When loaded as a response list, the AIML as added as responses, and the bot's language heuristic is used to match responses.

If you correct a bot's response, it should add your correction as a response to your original question. If you ask the exact question again, it should give this response.
The default matching order goes,
1 - exact question match
2 - scripts are run in order (states)
3 - heuristic is used to find the best match
4 - default response is used

If you have a "*" pattern in AIML, then #3 and #4 will never be used a the scripts will always return a response.

There are several property settings in the Language class that can be set to control this order. You can access the bot's Language instance from its mind's thoughts.

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 1477, today: 1, week: 3, month: 8

by eavinash1983 posted Mar 8 2017, 20:45

Which technique should ideally be used, loading AIML as script or as an response list?

Situations in which each of the techniques should be used ?


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 1589, today: 2, week: 9, month: 10

by admin posted Mar 9 2017, 12:12
For AIML that is mostly questions and responses, importing as a response list is better as it is more efficient and allows the usage of our heuristic matching.

For AIML that uses complex patterns, templates, and topics, then importing as a script is better.

There is also an option for both, it will index questions, and create states for patterns.

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 1709, today: 1, week: 2, month: 3

by eavinash1983 posted Mar 10 2017, 20:51

How does it helps when we index question ?

What is the configuration to achieve both the things as you mentioned in your answer ?

If we load as response list then does the pattern wildcards used in our AIML has no effect ?


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 1791, today: 3, week: 8, month: 9

by admin posted Mar 12 2017, 8:58
The method to load AIML is on the AIMLParser class,

>
public Vertex parseAIML(File file, boolean parseAsStateMachine, boolean createStates, boolean pin, boolean indexStatic, Vertex stateMachine, String encoding, Network network)

  • parseAsStateMachine - Determines if the states will be created, or the AIML will just be added as responses.
  • createStates - Determines if the nested states will be created, otherwise the patterns will just be load sequentially.
  • indexStatic - Determines if non pattern (* wildcards) will be added as responses.
Indexing the questions means the questions will be processed using our NLP heuristic, this allows for the bot to find the best matching response, and does not require the question match exactly. It is also more efficient as it does not need to create and process a big state machine.

If you load the AIML as responses (parseAsStateMachine=false), then patterns are still processed the same. For a pattern (* _ ^ wildcards etc) the response will only be used if the pattern matches. The patterns will be found using our NLP heuristic, which will still work the same as normal AIML except for some complicated recursive SRAI tags which may have subtle differences as the heuristic does not search for the pattern sequentially, but through words indexes.

Updated: Mar 12 2017, 9:00
Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 1759, today: 2, week: 3, month: 7

Id: 16352658
发布: Mar 8 2017, 9:13
答复: 5
的风景: 1785, 今天: 3, 周: 5, 一个月: 8
0 0 0.0/5