Ai Dreams Forum

Member's Experiments & Projects => General Project Discussion => Topic started by: 8pla.net on February 10, 2015, 03:47:51 pm

Title: Ultron7's J.A.R.V.I.S. Discussion
Post by: 8pla.net on February 10, 2015, 03:47:51 pm
For the sake of friendly discussion, here I'll share some of my perspectives.  They are definitely not intended to criticize any project, especially J.A.R.V.I.S... But the right to interject a little funniness for entertainment value is hereby reserved. Going with SQLite, and C++ on a commercial operating system? May as well support open source operating systems too. Why not? ChatScript, for example, is written in C++  and it compiles the same codebase in Visual Studio on Microsoft Windows and g++ on Linux with a bash shell script. FYI: The C++ compiler in the GNU Compiler Collection, is called g++.

How about running a highly secret research lab in PHP?  With the SQLite3 extension enabled by default in PHP version 5.3, being generally easier, PHP may even inspire solutions when C++ development faces a challenge. For the top secret PHP project, go with MySQL on a Linux Apache MySQL PHP (LAMP) server.  Why?  Well, just keep reading...

Not to disparage SQLite in any way... Seriously, SQLite is really a cool database, apparently a commercial success for A.I. products in the past.  Yet, an SQLite issue worth flagging early on, is performance.  Since SQLite is self-contained and serverless, it may slow down in performance as it grows larger and larger.  The "Lite" in "SQLite" stands for lightweight.  Usually, A.I. outgrows lightweight pretty quickly, so it is worth planning on that possibility. 

Like Assembly Language, and C Language, C++ may be considered more powerful than any web programming language, Perl, PHP, Python, Ruby, Java, JavaScript... etc to build Artificial Intelligence, because C++ is compiled and the web is just slower than even a standalone computer from yesteryear.  Yet C++ may be quite limited when it comes to running on  the web. Most shared webhosts won't support C++. Indeed, a C++ crash may be rare if you are careful. However, crashing a webserver shared by customers is simply not an option. Although not as fast and powerful as compiled C++, it certainly takes great effort to reach the limits of PHP.  Nearly every webhost supports PHP. In most cases, it may be important for a new A.I. to learn and grow from interactions with the public.   

There are indubitably other likelihoods, probabilities and possibilities... So please, let's hear from you, what are your perspectives?

 
Title: Re: Ultron7's J.A.R.V.I.S. Discussion
Post by: Ultron on February 10, 2015, 07:12:05 pm
I am not ashamed to admit that C++ is the only language I understand at this level, and I have chosen SQLite because it seemed easier to learn for starters. I have been also learning Java and C# for a while, but I am not quite that far yet. And as far as web-programming goes, I can only work with HTML, CSS, Javascript and only 'read' PHP.

Also, I have been working on Windows since my first computer, so I would not start something like this in unfamiliar grounds.

And I don't see why all this is a problem. The program shouldn't be too dependent of Windows because I am also planning to make peripheral versions for Android that communicate with the main program like with a server. But for now I am really just looking to test some concepts and how I do it is of no importance to me.

There should be 3-4 databases, two of which will contain approximately 540 thousand words and the other one or two is expected to contain about a million elements each. So yes, I will probably be looking for more efficient solutions in the future.

But since I am not showing off any programming skills and the center of importance is the idea and implementation itself, it does not matter in which language I post the source - besides, an experienced programmer could easily port it to another (did I mention the main.cpp is smaller then SQLite3? And it will remain small.).
Title: Re: Ultron7's J.A.R.V.I.S. Discussion
Post by: 8pla.net on February 10, 2015, 09:05:06 pm
Oh, just the opposite (of shame), C++ programmers have plenty to be proud of, such as being professional developers for the most part.  Aside from machine code, assembly language, and considering C Language is included in C++ ...  If I had to choose one computer programming language to build the most advanced A.I. possible. My choice would be C++. 

Would you consider object oriented PHP with classes, to show how similar it is to C++,  to be off topic?  I'm happy to limit the discussion to C++ programming and SQLite, if that is the theme you are after for this your thread.
Title: Re: Ultron7's J.A.R.V.I.S. Discussion
Post by: Ultron on February 10, 2015, 10:28:19 pm
I would love to explore other languages and experiment which behaves best in a given case. They say Lisp is the best for AI programming however I believe the language only influences mostly the efficiency - which is not trivial, but also not essential.

