> On 11. Oct 2021, at 22:05, Richard Noriega <noriegar...@gmail.com
> I'm using my own UIMA NLP tool to take text documents and pre-annotate them with certain keywords. I want to implement this into Inception, within a custom recommender's predict() function. However, because my tool creates its own CAS object, I am not sure how to implement this. I would appreciate any guidance.
Ok, this is far from being the optimal solution - but this is a potential approach:
* implement a custom recommender (cf. )
* let getTrainingCapability() return TRAINING_NOT_SUPPORTED
* in the predict method, extract the text from the given CAS and pass it to your tool
* take the CAS that your tool creates back and then copy all the stuff that you want have displayed as recommendations from your CAS and into the CAS that was passed to the predict method - make sure you only fill in the types/features for the specific recommender configuration (again cf. ):
// Add predictions to the CAS
Type predictedType = getPredictedType(aCas);
Feature scoreFeature = getScoreFeature(aCas);
Feature scoreExplanationFeature = getScoreExplanationFeature(aCas);
Feature predictedFeature = getPredictedFeature(aCas);
Feature isPredictionFeature = getIsPredictionFeature(aCas);
That should work then.
A better approach would of course be to modify your existing UIMA NLP tool code and let it fill in the types/features mentioned above directly into the CAS that is given to predict instead of letting the tool create its own CAS.