diff --git a/.gitignore b/.gitignore index 3ad461d..1f218bc 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,6 @@ project/plugins/project/ src/main/resources/static/js src/main/resources/static/css src/main/resources/static/fonts + +# package lock +ui/package-lock.json diff --git a/README.md b/README.md index 6c6d2d9..785f4d7 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ An `akka-http` server exposing a REST API for text annotation via the [`processo ## Requirements 1. [Java 8](https://docs.oracle.com/javase/8/docs/technotes/guides/install/install_overview.html) 2. [`sbt`](http://www.scala-sbt.org/download.html) +3. [`node.js`](https://nodejs.org/en/) +4. [`npm`](https://www.npmjs.com/get-npm) ## How is this useful? This might be useful to people wanting to do NLP in a non-`JVM` language without a good existing parser. Currently there are services for using `processors`' `CluProcessor`, `FastNLPProcessor` (a wrapper for `CoreNLP`) and `BioNLPProcessor`. diff --git a/server-setup.md b/server-setup.md new file mode 100644 index 0000000..4568ee2 --- /dev/null +++ b/server-setup.md @@ -0,0 +1,67 @@ +# Steps for setting up on Server + +## installing `java` + +See https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-get-on-ubuntu-16-04 + +``` +sudo apt-get update +sudo apt-get install default-jre +sudo add-apt-repository ppa:webupd8team/java +sudo apt-get update +sudo apt-get install oracle-java8-installer +``` + +## installing `bc` + +Don't know what it does, but was required to get `sbt` to play nice + +``` +sudo apt-get install bc +``` + +## installing `sbt` + +``` +echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list +sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823 +sudo apt-get update +sudo apt-get install sbt +``` + +## installing `node.js` + +``` +curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash - +sudo apt-get install -y nodejs +``` + +## installing `npm` + +run `npm -v` first to see if already installed + + +``` +sudo npm install npm -g +``` + +## ensure permissions + +``` +sudo chown -R mcapizzi processors-server +``` + +## adding `.sbtopts` +``` +-J-Xms4G +-J-Xmx6G +``` + +# Running on server + +``` +sbt +run-main NLPServer --host 0.0.0.0 +``` + +Then from local machine, use this `API` address: `http://[server_ip]:8888/api/annotate` diff --git a/src/main/resources/requests/annotate.json b/src/main/resources/requests/annotate.json new file mode 100644 index 0000000..a275aea --- /dev/null +++ b/src/main/resources/requests/annotate.json @@ -0,0 +1,3 @@ +{ + "text": "My name is Inigo Montoya. You killed my father. Prepare to die." +} \ No newline at end of file diff --git a/src/main/resources/requests/odin.json b/src/main/resources/requests/odin.json new file mode 100644 index 0000000..034d356 --- /dev/null +++ b/src/main/resources/requests/odin.json @@ -0,0 +1,4 @@ +{ + "rules": "", + "text": "My name is Inigo Montoya. You killed my father. Prepare to die." +} \ No newline at end of file