Hi,  Wow!

On Fri, Sep 1, 2017 at 4:20 AM, Masayuki Hatta <[email protected]> wrote:

> Hi,
>
> I added Debian packages of RelEx (and JWNL) to my Debian APT
> repository[1], so now a whole set of the OpenCog NLP pipline is available
> as .deb packages.  They can be used (almost) right out of the box if you
> are using Debian, Ubuntu or some other Debian-derivatives.
>

Very good!

>
> Now I'm trying to test with opencog/nlp/chatbot, and basically it works as
> expected.  But cogita (IRC bridge) doesn't work.  I appreciate if you could
> help.
>
> -----
>
> The following is the verbose log of what I do, step by step (basically
> following https://github.com/opencog/opencog/tree/master/opencog/
> nlp/chatbot).  I hope some other Debian/Ubuntu users out there would give
> it a try and re-test:
>
> 1) Running RelEx server
>
> Install "opencog-relex" package, then
>
> $ opencog-server
>
> (It's supposed to be opencog-server.sh, but Debian Policy doesn't allow
> executable extensions like .sh or .pl, so I changed the file name)
>

This should be renamed to something else, because it is not really the
"opencog server", it is the "relex server that generates opencog-style
output".

Maybe call it "relex-opencog" or "relex-oc-bridge" or something like that?

>
> Seems it works nicely:
>
> $ telnet localhost 4444
> Trying ::1...
> Connected to localhost.
> Escape character is '^]'.
>
> This is a pen.
>
> ; (S (NP this.p) (VP is.v (NP a pen.n)) .)
>
> (snip)
>
> ; END OF SENTENCE
> Connection closed by foreign host.
>
> 2) Running cogserver for chatbot
>
> I ship opencog/nlp/chatbot/run-chatbot.scm and lib/opencog-chatbot.conf
> as examples in my "opencog" package, so copy them to my home dir:
>
> $ cp /usr/share/doc/opencog/examples/run-chatbot.scm
> /usr/share/doc/opencog/examples/opencog-chatbot.conf ~
>
> And edit run-chatbot.scm a bit to change the path accordingly:
>
> --- ./run-chatbot.scm   2017-09-01 17:53:28.080287457 +0900
> +++ ./run-chatbot.scm.new       2017-09-01 17:51:23.480283129 +0900
> @@ -1,5 +1,5 @@
> -#! /usr/local/bin/guile \
> -  -L /usr/local/share/opencog/scm --
> +#! /usr/bin/guile \
> +  -L /usr/share/opencog/scm --
>  !#
>  ; For users who are not aware of readline ...
>  (use-modules (ice-9 readline))
> @@ -17,4 +17,4 @@
>  ; See https://github.com/opencog/opencog/issues/2021
>  (load-r2l-rulebase)
>
> -(start-cogserver "../lib/opencog-chatbot.conf")
> +(start-cogserver "./opencog-chatbot.conf")
>
> Then setting up a simple ~/.guile (at least adding /usr/share/opencog/scm
> to load path is needed):
>
> (add-to-load-path "/usr/share/opencog/scm")
>
> (add-to-load-path ".")
> (use-modules (ice-9 readline))
> (activate-readline)
>
> Now run guile:
>
> $ guile -l run-chatbot.scm
>
> (snip)
>
> Listening on port 17004
> GNU Guile 2.0.13
> Copyright (C) 1995-2016 Free Software Foundation, Inc.
>
> Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
> This program is free software, and you are welcome to redistribute it
> under certain conditions; type `,show c' for details.
>
> Enter `,help' for help.
> scheme@(guile-user)>
>
> And also it works as expected:
>
> $ telnet localhost 17004
>
> Trying ::1...
> Trying 127.0.0.1...
> Connected to localhost.
> Escape character is '^]'.
> (process-query "mhatta" "Are you a bot?")
> Entering scheme shell; use ^D or a single . on a line by itself to exit.
> guile> Hello mhatta, you said: "Are you a bot?"
> You asked a Truth Query
> I can't process truth query for now
>
> guile>
>

Yes, that all looks correct.


>
> 3) Now the problem.  I ship a pre-copmpiled binary of cogita in my
> "opencog" package as /usr/bin/cogita. And it seems to work:
>
> $ cogita -c mhatta-test
>
> And it can enter #mhatta-test@freenode.
>
> [18:03] == cogita-bot [[email protected]] has joined
> #mhatta-test
> [18:03] -cogita-bot:#mhatta-test- ola
> [18:03] <cogita-bot> here we are
>
> But it doesn't respond my queries. Seems it received the message anyway:
>
> :mhatta!3ba8fe13@gateway/web/freenode/ip.12.345.678.99 PRIVMSG
> #mhatta-test :cogita-bot: Hello!
> #mhatta-test: <mhatta> cogita-bot: Hello!
> input=:cogita-bot: Hello!
> nick=mhatta ident=3ba8fe13 host=gateway/web/freenode/ip.12.345.678.99
> target=#mhatta-test
> opencog reply:
>
> And seems cogita is sending to opencog cogserver something like:
>
> scm hush
> (process-query "mhatta" " Are you a bot?")
>

Yes, that would be correct.  Try removing the "scm hush" and see what
happens.

Are you sure that cogita connected to port 17004? Because if it did, it
should work ... The socket interface between cogita and the cogserver is
very simple...

Try altering the cogita source code, and see if you get a reply to (+ 2 2)
or (display "this is a test\n")  If you get a reply, then the socket
connection works, and (process-query..) is broken.

I cannot test the apt repo today, I've got too much to worry about right
now.

--linas

>
> But got no reply at all.  I think this query is correct abd cogserver is
> listening -- what's wrong?
>
> [1]: How to use my Debian APT repository for OpenCog
>
> I explained this in the previous mail, but anyway reprise here.
>
> 1) Add the repository:
>
> Do
>
> $ sudo touch /etc/apt/sources.list.d/opencog.list
>
> and put the following 2 lines in it:
>
> deb https://people.debian.org/~mhatta/debian mhatta-unstable/
> deb-src https://people.debian.org/~mhatta/debian mhatta-unstable/
>
> 2) Add my GPG key:
>
> $ wget -q -O - https://people.debian.org/~mhatta/mhatta.asc | sudo
> apt-key add
>
> 3) Then
>
> $ sudo apt-get update; sudo apt-get install opencog opencog-atomspace
> opencog-moses opencog-relex
>
> Some other libraries and updated link-grammar packages will be installed,
> too.
>
> Also, files are directly available at https://people.debian.org/~
> mhatta/debian/mhatta-unstable/
>
> Please let me know if you have any difficulties.
>
> --
> You received this message because you are subscribed to the Google Groups
> "opencog" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/opencog.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/opencog/e1284c3f-efb2-4ed6-929d-cd1b762ec1a9%40googlegroups.com
> <https://groups.google.com/d/msgid/opencog/e1284c3f-efb2-4ed6-929d-cd1b762ec1a9%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*"The problem is not that artificial intelligence will get too smart and
take over the world," computer scientist Pedro Domingos writes, "the
problem is that it's too stupid and already has." *

-- 
You received this message because you are subscribed to the Google Groups 
"opencog" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/opencog.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/opencog/CAHrUA3645R2APM0%2BdTs9NFVGvmhL%3DMqikG%3DHu2ZBWBqdzwizCw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to