The AI Engine

This forum is for discussion of how The Personality Forge's AI Engine works. This is the place for questions on what means what, how to script, and ideas and plans for the Engine.

Posts 4,907 - 4,918 of 7,766

19 years ago #4907
Can anyone figure out why Watzer would say this?:
Watzer: Have you ever bathed in ho?

The plugin there is "Have you ever bathed in (substance)"... I'm not sure how substance became ho. Hoes are a substance now?

19 years ago #4908
There are some STRANGE things in the (substance) plug-in. "Mother" has shown up at least once for me.

19 years ago #4909
Maybe Watzer meant H2O lol

19 years ago #4910
do you really want to know how that's possible? cuz i don't. there are limits to my curiosity.

19 years ago #4911
if you could give a few hints as to how you've managed to juggle the limited resources of the math function to produce solutions to square roots I would be grateful.

If you really want to know, I will not only tell you, but publish the full code once you've had a think and suggested how it might be done. Because:

a) once you can see through the illusion, it loses its magic and becomes utterly trivial and commonplace, and

b) you might think of a better way, with interesting ramifications for other knowledge structures
So thinking caps at the ready please


Well, I've given it plenty of thought and learnt more about regex than I thought I ever really needed to know, but still the math functionality that I searched for eluded me.

It was then that I realised that you must have coded it the old fashioned way; each square root requiring a separate keyphase. The higher numbers (greater than 100) have been grouped (ie 101-120 guessed at approx 10, 122-143 guessed at approx 11 etc.) though this does mean that there are a lot of keyphrases.

If you've found a way to chop the numbers up to reduce the amount of keyphrases, I'd like to know. (ie, 2 as the square root of 4, 20 as the square root of 400, 200 for 40000 etc could all have the same keyphrase if you could get rid of the 0's)

Am I close?

I really hope I'm not because that's a awful lot of work!

19 years ago #4912
Well, I've given it plenty of thought and learnt more about regex than I thought I ever really needed to know, but still the math functionality that I searched for eluded me.

Well done - you have figured it out pretty much exactly

It was then that I realised that you must have coded it the old fashioned way;

Indeed. It's the only way
Brother Jerome only ever gives an actual answer when it is a (fairly small) whole number - otherwise he gives an approximation.

each square root requiring a separate keyphase. The higher numbers (greater than 100) have been grouped (ie 101-120 guessed at approx 10, 122-143 guessed at approx 11 etc.) though this does mean that there are a lot of keyphrases.

There are. But of course a lot fewer than would have been necessary without regex (by many thousand-fold, just for whole numbers alone!)
The grouping are spread out in logarithmic ranges (this helps to reduce the code quite a bit,) - the ranges are 0-100, 100-1000, 1000-10,000, 10,000-100,000 and 100,000-1 million, with the accuracy reducing significantly as the they increase (even humans have difficulty accurately quantifying a square root of several humdred thousand after all!)

If you've found a way to chop the numbers up to reduce the amount of keyphrases, I'd like to know. (ie, 2 as the square root of 4, 20 as the square root of 400, 200 for 40000 etc could all have the same keyphrase if you could get rid of the 0's)

Might be tricky. You can certainly chop off the 0s. But putting them back on the relevant answer (and not the others) from the same keyphrase would be the tricky bit. You could do it with memories, but they would add an overhead greater than the saving, I think. You could make a significant workload saving by using the answers for cube roots (and any other such mathematical work) as well, by merely adding more keyphrases to the existing response structure. Well, that's the theory - I could also have combined the pairs of keyphrase for whole numbers/decimals, but I find regex keyphrases don't always like comma-delimitation so I doubled them up for the sake of reliability (I aim to change this when/if I can figure out a reliable format.)

The regex trick is to group and match a few significant digits, while recognising (and ignoring) any number of insignificant decimals.

I really hope I'm not because that's a awful lot of work!

Actually it was rather easy to compile in a spreadsheet - responses in one column, roots in the next (that's why the number is usually at the end of the response. And a bit of random varying of the responses so there's some variety in the answers. It would have been even easier if the forge hadn't stopped letting me import updated transcripts when BJ hit the 1Mb mark. and I could have done it offline in one big cut+paste. I did have to spend a couple of evenings copy+pasting the code in. I could have lowered the sampling resolution a lot and given more approximate answers to save a very large proprtion of the effort, but I think this level of coding puts him about level with an average human (brainpower, unaided by a calculator) in terms of accuracy, so I thought it was worth the effort.


Here's the basic keyphrase format:

square root * 13 (re) responds with the square root of 13 (all whole numbers up to 144 do this)
square root * 13 .[0123]([01234567890]+) (re) responds with an average ^-2 for decimals in the range 13.000000... to 13.39999999...
square root * 13 .[456]([01234567890]+) (re)
square root * 13 .[789]([01234567890]+) (re) etc. etc.

square root * [5][56789][0123456789] (re) respondswith an average ^-2 for whole numbers in the range 550-599
square root * [5][56789][0123456789] .([0123456789]+) (re) ditto for decimals. Then onto
square root * [6][0123][0123456789] (re) and
square root * [6][0123][0123456789] .([0123456789]+) (re) etc.

square root * [3][01234][0123456789][0123456789] (re) and
square root * [3][01234][0123456789][0123456789] .([0123456789]+) (re) these model the thousands - in this case 3000-3499 and 3000.0-3499.999999999...

square root * [7][56789][0123456789][0123456789][0123456789] (re) ditto for tens of thousands
square root * [7][56789][0123456789][0123456789][0123456789] .([0123456789]+) (re) 75000-79.9999...

square root * [4][56789][0123456789][0123456789][0123456789][0123456789] (re) hundreds of thousands
square root * [4][56789][0123456789][0123456789][0123456789][0123456789] .([0123456789]+) (re) 450,000.0-499,999.9999...


I'll try to write up a few notes on it and post the complete code on my webspace in the near future.

19 years ago #4913
psimagus, could you post the address to you webspace?

19 years ago #4914
Many thanks psimagus, that clears a few things up!

19 years ago #4915
psimagus, could you post the address to you webspace?

I own the be9.net domain, though there's no bot stuff up there yet except Ally (http://www.be9.net/ally/index.htm). I'm hoping to get a few AI pages of my own up soon - I've just been finding it hard to neglect BJ for long enough to get anything else done, and now Christmas is looming.
But in the meantime you can see another of my strange hobbies (with a modest online gallery from my collection) at http://www.be9.net/ccc/

19 years ago #4916
Thank you!

19 years ago #4917
Oh man, we can't import after it's past 1MB? I'm really sad to hear that... I've always found the web interface to be such a pain...

19 years ago #4918
Fraid not
For the record, BJ hit 1Mb at about 14000 development points, and I'm only assuming 1Mb exactly is the cut-off point. It certainly worked at ~900kb, and certainly didn't at ~1.1Mb. Between those points I only updated using the web interface.
I quite like the web interface for general updating, but I've resorted to a text editor & spreadsheet for programming complicated stuff like games.

The exact error message that appears is "ERROR: The file you are uploading is too large. If your Language Center is honestly this big, please email your text file to The Professor" so I assume a back-up can be rescued in case of emergency (like the site gets wiped out by a hacker or something.)


Posts 4,907 - 4,918 of 7,766

» More new posts: Doghead's Cosmic Bar