As I said, I am currently focused on the theory behind the program, and I do not intend to improve the code until the idea behind it.
Title: Re: Ultron7's J.A.R.V.I.S. Discussion
Post by: 8pla.net on February 17, 2015, 05:52:41 am
I just had sweet success on a piece of code, I'd been looking to write, just to see if I could do it.  First few attempts though, I called it quits a few times.  "Not today...", I'd say to myself.  And, then I would go back to it, the next day and manage to get it a little bit closer. And the day after that, even a little more closer.  Suddenly, one morning everything just became clear, finally it was implemented.  My theory all along was correct.  As for my earlier failures, they contained certain code snippets that were working correctly. So, I just cannibalized them for parts.
Title: Re: Ultron7's J.A.R.V.I.S. Discussion
Post by: Don Patrick on February 17, 2015, 08:26:36 am
Good to see you programming, Ultron. Is there a reason you are using both 'string' types and 'char' types? I only ever work with one of either.
Title: Re: J.A.R.V.I.S.
Post by: Ultron on February 17, 2015, 10:27:33 am
Yes Don, there is. Many different functions (both from the basic header set and sqlite3) require you to mix different types. I had chosen to work with strings mainly, but this means I have to write an additional 3 (sometimes up to 5-6) lines of code just to convert one type to another.

And it is not as simple as converting from one type to another - it is often the case that two types cannot be converted directly, so they have to undergo several conversions first. It is not easy to keep track (even when you have a comment after every function), as you can see from the picture, but I still manage to get an accurate conversion. It could cause problems with efficiency and speed however, because of all the additional lines (each with a function or two) which are mostly in loops within functions within functions... What!?

And 8planet... Yes I get that feeling often, but not because of all the programming errors. I sometimes stumble upon a rock (in my head) - I find out that this method of (let's call it) NLP, I somewhat limited. Yes there are obvious ways to improve it (I have concept updates for the next 2-3 versions) but sometimes it just isn't gonna do it. But that's good because I get to explore all the disadvantages of chat bots.

This program is intended to be a smart house assistant, not Artificial Intelligence. I believe (and hope to prove) that true NLP can never be achieved with classical methods. I believe that for true NLP a 'creature' must be able to associate each word with a sound, picture, feeling etc. so it can truly 'understand' it and thus be able to truly 'process' a sentence as opposed to what is done today - 'computing' or merely 'calculating' the output.

To make the distinction more clear - it is like comparing somebody who learns and understands the study material with somebody who merely memorizes the texts.
Title: Re: Ultron7's J.A.R.V.I.S. Discussion
Post by: Art on February 17, 2015, 01:39:12 pm
With all respect then how will your home automation assistant differ from say, Hal2000 or Homeseer or countless others on the market?

Is it to perhaps have more of a customizable and useful personality? Set timers, appointments, reminders, shopping lists, inventories, etc.?

Thanks!
Title: Re: Ultron7's J.A.R.V.I.S. Discussion
Post by: Don Patrick on February 17, 2015, 02:53:04 pm
You'll probably want to use the official term NLU (natural language understanding) instead of "true" Natural Language Processing.

If you have to do multi-line type conversions repeatedly, personally I would program mini-functions to do that with a single function call. It may theoretically take an extra microsecond but I find it much clearer to code and debug. For example, I made a custom enhanced version of "!strcmp()", simply called "is()", that my program calls several thousand times per sentence analysed, but it still replies instantaneously.

Anyway, coding tips aside, I am more interested in what Art is asking :). I'm always trying to make my AI some kind of useful, but I've found that a lot of the personal assistent tasks could equally be done with windows speech macros and a handful of voice commands.
Title: Re: Ultron7's J.A.R.V.I.S. Discussion
Post by: Ultron on February 17, 2015, 11:10:55 pm
Yes Don I have been considering making functions for that but for now they won't save me much lines - maybe if the program grows in source size.

