Обновление Diamond и мы построим вам свой собственный приложение для Android или iOS
FAQ

How to define template responses?

по admin опубликовано Mar 21 2014, 14:10

A template response is one that contains code in addition to text. The code is defined in the Bot Libre Self scripting language.

You can add a template response from the "Training & Chat Logs" page. You can even use a template response in a correction or learning response.

User: Whom do you love?
Bot:Template("I love {#self.love}")

or,

User: What is the hour?
Bot:Template("The current hour is {Date.time().hour}")

You can also program more sophisticated responses from the Scripts page.

You can also import AIML from either the Chat Logs page, or the Scripts page.


by aazxcqwe posted Jan 19 2015, 15:16
Hello,
I like the idea of having multiple passes. I think there may be a more simple way to do this, and maybe the bot already does it. I think it may be possible to simply associate all words to each other (again, perhaps how the brain works). There may be some exceptions to this where logical consistency is required, "is" versus "is not" for example might need to replace or negate the other. Then again, our brains probably simply adjust the weightings of these associations, with their sources referenced, like you have set the Self script up to be able to do.

So, could you suggest a way to test whether an association of multiple words exists. I've been constructing a script that would pair-wise check if each neighboring set of words are associated, but using the Get operator with the #next relationship. Would this be the most efficient way to do this?

Btw, one more request to set a default bot. (Still having to reselect bot through selecting several links pretty frequently.)
Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 1318, today: 1, week: 2, month: 9

by admin posted Jan 19 2015, 19:39
You can add any relationship between words that you wish. The system will define the #next and #previous relationships for words that appear together in sentences. Also a word can be an #instantiation of a #compound-word or have a #compound-word relationship for things like names "Barack Obama" and compound adjectives "very tall".

Not exactly sure what the end result you want is? I think Self is missing some operators though for more in depth queries, such as maybe "get relationship from :source to :target" (return how the objects are related, or "get relationship depth from :source to :target max :max" (find if/how deep the two objects are related), "all relationships from :source" (iterate over all relationships) "count relationships from :source of type :type" (return count of relationships).

I will add these to our todo list, if you can think of others, please reply to this thread.

For the default bot, do you mean from the web interface, or the Android interface? For the web interface you can click on browse, then "My Bots". Android also saves the last bot accessed in browse. You can also bookmark a bot by its id url in the web interface.

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 1348, today: 0, week: 0, month: 5

Идентификатор: 16008
Теги: aiml, programming, scripting, templates
Опубликовано: Mar 21 2014, 14:10
Обновлено: Feb 23 2016, 14:53
Ответы: 2
Вид: 2044, сегодня: 83, неделю: 224, месяц: 551
Я уверен, что
Вывесить флаг как оскорбительное, или в нарушение правил сайта