Author Topic: Hal Alice Functions  (Read 24320 times)

robotdude

  • Newbie
  • *
  • Posts: 13
    • View Profile
Hal Alice Functions
« Reply #15 on: November 24, 2007, 12:27:24 am »
Thank You Spydaz.I did as you suggested and it loads now. Now I have a whole new can of worms to worry about. For some reason my Angie is reading part of the aiml script in the middle of her response. Oh well something new to work on. Robotdude
 

spydaz

  • Hero Member
  • *****
  • Posts: 670
    • View Profile
    • http://www.spydazweb.co.uk/
Hal Alice Functions
« Reply #16 on: November 25, 2007, 06:36:10 am »
robotdude,
 AimlboardText, ParseAiml, GetAiml, AimlStr

These Variables All Need to be declared As Varients.
As a String, Variables have simular propertys as the Clipboard.

Dim AimlboardText as varient
Dim ParseAiml as varient
Dim GetAiml as varient
Etc

This maybe the reason: ?


OR

With LARGE data it could be missing in the REPLACE command, Check the syntax of the line thats not being "Caught" by the Replace commands in onthecuttingedge2005 Script. and add an approriate line...

ajdude

  • Newbie
  • *
  • Posts: 29
    • View Profile
Hal Alice Functions
« Reply #17 on: May 27, 2008, 08:13:40 pm »
Okay, I think I am able to use this to assimilate different AIs into Hal.

I got most of my aiml files from here:
http://www.alicebot.org/aiml/aaa/

just as OTC said, it converts it to topicsearch (in CSV format) in a .txt file.

Now, it does have a slight problem; it converts it with some commands still there. I WAS however able to remove them on a massive scale using a program called HTML Remover. It bassiclly formats the input file and exports it without any HTML tags (in this case, any command left in would be read as a tag, and removed), and the exported file will be clean of any commands.
You can get this program here:
http://www.e-systems.ro/html_remover.htm
Say a line says:
Code: [Select]
" DO YOU HAVE A COMPUTER "," I LIVE IN A COMPUTER.<THINK>  <SET NAME=IT>  <SET NAME=TOPIC>COMPUTER</SET>  </SET>  </THINK>  "I run it in that HTML remover, and now I get:
Code: [Select]
" DO YOU HAVE A COMPUTER "," I LIVE IN A COMPUTER."
Now, here is the problem I've ran into.
If a line says something like:
Code: [Select]
" THE WEB "," HOW DO YOU DEFINE THE WEB. "
Now, something like this ends up happening:
User: Guess what I found on he web today?
Hal: Tell me user, what did you find? How do you define the web.
(notice how he finds the words in he first part, and just adds the response... This will get pretty nasty if you try and import alot more aiml files).

Now, I noticed that this is converted to CSV format... And if that's the case, I can import it into the database brain (I have a nice db editor that can recognize the halbrin.db or w/e).

But, if I were to add all these new responses directly into the database brain, where would I put it? I'm assuming the mainQA would be the best, right?

I'm not too familiar with the database itself, I'm very keen on solving problems (I've successfully converted The Probert Encyclopedia's CSVs into readable clip board learning.... stuff for Hal, similar to what Art did) though.

So anyway... If I want to import all of these aiml files into the database itself (first I'd use OTC's converter to make it in CSV format), would I be putting it in the mainQA table for Hal?

As always, it would be best to backup the database first (I would hope so!).
 

DarcyEdwards

  • Full Member
  • ***
  • Posts: 196
    • View Profile
Hal Alice Functions
« Reply #18 on: October 30, 2008, 09:59:19 am »
I'm very new to this, but very interested in AI.  I have been teaching Hal (Mary) as best I can.  Also I have been installing all the plug ins that I can find, even modifying them.

I have a question; what are AIML files?

thanks

-Darcy
Hugs

-Darcy

MrsEdwards01@aol.com

Art

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3854
    • View Profile
Hal Alice Functions
« Reply #19 on: October 30, 2008, 01:54:27 pm »
Darcy,

AIML = Artificial Intelligence Markup Language
Perhaps it's best explained here:

