Skip to main content

Evaluation as a Service for Natural Language Processing

Project description

EaaS_API

Documentation

Setup can be found here. Documentation at https://expressai.github.io/EaaS_API/

Usage

To install the API, simply run

pip install eaas_api

To use the API, run the following.

from eaas_api import Client
client = Client()
client.load_config("config.json")  # you can change the settings for each metric in `config.json`

# To see supported metrics
print(client.metrics)

To use this API for scoring, you need to format your input as list of dictionary. Each dictionary consists of src (string, optional), refs (list of string, optional) and hypo (string, required). src and refs are optional based on the metrics you want to use. Please do not conduct any preprocessing on src, refs or hypo, we expect normal-cased detokenized texts. All preprocessing steps are taken by the metrics. Below is a simple example.

inputs = [{"src": "This is the source.", 
           "refs": ["This is the reference one.", "This is the reference two."],
           "hypo": "This is the generated hypothesis."}]
metrics = ["bleu", "chrf"] # Can be None for simplicity if you consider using all metrics

score_dic = client.score(inputs, metrics) # inputs is a list of Dict, metrics is metric list

The output is like

{
  'bleu': [32.46679154750991],  # Sample-level scores. A list of scores one for each sample.
  'corpus_bleu': 32.46679154750991, # Corpus-level score.
  'chrf': [38.56890099861521],
  'corpus_chrf': 38.56890099861521
}

Short-term TODO

  • Write config.json, add backend support.

Long-term TODO

  • 完善功能
  • 只给aws的ip (起一个api.eaas类似这样的域名),aws后期二次转发到cmu服务器
  • 打包成package
  • metric corpus-level指标计算; BLEU corpus-level的计算检查(是否其他metric也有类似的);我们可能要设计下返回结果的json格式
  • 我们弄个文档,总结每个指标的默认预处理方法,超参数使用,考虑是否预留个接口给用户设置
  • Confidence interval计算功能
  • Fine-grained analysis功能
  • 优化API访问效率

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eaas-0.1.1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eaas-0.1.1-py2.py3-none-any.whl (5.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file eaas-0.1.1.tar.gz.

File metadata

  • Download URL: eaas-0.1.1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.0 pkginfo/1.5.0.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.7.6

File hashes

Hashes for eaas-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f4e2007bdaa0853b91cfef11fb7014dc2a8fb75db09c797148a45c614fc38386
MD5 b980f9a7081c7d40eda51c62e98e1c76
BLAKE2b-256 6aaa987927f6207ddcb3e6e26a6684aef8e2e08df22be0bddb989663424a9623

See more details on using hashes here.

File details

Details for the file eaas-0.1.1-py2.py3-none-any.whl.

File metadata

  • Download URL: eaas-0.1.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.0 pkginfo/1.5.0.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.7.6

File hashes

Hashes for eaas-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 764793728b2a44b11e3c7085ec5d2441d2e50aaeef9a5365563f9a3aba3d9f68
MD5 261446d52a9ec5fbc42b4bf94f6cc329
BLAKE2b-256 ce86c2386f37e17ec48dcae176b5e274eb9635235f61ebdbdf916ab3299f1388

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page