nash403 / corenlp-request-wrapper

Make simple requests to Stanford CoreNLP with javascript.
MIT License
1 stars 0 forks source link

How to send Custom Ner #3

Open satishkumarkt opened 6 years ago

satishkumarkt commented 6 years ago

HI corenlp-request-wrapper support regexner?

If yes How to send Custom NER to corenlp-request-wrapper

Example in java props.put("annotators", "tokenize, ssplit, pos, lemma, ner, regexner");
props.put("regexner.mapping", "training.txt");

can you please provide some example

Thanks

nash403 commented 6 years ago

Hello

sorry for the delay, I got busy.

I am not sure I can answer correctly to your question since i made that package because I needed to seamlessly communicate with a CoreNLP server to annotate strings for a small project. I'm not really a big user of the CoreNLP stack. I'll try anyway:

In my code, since I just send requests to a running instance of CoreNLP server, if the said instance can receive regexner properties through the query string of the http request, then this module already suppports regexner 😄

However it means the way arguments are passed to the parse function have to change to support properties other than just annotators & outputFormat as it does today which is a breaking change. Maybe by changing the signature of the function from parse(stringToProcess, portNumber, annotators, outputFormat, cb) to something like parse(corenlpServerOptions, properties, cb), and the properties object would hold any data we'd want to pass to the server including regexner.

Right now, i do not have time to dig into this, but i will in the weeks to come unless you make a pull request first that I'd be happy to accept !

Cordially.

satishkumarkt commented 6 years ago

Thanks @nash403