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.
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)
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>
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:#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?")
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.