Team Ai
Apppublic

exbert-project/exbert

sourceHugging Faceapache-2.0updated 3y agoView on Hugging Face
185likes
swagger.yaml99 linesDownload Raw Back to server
1# see also: https://github.com/hjacobs/connexion-example2 3swagger: '2.0'4info:5  title: BERT-viz API6  version: "0.0.1"7consumes:8  - application/json9produces:10  - application/json11basePath: /api12 13# ===============================================================================14## DEFINE API ##15# ===============================================================================16paths:17 18  /get-model-details:19    get:20      tags: [All]21      operationId: main.get_model_details22      summary: Get necessary information about the model, such as number of layers and heads23      parameters:24        - name: model25          description: Short string representing pretrained model, such as 'bert-base-uncased'26          in: query27          type: string28      responses:29        200:30          description: Returns information about the model31 32  /attend+meta:33    get:34      tags: [All]35      operationId: main.get_attentions_and_preds36      summary: Get the attention information, BERT Embeddings, and spacy meta info for an input sentence37      parameters:38        - name: model39          description: Which pretrained transformer information is requested from40          in: query41          type: string42        - name: sentence43          description: Sentence to analyze44          in: query45          type: string46        - name: layer47          description: Layer to get attentions at48          in: query49          type: number50      responses:51        200:52          description: Returns attentions, embeddings, and metadata53 54  /update-mask:55    post:56      tags: [All]57      operationId: main.update_masked_attention58      summary: Get the masked attention information of tokens given indices to mask59      parameters:60        - name: payload61          description: Main contents62          in: body63          schema:64            $ref: '#/definitions/maskPayload'65      responses:66        200:67          description: Update BERT's masked behavior for passed tokens68 69 70definitions:71  maskPayload:72    type: object73    properties:74      model: 75        type: string76        description: Which model to get results from77      tokens:78        type: array79        items: 80          type: string81        description: Main sentence tokens to analyze82      sentence:83        type: string84        description: The original sentence the tokens came from, for extracting metadata85      mask:86        type: array87        items: 88          type: number89        description: Indices of tokens to mask90      layer:91        type: number92        description: Layer to get results for93      94    required:95      - model96      - tokens97      - sentence98      - mask99      - layer