-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpipeline.xml
More file actions
70 lines (66 loc) · 2.42 KB
/
Copy pathpipeline.xml
File metadata and controls
70 lines (66 loc) · 2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!-- ATR/HTR minimal pipeline (estratto) -->
<api xmlns="http://ws.apache.org/ns/synapse" name="ATR_HTR_Pipeline" context="/atr">
<resource methods="POST" uri-template="/run">
<inSequence>
<!-- 1) Ingestion -->
<log level="custom"><property name="step" value="ingestion"/></log>
<call>
<endpoint>
<http method="POST" uri-template="http://mi.local/services/ingestionAPI"/>
</endpoint>
</call>
<enrich>
<source type="body" clone="true"/>
<target type="property" property="ingestedImageRef"/>
</enrich>
<!-- 2) HTR -->
<log level="custom"><property name="step" value="htr"/></log>
<payloadFactory media-type="json">
<format>{"imageRef":"$1"}</format>
<args><arg expression="get-property('ingestedImageRef')"/></args>
</payloadFactory>
<call>
<endpoint>
<http method="POST" uri-template="http://mi.local/services/HTR-API"/>
</endpoint>
</call>
<enrich>
<source type="body"/><target type="property" property="rawText"/>
</enrich>
<!-- 3) Post-processing (NLP) -->
<log level="custom"><property name="step" value="post-processing"/></log>
<payloadFactory media-type="json">
<format>{"text":"$1"}</format>
<args><arg expression="get-property('rawText')"/></args>
</payloadFactory>
<call>
<endpoint>
<http method="POST" uri-template="http://mi.local/services/NLP-service"/>
</endpoint>
</call>
<enrich>
<source type="body"/><target type="property" property="cleanText"/>
</enrich>
<!-- 4) TEI export -->
<log level="custom"><property name="step" value="tei-export"/></log>
<payloadFactory media-type="json">
<format>{"content":"$1","target":"TEI"}</format>
<args><arg expression="get-property('cleanText')"/></args>
</payloadFactory>
<call>
<endpoint>
<http method="POST" uri-template="http://mi.local/services/TEI-normalizer"/>
</endpoint>
</call>
<enrich>
<source type="body"/><target type="property" property="teiDoc"/>
</enrich>
<!-- Risposta aggregata -->
<payloadFactory media-type="json">
<format>{"success":true,"tei":"$1"}</format>
<args><arg expression="get-property('teiDoc')"/></args>
</payloadFactory>
<respond/>
</inSequence>
</resource>
</api>