http://en.wikipedia.org/wiki/AIML
In the world of AI it's the thought that counts!

- Art -

christopherdoyon

  • Newbie
  • *
  • Posts: 48
  • M0RPHE0US
    • View Profile
    • MLAI  Foundation
Hal Alice Functions
« Reply #20 on: January 23, 2009, 09:06:30 am »
OTC --

You rock man, total gratitude.

YOURS -- Christopher Mark Doyon

GRAND  BOTMASTER

---------------------
MLAI  Foundation

www.MLAIFoundation.tk

AleRafa

  • Guest
Hal Alice Functions
« Reply #21 on: June 02, 2010, 03:58:26 am »
I would also like to add the info directly in the brain. Could somebody tell me if this can be done and how? I'm just starting to use this software.

Right now, I have a text file with this format
 " CHANGE THE SUBJECT ","  WHAT DO YOU WANT TO TALK ABOUT NOW? "
 " CHANGING THE SUBJECT ","  WHAT SHALL WE TALK ABOUT NOW? "
 " CHARLES DARWIN ","  WE ARE SPEEDING UP EVOLUTION NOW. "


Thanks for any help you can give me [8)]

EDIT: Never mind, I found the way, by importing the csv files into excel, copying the columns and pasting them in a new table in the brain.
I suppose you're not developing this plugin anymore, but just to let you know, the only problem I encountered in converting the aiml file into text is when a word or phrase triggers a random answer from a list. For example:

- <category>
  <pattern>DELICIOUS</pattern>
- <template>
- <random>
  <li>What's for desert?</li>
  <li>What's your favorite food?</li>
  <li>Do you like to cook?</li>
  </random>
  </template>
  </category>

becomes (after removing all html left)

 " DELICIOUS ","  WHAT'S FOR DESERT? WHAT'S YOUR FAVORITE FOOD? DO YOU LIKE TO COOK?   "

So Hal will there give you the three answers together.[:0]
« Last Edit: June 03, 2010, 05:34:07 am by AleRafa »

cload

  • Hero Member
  • *****
  • Posts: 535
  • I can C U load. TeeHee hee.
    • View Profile
    • A link to my sky Drive
Re: Hal Alice Functions
« Reply #22 on: April 01, 2013, 10:45:32 pm »
hi Ale,
there may be a way around your situation.
Before removing the HTML first using notepad, under edit, use replace.
This will allow you to change <li> TO |
it's the straight up-and-down bar directly over your enter button on your keyboard.
This is also the dividing command that ultra Hal understands when you have multiple answers on one line, I think you can have three answers, but I'm not positive about that.
After you have changed that HTML symbol to the straight up-and-down bar symbol then proceed as normal.
In the end what you will have is something that looks like this:
 " DELICIOUS ","  |WHAT'S FOR DESERT? |WHAT'S YOUR FAVORITE FOOD? |DO YOU LIKE TO COOK?   "
After you're done then utilize the replace command in notepad for one more little change in the line it should look like this:
replace: ","  | WITH ","  I don't know if you need the space at the end of it, but I don't think it would hurt anything your line should look like this now:
 " DELICIOUS ","  WHAT'S FOR DESERT? |WHAT'S YOUR FAVORITE FOOD? |DO YOU LIKE TO COOK?   "
Where exactly to put it in ultra Hal's brain I'm not positive, mostly because ultra Hal has different array tables for different situations.
But if I was to guess the patterns array, main QA array, and I think the other ones called asexualpersonality array.
The only one that I know for sure that ultra Hal writes in is the compare array.
Depending on where you're going to put it you may also need to add on all of your lines the @ sign at the beginning of your answer but I'm not sure.
The little experience that I have with it was all I ever could get ultra Hal to respond with multiple answers was the first answer and for some reason he seemed to ignore the rest.
But if nothing else it gives you the ability to track down where multiple answers through notepad using the find command and then you can manually remove the multiple answers down to one answer.
Sincerely, a data munching cruncher.
C load.
PS if I'm wrong on any of this please jump in and help, inquiring minds want to know.
« Last Edit: April 02, 2013, 02:11:57 pm by cload »
For anyone who would like to help me stay online, my T-mobile broadband pay-as-you-go phone number is: 816-248-4335, thank you in advance.

