Skip to content

Conversation

@duaakb
Copy link

@duaakb duaakb commented Sep 15, 2025

Analysis results are cached for 45 minutes.

When the user clicks “Save CAS”, the analysis result as an XMI file is sent to the importer.

More details will follow

AnalysisSession s = getCachedSession(analysisId);
if (s == null) throw new IllegalArgumentException("No cached session for id: " + analysisId);

java.io.ByteArrayOutputStream bos = new java.io.ByteArrayOutputStream(); // Convert JCas -> XMI bytes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be duplicated, please reuse the function from above

if (documentId != null && !documentId.isBlank()) fields.put("documentId", documentId);
if (casView != null && !casView.isBlank()) fields.put("casView", casView);

String corpusConfigJson = System.getenv("UCE_CORPUS_CONFIG_JSON"); // Include corpusConfig
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should not need the corpus config here, please check

RunDUUIPipeline.AnalysisResponse resp =
pipeline.getModelResourcesWithHandle(selectedModels, inputText, inputClaim,
inputCoherence, inputStance, inputLLM);
DUUIInformation DataRequest = pipeline.getModelResources(selectedModels, inputText, inputClaim, inputCoherence, inputStance, inputLLM);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cant you use the result from "resp" here?

// send to importer
long corpusId = Long.parseLong(ctx.queryParam("corpusId")); // from ?corpusId=...
RunDUUIPipeline.sendToImporterViaHttp(
"http://localhost:4567/api/ie/upload/uima",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check if we can use only "/api/ie/..." here as above, we should not hard-code this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants