Giter Club home page Giter Club logo

parameter-matching-web-apis's Introduction

Semantic Parameter Matching in Web APIs with Transformer-based Question Answering

This repository is the official implementation of the paper "Semantic Parameter Matching in Web APIs with Transformer-based Question Answering" (see citation) and contains notebooks for fine-tuning and evaluating a pre-trained BERT model to the task of semantic parameter matching in Web APIs. Additional materials (datasets, model checkpoints, and reports of executed notebooks) can be found on Zenodo. The fine-tuned model (best checkpoint with a top-k accuracy of 81.46% for k=1) is available on Hugging Face.

Web API and UI for Inference

We implemented a Flask application that places our model behind a Web API and UI for inference. To use this application, navigate to tools and create a docker image with:

docker build -t restberta-core .

Start the docker container with:

docker run -d -p 80:80 --name pm-cpu restberta-core

If you want to start the application for another Web API integration task, i.e., with another RESTBERTa model (e.g., for endpoint discovery, see RESTBERTa), specify the model as ENV parameter:

docker run -d -p 80:80 -e MODEL=SebastianKotstein/restberta-qa-endpoint-discovery --name ed-cpu restberta-core

Web UI

To open the Web UI, use a browser and navigate to http://localhost:80.

Web API

Use the following cURL to make a prediction:

curl -L 'http://localhost:80/predict' \
-H 'Accept: application/vnd.skotstein.restberta-core.results.v1+json' \
-H 'Content-Type: application/vnd.skotstein.restberta-core.schemas.v1+json' \
-d ' {
 "schemas":[
    {
      "schemaId": "s00",
      "name": "My schema",
      "value": "state units auth.key location.city location.city_id location.country location.lat location.lon location.postal_code",
      "queries": [
        {
          "queryId": "q0",
          "name": "My query",
          "value": "The ZIP of the city",
          "verboseOutput": true
        }
      ]
    }
  ]
}'

Citation

@INPROCEEDINGS{10.1109/SOSE58276.2023.00020,
  author={Kotstein, Sebastian and Decker, Christian},
  booktitle={2023 IEEE International Conference on Service-Oriented System Engineering (SOSE)}, 
  title={Semantic Parameter Matching in Web APIs with Transformer-based Question Answering}, 
  year={2023},
  volume={},
  number={},
  pages={114-123},
  doi={10.1109/SOSE58276.2023.00020}}

parameter-matching-web-apis's People

Contributors

sebastiankotstein avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.