GithubHelp home page GithubHelp logo

hyperonym / barba Goto Github PK

View Code? Open in Web Editor NEW
7.0 4.0 0.0 51 KB

Barba is a multilingual natural language inference model for textual entailment and zero-shot text classification, available as an end-to-end service through TensorFlow Serving.

License: MIT License

Jupyter Notebook 75.76% Dockerfile 2.50% Makefile 3.52% Python 18.22%
classification model multilingual natural-language-inference natural-language-processing tensorflow text-classification zero-shot textual-entailment

barba's Introduction

Barba

Barba is a multilingual natural language inference model for textual entailment and zero-shot text classification, available as an end-to-end service through TensorFlow Serving. Based on XLM-RoBERTa, it is trained on selected subsets of publicly available English (GLUE), Chinese (CLUE), Japanese (JGLUE), Korean (KLUE) datasets, as well as other private datasets.

Quick Start

Installation

Docker images are available on Docker Hub and GitHub Packages.

For GPU acceleration, you also need to install the NVIDIA Driver and NVIDIA Container Runtime. Barba's image already comes with related libraries such as CUDA and cuDNN, so there is no need to install them manually.

Basic Usage

Replace X.Y.Z with the latest version, then run:

docker run -p 8501:8501 hyperonym/barba:X.Y.Z

Textual Entailment

curl -X POST \
  'http://127.0.0.1:8501/v1/models/barba:predict' \
  --data-raw '{
  "instances": [
    {
      "hypothesis": "Leonardo da Vinci never painted on walnut wood",
      "premise": "The Lady with an Ermine is a portrait painting widely attributed to the Italian Renaissance artist Leonardo da Vinci. Dated to around 1489 to 1491, the work is painted in oils on a panel of walnut wood."
    },
    {
      "hypothesis": "最长的黄鳝能有1米长",
      "premise": "黄鳝(学名:Monopterus albus):又名鳝鱼,古代称为蝉鱼、黄蝉等。体细长呈蛇形,体长约20-70厘米,最长可达1米。体前圆后部侧扁,尾尖细。"
    }
  ]
}'

Zero-shot Text Classification

curl -X POST \
  'http://127.0.0.1:8501/v1/models/barba:predict' \
  --data-raw '{
  "signature_name": "cartesian",
  "inputs": {
    "hypothesis": [
      "foreign policy",
      "Europe",
      "elections",
      "business",
      "outdoor recreation",
      "politics"
    ],
    "premise": [
      "Who are you voting for in 2020?",
      "北欧有很多不错的滑雪场"
    ]
  }
}'

License

Barba is available under the MIT License.


© 2023 Hyperonym

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.