Virtual Humans Forum
Virtual Humans Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Virtual Humans
Partner website:
Chatbots.org
 All Forums
 Virtual Humans
 V-Humans
 The Fadela Project.
 New Topic  Reply to Topic
 Printer Friendly
Next Page
Author Previous Topic Topic 
Page: of 2

TheMikh28
Curious Member



USA
39 Posts

Posted - Mar 23 2009 :  07:00:22  Show Profile
As of tonight, I've finally found myself some spare time to introduce the project I've been working on that I mentioned in my introduction topic, and how I've gone about developing it.

I wasn't sure whether or not the v-humans forum or the AI forum was more appropriate, but I went with v-humans, as developing a chatbot is the primary objective, with AI (hopefully) being the secondary objective.

Anyway, the initial intention of this project when I launched it as the "Nasrin project" this past November was to develop a chatbot which would learn not only word associations, but also the following:

-Concept associations
-Weighing of statements (positive, negative, neutral, etc), and reaction to such
-Development of an "emotional" predisposition toward certain users it interacts with based on past interactions and the above two points described.

Extremely early into the project (six days later), however, my laptop's hard drive nuked itself and I lost whatever work I'd done up until that point along with everything else on the hard drive. I relaunched the project as "Fadela" - hence the current project name - in late December, having much of the program's structuring from the first six days pretty much memorized, and quickly reconstructed it..

Aside from the three key points above, however, I have little to no guiding principles in the development of this project; if I believe that an idea is practical in advancing the project, I take note of it, and if it potentially provides an immediate opportunity to advance the project, I jump on it. I do, however, seek to take advantage of my introspective nature when it comes to devising processes, and attempt to model such processes after my own thought process in at least some way or another.

One point that I have stuck to, however, is that the bot cannot "learn" natural language until after it has some sort of "understanding" of the structuring of natural language, if that makes any sense, and have (somewhat cheaply) bypassed this so that more focus can be placed on how the "mind" processes/reprocesses stored information rather than how the "mind" makes sense of the information being input.

For instance, instead of saying "I am tall," I would say "(i) `I` _am_ 'tall'." The system processes the latter statement, identifies the "subject1-state/possession/action-subject2" relationship, depending on markers (not limited to the ones in the example) used. At the same time, however, the system takes statistics on word types, sentence types, sentence structures, etc. for future application at a time in which it may be desirable to switch to natural language.

While I am far from developing such a process (realistic goal, but further down on my checklist), stored information may also be reprocessed and "analyzed" by the system, and relationships can be established during such "reprocessing" sessions for greater efficiency or resourcefulness.

Throughout my development, I have saved ideas, brainstorming sessions, and occasionally a resourceful post from the forum in a series of (usually rather short -- from a sentence or two to about a half-page) text files (now approaching 110 in count). Though many of the earlier files have become obsolete as more advanced or efficient ideas have come into play for the project, most are still quite helpful in pointing at where I can improve or continue to ponder about how certain things can be done, so that I never really run out of things to work on for this project.

As of now, I am currently (1) working an effective system of storing processed information and linking such, and (2) pondering about how I can do about developing a realistic response system.

Lastly, I'm probably steps behind most of the developers on this forum. I work at an irregular pace, work based on my own ideas and save documentation by professionals for reading at an unspecified point in the future, have a bad habit of "making up" terminology on the go (albeit consistent in use once a term is coined) rather than looking up the official terminology (in order to cut back on time while working), and I have a slight tendency to reinvent the wheel at times with certain functions.

Despite this, I hope that this project may prove useful in some way or another.

[M*P]

toborman
Hooked Member



USA
289 Posts

Posted - Mar 23 2009 :  08:06:31  Show Profile  Visit toborman's Homepage  Reply with Quote
I think you'll get better responses at v-forum than AI forum. Several projects here have objectives similar to yours. Looking forward to hearing details from your introspection of mental processes.

