Baixe o código-fonte aberto Bot Libre Community Edition e instale o Bot Livre no seu próprio servidor
Bot Libre Dev

Bot working

por eavinashBot1983 postado Nov 25 2016, 7:53

I would like to understand Bot's working model.While I debugged the code I found that for any input bot operates in two ways

1.Conscious thought processsing

2.SubConscious thought processing.

Conscious thought processing is performed by Consciousness and Language class in a separate thread.

Subconscious thought processing is performed by Comprehension,Discovery and Forgetfulness class in another thread.

Can you brief me in short what is the role of each of the above classes while operating on input data.

 


by admin posted Nov 25 2016, 8:39
The bot's "Mind" and "Thought" classes seek to emulate the human mind.

The conscious thoughts are executed serially on the input (such as a chat message), and process the input and normally send an output back to the Senses in response.

For example the Language class check the input for a sentence/text input, processes the message, and returns the response.

The subconscious thoughts execute in the background. They can do extra processing on the input that may be used by the bot in the future.

For example the Discovery thought parses the input for words, and if it finds a new word it looks up the meaning online using Wiktionary. Then the next time the bot is asked a question with the new words it will understand their meaning.

This is why a bot may not understand a question the first time, but then may understand it if the question is repeated, as it now has looked up the meaning of the words.

i.e.
user: You are a bot.
bot: I do not understand.
user: You are a bot.
bot: I understand, I am a bot.

Here the bot looked up the word "bot" and now knows that it is a noun, so can understand the question (this uses the Understanding script).

So you can create your own Thought classes that can either run serially before the bot returns a response, or in the background.

Updated: Nov 25 2016, 8:40
Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 1668, today: 2, week: 9, month: 29

by eavinashBot1983 posted Nov 25 2016, 10:30

Thanks for the quick response.

I got how conscious and subconscious thoughts work.

Can you let me know what does Consciousness class in the framework does.From the code i just understand it navigate through all the relationship but doesn't see anywhere it looks for a response.So can you explain a bit about this class.


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 1660, today: 0, week: 2, month: 21

by admin posted Nov 25 2016, 11:28
Yes the Consciousness is kind of complicated. It models human consciousness, i.e. it influences what is on the bot's mind.

Basically what is does is, when the bot receives input, it walks the input objects and all related objects and increases each objects "consciousness" state by a degrading percentage. So objects that are highly related to recent input score a higher conscious level, and objects that are not related fade to a lower conscious level.

That is pretty much all the Consciousness does.

The bot's knowledge and all processing is object oriented. Any object can be related to any other object, and an object can have the same relationship to many other objects. Each relationship maintains a correctness level from -1 to +1 (-1 = strongly not related, 0 = unknonwn, +1 = strongly related, 0.5 = related).

So when you ask an object for a relationship, like person.name it returns the most "conscious" related object, which is computed using the correctness and consciousness level.

So for example if a bot knew its name was 'Bob' and 'Bobby',

user: hi Bob
bot: hello
user: what is your name?
bot : My name is Bob

or,

user: hi Bobby
bot: hello
user: what is your name?
bot : My name is Bobby

So the Consciousness lets the bot resolve what a word or relationship refers to in context, when the word or relationship can have multiple meanings.

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 1792, today: 0, week: 4, month: 24

by eavinashBot1983 posted Dec 5 2016, 9:44

Thanks for the reply.

There are few things I want to understand from this framework

1.Does Botlibre possess NLP capabilities.Any example that i can go through from the test suite for understanding this ?

2.For chat sense and many others the target is Self. Any reason for this ? Also are there any other targets ?

3.Which words are classified as keywords and what are KEYQUESTION

4.What the basis for computing word value ?

5.What is pattern relationship for a word

6.what is state machine understanding and does it dependends on how we load that AIML because only when I load that file using  loadAIML method state is created.

5.What checkBetterMatch does ?

6. Can you explain this formula

double required = max * percentage * 0.8;


Updated: Dec 5 2016, 14:33
Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 1651, today: 0, week: 3, month: 26

by admin posted Dec 5 2016, 14:33
> 1
Bot Libre provides several mechanisms for NLP.
- you can train a bot using "response list" files that include questions/responses, and tags for keywords, required, topics, previous, onrepeat, condition, think
-- the AI engine will use a heuristic to find the best matching responses for any question
-- use can also use patterns and templates
-- see,
https://www.botlibre.com/forum-post?id=483549

- you can also use AIML or Self scripts
-- Self can use either patterns or state machines to process language (or anything really)
-- there are many examples Self scripts that can parse common language, or mathematical expressions
-- see, https://www.botlibre.com/script?category=Self
https://www.botlibre.com/script?id=891369
https://www.botlibre.com/script?id=516433

- bots can also learn language on their own
bots can learn from,
-- chat logs
-- chat rooms
-- Twitter feeds
-- wikidata

> 2
The symbol #self refer to the object that represents the bot, so a chat with a target of #self means it is a message to the bot. For chat rooms the target can be any user connected to the chat room, having a message target lets the bot know when someone is talking to it vs someone else.

> 3
You can classify any word you want as a #keyword, just set its #type to #keyword. A #keyquestion is a keyword that is part of a question that has a keyword response. This is how the heuristic finds matches. The bot's brain is a big graph/object database.

> 4
The word value heuristic is complicated you can view the code in the Language class. It scores keyword higher, and nouns and adjective higher than verbs, and articles as low.

> 5
A word may be involved in patterns that have a response. This is how the heuristic finds matching patterns.

> 6
state machines are created when you import/compile Self or AIML.
The understanding state is compiled from the Understanding.self script, and can understand common language.

> 7?
Please give a context to the code.

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 1953, today: 0, week: 4, month: 24

Id: 14762362
Postado: Nov 25 2016, 7:53
Atualizado: Nov 25 2016, 8:30
Respostas: 5
Pontos de vista: 2176, hoje: 1, semana: 4, mês: 30
0 0 0.0/5