LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   For Fun: Universal AI,Artificial Intelligence, auto-learn, basic version,a daily code (https://www.linuxquestions.org/questions/programming-9/for-fun-universal-ai-artificial-intelligence-auto-learn-basic-version-a-daily-code-766324/)

frenchn00b 11-02-2009 04:39 PM

For Fun: Universal AI,Artificial Intelligence, auto-learn, basic version,a daily code
 
Hello,

While you sleep, one can add some lines to this basic intelligence code.

The basic of this coding is:
- it has to be very basic: A B C D sentences, with A subject and B complement (in right order at beginning)
- it has to be coded in bash or sh
- it can be elaborated, and is capable of learning
The code has to be the simplest as possible, since all is dictionary/database dependent. A can be verb (action / shell), or noun, or subject.
- 2 files only: the main code of the bash program and the database.
- it shall be capable to learn, e.g. type:
Code:

!learn
to add to main dictionary database

Example:
Code:

    George say hello
:> hello

George is e.g. the A.I.

Here is the start:

Code:

echo "Hello"

clear

while [ 1 ] ; do

echo  " "
printf ":> "
read cmd


if [ "" != "$cmd" ] ; then
   
    cat dico.txt | while read ii ; do
        #echo "seen: $ii"
       
        if  [ `echo $ii | cut -f1 -d" "` == `echo $cmd | cut -f1 -d" "`  ] ; then
           
            if  [ "n" == `echo $ii | cut -f2 -d" "`  ] ; then
                  echo $ii | cut -f3-25 -d" "
            fi
           
            if  [ "v" == `echo $ii | cut -f2 -d" "`  ] ; then
                  echo "exec..."
                  echo `echo $ii | cut -f3 -d" "` `echo $cmd | cut -f3 -d" "`
                  exec `echo $ii | cut -f3 -d" "` `echo $cmd | cut -f3 -d" "`
            fi
           
        fi
       
    done
   

fi




if [ "!learn" == "$cmd" ] ; then
        printf "name:"
        read i
        printf "type, (n for noun and v for action,verb):"
        read j
        if [ "$j" == "v" ] ; then
            printf "command:"
            else
            printf "word definition:"
        fi
        read k
        echo "$i $j $k" >> dico.txt
fi


if [ "!view" == "$cmd" ] ; then
    cat dico.txt
fi


if [ "!quit" == "$cmd" ] ; then
    exit
    exit 0
fi




done


with dico.txt
Code:

hello n hello
good n positive value
cat n lazy animal of human
dog n animal of human
pc n personal computer
linux n the best operating system

While you sleep, we work on it :)

Have Fun while coding !! That's the principle& idea !! Not research
Maybe we could have a pseudo - AI, at the end. Never dream, no one will never make it perfect, never, let's stop dreaming. Real A.I. is not possible, will be always bits.

MS3FGX 11-02-2009 04:46 PM

I am not sure I have words to describe my confusion. How are we supposed to work on this in our sleep, exactly?

frenchn00b 11-02-2009 04:55 PM

Quote:

Originally Posted by MS3FGX (Post 3741819)
I am not sure I have words to describe my confusion. How are we supposed to work on this in our sleep, exactly?

Bash is very basic, everyone almost understands bash, can be even destined to 1-3 weeks new linux users, and can be good start for new linux fans, to get into bash code/commands. Bash can be read easily, and limits the code to the simplest, since it has to be simple to ever have any chances of having any interesting potentials / results.

While you sleep, it is so simple to work with bash, everyone can contribute a piece of code, even an if [ ] ; then ... or a single line costs almost : nothing in time, if 1x line per 100, it becomes fun to see where we end up :) Ever it has chances or will die, like *nix codes, sometimes.
That's Linux, and will certainly always exists in the future. 100pct new Ubuntu users, each year. It has some good.

~$ apt-get moo
(__)
(oo)
/------\/
/ | ||
* /\---/\
~~ ~~
...."Have you mooed today?"...


All times are GMT -5. The time now is 01:04 AM.