http://mindmap.iwarp.com
Go to Top of Page

GrantNZ
Dedicated Member



New Zealand
2677 Posts

Posted - Mar 23 2009 :  09:25:50  Show Profile  Reply with Quote
Sounds like a good project - good luck with it, and please keep us updated
Go to Top of Page

hologenicman
Moderator



USA
3323 Posts

Posted - Apr 02 2009 :  22:26:36  Show Profile  Visit hologenicman's Homepage  Reply with Quote
quote:
I work at an irregular pace, work based on my own ideas and save documentation by professionals for reading at an unspecified point in the future, have a bad habit of "making up" terminology on the go (albeit consistent in use once a term is coined) rather than looking up the official terminology (in order to cut back on time while working), and I have a slight tendency to reinvent the wheel at times with certain functions.


This sounds like the kind of workflow that I am used to. Don't knock yourself for it, it can be very creative.

The only thing that I would advise (which was given to me by Jim Laacke) is to absolutely document every tiny little detail and keep a very detailed "change-log" for your project. I often drop a project for months at a time and then when I come back to it, I have to read through the documentation and change-log to figure out just what I was thinking before I set the project down.

The funny part is that when I return to the project, my brain is a few months older, and sometimes I have trouble comprehending what my younger brain was in the process of creating...

John L>
IA|AI

HologenicMan
John A. Latimer
http://www.UniversalHologenics.com

"If the Human brain were so simple that we could understand it,
we would be so simple that we couldn't..."
-Emerson M Pugh-

Current project:http://www.vrconsulting.it/vhf/topic.asp?TOPIC_ID=816&whichpage=1

DISCOVERY: The more I learn, the more I learn how little I know.
GOAL: There's strength in simplicity.
NOTE: Goal not always achieved.

Edited by - hologenicman on Apr 02 2009 22:28:22
Go to Top of Page

TheMikh28
Curious Member



USA
39 Posts

Posted - Aug 22 2009 :  18:48:40  Show Profile  Reply with Quote
Sorry about the long reply; I have a tendency to shyly lurk around until I have something worthwhile to say. Anyway, the project has come very far within the past several months, and I have enough theory and ideas cooked up to keep me busy for many more months.

With regard to the two areas I was working on when I created this topic, I have developed a relatively effective method of storing and linking processed information, and am now pondering means that are both more efficient, and more simplistic. The realistic response system has yet to be developed, though I believe that every brainstorming session brings me one step closer to that objective.

I've spent a significant part of the last couple months thinking about the possible applications of a function which basically converts a sentence of words into an array of words, then, treating each word like a "zero" in a binary number, determines every combination from 0 (all words) to 2^n (no words) where n represents the total number of words in a sentence.

To elaborate on this, suppose I had the phrase "WordA WordB WordC." It would be broken down something like this:

[0] WordA WordB WordC
[1] WordA WordB *
[2] WordA * WordC
[3] WordA * *
[4] * WordB WordC
[5] * WordB *
[6] * * WordC
[7] * * *

While there lies a great deal of potential in this function's applications (with regard to pattern generating, matching, storing, etc.), I came to the conclusion last night after extensive pondering that any such extended applications are simply not enough for sense to be made of an input sentence -- as far as I know, anyway. Positive/negative feedback to the program on the basis of the responses it may generate *may* help this situation, but to what extent is unknown to me at this point.

It may be necessary to pre-code concepts such as Self (the bot), Other (the user), Time, States of Being, Possessions, and Actions, among possible others that I may not have identified yet, in order for sentences to be effectively processed for information to store.

quote:
Originally posted by toborman

I think you'll get better responses at v-forum than AI forum. Several projects here have objectives similar to yours. Looking forward to hearing details from your introspection of mental processes.



By far the most useful function that is based the human thought process that I've devised since creating this topic is a peculiar data structure that I simply refer to as the "Weightstack."

