forked from c-amr/camr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswagger.yaml
211 lines (206 loc) · 5.93 KB
/
swagger.yaml
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
swagger: '2.0'
# This is your document metadata
info:
version: "0.0.2"
title: CAMR REST API
#host: <ip here>:5000
definitions:
InputSentences:
type: array
title: InputSentences
items:
type: object
title: InputSentence
description: |
String or object representing single sentence
(if object, all fields will be delivered to output transparently)
properties:
text:
title: InputSentenceText
type: string
InputParagraphs:
type: array
title: InputParagraphs
description: String or object representing a paragraph
items:
type: object
title: InputParagraph
description: |
String or object representing single sentence
(if object, all fields will be delivered to output transparently)
properties:
text:
title: InputParagraphText
description: Text of input paragraph
type: string
Sentences:
title: Sentences
type: array
items:
title: Sentence
description: Represents a sentence processed with AMR parser
type: object
properties:
AMRtext:
type: string
instances:
title: AMRInstances
description: Array of AMR instances; represents nodes in AMR graph
type: array
items:
title: AMRInstance
description: AMR instance; represents a node in AMR graph
type: object
properties:
index:
type: integer
concept:
type: string
tokenIndex:
type: integer
relations:
title: AMRRelations
description: Array of relations between two AMR instances or AMR instance and a constant; represents edges in AMR graph
type: array
items:
title: AMRRelation
description: Relation between to AMR instances or AMR instance and a constant; represents an ege in AMR graph
type: object
properties:
source:
description: Index of source instance
type: integer
target:
type: integer
edge:
description: Relation edge name
type: string
type:
description: Relation type - if other than 'relation', then points to constant
type: string
root:
description: Index of AMR root instance
type: integer
text:
description: Sentence text
type: string
tokens:
title: SentenceTokens
description: Array of sentence tokens
type: array
items:
title: Token
description: Sentence token
type: object
properties:
index:
description: Token index starting with 1
type: integer
text:
description: Token text
type: string
lemma:
description: Token lemma
type: string
pos:
description: Part-Of-Speech
type: string
ne:
description: Named Entity
type: string
Paragraphs:
title: Paragraphs
type: array
items:
title: Paragraph
description: |
Object representing output paragraph
(contains all fields from input)
or array of sentences if input was array of strings
type: object
properties:
sentences:
$ref: '#/definitions/Sentences'
paths:
'/api/parse':
post:
summary: Process (text/JSON/YAML) document with AMR parser.
description: |
Will invoke CAMR parser with input document in text/JSON/YAML formats
(expects sentence per line if plaintext input)
consumes:
- text/plain
- application/json
- application/yaml
produces:
- application/json
- application/yaml
parameters:
#- name: ssplit
# in: query
# required: false
# description: Split Sentences
# type: boolean
- name: fmt
in: query
required: false
description: Output Format
type: string
enum: [json, yaml]
- name: pretty
in: query
required: false
description: Pretty format JSON output
type: boolean
- name: document
in: body
required: true
description: Text of input document
schema:
$ref: '#/definitions/InputSentences'
responses:
200:
description: Successful response
schema:
$ref: '#/definitions/Sentences'
'/api/parse?ssplit=true':
post:
summary: Process (text/JSON/YAML) document with AMR parser.
description: |
Will invoke CAMR parser with input document in text/JSON/YAML formats
(will split line into sentences)
consumes:
- text/plain
- application/json
- application/yaml
produces:
- application/json
- application/yaml
parameters:
#- name: ssplit
# in: query
# required: false
# description: Split Sentences
# type: boolean
- name: fmt
in: query
required: false
description: Output Format
type: string
enum: [json, yaml]
- name: pretty
in: query
required: false
description: Pretty format JSON output
type: boolean
- name: document
in: body
required: true
description: Text of input document
schema:
$ref: '#/definitions/InputParagraphs'
responses:
200:
description: Successful response
schema:
$ref: '#/definitions/Paragraphs'