@enmaso/node-ner
v1.0.5
Published
Lightweight Nodejs Stanford NER package
Downloads
13
Readme
node-ner
Lightweight Nodejs Stanford NER Project module
Requirements
- Stanford NER Download
- Java 1.8+
Pre-installation
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.
Installation
npm install --save @enmaso/node-ner
Usage
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)
})
Kill Stanford NERServer
$ ps -A |grep java
$ kill -9 PID
PID will be the first number of the server.sh process
Contributions
Always looking for testing and bug reporting.
License
See License GPL-3.0