private void createERC() { final IEntityConverterFields fields = new DefaultFields(); final HashSet<String> stopFeatures = new HashSet<>(); stopFeatures.add("uima.cas.AnnotationBase:sofa"); stopFeatures.add("uk.gov.dstl.baleen.types.BaleenAnnotation:internalId"); erc = new EntityRelationConverter(monitor, stopFeatures, fields, false); }
@Override public void doInitialize(final UimaContext aContext) throws ResourceInitializationException { super.doInitialize(aContext); final IEntityConverterFields fields = new DefaultFields(); final HashSet<String> stopFeatures = new HashSet<>(); stopFeatures.add("uima.cas.AnnotationBase:sofa"); stopFeatures.add("uk.gov.dstl.baleen.types.BaleenAnnotation:internalId"); entityRelationConverter = new EntityRelationConverter(getMonitor(), stopFeatures, fields, false); if (outputDocuments) { initialiseForDocuments(); } if (outputMentions) { initialiseForMentions(); } if (outputEntities) { initialiseForEntities(); } if (outputRelations) { initialiseForRelations(); } }
@Override protected void doProcess(final JCas jCas) throws AnalysisEngineProcessException { Map<String, Object> output = SingleDocumentConsumerFormat.formatCas( jCas, new DefaultFields(), contentHashAsId, getMonitor(), getSupport()); // Persist to ActiveMQ try { String json = MAPPER.writeValueAsString(output); String id = (String) output.getOrDefault("externalId", ""); Message msg = samr.getSession().createTextMessage(json); Destination destination = samr.getSession().createTopic(endpoint); samr.getProducer().send(destination, msg); getMonitor().debug("Document with id {} sent to ActiveMQ", id); } catch (JsonProcessingException e) { getMonitor() .error("Unable to parse object to JSON - document will not be sent to ActiveMQ", e); } catch (final JMSException e) { getMonitor().error("Unable to send document to ActiveMQ", e); } } }
@Override protected void doProcess(final JCas jCas) throws AnalysisEngineProcessException { Map<String, Object> output = SingleDocumentConsumerFormat.formatCas( jCas, new DefaultFields(), contentHashAsId, getMonitor(), getSupport()); // Persist to ActiveMQ try { String json = MAPPER.writeValueAsString(output); String id = (String) output.getOrDefault("externalId", ""); Message msg = samr.getSession().createTextMessage(json); Destination destination = samr.getSession().createTopic(endpoint); samr.getProducer().send(destination, msg); getMonitor().debug("Document with id {} sent to ActiveMQ", id); } catch (JsonProcessingException e) { getMonitor() .error("Unable to parse object to JSON - document will not be sent to ActiveMQ", e); } catch (final JMSException e) { getMonitor().error("Unable to send document to ActiveMQ", e); } } }
getSupport().getDocumentHistory(jCas), stopFeatures, new DefaultFields());
@Before public void setUp() throws Exception { fields = new DefaultFields(); long internalId = 1L; int mergedId = 10;