Anyway, I am not too familiar with all of the features other assistants provides, but bear in mind this is a sort of proof-of-concept with no commercial aim. But anyway some of it's top features would be:

 -The ability to learn to reply to any sentence (it should in time be able to learn from both reading text files, internet and sometimes ask the user for help if previous fail);

 -To keep the program small and fast but still be able to do anything you would need help with (turn on the TV, lights etc.) I am planing to implementing a database containing addresses from where it can call various mini-programs (batch files, exe's etc). This should be implemented after a few processing tweaks and the update to jDB IV (which would enable it to understand if a sentence is a command, question, statement etc.). It should also be able to write it's own programs (most likely by filling code forms with parameters provided through normal conversation, so it can learn to do new things for you.

 -I believe personalities can only be simulated, and very poorly too. You can't just change a few parameters and get a new personality. However there will be of course a distinction between different copies of the program - the databases should be very different. Also it could easily remember user preferences such as how often do you want a status update, weather, local news etc. But I will not attempt to take it further than necessary.

To summarize this, it is intended to be a highly adaptable and dynamic program. It can improve it's conversation skills, update it's databases, learn new 'skills' and most importantly it adapts to the user in a real, non-commercial, 'natural' way. Not to mention (once it reaches jDB III / IV ) it should be able to reply to nearly all of the user input correctly.

I am not sure what my goal is, other then proving a small concept and gaining some experience with programming AI. The updates I have planed are not complicated - the concept is simple and the only thing that can slow me down is technical issues.

It is all on paper - ideas, methods, problems - just need to get it compiled. Also anyone is welcome to budge in, if they have the nerves. I am not sure how multiple people working on the same file would work, but contributing with some coding tips or functions that ease these processes is much appreciated.


P.S. Thanks for clearing the terms up as well, Don. Also Art, it should be easy to implement timers, alarms etc. with mini applets as mentioned previously.
Thank you all for the interest in the project :)
Title: Re: Ultron7's J.A.R.V.I.S. Discussion
Post by: Don Patrick on February 19, 2015, 07:46:39 pm
The first thing I noticed was that you were declaring "string sugOutPatP" twice. More importantly, the first time you declare it you don't set any value to it. This causes that string to contain random garbage values. You then set the other "string sugOutPat = sugOutPatP", which results in the garbage values being transferred to sugOutPat. Which can make your program blow up, crash, malfunction inexplicably, anything.
I make a habit of always assigning an empty "" value to any strings I declare to prevent such malfunctions.

What you seem to have fixed is the second declaration, by removing the word "string" within the "if()" statement. With the word "string" in front, the string, despite sharing the same name as the first, only existed within the "if()" statement, outside of which any reference to "sugOutPatP" would still refer to the first declared, unaffected and valueless, version.

Haven't looked at your new problem yet. Let me know if you've fixed the first one properly.
(also if you post the actual code instead of screenshots I could easier copy-paste and explain)
Title: Re: Ultron7's J.A.R.V.I.S. Discussion
Post by: Ultron on February 19, 2015, 11:04:56 pm
Yes you are right. There were a few problems caused by declarations placed in the wrong place, like the one that was placed in the if statement but although incorrect they were not the key to the problem. I actually fixed that fairly quickly however I do not post an update after every tiny bug I fix :)

Also, you can see a lot of pointless cout's and declarations and variables in my code at this phase - this is because of my preferred way of debugging. I place some cout's, try to move or copy the values of variables to others in order to pinpoint the exact problem.

I learned a great deal from all of these mistakes, but most of them were made because I was rushing to get this program working so I skipped some thinking and because I had to change the original code a lot there were many errors such as "=<" instead of "<" and so on.

I will post and update in a few minutes. In the meantime I would ask if Fred or a moderator can move the discussions to the other thread created for that specific purpose - just to keep this thread tidy and easy to find the actual useful content (not that the discussion is pointless, but you get my point).
And thank you all for your interest and everyday input on my ideas as well as taking the time to check out bits of the code for errors :) It is the psychological support that is the most valuable.
Title: Re: Ultron7's J.A.R.V.I.S. Discussion
Post by: Don Patrick on February 21, 2015, 07:22:08 am
I see, so the other thread is strictly for monologueing? I'll ignore it then because of my tendency to offer solutions when people post problems.

I do think that the ability to remember user preferences, or rather learn the user's habits, is fairly novel.
Title: Re: Ultron7's J.A.R.V.I.S. Discussion
Post by: Ultron on February 21, 2015, 12:11:42 pm
Well not so strictly, but since it's meant for updates I don't think it should be mixed with discussion. Not that I mind anybodies comments - on the contrary, I thank you all for the interest. Also if anyone happens to post there by accident nobody will mind - it's the moderator's job to move topics anyway :P

And thank you for all your input Don :) It is good to know there are still people out there who want to help because...they want to help! And not earn money or some virtual 'reputation' (I hate the StackOverflow community - for the record).

Anyway, I see the aspect of adapting to the user as essential, not a good or novel addition to the program. If this is going to be an 'A.I.' project, then it must be able to change on it's own and adapt to the environment - in this case, the hardware it is installed on and the user commanding it.
And for the record, the project is Open to anyone who wants in on it - Jarvis is just the first stepping stone in the whole 'franchise'. I have so much functions, concepts and database designs on paper but my inexperienced self can only manage to code so much with my time.

I have designs for 4 more updates on the database design (all the way to jDB - V) and have also been designing a 'grammar processing engine', which would involve creating a program much like Jarvis except it would work on a different principle but also create a C++ header that other's can use it to ease their chatbot projects. I am looking forward to one day compare these two methods of NLP (or more appropriately NLU) to find out which one is more agile.

The 'flagship' of all these projects and ideas is a concept for a true A.I. that should be able to become 'human' in a psychological way. During the summer I plan on making a makeshift robot / android which would serve as a platform for the A.I. (the concept involves it being able to 'experience' things in a physical manner).
Title: Re: Ultron7's J.A.R.V.I.S. Discussion
Post by: Ultron on February 22, 2015, 05:48:42 pm
Well the first prototype is finally complete and running smoothly. I made some final tweaks (mostly aesthetic) and another fix for one of the character counters. The databases are VERY limited and I am having a very hard time finding and easy way to shove 500k words into them. I have found many project which are either lists of English words - even managed to find some which are listed along with their corresponding linguistic 'types' or 'parts of speech' however my structures differ greatly and at this point it seems I will have to manually fill the databases.


I have also managed to make an installer for Version 0.1A - this is really just for the experience and education, but nonetheless it saves you a few extra seconds in case you simply wish to try out the prototype.



Some projects that might be of potential use:


http://wordlist.aspell.net/
http://www-01.sil.org/linguistics/wordlists/english/wordlist/wordsEn.txt
http://en.wikipedia.org/wiki/Moby_Project


Just sharing these in case anyone else might find a need.


Anyways, I have began coding Version 0.2 - so far I have completed one new function, did some minor code tweaking and also began upgrading the database system to jDB II. This means that AwDB will now contain two additional fields - 'preceeded' and 'VERB_FORM'. The latter is used for words that can (besides their MAIN_FORM / type) also be verbs. If a word cannot be of a verb type in any case, then the field is left with value NULL.


Also, Version 0.2 is planned to contain a TTS engine (I am not sure which) and this should just represent another aesthetic tweak and since I have previous experience with TTS in C++ it shouldn't be much a job.


It may also be worth noting that JARVIS is not expected to be of any particular use until Version 0.3, which is planned to allow you to communicate with the program via microphone and execute external programs (most likely going to implement a batch caller function).
And while this version might be of technical use, JARVIS is not expected to be a proper 'chatter' until I implement jDB V system (possible version 0.4 - 0.5).


I'd also like to point out (again) that I do not expect this program to ever become a smart and human-like chatterbot. I believe this is nearly impossible - specially if you want the program to have a character of his own. Our character is determined by so many things and a lifetime of experiences - something I doubt programmers will ever be able to 'code'. Though it may not be entirely impossible - just not to that 'natural' extent.
Title: Re: Ultron7's J.A.R.V.I.S. Discussion
Post by: 8pla.net on February 23, 2015, 03:03:48 am
Yay!  I've been appointed the author of this awesome new thread --  Woo Hoo!
I may download the C++ source and compile it on Linux when I have a chance.
Thing is, I'm running SQLite 2.0 at the moment, so I may have to upgrade first.
Title: Re: Ultron7's J.A.R.V.I.S. Discussion
Post by: Ultron on February 23, 2015, 08:21:03 pm
Actually the installation does everything for you. Then you can download the source zip. You just need to have MinGW installed before you can run this.
You don't need to download SQLite 3 as I have it included in the source.

Also let me know how it goes (if it even does) on Linux. I will need to start thinking about portability since I also want this mobile (Android and smartwatches) but no support for Apple users.
Title: Re: Ultron7's J.A.R.V.I.S. Discussion
Post by: Don Patrick on February 25, 2015, 06:52:41 pm
Thanks for linking the Moby project. I know what you mean about having different structures, it makes most of all available word lists either incompatible or flawed after conversion, but the lists of names and abbreviations could always come in handy.
Title: Re: Ultron7's J.A.R.V.I.S. Discussion
Post by: Ultron on February 25, 2015, 10:27:43 pm
Actually, since I am coding the converter myself I could easily fix conversion problems (from .txt or similar to my format) however there just isn't such data anywhere (word + type). I have found huge word lists and have managed to make a program that converts the .txt list to my .db format but that's about it.
Title: Re: Ultron7's J.A.R.V.I.S. Discussion
Post by: Don Patrick on February 26, 2015, 07:23:30 am
That is what I meant. My database handles word types differently than the classic grammatical "noun", "adjective" etc. structure, except names, amounts and numbers. So even if I converted such word lists, a great deal of words would be misclassified. Instead I use morphology and grammar to let the program categorise words on its own, but that's not a perfect solution either. I wonder if other grammar parsers do use strictly word lists of noun/adverb/adjective/verb categories.
Title: Re: Ultron7's J.A.R.V.I.S. Discussion
Post by: Ultron on February 26, 2015, 11:43:12 am

I am also working on another prototype program much like Jarvis, except it's chatbot focuses on grammar and morphology. In the future I plan to merge these two prototypes and form a chatbot (named Jocasta) that is to never make a logical mistake while chatting.


Anyways, for the moment I could use even the basic classifications and theoretically I could make a secondary program to estimate and judge a type of word (according to my classification) by exploring how it is used in different sentences. My idea for the next version was to have a more specific word classification (which is essential since like this it cannot differentiate between a  whale and a table).


This would be something like: noun -> entity -> name -> personal;                (Jonathan)
                                                    noun -> entity -> item -> tool -> electronic;    (multimeter)
                                                    verb -> animal -> human;                                    (crying)


See, I believe we naturally classify things (entities, actions...) in a similar manner, however we also have some sort of bio-databases further explaining each - what does crying mean we should do? Does it depend on who is crying? Is Jonathan a friend or foe?


This is designed so the chatterbot can reply accurately (in context) and make sense. Jarvis will never 'understand' what he is saying, nor what he is listening to. He will however, be able to take appropriate action and write a logical response to what he hears, much like we do.


A real AGI would be able to make this classification on it's own, by exploring life like we do. For that, it cannot be stuck in a stationary computer and learn about life by reading what he is told. Try describing colors to someone who was born blind. Yeah, same with Jarvis.
Title: Re: Ultron7's J.A.R.V.I.S. Discussion
Post by: Ultron on May 10, 2015, 09:22:27 pm
I have been recently studying openGL, serial communications and more through openFrameworks - a C++ toolset which I recently learned about. The tool is amazing and makes simple tasks the way they should be - simple. However the graphics required for me next (and actually usable) release of JARVIS are far from simple.


For the HUD I am looking to make a globe which involves a lot of details on it's own - and a lot of functionality. But for a start I will be satisfied with making the hexagon sphere around it. It is supposed to be semi-transparent and made out of hexagons - obviously - and I have no idea how to achieve this. I've been thinking buckyballs:


http://notime.arts.ucla.edu/zerowave/images/print/Push.jpg (http://notime.arts.ucla.edu/zerowave/images/print/Push.jpg)


But I would require a larger version (with more hexagons) and also I believe it would be best if they would be curved (as if the shapes were drawn onto a plain ball).


I realize there is not much of you with experience on this, but hope is not to be given up. OpenFrameworks have a poor collection of tutorials and it is hard utilizing the many openGL tutorials since many functions are wrapped or available under different names.
Title: Re: Ultron7's J.A.R.V.I.S. Discussion
Post by: Ultron on September 11, 2018, 08:14:03 pm
Hello everyone!

I accidentally stumbled upon a reference somewhere to my JARVIS project that is discussed here and I got nostalgic. I was also amazed by the view count on the topic so I suppose I sort of owe everyone an update.

Sadly I don't have any incredible creation to showcase, however I just wanted to state that the project still lives! Currently in a slightly different form - a machine-learning capable, artificially intelligent IoT network managed from a computer cluster. It is still in it's young phases however a working web and mobile interface as well as a demo IoT/Web server running on raspberry pi is already fully functional. I will gladly post a topic on the entire subject as it is very big and interdisciplinary, involving both hardware, software and web design.
Time is scarce as I both study robotics and work professionally as a web developer but I am looking forward to joining back this incredible community!
Title: Re: Ultron7's J.A.R.V.I.S. Discussion
Post by: Freddy on September 11, 2018, 08:42:00 pm
Hi and welcome back !

I'm looking forward to hearing what you have been creating :)
Title: Re: Ultron7's J.A.R.V.I.S. Discussion
Post by: 8pla.net on September 12, 2018, 01:25:35 am
Raspberry Pi ?  That's great!