Anyway, back to work

- Posted in Uncategorized by

So, anyway, back to work. I was incorporating ChatGPT or other LLMs into Brainhat. To talk to them, I need to send and receive JSON. Mother, help me. I could also use JSON for third-party software that wants to talk to Brainhat. So, it points to me needing to handle JSON in HTTP posts and such. Another detour!

I know that if I go look for something online it will use some crap like cmake or m4. So, I have to write it. To write it, I have to understand it. I outlasted XML, by the way, I think.... Oh wait. I didn't. Used to produce it--VoiceXML. Do you remember that?

Risc-V!

- Posted in Uncategorized by

I got built a little system out of a MilkV motherboard running Bianbu Linux. Works! And now, there's a Risc-V port of Brainhat. It was no problem compiling after the thrashing the compiler under Omnios put me through. No hard feelings; I deserved it.

I ported Brainhat to Omnios

- Posted in Uncategorized by

I ported Brainhat to Omnios (I really like Omnios!). I say 'ported' because the compiler complained about my code... a lot! I've just run the test suite. There are things to fix. Gabriela looks like it didn't run. Tests 126 and 127 look broken. Probably more. Very few of the test outputs appear to agree with the saved outputs. I don't see a difference in every case though. It might be due to a line feed missing or such. I had to change the sed invocation in the makefile, and this probably has something to do with it.

Hmmm... I am seeing this message from httpd.c when trying to fetch a page:

httprequest: nreads = MAXREADS; shutting down.

Doesn't appear to shut anything down, though.

Here's one line that is causing gabriela to dump core:

"Jorge returned to Tapachula to study law."

Digging into it.

BUGs:

>> i returned home to study  <--- "home" should be interpeted as "to home".  It's a one-off.
autohash3_a: couldn't find a CHILD-OF in Root-OBJECT
autohash3_a: couldn't find a CHILD-OF in Root-OBJECT
 You did return home studies.autohash3_a: couldn't find a CHILD-OF in Root-OBJECT

and

>> i returned to home to study
./run: line 6: 12384: Memory fault(coredump)

This is the same bug as in Gabriela. Tough to find(!) What does this say, anyway? "I returned to home because I study."

--effect-- because --cause-- ?

Does it work for "the dog went to the bowl to drink"? Yes. It works. Sort of. Which is the cause and which is the effect? Maybe it says "dog to drink because dog went to the bowl." Or maybe it says "dog went to the bowl because dog to drink". That seems better. The cause is the second part--to drink or to study.

How do I capture that in grammar? I'll work that. But first! And why AM I GETTING a segv?

>> i returned to the bowl to study
 You did return to the bowl.
>> i returned to the home to study
./run: line 6: 12540: Memory fault(coredump)

Hmmm.... "home" has a problem but "bowl" does not.

Ach! It's a problem with a rewrite rule! I'm an idiot; routine rewrite was in the traceback. I was looking past it to grammar issues. And, in fact (though the rewrite seems broken...), it's already translating the input into cause and effect. This is the problem with working on a 30 year-old project. I've been here already!

Anyway, the rewrite is working under Linux. I musta messed something up. Yep...needed a static int declaration. It is working now.

I also had to increase a setting of "MAXREADS" in the http code from 9 to ... 100. The Omnios version was resetting the connection because it saw too many incoming web connections(?). I dunno. I wrote the code, is all.

Goldilocks from ChatGPT

- Posted in Uncategorized by

Here's a sample from ChatGPT:

Goldilocks was a girl.
She walked in the woods.
She found a house.
The house had three bears.
The bears lived in the house.
The bears woke up.
They made porridge.
Papa Bear's porridge was too hot.
Mama Bear's porridge was too hot.
Baby Bear's porridge was just right.
Goldilocks went to the kitchen.
Goldilocks tasted Papa Bear's porridge.
Goldilocks tasted Mama Bear's porridge.
Goldilocks tasted Baby Bear's porridge.
Baby Bear's porridge was just right.
Goldilocks ate Baby Bear's porridge.
Goldilocks went to the living room.
Goldilocks sat in Papa Bear's chair.
The chair was too hard.
Goldilocks sat in Mama Bear's chair.
The chair was too soft.
Goldilocks sat in Baby Bear's chair.
The chair was just right.
The chair broke.
Goldilocks went to the bedrooms.
Goldilocks lay in Papa Bear's bed.
Papa Bear's bed was too hard.
Goldilocks lay in Mama Bear's bed.
Mama Bear's bed was too soft.
Goldilocks lay in Baby Bear's bed.
Baby Bear's bed was just right.
Goldilocks fell asleep.
The bears came home.
Papa Bear said, "Someone has eaten my porridge."
Mama Bear said, "Someone has eaten my porridge."
Baby Bear said, "Someone has eaten my porridge."
They saw the bowls were empty.
They saw the chairs were moved.
Baby Bear saw his chair was broken.
Papa Bear saw his porridge was eaten.
Mama Bear saw her porridge was eaten.
They found Goldilocks in Baby Bear's bed.
Goldilocks woke up.
She ran away.

ChatGPT's output will vary. After cleaning up the line feeds and such, the problems I would have with this block include:

"Goldilocks was a girl": Brainhat won't parse this correctly. It can parse "A girl's name is Goldilocks", however. I can approch it one of two ways--with a rewrite rule or new grammar. In either case, I'd need to recognize that "Goldilocks" is not in the vocabulary. That would differentiate the statement from something like "the pitcher was a girl."

"The house had three bears": Literally, this is an odd statement. Inference needs to fix it.

Use of the plural as in "The bears woke up" and "They made porridge" might be wonky.

"Papa Bear's porridge was too hot": we've never been introduced to "Papa Bear" as a formal title. To Brainhat, this will appear as two nouns, side-by-side. Something like "the big bear's name is papa bear" would take care of it.

Introducing these problems/process to readers, I could show why manual rewrites are needed, and what they should be. I think that will get me there faster. Otherwise I am diving back into development.

Anyway, whatever page I create for this translation, it should aid in making it on a line-by-line basis.

See also: https://www.brainhat.com/blog/gabriela-goes-chatgpt-and-back.html

Sending stuff to ChatGPT

- Posted in Uncategorized by

So, as I wasn't saying, it seems to me that a good first marriage of Brainhat and ChatGPT would be for ChatGPT to simplify input for Brainhat to use and then for ChatGPT to make a summary of the context when needed. This could have a page associated with it. I'm not doing any server-side storage (or local storage for that matter). I don't know where the integration will occur, but setting up another web page should be interesting enough.

The next integration will be to use ChatGPT to disambiguate input, to provide answers to otherwise unanswered questions and to support goal-seeking processing.

But, first, another web page. It will have a window where the user can post some text for translation into Brainhat language (another window). Maybe if you post in the ChatGPT window you get the Brainhat version in the other window and vice versa. Or maybe there could be a "send to ChatGPT" button for the context or a "Send to Brainhat" for the ChatGPT translation. We'll see.

See: https://www.brainhat.com/blog/gabriela-goes-chatgpt-and-back.html