Skip to content

Instantly share code, notes, and snippets.

@rohithBirdeye
Created March 28, 2019 06:40
Show Gist options
  • Save rohithBirdeye/c4182ebe44a04d47b62ac5e293878a85 to your computer and use it in GitHub Desktop.
Save rohithBirdeye/c4182ebe44a04d47b62ac5e293878a85 to your computer and use it in GitHub Desktop.
public String getLeadScore(String leadJson) throws Exception {
try {
if(StringUtils.isBlank(leadJson))
return null;
String leadObj = "\'"+ leadJson + "\'";
String[] command = { pythonPath, pythonScriptPath + "/interp.py", "score",
pythonScriptPath + "/leadmodel",leadObj};
logger.info(leadgenMarker, "command str {}", Arrays.toString(command));
System.out.println(Arrays.toString(command));
Process p = Runtime.getRuntime().exec(command);
BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
String leadScore = in.readLine();
return leadScore;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment