From feafa87ae88539cd7d69cb8a26d330b311f03fab Mon Sep 17 00:00:00 2001 From: Linas Vepstas Date: Tue, 24 Dec 2013 01:15:53 -0600 Subject: [PATCH 1/5] Misc scripts updates --- .../nlp/learn/misc-scripts/opencog-fr.conf | 65 +++++++++++++++++++ opencog/nlp/learn/misc-scripts/ss-one.sh | 15 ++++- opencog/nlp/learn/misc-scripts/wiki-ss-fr.sh | 7 ++ opencog/nlp/learn/misc-scripts/wiki-ss-lt.sh | 2 +- 4 files changed, 85 insertions(+), 4 deletions(-) create mode 100644 opencog/nlp/learn/misc-scripts/opencog-fr.conf create mode 100755 opencog/nlp/learn/misc-scripts/wiki-ss-fr.sh diff --git a/opencog/nlp/learn/misc-scripts/opencog-fr.conf b/opencog/nlp/learn/misc-scripts/opencog-fr.conf new file mode 100644 index 00000000000..b59c3f86bea --- /dev/null +++ b/opencog/nlp/learn/misc-scripts/opencog-fr.conf @@ -0,0 +1,65 @@ +# +# This file provides an example configuration for a production OpenCog +# server. Particularly noteworthy is the list of automatically loaded +# modules. +# +SERVER_PORT = 17003 +LOG_FILE = cogserver-fr.log + +# Other possible log levels are "error", "warn", "info", "debug" and "fine" +# LOG_LEVEL = debug +LOG_LEVEL = info +LOG_TO_STDOUT = false +SERVER_CYCLE_DURATION = 100 +IDLE_CYCLES_PER_TICK = 3 + +# Economic Attention Allocation parameters +STARTING_STI_FUNDS = 10000 +STARTING_LTI_FUNDS = 10000 +STI_FUNDS_BUFFER = 10000 +LTI_FUNDS_BUFFER = 10000 +MIN_STI = -400 + +# Use this command PROMPT when telnet/terminal doesn't support ANSI +PROMPT = "opencog> " +# Prompt with ANSI color codes +ANSI_PROMPT = "opencog> " +# Use this guile PROMPT when telnet/terminal doesn't support ANSI +SCM_PROMPT = "guile> " +# Prompt with ANSI color codes +ANSI_SCM_PROMPT = "guile> " +# Global option so that modules know whether they should output ANSI color +# codes +ANSI_ENABLED = true + +# Cogserver in OSX will automatically change .so extension to .dylib +# if .so exists. +MODULES = opencog/server/libbuiltinreqs.so, + opencog/persist/sql/libpersist.so, + opencog/query/libquery.so, + opencog/shell/libscheme-shell.so, + opencog/nlp/types/libnlp-types.so + + +SCM_PRELOAD = atomspace/core_types.scm, + spacetime/spacetime_types.scm, + nlp/types/nlp_types.scm, + dynamics/attention/attention_types.scm, + scm/persistence.scm, + scm/utilities.scm, + scm/apply.scm, + scm/file-utils.scm, + scm/debug.scm, + nlp/scm/type-definitions.scm, + nlp/scm/config.scm, + nlp/scm/file-utils.scm, + nlp/scm/nlp-utils.scm, + nlp/scm/disjunct-list.scm, + nlp/scm/processing-utils.scm, + nlp/learn/link-pipeline.scm + +# Database login credentials. Change these to reflect your actual setup! +STORAGE = "learn-fr" +STORAGE_USERNAME = "linas" +STORAGE_PASSWD = "asdf" +# diff --git a/opencog/nlp/learn/misc-scripts/ss-one.sh b/opencog/nlp/learn/misc-scripts/ss-one.sh index a5cfacd7a33..439fb25eba8 100755 --- a/opencog/nlp/learn/misc-scripts/ss-one.sh +++ b/opencog/nlp/learn/misc-scripts/ss-one.sh @@ -7,18 +7,23 @@ # # Set up assorted cnstants needed to run. -lang=lt +lang=$1 +filename="$2" + splitter=/home/linas/src/relex/src/split-sentences/split-sentences.pl splitdir=split-articles subdir=submitted-articles -filename="$1" - # Punt if the cogserver has crashed haveserver=`ps aux |grep cogserver |grep opencog-$lang` if [[ -z "$haveserver" ]] ; then exit 1 fi +haveserver=`ps aux |grep relex |grep linkgram` +if [[ -z "$haveserver" ]] ; then + exit 1 +fi + # Split the filename into two parts base=`echo $filename | cut -d \/ -f 1` @@ -36,6 +41,10 @@ haveserver=`ps aux |grep cogserver |grep opencog-$lang` if [[ -z "$haveserver" ]] ; then exit 1 fi +haveserver=`ps aux |grep relex |grep linkgram` +if [[ -z "$haveserver" ]] ; then + exit 1 +fi # Move article to the done-queue mv "$splitdir/$rest" "$subdir/$rest" diff --git a/opencog/nlp/learn/misc-scripts/wiki-ss-fr.sh b/opencog/nlp/learn/misc-scripts/wiki-ss-fr.sh new file mode 100755 index 00000000000..e2e9e9b0c7e --- /dev/null +++ b/opencog/nlp/learn/misc-scripts/wiki-ss-fr.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# +# Batch parsing script. +# Loop over all the files in 'beta-pages', sentence-split them +# and submit them for parsing. +# +time find beta-pages -type f -exec ./ss-one.sh fr "{}" \; diff --git a/opencog/nlp/learn/misc-scripts/wiki-ss-lt.sh b/opencog/nlp/learn/misc-scripts/wiki-ss-lt.sh index 57dee9d213c..ec8b8689507 100755 --- a/opencog/nlp/learn/misc-scripts/wiki-ss-lt.sh +++ b/opencog/nlp/learn/misc-scripts/wiki-ss-lt.sh @@ -4,4 +4,4 @@ # Loop over all the files in 'beta-pages', sentence-split them # and submit them for parsing. # -time find beta-pages -type f -exec ./ss-one.sh "{}" \; +time find beta-pages -type f -exec ./ss-one.sh lt "{}" \; From 3d9b024bbccb940d7a857a43da0b6ed8711c7d93 Mon Sep 17 00:00:00 2001 From: Linas Vepstas Date: Tue, 24 Dec 2013 10:08:20 -0600 Subject: [PATCH 2/5] tweak sql parameters for performance. --- opencog/persist/sql/AtomStorage.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/opencog/persist/sql/AtomStorage.cc b/opencog/persist/sql/AtomStorage.cc index 7d6a76a4c75..f61f69aa23a 100644 --- a/opencog/persist/sql/AtomStorage.cc +++ b/opencog/persist/sql/AtomStorage.cc @@ -366,8 +366,11 @@ void AtomStorage::init(const char * dbname, const char * username, const char * authentication) { - // Create four, by default ... maybe make more? - for (int i=0; i<4; i++) + // Create six, by default ... maybe make more? + // There should probably be a few more here, than the number of + // startWriterThread() calls below. +#define DEFAULT_NUM_CONNS 6 + for (int i=0; i Date: Tue, 24 Dec 2013 12:02:22 -0600 Subject: [PATCH 3/5] Add sql INSERT/UPDATE locks. The SQL INSERT statement can only be issued once, ever, for a given atom. Add locks to prevent two threads from trying to call it simultaneously. --- opencog/persist/sql/AtomStorage.cc | 76 +++++++++++++++++++++++++++--- opencog/persist/sql/AtomStorage.h | 6 +++ 2 files changed, 76 insertions(+), 6 deletions(-) diff --git a/opencog/persist/sql/AtomStorage.cc b/opencog/persist/sql/AtomStorage.cc index f61f69aa23a..0c2816d1023 100644 --- a/opencog/persist/sql/AtomStorage.cc +++ b/opencog/persist/sql/AtomStorage.cc @@ -35,6 +35,7 @@ #include +#include #include #include #include @@ -383,6 +384,11 @@ void AtomStorage::init(const char * dbname, db_typename[i] = NULL; } + // Associate the create lock with the create mutex, + // but leave it unlocked. + std::unique_lock crl(id_create_mutex, std::defer_lock); + id_create_lock.swap(crl); + local_id_cache_is_inited = false; if (!connected()) return; @@ -824,15 +830,14 @@ void AtomStorage::do_store_single_atom(AtomPtr atom, int aheight) // Use the TLB Handle as the UUID. char uuidbuff[BUFSZ]; - // UUID uuid = atom->_uuid; - Handle h = atom->getHandle(); + Handle h(atom->getHandle()); if (TLB::isInvalidHandle(h)) throw RuntimeException(TRACE_INFO, "Trying to save atom with an invalid handle!"); - UUID uuid = h.value(); // XXX cheesy hack, fixme + UUID uuid = h.value(); snprintf(uuidbuff, BUFSZ, "%lu", uuid); - bool update = atomExists(h); + bool update = maybe_exists_id(uuid); if (update) { cols = "UPDATE Atoms SET "; @@ -953,7 +958,7 @@ void AtomStorage::do_store_single_atom(AtomPtr atom, int aheight) #endif /* USE_INLINE_EDGES */ // Make note of the fact that this atom has been stored. - add_id_to_cache(atom->getHandle().value()); + add_id_to_cache(uuid); } /* ================================================================ */ @@ -1087,11 +1092,70 @@ bool AtomStorage::atomExists(Handle h) /** * Add a single UUID to the ID cache. Thread-safe. + * This also unlocks the id-creation lock, if it was being held. */ void AtomStorage::add_id_to_cache(UUID uuid) { std::unique_lock lock(id_cache_mutex); local_id_cache.insert(uuid); + + // If we were previously making this ID, then we are done. + // The other half of this is in maybe_exists_id() below. + if (0 < id_create_cache.count(uuid)) + { + id_create_cache.erase(uuid); + id_create_lock.unlock(); + } +} + +/** + * This returns true, or false, depending on whether we think that the + * database already knows about this UUID, or not. We do this because, + * we need to use an SQL UPDATE vs SQL INSERT depending on which case it + * is. Note that SQL INSERT can be used once and only once-ever, so we + * have to avoid teh case of two threads, each trying to perform an INSERT + * in the same ID. We do this by locking, so that only one writer ever + * gets told that its a new ID. + */ +bool AtomStorage::maybe_exists_id(UUID uuid) +{ + std::unique_lock cache_lock(id_cache_mutex); + // Look at the local cache of id's to see if the atom is in storage or not. + if (0 < local_id_cache.count(uuid)) + return true; + + // Is some other thread in the process of adding this ID? + bool id_is_being_made = (0 < id_create_cache.count(uuid)); + if (id_is_being_made) + { + cache_lock.unlock(); + while (true) + { + // If we are here, some other thread is making this UUID, + // and so we need to wait till they're done. Wait by stalling + // on the creation lock. + id_create_lock.lock(); + // If we are here, then someone finished creating some UUID. + // Was it our ID? If so, we are done; if not, wait some more. + cache_lock.lock(); + if (0 == id_create_cache.count(uuid)) + { + id_create_lock.unlock(); + + OC_ASSERT(0 < local_id_cache.count(uuid), + "Atom for UUID was not created!"); + + return true; + } + cache_lock.unlock(); + } + } + + // If we are here, then no one has attempted to make this UUID before. + // Grab the maker lock, and make the damned thing already. + id_create_lock.lock(); + id_create_cache.insert(uuid); + return false; } /** @@ -1490,7 +1554,7 @@ void AtomStorage::store(const AtomTable &table) #endif table.foreachHandleByType( - [&](Handle h)->void { store_cb(h); }, ATOM, true); + [&](Handle h)->void { store_cb(h); }, ATOM, true); #ifndef USE_INLINE_EDGES // Create indexes diff --git a/opencog/persist/sql/AtomStorage.h b/opencog/persist/sql/AtomStorage.h index 3ea06db66ad..03de937dd27 100644 --- a/opencog/persist/sql/AtomStorage.h +++ b/opencog/persist/sql/AtomStorage.h @@ -87,6 +87,12 @@ class AtomStorage std::set local_id_cache; void add_id_to_cache(UUID); void get_ids(void); + + std::mutex id_create_mutex; + std::unique_lock id_create_lock; + std::set id_create_cache; + bool maybe_exists_id(UUID); + UUID getMaxObservedUUID(void); int getMaxObservedHeight(void); bool idExists(const char *); From b7ac5c2e9a283acc6da1cd4e4ba5b216531d5e52 Mon Sep 17 00:00:00 2001 From: Linas Vepstas Date: Tue, 24 Dec 2013 12:15:22 -0600 Subject: [PATCH 4/5] Move common scm configuration to one file. --- lib/opencog.conf | 4 ++-- opencog/nlp/scm/processing-utils.scm | 5 ++++- opencog/scm/config.scm | 20 ++++++++++++++++++++ opencog/scm/debug.scm | 7 ------- opencog/scm/repl-shell.scm | 4 ++-- 5 files changed, 28 insertions(+), 12 deletions(-) create mode 100644 opencog/scm/config.scm delete mode 100644 opencog/scm/debug.scm diff --git a/lib/opencog.conf b/lib/opencog.conf index 92ceae40a79..3ec05f43cbd 100644 --- a/lib/opencog.conf +++ b/lib/opencog.conf @@ -53,14 +53,14 @@ MODULES = opencog/server/libbuiltinreqs.so, # need it. # opencog/persist/zmq/events/libatomspacepublishermodule.so -SCM_PRELOAD = atomspace/core_types.scm, +SCM_PRELOAD = scm/config.scm, + atomspace/core_types.scm, spacetime/spacetime_types.scm, nlp/types/nlp_types.scm, dynamics/attention/attention_types.scm, embodiment/AtomSpaceExtensions/embodiment_types.scm, # viterbi/viterbi_types.scm, scm/apply.scm, - scm/debug.scm, scm/file-utils.scm, scm/persistence.scm, scm/repl-shell.scm, diff --git a/opencog/nlp/scm/processing-utils.scm b/opencog/nlp/scm/processing-utils.scm index 76cd872f850..b759afaa7b8 100644 --- a/opencog/nlp/scm/processing-utils.scm +++ b/opencog/nlp/scm/processing-utils.scm @@ -49,6 +49,9 @@ ; to the "*new-parsed-sent-anchor*" via a ListLink; the set of newly added ; sentences can be fetched with the "get-new-parsed-sentences" call. ; +; The relex-server-host and port are set in config.scm, and default to +; localhost 127.0.0.1 and port 4444 +; (define (relex-parse plain-txt) ; A little short routine that sends the plain-text to the @@ -56,7 +59,7 @@ ; atomspace (using exec-scm-from-port to do the load) (define (do-sock-io sent-txt) (let ((s (socket PF_INET SOCK_STREAM 0))) - (connect s AF_INET (inet-aton "127.0.0.1") 4444) + (connect s AF_INET (inet-aton relex-server-host) relex-server-port) (display sent-txt s) (display "\n" s) ; must send newline to flush socket diff --git a/opencog/scm/config.scm b/opencog/scm/config.scm new file mode 100644 index 00000000000..f0a6a48006c --- /dev/null +++ b/opencog/scm/config.scm @@ -0,0 +1,20 @@ +; +; config.scm +; +; General cog-server configuration, for scheme. +; XXX TODO This stuff really should be unified with the opencog.conf +; file aka the util/config.h mechanisms. But, for now, these +; remain separate. I'm too lazy to "improve" this right now. +; +;-------------------------------------------------------------- +; Turn on debugging prints -- this generally makes life easier. +(turn-on-debugging) + +;-------------------------------------------------------------- +; The scheme shell listen port. +(define shell-port 18001) + +;-------------------------------------------------------------- +; The relex server host and port +(define relex-server-host "127.0.0.1") +(define relex-server-port 4444) diff --git a/opencog/scm/debug.scm b/opencog/scm/debug.scm deleted file mode 100644 index 83e4b50ca8d..00000000000 --- a/opencog/scm/debug.scm +++ /dev/null @@ -1,7 +0,0 @@ -; -; debug.scm -; -; Turn on debugging prints -- this generally makes life easier. -; -(turn-on-debugging) - diff --git a/opencog/scm/repl-shell.scm b/opencog/scm/repl-shell.scm index 32cd03b9175..06ed6e0c334 100644 --- a/opencog/scm/repl-shell.scm +++ b/opencog/scm/repl-shell.scm @@ -10,8 +10,8 @@ (use-modules (system repl server)) (use-modules (system repl common)) -; localhost, port number 18001 -(spawn-server (make-tcp-server-socket #:port 18001)) +; localhost, port number 18001 (shell-port is set in config.scm) +(spawn-server (make-tcp-server-socket #:port shell-port)) (repl-default-prompt-set! "opencog-scheme>") ; -------------------------------------------------------------------- From 0ae84684a851268ef16b016f341a82595d35e0f2 Mon Sep 17 00:00:00 2001 From: Linas Vepstas Date: Tue, 24 Dec 2013 12:29:28 -0600 Subject: [PATCH 5/5] Update the various language processing scripts. --- opencog/nlp/learn/misc-scripts/config-fr.scm | 18 +++++ opencog/nlp/learn/misc-scripts/config-lt.scm | 18 +++++ opencog/nlp/learn/misc-scripts/config-pl.scm | 18 +++++ .../nlp/learn/misc-scripts/opencog-fr.conf | 12 ++-- .../nlp/learn/misc-scripts/opencog-lt.conf | 12 ++-- .../nlp/learn/misc-scripts/opencog-pl.conf | 65 +++++++++++++++++++ opencog/nlp/learn/misc-scripts/wiki-ss-fr.sh | 2 +- opencog/nlp/learn/misc-scripts/wiki-ss-lt.sh | 2 +- opencog/nlp/learn/misc-scripts/wiki-ss-pl.sh | 7 ++ 9 files changed, 140 insertions(+), 14 deletions(-) create mode 100644 opencog/nlp/learn/misc-scripts/config-fr.scm create mode 100644 opencog/nlp/learn/misc-scripts/config-lt.scm create mode 100644 opencog/nlp/learn/misc-scripts/config-pl.scm create mode 100644 opencog/nlp/learn/misc-scripts/opencog-pl.conf create mode 100755 opencog/nlp/learn/misc-scripts/wiki-ss-pl.sh diff --git a/opencog/nlp/learn/misc-scripts/config-fr.scm b/opencog/nlp/learn/misc-scripts/config-fr.scm new file mode 100644 index 00000000000..1b17ea428e6 --- /dev/null +++ b/opencog/nlp/learn/misc-scripts/config-fr.scm @@ -0,0 +1,18 @@ +; +; config-fr.scm +; +; French parser config +; General cog-server configuration, for scheme. +; +;-------------------------------------------------------------- +; Turn on debugging prints -- this generally makes life easier. +(turn-on-debugging) + +;-------------------------------------------------------------- +; The scheme shell listen port. +(define shell-port 18002) + +;-------------------------------------------------------------- +; The relex server host and port +(define relex-server-host "10.1.1.4") +(define relex-server-port 4444) diff --git a/opencog/nlp/learn/misc-scripts/config-lt.scm b/opencog/nlp/learn/misc-scripts/config-lt.scm new file mode 100644 index 00000000000..60565a487e1 --- /dev/null +++ b/opencog/nlp/learn/misc-scripts/config-lt.scm @@ -0,0 +1,18 @@ +; +; config-lt.scm +; +; Lithuanian parser config +; General cog-server configuration, for scheme. +; +;-------------------------------------------------------------- +; Turn on debugging prints -- this generally makes life easier. +(turn-on-debugging) + +;-------------------------------------------------------------- +; The scheme shell listen port. +(define shell-port 18001) + +;-------------------------------------------------------------- +; The relex server host and port +(define relex-server-host "10.1.1.4") +(define relex-server-port 4444) diff --git a/opencog/nlp/learn/misc-scripts/config-pl.scm b/opencog/nlp/learn/misc-scripts/config-pl.scm new file mode 100644 index 00000000000..4e863d5a7ad --- /dev/null +++ b/opencog/nlp/learn/misc-scripts/config-pl.scm @@ -0,0 +1,18 @@ +; +; config-pl.scm +; +; Polish parser config +; General cog-server configuration, for scheme. +; +;-------------------------------------------------------------- +; Turn on debugging prints -- this generally makes life easier. +(turn-on-debugging) + +;-------------------------------------------------------------- +; The scheme shell listen port. +(define shell-port 18003) + +;-------------------------------------------------------------- +; The relex server host and port +(define relex-server-host "10.1.1.4") +(define relex-server-port 4444) diff --git a/opencog/nlp/learn/misc-scripts/opencog-fr.conf b/opencog/nlp/learn/misc-scripts/opencog-fr.conf index b59c3f86bea..f7ffc6d71c2 100644 --- a/opencog/nlp/learn/misc-scripts/opencog-fr.conf +++ b/opencog/nlp/learn/misc-scripts/opencog-fr.conf @@ -21,13 +21,13 @@ LTI_FUNDS_BUFFER = 10000 MIN_STI = -400 # Use this command PROMPT when telnet/terminal doesn't support ANSI -PROMPT = "opencog> " +PROMPT = "opencog-fr> " # Prompt with ANSI color codes -ANSI_PROMPT = "opencog> " +ANSI_PROMPT = "opencog-fr> " # Use this guile PROMPT when telnet/terminal doesn't support ANSI -SCM_PROMPT = "guile> " +SCM_PROMPT = "guile-fr> " # Prompt with ANSI color codes -ANSI_SCM_PROMPT = "guile> " +ANSI_SCM_PROMPT = "guile-fr> " # Global option so that modules know whether they should output ANSI color # codes ANSI_ENABLED = true @@ -41,7 +41,8 @@ MODULES = opencog/server/libbuiltinreqs.so, opencog/nlp/types/libnlp-types.so -SCM_PRELOAD = atomspace/core_types.scm, +SCM_PRELOAD = scm/config-fr.scm, + atomspace/core_types.scm, spacetime/spacetime_types.scm, nlp/types/nlp_types.scm, dynamics/attention/attention_types.scm, @@ -49,7 +50,6 @@ SCM_PRELOAD = atomspace/core_types.scm, scm/utilities.scm, scm/apply.scm, scm/file-utils.scm, - scm/debug.scm, nlp/scm/type-definitions.scm, nlp/scm/config.scm, nlp/scm/file-utils.scm, diff --git a/opencog/nlp/learn/misc-scripts/opencog-lt.conf b/opencog/nlp/learn/misc-scripts/opencog-lt.conf index 54982cd6025..2d3f6334c95 100644 --- a/opencog/nlp/learn/misc-scripts/opencog-lt.conf +++ b/opencog/nlp/learn/misc-scripts/opencog-lt.conf @@ -21,13 +21,13 @@ LTI_FUNDS_BUFFER = 10000 MIN_STI = -400 # Use this command PROMPT when telnet/terminal doesn't support ANSI -PROMPT = "opencog> " +PROMPT = "opencog-lt> " # Prompt with ANSI color codes -ANSI_PROMPT = "opencog> " +ANSI_PROMPT = "opencog-lt> " # Use this guile PROMPT when telnet/terminal doesn't support ANSI -SCM_PROMPT = "guile> " +SCM_PROMPT = "guile-lt> " # Prompt with ANSI color codes -ANSI_SCM_PROMPT = "guile> " +ANSI_SCM_PROMPT = "guile-lt> " # Global option so that modules know whether they should output ANSI color # codes ANSI_ENABLED = true @@ -41,7 +41,8 @@ MODULES = opencog/server/libbuiltinreqs.so, opencog/nlp/types/libnlp-types.so -SCM_PRELOAD = atomspace/core_types.scm, +SCM_PRELOAD = scm/config-lt.scm, + atomspace/core_types.scm, spacetime/spacetime_types.scm, nlp/types/nlp_types.scm, dynamics/attention/attention_types.scm, @@ -49,7 +50,6 @@ SCM_PRELOAD = atomspace/core_types.scm, scm/utilities.scm, scm/apply.scm, scm/file-utils.scm, - scm/debug.scm, nlp/scm/type-definitions.scm, nlp/scm/config.scm, nlp/scm/file-utils.scm, diff --git a/opencog/nlp/learn/misc-scripts/opencog-pl.conf b/opencog/nlp/learn/misc-scripts/opencog-pl.conf new file mode 100644 index 00000000000..1f3ecf7f0d4 --- /dev/null +++ b/opencog/nlp/learn/misc-scripts/opencog-pl.conf @@ -0,0 +1,65 @@ +# +# This file provides an example configuration for a production OpenCog +# server. Particularly noteworthy is the list of automatically loaded +# modules. +# +SERVER_PORT = 17004 +LOG_FILE = cogserver-pl.log + +# Other possible log levels are "error", "warn", "info", "debug" and "fine" +# LOG_LEVEL = debug +LOG_LEVEL = info +LOG_TO_STDOUT = false +SERVER_CYCLE_DURATION = 100 +IDLE_CYCLES_PER_TICK = 3 + +# Economic Attention Allocation parameters +STARTING_STI_FUNDS = 10000 +STARTING_LTI_FUNDS = 10000 +STI_FUNDS_BUFFER = 10000 +LTI_FUNDS_BUFFER = 10000 +MIN_STI = -400 + +# Use this command PROMPT when telnet/terminal doesn't support ANSI +PROMPT = "opencog-pl> " +# Prompt with ANSI color codes +ANSI_PROMPT = "opencog-pl> " +# Use this guile PROMPT when telnet/terminal doesn't support ANSI +SCM_PROMPT = "guile-pl> " +# Prompt with ANSI color codes +ANSI_SCM_PROMPT = "guile-pl> " +# Global option so that modules know whether they should output ANSI color +# codes +ANSI_ENABLED = true + +# Cogserver in OSX will automatically change .so extension to .dylib +# if .so exists. +MODULES = opencog/server/libbuiltinreqs.so, + opencog/persist/sql/libpersist.so, + opencog/query/libquery.so, + opencog/shell/libscheme-shell.so, + opencog/nlp/types/libnlp-types.so + + +SCM_PRELOAD = scm/config-pl.scm, + atomspace/core_types.scm, + spacetime/spacetime_types.scm, + nlp/types/nlp_types.scm, + dynamics/attention/attention_types.scm, + scm/persistence.scm, + scm/utilities.scm, + scm/apply.scm, + scm/file-utils.scm, + nlp/scm/type-definitions.scm, + nlp/scm/config.scm, + nlp/scm/file-utils.scm, + nlp/scm/nlp-utils.scm, + nlp/scm/disjunct-list.scm, + nlp/scm/processing-utils.scm, + nlp/learn/link-pipeline.scm + +# Database login credentials. Change these to reflect your actual setup! +STORAGE = "learn-pl" +STORAGE_USERNAME = "linas" +STORAGE_PASSWD = "asdf" +# diff --git a/opencog/nlp/learn/misc-scripts/wiki-ss-fr.sh b/opencog/nlp/learn/misc-scripts/wiki-ss-fr.sh index e2e9e9b0c7e..a7ba9c8c5ab 100755 --- a/opencog/nlp/learn/misc-scripts/wiki-ss-fr.sh +++ b/opencog/nlp/learn/misc-scripts/wiki-ss-fr.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Batch parsing script. +# Batch parsing script for French. # Loop over all the files in 'beta-pages', sentence-split them # and submit them for parsing. # diff --git a/opencog/nlp/learn/misc-scripts/wiki-ss-lt.sh b/opencog/nlp/learn/misc-scripts/wiki-ss-lt.sh index ec8b8689507..4e07ec79ccb 100755 --- a/opencog/nlp/learn/misc-scripts/wiki-ss-lt.sh +++ b/opencog/nlp/learn/misc-scripts/wiki-ss-lt.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Batch parsing script. +# Batch parsing script for Lithuanian. # Loop over all the files in 'beta-pages', sentence-split them # and submit them for parsing. # diff --git a/opencog/nlp/learn/misc-scripts/wiki-ss-pl.sh b/opencog/nlp/learn/misc-scripts/wiki-ss-pl.sh new file mode 100755 index 00000000000..f2113dc0c31 --- /dev/null +++ b/opencog/nlp/learn/misc-scripts/wiki-ss-pl.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# +# Batch parsing script for Polish. +# Loop over all the files in 'beta-pages', sentence-split them +# and submit them for parsing. +# +time find beta-pages -type f -exec ./ss-one.sh pl "{}" \;