зеркало из https://github.com/microsoft/inmt.git
Modify API Documentation (#27)
This commit is contained in:
Родитель
af39c7dd08
Коммит
134946df22
Двоичные данные
docs/html-documentation-generated.zip
Двоичные данные
docs/html-documentation-generated.zip
Двоичный файл не отображается.
|
@ -1,30 +1,30 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>SIMPLE TRANSLATION API</title>
|
||||
<title>Interactive Neural Machine Translation</title>
|
||||
<style type="text/css">
|
||||
body {
|
||||
font-family: Trebuchet MS, sans-serif;
|
||||
font-size: 15px;
|
||||
color: #444;
|
||||
margin-right: 24px;
|
||||
font-family: Trebuchet MS, sans-serif;
|
||||
font-size: 15px;
|
||||
color: #444;
|
||||
margin-right: 24px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 25px;
|
||||
h1 {
|
||||
font-size: 25px;
|
||||
}
|
||||
h2 {
|
||||
font-size: 20px;
|
||||
h2 {
|
||||
font-size: 20px;
|
||||
}
|
||||
h3 {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
h3 {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
hr {
|
||||
height: 1px;
|
||||
border: 0;
|
||||
color: #ddd;
|
||||
background-color: #ddd;
|
||||
hr {
|
||||
height: 1px;
|
||||
border: 0;
|
||||
color: #ddd;
|
||||
background-color: #ddd;
|
||||
}
|
||||
|
||||
.app-desc {
|
||||
|
@ -50,10 +50,10 @@
|
|||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.method-notes {
|
||||
margin: 10px 0 20px 0;
|
||||
font-size: 90%;
|
||||
color: #555;
|
||||
.method-notes {
|
||||
margin: 10px 0 20px 0;
|
||||
font-size: 90%;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
pre {
|
||||
|
@ -81,8 +81,8 @@
|
|||
background-color: #a41e22;
|
||||
}
|
||||
|
||||
.huge {
|
||||
color: #fff;
|
||||
.huge {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
pre.example {
|
||||
|
@ -148,9 +148,9 @@
|
|||
clear: both;
|
||||
}
|
||||
|
||||
.field-items {
|
||||
padding: 0 0 15px 0;
|
||||
margin-bottom: 15px;
|
||||
.field-items {
|
||||
padding: 0 0 15px 0;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.return-type {
|
||||
|
@ -178,12 +178,12 @@
|
|||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>SIMPLE TRANSLATION API</h1>
|
||||
<h1>Interactive Neural Machine Translation</h1>
|
||||
<div class="app-desc">Api for translation suggestions and attention score</div>
|
||||
<div class="app-desc">More information: <a href="https://helloreverb.com">https://helloreverb.com</a></div>
|
||||
<div class="app-desc">Contact Info: <a href="hello@helloreverb.com">hello@helloreverb.com</a></div>
|
||||
<div class="app-desc">Version: 1.0</div>
|
||||
<div class="app-desc">BasePath:/I927/INMT-SIMPLE/1.0</div>
|
||||
<div class="app-desc">Version: 0.1</div>
|
||||
|
||||
<div class="license-info">All rights reserved</div>
|
||||
<div class="license-url">http://apache.org/licenses/LICENSE-2.0.html</div>
|
||||
<h2>Access</h2>
|
||||
|
@ -193,18 +193,18 @@
|
|||
|
||||
<h3>Table of Contents </h3>
|
||||
<div class="method-summary"></div>
|
||||
<h4><a href="#Simple">Simple</a></h4>
|
||||
<h4><a href="#Default">Default</a></h4>
|
||||
<ul>
|
||||
<li><a href="#translateNew"><code><span class="http-method">get</span> /api/simple/translate_new</code></a></li>
|
||||
<li><a href="#apiSimpleTranslateNewGet"><code><span class="http-method">get</span> /api/simple/translate_new</code></a></li>
|
||||
</ul>
|
||||
|
||||
<h1><a name="Simple">Simple</a></h1>
|
||||
<div class="method"><a name="translateNew"></a>
|
||||
<h1><a name="Default">Default</a></h1>
|
||||
<div class="method"><a name="apiSimpleTranslateNewGet"></a>
|
||||
<div class="method-path">
|
||||
<a class="up" href="#__Methods">Up</a>
|
||||
<pre class="get"><code class="huge"><span class="http-method">get</span> /api/simple/translate_new</code></pre></div>
|
||||
<div class="method-summary">get suggestions, attension scores, preplex and average score for your partial translation (<span class="nickname">translateNew</span>)</div>
|
||||
<div class="method-notes"></div>
|
||||
<div class="method-summary"> (<span class="nickname">apiSimpleTranslateNewGet</span>)</div>
|
||||
<div class="method-notes">Auto generated using Swagger Inspector</div>
|
||||
|
||||
|
||||
|
||||
|
@ -212,13 +212,17 @@
|
|||
|
||||
<h3 class="field-label">Query parameters</h3>
|
||||
<div class="field-items">
|
||||
<div class="param">langspec (required)</div>
|
||||
<div class="param">sentence (optional)</div>
|
||||
|
||||
<div class="param-desc"><span class="param-type">Query Parameter</span> — The type of translation </div> <div class="param">sentence (required)</div>
|
||||
<div class="param-desc"><span class="param-type">Query Parameter</span> — The sentence that is to be translated </div> <div class="param">partial_trans (optional)</div>
|
||||
|
||||
<div class="param-desc"><span class="param-type">Query Parameter</span> — The sentence that is to be translated </div> <div class="param">partial_trans (required)</div>
|
||||
<div class="param-desc"><span class="param-type">Query Parameter</span> — Partial translation done so far by the user </div> <div class="param">n_words (optional)</div>
|
||||
|
||||
<div class="param-desc"><span class="param-type">Query Parameter</span> — Partial translation done so far by the user </div> </div> <!-- field-items -->
|
||||
<div class="param-desc"><span class="param-type">Query Parameter</span> — Number of next words in partial suggestions </div> <div class="param">n_best_partial (optional)</div>
|
||||
|
||||
<div class="param-desc"><span class="param-type">Query Parameter</span> — Number of partial sentences suggestion </div> <div class="param">langspec (optional)</div>
|
||||
|
||||
<div class="param-desc"><span class="param-type">Query Parameter</span> — The source and target language of translation </div> </div> <!-- field-items -->
|
||||
|
||||
|
||||
<h3 class="field-label">Return type</h3>
|
||||
|
@ -232,11 +236,15 @@
|
|||
<h3 class="field-label">Example data</h3>
|
||||
<div class="example-data-content-type">Content-Type: application/json</div>
|
||||
<pre class="example"><code>{
|
||||
"result" : [ "result", "result" ],
|
||||
"attn" : [ 0.8008281904610115, 0.8008281904610115 ],
|
||||
"avg" : 1.4658129805029452,
|
||||
"result" : {
|
||||
"partial_sentence" : [ "partial_sentence", "partial_sentence" ],
|
||||
"full_sentence" : [ "full_sentence", "full_sentence" ]
|
||||
},
|
||||
"attn" : [ 0, 0 ],
|
||||
"avg" : 6.027456183070403,
|
||||
"source" : [ "source", "source" ],
|
||||
"partial" : "partial",
|
||||
"ppl" : 6.027456183070403
|
||||
"ppl" : 1.4658129805029452
|
||||
}</code></pre>
|
||||
|
||||
<h3 class="field-label">Produces</h3>
|
||||
|
@ -248,14 +256,11 @@
|
|||
|
||||
<h3 class="field-label">Responses</h3>
|
||||
<h4 class="field-label">200</h4>
|
||||
An array containing result (the suggestions), attentions, partial translation by the user, perplexity and average score
|
||||
Auto generated using Swagger Inspector
|
||||
<a href="#inline_response_200">inline_response_200</a>
|
||||
<h4 class="field-label">400</h4>
|
||||
Bad Request
|
||||
<a href="#"></a>
|
||||
<h4 class="field-label">500</h4>
|
||||
Some internal server error
|
||||
<a href="#"></a>
|
||||
<h3 class="field-label">Example data</h3>
|
||||
<div class="example-data-content-type">Content-Type: 0</div>
|
||||
<pre class="example"><code>{"result": {"full_sentence": ["The weather is fine today"], "partial_sentence": ["The weather is fine today ", "The weather is beautiful today ", "The weather is fair today "]}, "source": ["\u0906\u091c", "\u092e\u094c\u0938\u092e", "\u0938\u0941\u0939\u093e\u0935\u0928\u093e", "\u0939\u0948"], "attn": [1, 0, 1, 1], "partial": "The weather ", "ppl": 2.579774035066862, "avg": -0.9477018117904663}</code></pre>
|
||||
</div> <!-- method -->
|
||||
<hr/>
|
||||
|
||||
|
@ -271,11 +276,12 @@
|
|||
<h3><a name="inline_response_200"><code>inline_response_200</code></a> <a class="up" href="#__Models">Up</a></h3>
|
||||
|
||||
<div class="field-items">
|
||||
<div class="param">result (optional)</div><div class="param-desc"><span class="param-type"><a href="#string">array[String]</a></span> </div>
|
||||
<div class="param">attn (optional)</div><div class="param-desc"><span class="param-type"><a href="#BigDecimal">array[BigDecimal]</a></span> </div>
|
||||
<div class="param">result (optional)</div><div class="param-desc"><span class="param-type"><a href="#object">Object</a></span> </div>
|
||||
<div class="param">attn (optional)</div><div class="param-desc"><span class="param-type"><a href="#integer">array[Integer]</a></span> </div>
|
||||
<div class="param">avg (optional)</div><div class="param-desc"><span class="param-type"><a href="#BigDecimal">BigDecimal</a></span> </div>
|
||||
<div class="param">source (optional)</div><div class="param-desc"><span class="param-type"><a href="#string">array[String]</a></span> </div>
|
||||
<div class="param">partial (optional)</div><div class="param-desc"><span class="param-type"><a href="#string">String</a></span> </div>
|
||||
<div class="param">ppl (optional)</div><div class="param-desc"><span class="param-type"><a href="#BigDecimal">BigDecimal</a></span> </div>
|
||||
<div class="param">avg (optional)</div><div class="param-desc"><span class="param-type"><a href="#BigDecimal">BigDecimal</a></span> </div>
|
||||
</div> <!-- field-items -->
|
||||
</div>
|
||||
</body>
|
||||
|
|
Двоичные данные
docs/openapi-yaml-client-generated.zip
Двоичные данные
docs/openapi-yaml-client-generated.zip
Двоичный файл не отображается.
|
@ -1,75 +1,102 @@
|
|||
openapi: 3.0.0
|
||||
---
|
||||
openapi: 3.0.1
|
||||
info:
|
||||
title: SIMPLE TRANSLATION API
|
||||
title: Interactive Neural Machine Translation
|
||||
description: Api for translation suggestions and attention score
|
||||
version: "1.0"
|
||||
version: "0.1"
|
||||
servers:
|
||||
- url: https://virtserver.swaggerhub.com/I927/INMT-SIMPLE/1.0
|
||||
description: SwaggerHub API Auto Mocking
|
||||
- url: http://localhost:8000
|
||||
paths:
|
||||
/api/simple/translate_new:
|
||||
get:
|
||||
tags:
|
||||
- simple
|
||||
summary: get suggestions, attension scores, preplex and average score for your
|
||||
partial translation
|
||||
operationId: translate_new
|
||||
description: Auto generated using Swagger Inspector
|
||||
parameters:
|
||||
- name: langspec
|
||||
in: query
|
||||
description: The type of translation
|
||||
required: true
|
||||
style: form
|
||||
explode: true
|
||||
schema:
|
||||
type: string
|
||||
- name: sentence
|
||||
in: query
|
||||
description: The sentence that is to be translated
|
||||
required: true
|
||||
required: false
|
||||
style: form
|
||||
explode: true
|
||||
schema:
|
||||
type: string
|
||||
example: '%E0%A4%86%E0%A4%9C%20%E0%A4%AE%E0%A5%8C%E0%A4%B8%E0%A4%AE%20%E0%A4%B8%E0%A5%81%E0%A4%B9%E0%A4%BE%E0%A4%B5%E0%A4%A8%E0%A4%BE%20%E0%A4%B9%E0%A5%88%20'
|
||||
- name: partial_trans
|
||||
in: query
|
||||
description: Partial translation done so far by the user
|
||||
required: true
|
||||
required: false
|
||||
style: form
|
||||
explode: true
|
||||
schema:
|
||||
type: string
|
||||
example: The+weather+
|
||||
- name: n_words
|
||||
in: query
|
||||
description: Number of next words in partial suggestions
|
||||
required: false
|
||||
style: form
|
||||
explode: true
|
||||
schema:
|
||||
type: string
|
||||
example: "3"
|
||||
- name: n_best_partial
|
||||
in: query
|
||||
description: Number of partial sentences suggestion
|
||||
required: false
|
||||
style: form
|
||||
explode: true
|
||||
schema:
|
||||
type: string
|
||||
example: "3"
|
||||
- name: langspec
|
||||
in: query
|
||||
description: The source and target language of translation
|
||||
required: false
|
||||
style: form
|
||||
explode: true
|
||||
schema:
|
||||
type: string
|
||||
example: hi-en
|
||||
responses:
|
||||
"200":
|
||||
description: An array containing result (the suggestions), attentions, partial
|
||||
translation by the user, perplexity and average score
|
||||
description: Auto generated using Swagger Inspector
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/inline_response_200'
|
||||
"400":
|
||||
description: Bad Request
|
||||
"500":
|
||||
description: Some internal server error
|
||||
examples:
|
||||
"0":
|
||||
value: '{"result": {"full_sentence": ["The weather is fine today"], "partial_sentence": ["The weather is fine today ", "The weather is beautiful today ", "The weather is fair today "]}, "source": ["\u0906\u091c", "\u092e\u094c\u0938\u092e", "\u0938\u0941\u0939\u093e\u0935\u0928\u093e", "\u0939\u0948"], "attn": [1, 0, 1, 1], "partial": "The weather ", "ppl": 2.579774035066862, "avg": -0.9477018117904663}'
|
||||
servers:
|
||||
- url: http://localhost:8000
|
||||
servers:
|
||||
- url: http://localhost:8000
|
||||
components:
|
||||
schemas:
|
||||
inline_response_200:
|
||||
type: object
|
||||
properties:
|
||||
result:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
type: object
|
||||
properties:
|
||||
partial_sentence:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
full_sentence:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
attn:
|
||||
type: array
|
||||
items:
|
||||
multipleOf: 0.1
|
||||
type: number
|
||||
type: integer
|
||||
avg:
|
||||
type: number
|
||||
source:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
partial:
|
||||
type: string
|
||||
ppl:
|
||||
multipleOf: 0.1
|
||||
type: number
|
||||
avg:
|
||||
multipleOf: 0.1
|
||||
type: number
|
||||
type: number
|
Загрузка…
Ссылка в новой задаче