forked from HendrikStrobelt/Seq2Seq-Vis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.yaml
261 lines (249 loc) · 6.1 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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
# see als: https://github.com/hjacobs/connexion-example
swagger: '2.0'
info:
title: S2S API
version: "0.1"
consumes:
- application/json
produces:
- application/json
basePath: /api
#security:
# enable OAuth protection for all REST endpoints
# (only active if the TOKENINFO_URL environment variable is set)
# - oauth2: [uid]
# a simple data path:
paths:
/translate:
get:
tags: [Translate, All]
operationId: server.get_translation
summary: Get Translation and Data for sentence
parameters:
- $ref: '#/parameters/inSentence'
- $ref: '#/parameters/neighbors'
- $ref: '#/parameters/partial'
- $ref: '#/parameters/force_attn'
responses:
200:
description: Return Translation and meta data
schema:
$ref: '#/definitions/Translation'
/translate_compare:
get:
tags: [Translate, Neighbors, All]
operationId: server.get_translation_compare
summary: Two-way comparison between two sentences with merged vector-spaces
parameters:
- $ref: '#/parameters/inSentence'
- $ref: '#/parameters/compareSentence'
- $ref: '#/parameters/neighbors'
responses:
200:
description: fun
/project_info:
get:
tags: [All]
operationId: server.get_info
summary: get general project informations
parameters:
- $ref: '#/parameters/project_id'
responses:
200:
description: fun
# /compare_translation:
# get:
# tags: [Translate, All]
# operationId: server.compare_translation
# summary: Compare Translation and Data for sentences
# parameters:
# - $ref: '#/parameters/inSentence'
# - $ref: '#/parameters/compareSentences'
# - $ref: '#/parameters/partial'
# responses:
# 200:
# description: Return Translations and distances
# schema:
# $ref: '#/definitions/Translation'
/close_words:
get:
tags: [Embedding, All]
operationId: server.get_close_words
summary: Get the closest words w.r.t word embedding
parameters:
- $ref: '#/parameters/inWord'
- $ref: '#/parameters/loc'
- $ref: '#/parameters/p_method'
- $ref: '#/parameters/limit'
responses:
200:
description: Return list of closest words
/close_vectors:
get:
tags: [Embedding, All]
operationId: server.get_close_vectors
summary: Find closesest vector to vector at position
parameters:
- $ref: '#/parameters/vector_name'
- $ref: '#/parameters/indices'
responses:
200:
description: return list of indices
/neighbor_details:
get:
tags: [Embedding, All]
operationId: server.get_neighbor_details
summary: Get details about close neighbors
parameters:
- $ref: '#/parameters/vector_name'
- $ref: '#/parameters/indices'
- $ref: '#/parameters/p_method'
responses:
200:
description: return list details
/train_data_for_index:
get:
tags: [Index, All]
operationId: server.train_data_for_index
summary: Get data from training set for specific index id
parameters:
- $ref: '#/parameters/indices'
- $ref: '#/parameters/loc'
responses:
200:
description: return list details
parameters:
inSentence:
name: in
description: the input sentence
in: query
type: string
default: "world"
compareSentence:
name: compare
description: compare sentence
in: query
type: string
compareSentences:
name: compare
description: list of sentences to compare against (tab seperated !!)
in: query
required: true
type: array
collectionFormat: pipes
items:
type: string
inWord:
name: in
description: the input word
in: query
type: string
default: "hello"
loc:
name: loc
description: location - src or tgt
in: query
type: string
enum:
- "src"
- "tgt"
default: "src"
limit:
name: limit
description: limit of results
in: query
type: integer
default: 100
p_method:
name: p_method
description: projection method to use
in: query
type: string
enum:
- "mds"
- "pca"
- "tsne"
- "none"
default: "pca"
vector_name:
name: vector_name
description: Name of the vector -- encoder, embedding, etc...
in: query
type: string
default: "context"
index:
name: index
in: query
description: position in corpus
type: integer
default: 100
indices:
name: indices
in: query
description: positions in corpus
type: array
items:
type: integer
required: true
neighbors:
name: neighbors
description: list of dimensions to add neighbors to
in: query
type: array
items:
type: string
required: false
partial:
name: partial
description: partial translate for decoder
in: query
type: array
collectionFormat: pipes
items:
type: string
required: false
force_attn:
name: force_attn
description: force attention
in: query
type: array
items:
type: integer
required: false
project_id:
name: project_id
description: Project ID
in: query
type: string
required: false
# These definitions are only needed for proper documentation
# no functional purpose
definitions:
Translation:
type: object
required:
- in
- out
- attn
properties:
in:
type: string
description: input sentence
example: "The sun is yellow ."
out:
type: string
description: translated sentence
example: "Die Sonne ist gelb ."
attn:
type: array
description: Attention for each output position
example: [[.1,.2,.13],[.3,.4,.2]]
items:
type: integer
#securityDefinitions:
# oauth2:
# type: oauth2
# flow: implicit
# authorizationUrl: https://example.com/oauth2/dialog
# scopes:
# uid: Unique identifier of the user accessing the service.