-
Notifications
You must be signed in to change notification settings - Fork 0
DRUM System Installation Notes
To get the TRIPS DRUM system from the github mirror, use this command:
git clone https://github.com/wdebeaum/drum.git
This will create a drum/ directory under your current directory. This is often called $TRIPS_BASE.
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 DRUM:
cvs -d $USER@trips.cs.rochester.edu:/p/cvs/trips checkout -P drum
...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.
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.
You will also need a Lisp implementation (we tend to use SBCL 1.2+) as well as Java (1.7+), Perl, 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, 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 (DRUM will also work with older versions, eg: http://nlp.stanford.edu/software/stanford-corenlp-full-2014-06-16.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 get the Enju parser. Get the binary package that is appropriate for your platform. You will have to fill out a form. Unpack it in /usr/local/share/enju/.
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
/usr/local/share/enju/enju-2.4.2/
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. 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.
There are a couple of ways to send text through the system, which require different ways of starting the system: you can use DrumGUI, or you can use test.lisp. Both ways will pop up a window listing all the connected TRIPS modules, 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.
The simpler way is to run the whole system with:
$TRIPS_BASE/bin/trips-drum
And then use the DrumGUI to select which passage to process. The buttons at the top left can generally be used left to right, but you don't need to use all of them. I'll refer to the buttons here by their tooltips. Click the "Open folder" button to select a folder full of passage files. The files will appear in the left pane of DrumGUI. Then you can select one of them and click the "View" button to see its contents in the top "Text" pane. Then click the "Process dataset" button to send the text through the system. While the system is busy, some of the buttons may be disabled. Eventually, extractions should appear in the bottom "Extracted data" pane.
Another way is to run the Lisp parts in one window and everything else in another, so that you can use Lisp interactively without other stuff interfering. To run the other stuff, use this command:
$TRIPS_BASE/bin/trips-drum -nolisp
This is when the Facilitator window pops up and the non-lisp modules connect.
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/drum/
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 the whole first paragraph with this command:
(ptest 'sasaki-1)
Alternatively you can instruct it to parse a string you give it like this:
(test "The oncogenes are KRAS, PIK3CA and BRAF.")
It is also still possible to use DrumGUI in this mode.
In addition to the extractions visible in DrumGUI, 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-drum to open each graph as it's made, by passing it the option -graphviz-display true. 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.
If the passage you're processing is XML rather than text, you should use the xml-input mode by passing -mode xml-input to trips-drum.