Using Linear CRF trained model to predict labels for a sentence

20 views
Skip to first unread message

namrata ghadi

unread,
Jul 11, 2017, 12:09:04 AM7/11/17
to Factorie
I am working on a use-case where I have trained a linear chain CRF model and persisted it for further use.
I would like to make this model now available through a service. This service, takes input of user query who's labels now need to be inferred using the model. 
Is there a way to do this without having to tokenize the sentence and set initial labels randomly for the tokens and then having model predict the actual labels??
The LinearChainCRF examples in the tutorial use pre-tokenized and labeled test files. But, I am not sure how to provide sentence without any pre-set labels.
Please help.

Emma Strubell

unread,
Jul 11, 2017, 11:46:45 AM7/11/17
to Factorie
Hi Namrata,

You do need to tokenize the sentence -- otherwise what would the chain be in the linear chain CRF? Factorie provides a fast English tokenizer, as well as a whitespace tokenizer. If you want to tag raw (untokenized) text you will need to define some way of splitting up the text into things that are taggable. Does that make sense?

Emma

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

namrata ghadi

unread,
Jul 11, 2017, 11:51:22 AM7/11/17
to dis...@factorie.cs.umass.edu
Yes. I have a tokenizer that generates token. But it is a sequence of strings. 
And the model needs a sequence of labels. I was not sure how to set initial labels for the tokens. 

---
You received this message because you are subscribed to the Google Groups "Factorie" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss+u...@factorie.cs.umass.edu.
--
It is only impossible until it’s done.
-Nelson Mandela
Reply all
Reply to author
Forward
0 new messages