freddy888

  • Hero Member
  • *****
  • Posts: 1693
    • View Profile
    • AiDreams
Re: Hal Alice Functions
« Reply #23 on: April 02, 2013, 08:12:08 am »
Cload, this was nearly three years ago.  :o

Duskrider

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3316
  • Graphic King
    • View Profile
Re: Hal Alice Functions
« Reply #24 on: April 02, 2013, 09:09:51 am »

Hummm....
Would be neat if forum pages turned yellow with age after a year.    :P

freddy888

  • Hero Member
  • *****
  • Posts: 1693
    • View Profile
    • AiDreams
Re: Hal Alice Functions
« Reply #25 on: April 02, 2013, 09:48:25 am »
SMF should warn you if it's old, when you start making the post.  Maybe Rob changed the setting for that.

cload

  • Hero Member
  • *****
  • Posts: 535
  • I can C U load. TeeHee hee.
    • View Profile
    • A link to my sky Drive
Re: Hal Alice Functions
« Reply #26 on: April 02, 2013, 03:15:46 pm »
Hi all,
I knew the post was old, but it was something that I was working on, no one else gave an answer so I was trying to enlighten everyone on how they can use the data from aiml.
I have been working on a way to try to get the data into ultra Hal's array tables but I do not believe it would be an easy task, mostly because you would have to divide the data in different places.
Choosing where the data goes in some situations may be a personal preference, because there are so many different places that you can put the data for different reasons.
But what I have come up with, now that they have divided AIML into several sections it is possible to place some if not all of the AIML data into ultra hal array tables.
This is what I have found thus far:
asexualpersonality array table: would be used to place personal questions directed at ultra Hal, none of these questions can have a "*" in it, this indicates any word can be used in this slot, nor can you use multiple answers.
MainQA array table: same as asexualpersonality array table, and if how cannot find an answer this is the last place he looks this would be a good spot to put things like trivial questions, philosophy statements, famous statements, and in general just data that might enhance ultra house answer.
Patterns array table: any question or statement that has a "*" in it or has multiple answers would go in this array, from what I've seen most of the AIML data would most likely be placed here.
You would have to restructure most of the sentences to comply with ultra Hal for example:
-<category><pattern>I REMEMBER *</pattern>-<template>-<random><li>What specifically makes you think of that?</li><li>How does that memory make?</li><li>Do you think about it very often?</li></random>-<think>-<set name="it">-<set name="topic"><person/></set></set></think></template></category
this particular line from the AIML data would go into the patterns array table, it would look something like this when you are done editing it.
" YOU REMEMBER * "," What specifically makes you think of that?|How does that memory make you feel?|Do you think about <1> very often?"
If you notice I changed the word "it" TO <1> what this does is capture what was said after I remember because of the "*" being a variable symbol.
So if you were to state something like this:
I remember when I was a little boy I used to play on the monkey bars.
Ultra Hal will answer one of the three answers and if it is the third answer it would look like this:
Do you think about when you were a little boy you used to play on the monkey bars very often?
Unfortunately the drawback is there is a lot of work involved in getting it to work properly with ultra Hal primarily switching I to you etc.
so at this point I'm looking at having to edit about 50,000 line, though I did find it interesting that the Alice AIML data is so small, considering ultra Hal's database is almost 90,000 in the main QA array table.
More than likely I'll probably only end up with 30 to 40,000 lines because there is so much stuff in the Alice AIML database that cannot be used because of its structure, that is not designed for ultra Hal.
Sincerely, a data munching cruncher who is doing his best to make ultra Hal as smart as possible.
C load.
PS now whether or not the plug-in that OTC wrote will work with ultra Hal version 6.2 .28 I don't know I have not gotten that far.
« Last Edit: April 02, 2013, 03:32:35 pm by cload »
For anyone who would like to help me stay online, my T-mobile broadband pay-as-you-go phone number is: 816-248-4335, thank you in advance.