Lightweight Nodejs Stanford NER Project module
- Stanford NER Download
- Java 1.8+
Stanford NER needs to be running as a tcp server, default is 8080. Copy server.sh to same directory as stanford-ner project.
/stanford-ner-2017-06-09
| /classifiers
| /lib
| build.xml
| stanford-ner.jar
| ...
| server.sh
Run the server
sudo ./server.sh 8080
If you change the TCP port from 8080, you need to make sure you define the port in your project method. The parse method defaults to port 8080.
npm install --save @enmaso/node-ner
const ner = require('@enmaso/node-ner')
let file = 'path/to/file.extension'
ner.parse(file, (tags) => {
console.log(tags)
})
Returns JSON object.
If you use a port other than 8080 for the NERServer, you will need to pass the port in with your parse method
ner.parse(file, 8080, (tags) => {
console.log(tags)
})
$ ps -A |grep java
$ kill -9 PID
PID will be the first number of the server.sh process
Always looking for testing and bug reporting.
See License GPL-3.0