Re: Code snippets for using the NLP service

28 views
Skip to first unread message

Greg Woolf

unread,
Mar 2, 2016, 10:46:16 PM3/2/16
to dis...@factorie.cs.umass.edu
Hi, I've been experimenting with NLP libraries and found Mallet and factorie libraries to be outstanding!

I've managed to get the NLP service running on port 3228 and calling the service using the echo command from the terminal window.  I was hoping you could suggest some code snippets for calling the NLP service directly from Scala and retrieving the output in a structured format (like JSON).

Many thanks for a terrific product.

On Wed, Mar 2, 2016 at 10:42 PM, Greg Woolf <gre...@gmail.com> wrote:
Hi, I've been experimenting with NLP libraries and found Mallet and factorie libraries to be outstanding!

I've managed to get the NLP service running on port 3228 and calling the service using the echo command from the terminal window.  I was hoping you could suggest some code snippets for calling the NLP service directly from Scala and retrieving the output in a structured format (like JSON).

Many thanks for a terrific product.

Emma Strubell

unread,
Mar 4, 2016, 2:45:30 PM3/4/16
to dis...@factorie.cs.umass.edu
Hi Greg, here's an example of running a pos tagger and lemmatizer from Scala: https://gist.github.com/strubell/68333a1127265a146cd8

On Wed, Mar 2, 2016 at 10:46 PM Greg Woolf <gre...@gmail.com> wrote:
Hi, I've been experimenting with NLP libraries and found Mallet and factorie libraries to be outstanding!

I've managed to get the NLP service running on port 3228 and calling the service using the echo command from the terminal window.  I was hoping you could suggest some code snippets for calling the NLP service directly from Scala and retrieving the output in a structured format (like JSON).

Many thanks for a terrific product.

On Wed, Mar 2, 2016 at 10:42 PM, Greg Woolf <gre...@gmail.com> wrote:
Hi, I've been experimenting with NLP libraries and found Mallet and factorie libraries to be outstanding!

I've managed to get the NLP service running on port 3228 and calling the service using the echo command from the terminal window.  I was hoping you could suggest some code snippets for calling the NLP service directly from Scala and retrieving the output in a structured format (like JSON).

Many thanks for a terrific product.

--
--
Factorie Discuss group.
To post, email: dis...@factorie.cs.umass.edu
To unsubscribe, email: discuss+u...@factorie.cs.umass.edu

Greg

unread,
Mar 7, 2016, 4:37:06 PM3/7/16
to Factorie
Hi Emma, thanks for your reply.  The  Wordnet lemmatizer works great.  2 follow-up questions

1) I'm using the following command to start the NLP service with POS tags and wordnet.  Are there any other parameters (like coref) that can be added to produce a more complete analysis of the text:
bin/fac nlp --wsj-forward-pos --transition-based-parser --conll-chain-ner  --wordnet-lemma 

2) Do you have a complete listing of all the PoS Tags and their definitions that result from the parse tree?  Can we get them for tags from all the columns in the results (e.g. see the following results):
1    1    Michael        NNP    2    nn    B-PER    michael
2    2    Dell        NNP    3    nsubj    L-PER    dell
3    3    is        VBZ    0    root    O    be
4    4    the        DT    5    det    O    the
5    5    CEO        NNP    3    dobj    B-ORG    ceo
6    6    OF        IN    5    prep    I-ORG    of
7    7    Dell        NNP    6    pobj    L-ORG    dell
Reply all
Reply to author
Forward
0 new messages