I plan to write an essay on its properties and applications in the future, but in a nutshell, it is like this:

-An array containing arrays, which I refer to as "items."
-Each item has a "name" value, a "weight" value, and an area set aside for any miscellaneous information.
-Last item added is the first item in the array.
-If a duplicate item (an item with the same "name" value) is added, the item is "bumped" to the first position in the array, and its weight is increased by one.

In selecting an item from the array (assuming it's not empty):

-A tally of the total "weight" of the array is taken.
-The items within the array are iterated.
-For each item in the iteration, a random value between 1 and 0 is generated. If this random value is less than
(ItemWeight/TotalWeight)/(ItemPosition+1)

where ItemPosition is from 0 to n, then that particular item is returned, and (optionally) bumped to the first position if it is not there already. Otherwise, the next item in the array is checked. If the entire array is iterated and no items are returned, then the loop starts back at 0, until an item is returned.

Now, what's interesting about this function is that it is an interesting modeling of human memory; memories that are thought about often tend to be remembered better than memories that are not thought about too often. Similarly, if an obscure/seemingly forgotten memory comes to mind for whatever reason, it is in a much better position to be thought about more often thereafter. This structure allows for adjustable prioritization of ideas and information based on how often they are used, as well as how long it has been since they were last used.

quote:
Originally posted by hologenicman

This sounds like the kind of workflow that I am used to. Don't knock yourself for it, it can be very creative.

The only thing that I would advise (which was given to me by Jim Laacke) is to absolutely document every tiny little detail and keep a very detailed "change-log" for your project. I often drop a project for months at a time and then when I come back to it, I have to read through the documentation and change-log to figure out just what I was thinking before I set the project down.



I've done what I can to maintain some sort of changelog, but I also try to include comments in the code to give some sort of idea about what was thinking when I wrote the code. But I must confess, my older programs seem strange to me when I look at their code after months or years.

In other news, I my degree program / major has officially been changed to Computer Science as of yesterday.

[M*P]
Go to Top of Page

TheMikh28
Curious Member



USA
39 Posts

Posted - Apr 08 2010 :  00:06:11  Show Profile  Reply with Quote
For the past several months, I've been allocating my efforts in this project to determining relationships within series of (word) sequences, and to a lesser extent, relationships between series of "broken down" sentence sequences. Pondering in this area has yielded a large number of positive results that will serve to greatly advance the project, and though development of the code itself has been at a halt since January, I'm anticipating making a giant leap forward in the project when I do finally get around to coding again. That will depend, however, upon how soon I am able to consolidate the ideas I am presently pondering.

Hopefully I'll have something to show for my work at some point in the future.

[M*P]
Go to Top of Page

hologenicman
Moderator



USA
3323 Posts

Posted - Apr 10 2010 :  13:53:05  Show Profile  Visit hologenicman's Homepage  Reply with Quote
Glad to see that youare still working on it.

Keep having fun with it and bring us up to date along the way.

John L>
IA|AI

HologenicMan
John A. Latimer
http://www.UniversalHologenics.com

"If the Human brain were so simple that we could understand it,
we would be so simple that we couldn't..."
-Emerson M Pugh-

Current project:http://www.vrconsulting.it/vhf/topic.asp?TOPIC_ID=816&whichpage=1

DISCOVERY: The more I learn, the more I learn how little I know.
GOAL: There's strength in simplicity.
NOTE: Goal not always achieved.
Go to Top of Page

TheMikh28
Curious Member



USA
39 Posts

Posted - May 18 2010 :  08:27:39  Show Profile  Reply with Quote
Currently directing the brunt of my attention to (1) determining relationships between "broken down" sentence sequences, and (2) determining how dynamically generated sentences or something similar might be brought about. I have a lot of ideas formulated for the latter, but it's all a matter of which ideas will provide the best results, and how to piece them all together in the most effective and efficient manner possible.

The project moves rather sporadically, and I've always seemed to be far more enthusiastic about the formulation of ideas than I have been about actually converting these ideas to code :P but progress is indeed being made with each passing day.

The heart of determining word or structure relationships in this project lies in a simple 2D grid:


	A1	A2	A3
A1	#	#	#
A2	#	#	#
A3	#	#	#


Within a grid like this, the likelihood that one item occurs in the same sequence as another may be determined by maintaining a count of such occurrences each time input is processed. With certain modifications to this simple structure, the frequency of occurrence in subsequent sequences may also be determined, amongst a multitude of other things. Such is an oversimplification of the area I've been giving a great deal of thought to since this Winter.

quote:
Originally posted by hologenicman

Glad to see that youare still working on it.

Keep having fun with it and bring us up to date along the way.



That I am; this project keeps me continuously thinking in new ways as I work on it, so I never really get bored, even after well over a year of work. The project moves quite sporadically though, so I try to update whenever something worthwhile comes up; otherwise though, my day-to-day progress tends to be at a snail's pace and somewhat insignificant.

[M*P]
Go to Top of Page

mikmoth
Moderator



USA
2082 Posts

Posted - May 18 2010 :  16:04:37  Show Profile  Visit mikmoth's Homepage  Reply with Quote
A good model to study might be Markov chains. I know it's been batted around before. You can find many examples around the web. Or I can give you a working version of one I translated to C++. It finds all the combinations of words and counts how many times they are put together and can make sensible sentences.

I've experimented with making thousands of sentence chains and passing them through a logic & grammar filter - but in the end you never know what you're going to get since there is a random spinner although functioning with count weights.

The other is connecting the search part of the algorithm to semantic data and ontologies. But this can get a little more complicated.

Just some thoughts...

http://lhandslide.com
Go to Top of Page

TheMikh28
Curious Member



USA
39 Posts

Posted - May 19 2010 :  19:31:46  Show Profile  Reply with Quote
quote:
Originally posted by mikmoth

A good model to study might be Markov chains. I know it's been batted around before. You can find many examples around the web. Or I can give you a working version of one I translated to C++. It finds all the combinations of words and counts how many times they are put together and can make sensible sentences.


That would be great; I've always been curious as to how exactly they work.

[M*P]

Edited by - TheMikh28 on May 19 2010 19:32:54
Go to Top of Page

mikmoth
Moderator



USA
2082 Posts

Posted - May 19 2010 :  21:50:34  Show Profile  Visit mikmoth's Homepage  Reply with Quote
Here you go. I found a version I made in VB.Net 2008. It's the most simple model of a markov sentence generator. You just feed it some sentences - the more the better - and the thing will start talking back. It serves itself as a little chatbot.

Believe it or not I translated it from one of the first ever markov sentence generators. It came from an Amiga Basic Program circa 1989 - its called NIALL - kinda famous. Works great tho... and if you can deconstruct it you're on your way to figuring out how it works.

VB2008 Version.
http://karigirl.com/stuff2/Niall.zip


Here is the C++ code translation for any wondering travelers. You just feed strings into the INPUT function and get the output from the reply function.


quote:
//NIALL
CString NIALLWORD[3000+1][1+1];
CString NIALLW1[3000+1];
int NIALLNUM;
CString NIALLOutMessage;
CString NIALLT;
int NIALLW;
int NIALLMNW;
//NIALL

void NIALL_USER_INPUT(CString Statement)
{

CString r;
int f=0;
CString Q;
int FS=0;

NIALLMNW = 3000;
NIALLWORD[0][0] = " "; NIALLWORD[NIALLMNW][0] = ".";

NIALLT = Statement;

if (NIALLT=="") return;
NIALLT = LCase(NIALLT);

// --- Cuts out the rubbish ---
r = ""; for(f=1; f<=NIALLT.GetLength();f++) {
if (NIALLT.Mid(f-1, 1)==",") NIALLT.Mid(f-1, 1);
if ((1+("!$%^&*()_+|}{@?>/#\\="+CString(char(34))).Find(NIALLT.Mid(f-1, 1)))==0) r += NIALLT.Mid(f-1, 1);
}

// --- Seperates into words ---
if (NIALLT.Right(1)==".") NIALLT.Replace(".", " ");

Q = NIALLT;

FULLSTOP: ;
if ((1+Q.Find("."))>0) { FS = 1; NIALLT = Q.Left((1+Q.Find("."))-1); Q = Q.Right(Q.GetLength()-(1+Q.Find("."))); }
NIALLW = 1; NIALLW1[NIALLW] = ""; for(f=1; f<=NIALLT.GetLength();f++) {
if (NIALLT.Mid(f-1, 1)==" ") {
if (NIALLT.Mid(f+1-1, 1)!=" ") {
NIALLW += 1; NIALLW1[NIALLW] = "";

goto Skip;

}
}

NIALLW1[NIALLW] = NIALLW1[NIALLW]+NIALLT.Mid(f-1, 1);



Skip: ;

}
if (NIALLNUM<NIALLMNW-1) {
NIALL_ANALYSE_SENTENCE();
}
if (FS==1) { FS = 0; NIALLT = Q; goto FULLSTOP; }
}



void NIALL_ANALYSE_SENTENCE()
{

int OLD=0;
int H=0;
int f=0;
CString C1;
int G=0;
int i=0;

// --- Loop for the number of words +1 ---
OLD = 0;

for(H=1; H<=NIALLW+1; H++) {
if (H==NIALLW+1) { f = NIALLMNW; goto FOUNDIT; }
for(f=1; f<=NIALLNUM; f++) { if (NIALLW1[H]==NIALLWORD[f][0] && NIALLW1[H]!="" && NIALLW1[H]!=" ") goto FOUNDIT;
} // f
// --- The word is a new one ---
NIALLNUM += 1; NIALLWORD[NIALLNUM][0] = NIALLW1[H]; f = NIALLNUM;
FOUNDIT: ;
if (NIALLWORD[OLD][1]=="") { NIALLWORD[OLD][1] = "1|"+Str(f)+"(1)"; goto ALLDONE; }
C1 = NIALLWORD[OLD][1]; C1 = Str(Val(C1)+1)+C1.Right(C1.GetLength()-(1+C1.Find("|"))+1);
for(G=(1+C1.Find("|"))+1; G<=C1.GetLength();G++) {
if (Val(C1.Right(C1.GetLength()-G))==f) goto HERE;
G = (1+C1.Find(")", G-1));
} // G
C1 += Str(f)+"(1)"; NIALLWORD[OLD][1] = C1; goto ALLDONE;
HERE: ;
G = (1+C1.Find("(", G-1)); i = (1+C1.Find(")", G-1))-1;
C1 = C1.Left(G)+Str(Val(C1.Right(C1.GetLength()-G))+1)+C1.Right(C1.GetLength()-i);
NIALLWORD[OLD][1] = C1;
ALLDONE: ;
OLD = f;
} // H
}

void NIALL_REPLIES()
{

CString UsedWords[300];

int g=0;

CString NIALL_REPLIES;

CString REP;
int c=0;
CString C1;

int r;
int G;
int f;
CString F1;

int D;
int i;

if (NIALLNUM==0);
REP = ""; c = 0;
RLOOP: ;



DoEvents();

C1 = NIALLWORD[c][1];

r = Int(Rnd()*Val(C1)+1);


if (r==0) goto RLOOP;

for(G=(1+C1.Find("("));G<=C1.GetLength();G++) {

r -= Val(C1.Right(C1.GetLength()-G));
if (r<0) goto THISWORD;
G = (1+C1.Find("(", G+1-1))-1;
} /
return;
THISWORD: ;

DoEvents();
for(f=G; f>=1; f--) {
F1 = C1.Mid(f-1, 1);
if (F1==")" || F1=="|") goto word;
}
word: ;



D = (int)Round(Val(C1.Right(C1.GetLength()-f)));
if (NIALLWORD[c][0]=="i") NIALLWORD[c][0] = "I";
REP += Str(NIALLWORD[c][0])+" ";

i++;


c = D; if (c<NIALLMNW-1 & c!=1) goto RLOOP;

SKIPME1: ;
if (REP=="") return;

REP = Trim(REP);
NIALL_REPLIES = REP;
NIALLOutMessage = REP;


}

http://lhandslide.com
Go to Top of Page

TheMikh28
Curious Member



USA
39 Posts

Posted - May 22 2010 :  15:18:11  Show Profile  Reply with Quote
Thanks! I'm currently in the process of porting the C++ version over to PHP; whatever version of PHP I'm running doesn't seem to like the gotos, despite the language having support for it, but I'll get it to work properly sooner or later.

[M*P]
Go to Top of Page

mikmoth
Moderator



USA
2082 Posts

Posted - May 22 2010 :  20:49:53  Show Profile  Visit mikmoth's Homepage  Reply with Quote
Good luck. Let me know if you find any bugs or things that can be improved. I apologize for the simple use of variable names and non-commented code. But... that's how the original was and seemed simple to translate word for word.

http://lhandslide.com
Go to Top of Page

TheMikh28
Curious Member



USA
39 Posts

Posted - Jan 23 2011 :  21:26:35  Show Profile  Reply with Quote
Between last summer and last fall, I was hung up with respect to how I could go about converting the project to "real-time" -- that is, having the amount of time spent processing data and generating a response indirectly influenced by the time the user takes to give input.

Due to the sheer volume of information to be processed or re-processed as word and structural relationships are made, it can take far too long for the program to finish processing all the information (especially as data starts to accumulate) before generating a response.

As such, I devised a means by which the program "prioritizes" the information it is to process. In a nutshell, it processes more recently input data, and then works backward. With this, the program is able to partially process the most important data before generating a response based on the relationships it has already made. Later, while the program isn't actively being used, the remainder of the information is processed through a "sleep function."

As of late last fall or early this past winter, I finally got around to working out the issues preventing me from implementing such real-time capabilities, and over the past month have implemented and/or revised most of the project ideas established this past summer.

I now hope to implement the new response system -- which has been constantly delayed since 2009 due to frequently revising theory regarding how it is to be done -- since it's the only thing left to be done at this point. Once that's done, I believe I'll be able to make far more interesting updates far more often, and even provide logs of conversations.

quote:
I wasn't sure whether or not the v-humans forum or the AI forum was more appropriate, but I went with v-humans, as developing a chatbot is the primary objective, with AI (hopefully) being the secondary objective.


I'm starting to feel that the category of this project is starting to fall closer to AI than Virtual Humans.

[M*P]
Go to Top of Page

TheMikh28
Curious Member



USA
39 Posts

Posted - Jan 29 2011 :  01:08:26  Show Profile  Reply with Quote
Finished a crude implementation of the new response system yesterday.

It's quite buggy and despite all the time I spent developing it on paper, it didn't play out quite the way I'd anticipated. I'll hopefully get it fixed up over the next several days if time permits.

I'm quite excited about how this is coming together, nevertheless.

[M*P]
Go to Top of Page

mikmoth
Moderator



USA
2082 Posts

Posted - Feb 01 2011 :  07:46:31  Show Profile  Visit mikmoth's Homepage
Hey Mik,

You make any progress? Would love to see an example of your program's responses anyways.

Keep on at it and good luck.


http://lhandslide.com
Go to Top of Page
Page: of 2 Previous Topic Topic   
Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Virtual Humans Forum © V.R.Consulting Go To Top Of Page
This page was generated in 0.21 seconds. Snitz Forums 2000