Skip to content

STEP System Installation Notes

lgalescu edited this page Jan 14, 2020 · 2 revisions

(see also DRUM System Installation Notes, from which this page was derived)

Getting the source code...

...from github

To get the TRIPS STEP system from the github mirror, use this command:

git clone https://github.com/wdebeaum/step.git

This will create a step/ directory under your current directory. This is often called $TRIPS_BASE.

...from CVS

However, if you want to contribute directly back to the original TRIPS CVS repository, you instead need an account on trips.cs.rochester.edu. Getting such an account is beyond the scope of this article.

Once you have an account:

Make sure your $CVS_RSH environment variable is set to ssh. How you do this depends on which command line shell you're using:

export CVS_RSH=ssh # bash
setenv CVS_RSH ssh # csh

Run this command to checkout STEP:

cvs -d $USER@trips.cs.rochester.edu:/p/cvs/trips checkout -P step

...where $USER is your username. This will create a directory called src/ under your current directory. The directory src/ is in is often called $TRIPS_BASE.

WordNetSQL/wn.db note

Please note that the CVS version downloads the wn.db file by default, using a password. The password shouldn't be made public, so it wasn't included in the github repo. So the git version falls back on making wn.db from scratch, which may take longer. It also requires an additional download, the WordNet tagged gloss corpus.

Vagrant option

The STEP system can be installed in a virtual machine using Vagrant. This is easy, reliable, and inefficient; it may take hours to set up, and the resulting STEP system itself may run a little slower, but it's almost completely automatic. See the instructions in the comments at the top of $TRIPS_BASE/src/Systems/STEP/Vagrantfile for more. The commands in that file may be helpful to look at even if you're installing things manually instead of using Vagrant.

Prerequisites

You will also need a Lisp implementation (we tend to use SBCL 1.2+) as well as Java (1.7+), Perl, Scala (2.11.7), and some other relatively standard development tools. If you're on a Mac, I think XCode gets you most of this.

If you use SBCL, you need to make sure it has multithreading support (the pre-built binaries don't). On the Mac, an easy way to do this is through MacPorts, using this command:

sudo port install sbcl +threads

You'll also need to get these files from WordNet, and Stanford CoreNLP:

http://wordnetcode.princeton.edu/3.0/WordNet-3.0.tar.bz2

http://wordnetcode.princeton.edu/glosstag-files/WordNet-3.0-glosstag.tar.bz2 (needed for git version only)

http://nlp.stanford.edu/software/stanford-corenlp-full-2015-12-09.zip

And unpack them in these directories (which you may need to create), respectively:

/usr/local/share/wordnet/
/usr/local/share/wordnet/
/usr/local/share/stanford-corenlp/

Also download this file:

https://geonames.usgs.gov/docs/stategaz/NationalFile_20170201.zip

And move/rename it to this (don't unpack it):

/usr/local/share/geonames/2017-02-01/NationalFile.zip

(if the link is broken, try changing the date part to the first day of this or last month. If that doesn't work, see $TRIPS_BASE/src/TextTagger/docs/README.xhtml for more detailed instructions)

Now these directories/files should exist on your system with these names:

/usr/local/share/wordnet/WordNet-3.0/
/usr/local/share/wordnet/WordNet-3.0/glosstag/ (git version only)
/usr/local/share/stanford-corenlp/stanford-corenlp-full-2015-12-09/
/usr/local/share/geonames/2016-10-01/NationalFile.zip

Configuring, making, installing

Once you have the prerequisites, run these commands to configure, build, and install TRIPS:

cd $TRIPS_BASE/src/
./configure --with-lisp=sbcl
make
make install

The --with-lisp option lets you tell configure the command to use to run lisp. By default it uses lisp, but SBCL doesn't call itself that.

Depending on how you installed Scala, you may also need to add --with-scala=... and --with-scalac=... options in order to provide the correct paths to the scala runtime and scalac compiler executables. If they're called scala and scalac (or scala-2.11 and scalac-2.11), and they're accessible via your $PATH, you don't need these options.

There are many other options to configure, which you can see by giving it the --help option. But for the most part the defaults should be fine. (Doing ./configure --help in src/ doesn't show you absolutely everything, though; you can see more if you go into one of the src/config/*/ directories first. For example, in src/config/lisp/, it describes --with-lisp and a few others.)

I think parts of both make and make install will download some other stuff for you, so you need to be connected to the internet when you run them. This may take some time the first time.

make install will install TRIPS into $TRIPS_BASE/etc/ and $TRIPS_BASE/bin/. The latter is for executable programs, the former for everything else.

Running the system

The usual way to start a TRIPS system is to run the trips-$system script installed in $TRIPS_BASE/bin/ ($system=step in this case). But since STEP lacks a GUI (like DRUM's DrumGUI), you will likely need to drive the system from the Lisp REPL, which means you should run the Lisp components separately from the other parts of the system. Run the non-Lisp parts in one terminal window using this command:

$TRIPS_BASE/bin/trips-step -nolisp

This will pop up a window listing all the connected TRIPS modules (right now only the non-Lisp ones), with lights indicating their status (this communication hub program is called the Facilitator). The system will also create a subdirectory of the current directory named with the current time and date (the logdir), and put several log files in it. What I usually do is create a $TRIPS_BASE/logs/ directory, and then instead of writing $TRIPS_BASE/ I can just use ../. That way all the logdirs are in one place, separate from other stuff.

Then, to run the Lisp parts using SBCL (I think you can also do this from Emacs/SLIME somehow, but I'm a vim user):

cd $TRIPS_BASE/src/Systems/STEP/
sbcl --load test --eval '(run)'

You should see a few more modules connect, including the Parser. At the Lisp prompt, you can instruct the system to run a whole paragraph from test.lisp with a command like this:

(ptest 'story1)

or like this:

(test-paragraph 'step3)

depending on whether the paragraph ID is the first or second element in the list describing the paragraph in the *sample-dialogues* variable.

Alternatively you can instruct it to parse a string you give it like this:

(test "The oncogenes are KRAS, PIK3CA and BRAF.")

output graphs

In addition to the messages visible in the Lisp console, there will be a bunch of graphs in the logdir, one for each successfully parsed sentence. These are essentially the same type of LF graph you see from the web parser. They are called lf-graph-###.dot, where ### is a number, and they are in Graphviz dot format. On Mac OS X 10.8 and newer, you can view them with Graphviz.app from this package (not the newer 2.38 version!):

http://www.graphviz.org/pub/graphviz/stable/macos/mountainlion/graphviz-2.36.0.pkg

Also, if you have this installed you can instruct trips-step to open each graph as it's made, by passing it the option -graphviz-display true. You can change this option at runtime from the Lisp REPL using (enable-graphviz-display) or (disable-graphviz-display). If you're having trouble with this, see GraphvizInstallation.

The Lisp form of these graphs will also show up in facilitator.log (in the logdir), along with all the other messages between TRIPS modules. The $TRIPS_BASE/bin/extract-messages program can help you get just the messages you are interested in from this file. If you're giving the system strings interactively, you'll probably also see the Lisp LFs in the Lisp console, because it copies all the messages sent and received by Lisp modules there.

Clone this wiki locally