-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to load pre-transpiled PMML service provider JAR files? #257
Comments
The Java API can be derived from the class name: "serviceLoading" + "builder": URL serviceJarURL = ...;
// First do "loadService", then do "build"
Evaluator evaluator = new ServiceLoadingModelEvaluatorBuilder()
.loadService(serviceJarURL)
.build();
The Your More importantly, the
The right question to ask is "how can I obtain a Assuming a file in local filesystem: File serviceJarFile = new File("/path/to/xxx.pmml.jar");
URL serviceJarURL = (serviceJarFile.toURI()).toURL(); Assuming a resource on some publicly accessible web seriver: URL serviceJarURL = new URL("https://myserver.com/mydir/xxx.pmml.jar");
Yep, that's one valid reason for choosing JPMML-Transpiler over the standard JPMML-Evaluator - transpiled models do not have any Ja(va|karta) XML Binding dependencies, and they load blazing fast. |
Thank you very much, I will solve the problem according to your suggestion. |
How can I get an Evaluator from xxx.pmml.jar through the ServiceLoadingModelEvaluatorBuilder in a packaged jar?
I can't use this.getClass().getClassLoader().getResource("xxx.pmml.jar") to get the URL which is needed in SerciceLoadingModelEvaluatorBuilder.loadService to get an Evaluator because in a packaged jar I can't get the path.
I know that I can use LoadingModelEvaluatorBuilder to get an Evaluator from a xxx.pmml, but the unmarshal step will cost much time when I need to load abundant models.
I hope that someone can help me to solve this problem
The text was updated successfully, but these errors were encountered: