You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@opennlp.apache.org by "Joern Kottmann (JIRA)" <ji...@apache.org> on 2016/07/20 09:55:20 UTC

[jira] [Comment Edited] (OPENNLP-776) Model Objects should be Serializable

    [ https://issues.apache.org/jira/browse/OPENNLP-776?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15385632#comment-15385632 ] 

Joern Kottmann edited comment on OPENNLP-776 at 7/20/16 9:54 AM:
-----------------------------------------------------------------

I am not sure i am understanding what has to be done here to achieve your goal to use our models in Spark. Spark uses java serialization, so we would just need to make the BaseModel implement java.io.Serializable, right? And that can be hooked up to the existing serialization.

Why would we need public no-arg constructors?


was (Author: joern):
I am not sure i am understanding what has to be done here to achieve your goal to use our models in Spark. Spark uses java serialization, so we would just need to make the BaseModel implement java.io.Serializable, right? And that can be hooked up to the existing serialization.

> Model Objects should be Serializable
> ------------------------------------
>
>                 Key: OPENNLP-776
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-776
>             Project: OpenNLP
>          Issue Type: Improvement
>    Affects Versions: tools-1.5.3
>            Reporter: Tristan Nixon
>            Priority: Minor
>              Labels: features, patch
>         Attachments: externalizable.patch
>
>
> Marking model objects (ParserModel, SentenceModel, etc.) as Serializable can enable a number of features offered by other Java frameworks (my own use case is described below). You've already got a good mechanism for (de-)serialization, but it cannot be leveraged by other frameworks without implementing the Serializable interface. I'm attaching a patch to BaseModel that implements the methods in the java.io.Externalizable interface as wrappers to the existing (de-)serialization methods. This simple change can open up a number of useful opportunities for integrating OpenNLP with other frameworks.
> My use case is that I am incorporating OpenNLP into a Spark application. This requires that components of the system be distributed between the driver and worker nodes within the cluster. In order to do this, Spark uses Java serialization API to transmit objects between nodes. This is far more efficient than instantiating models on each node independently.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)