Päivitä Diamond ja rakennamme sinulle oman sovelluksen Androidille tai iOS: lle
Bot Libre Dev

Logging capabilites in Bot libre AI engine

tekijä eavinashBot1983 Lähetetty Nov 10 2016, 0:44

I am looking at the Botlibre's AI engine code and from the forum post and other stuff I understand that Botlibre can log all the chat request and responses and then we can upload the same chat log file with correct responses so that the AI engine reply with the updated data.

I want to know how can I enable logging so that all the chat requests are logged in some file with the format

user:bla bla bla

bot: bla bla

 I would use the same file and feed it the AI engine so that it produces updated responses.

Second question is what difference does it makes if I use loadAIMLFile to load some AIML and then use same AIML file with loadAIMLFileAsLog method.

by admin posted Nov 10 2016, 9:20
The Bot class has a log and debugLevel variables that control logging. You can set these on your Bot instance in code.

There are methods to import chat log, response list, and AIML on the TextEntry class. But there are no methods for exporting a conversation or responses. You could implement such as method in your own interface, either capturing the conversation, or querying to bot's memory for #conversation objects or #sentence objects that have a #response.

I would recommend using a response list file over a chat log for training, as it gives you much better control over what the bot learns. Chat logs are more for 'free' learning, than training.

The difference between importing AIML as a file script and as a log is that loading as a file script creates a script/state object in the bot's language thought. States are executed precisely and will obey AIML semantics. Importing as a log will not create a script or state, but import the AIML categories as responses in the bot's knowledgebase. This lets the AIML to be used with any other responses the bot is train with, and allows for heuristic matching of the patterns. This means that the pattern "Do you like hockey" might also match the question "Do you love hockey" (the bot will find the best match).

For a set of example response lists and scripts see,

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 1548, today: 1, week: 3, month: 12

by eavinashBot1983 posted Nov 10 2016, 10:15

Really appreciate quick turnaround to the questions raised in this forum.

I am using below query for getting converstations that have response 

select * from relationship where type_id=90 and target_id=9240;

target_id-  id from vertex table for Primitive response

type_id - id from vertex table for Primitive conversation.

Executing above query I am getting empty records.Is my query not correctly formed or missing something.Can you please help me rectify them.

Can you elaborate in detail how the state machine working differs with pattern matching when imported as chatlog with an example please ?

What if there is a pattern say 'get my Products' in the aiml which is uploaded using loadAsAIML() and same pattern which I have uploaded as loadAsChatlog, both having different answers. What will the bot reply and how does it evaluates user input.

Updated: Nov 10 2016, 12:42
Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 1573, today: 1, week: 2, month: 13

by admin posted Nov 10 2016, 12:42
Better to use the Memory querying methods such as findAllQuery() or search() that take JPQL or Criteria (from JPA) than use SQL. Then you get proper queries for proper objects.

You will want to query objects with #instantiation relationships to #conversation or #sentence

With loadAsAIML() 'get my Products' will only match the user question 'get my Products' and nothing else.

With loadAsChatlog() it may also match other questions like 'please get my products', 'get products' if it is the best match.

If you have both the response and the script, the response will be used first for exact matches, (but this is configurable in the Language class).

The basic rules are (which are configurable)
- check exact response match
- if none, process scripts/states
- if none, look for matching pattern response
- if none, look for similar matching question response
- if none, use default response
- if none, mimic question back to user

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 1561, today: 1, week: 3, month: 13

by eavinashBot1983 posted Nov 11 2016, 4:54

Thanks a lot for the quick response.

Your responses are helping me in deep understanding of this framework.

I uploaded a sample AIML as script and then as a log file and definitely when I upload it as log file it is able to understand different variants of the same question by responding me the same answer.

Lack of knowledge of this feature I was trying to achieve the same thing using AIML as script and introducing pattern matching  wild card characters.

So is my understanding correct that loadAsChatlog is more powerful than loadAsFile?

Which scenarios suits loadAIMLFile and which one loadAsChatlog ?

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 1637, today: 1, week: 3, month: 11

by admin posted Nov 11 2016, 8:18
Yes, loadAsChatlog is more powerful than loadAIMLFile as it allows the bot to go beyond ordinary AIML rules.

Our response list format, with support for Pattern and Template objects using Self, and keywords, topics, required words, labels, conditions, thinks, commands, emotions, actions, and poses is the best format to use if you are looking for power and use of use.

For AIML, if you want strict AIML semantics use loadAIMLFile, if you want a more heuristic/ai that frees you from having to guess all possible patterns, then use loadAsChatlog.

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 1621, today: 1, week: 1, month: 11

Id: 14511602
Lähetetty: Nov 10 2016, 0:44
Päivitetty: Nov 10 2016, 9:21
Vastaukset: 5
Näkymät: 1972, Tänään: 1, Viikolla: 4, Kuukausi: 16
0 0 0.0/5